/* 組合士ポータル demo UI — intentionally simple and printable. */
:root {
  --ink: #18302f;
  --ink-soft: #526362;
  --ink-faint: #758481;
  --brand-950: #102f2d;
  --brand-900: #174a46;
  --brand-800: #195d57;
  --brand-700: #1e7168;
  --brand-600: #27867b;
  --brand-100: #dff2ed;
  --brand-50: #eff9f6;
  --amber-700: #a95b16;
  --amber-600: #ca6e1c;
  --amber-100: #ffecd3;
  --amber-50: #fff8ed;
  --blue-700: #28648a;
  --blue-100: #e1f0f8;
  --red-700: #a13f3c;
  --red-100: #fbe6e3;
  --green-700: #24704c;
  --green-100: #dff3e8;
  --purple-700: #6f548d;
  --purple-100: #eee7f7;
  --canvas: #f4f5f1;
  --surface: #ffffff;
  --surface-soft: #f9faf7;
  --line: #dce3df;
  --line-strong: #c6d0cb;
  --shadow-sm: 0 1px 2px rgba(18, 45, 43, .06), 0 5px 18px rgba(18, 45, 43, .035);
  --shadow-md: 0 14px 35px rgba(18, 45, 43, .12);
  --radius-sm: .55rem;
  --radius: .85rem;
  --radius-lg: 1.2rem;
  --sidebar-width: 17rem;
  --topbar-height: 4rem;
  --font: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Meiryo", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--canvas); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--brand-700); text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:hover { color: var(--brand-900); }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.u-hidden, .visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.no-scroll { overflow: hidden; }
.skip-link { position: fixed; left: .75rem; top: .75rem; z-index: 200; padding: .7rem 1rem; border-radius: .5rem; background: #fff; color: var(--brand-900); transform: translateY(-160%); box-shadow: var(--shadow-md); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid rgba(39, 134, 123, .35); outline-offset: 2px; }

/* Application frame */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; display: flex; width: var(--sidebar-width); flex-direction: column; overflow-y: auto; background: var(--brand-950); color: rgba(255,255,255,.78); }
.brand-lockup { display: flex; min-height: 5.2rem; align-items: center; justify-content: space-between; padding: 1.15rem 1.15rem 1rem; border-bottom: 1px solid rgba(255,255,255,.09); }
.brand-mark { display: flex; align-items: center; gap: .78rem; color: white; text-decoration: none; line-height: 1.25; }
.brand-mark:hover { color: white; }
.brand-mark strong, .brand-mark small { display: block; }
.brand-mark strong { font-size: .96rem; letter-spacing: .02em; }
.brand-mark small { margin-top: .28rem; color: rgba(255,255,255,.55); font-size: .7rem; font-weight: 500; letter-spacing: .06em; }
.brand-symbol { display: grid; width: 2.35rem; height: 2.35rem; flex: 0 0 auto; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: .72rem; background: linear-gradient(150deg, var(--brand-600), var(--brand-800)); font-family: serif; font-size: 1.12rem; font-weight: 700; box-shadow: inset 0 1px rgba(255,255,255,.2); }
.role-panel { margin: 1rem 1rem .6rem; padding: .85rem; border: 1px solid rgba(255,255,255,.09); border-radius: .8rem; background: rgba(255,255,255,.055); }
.role-panel strong, .role-panel span { display: block; }
.role-panel strong { margin-top: .55rem; color: #fff; font-size: .84rem; }
.role-panel span:last-child { margin-top: .12rem; color: rgba(255,255,255,.54); font-size: .72rem; }
.demo-pill { width: max-content; padding: .16rem .44rem; border-radius: 999px; background: var(--amber-100); color: #82430d !important; font-size: .65rem !important; font-weight: 800; letter-spacing: .08em; }
.nav-list { flex: 1; padding: .65rem .72rem 1.2rem; }
.nav-section-label { margin: 1.3rem .65rem .42rem; color: rgba(255,255,255,.38); font-size: .66rem; font-weight: 700; letter-spacing: .12em; }
.nav-item { position: relative; display: flex; min-height: 2.8rem; align-items: center; gap: .62rem; margin: .16rem 0; padding: .58rem .68rem; border-radius: .62rem; color: rgba(255,255,255,.7); font-size: .83rem; font-weight: 600; text-decoration: none; transition: background .15s ease, color .15s ease; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.is-active { background: #fff; color: var(--brand-950); box-shadow: 0 5px 18px rgba(0,0,0,.13); }
.nav-icon { display: grid; width: 1.3rem; height: 1.3rem; flex: 0 0 auto; place-items: center; font-size: .9rem; font-weight: 800; }
.nav-count { margin-left: auto; padding: .05rem .42rem; border-radius: 999px; background: var(--amber-100); color: #7d410c; font-size: .66rem; }
.nav-tag { margin-left: auto; padding: .05rem .32rem; border: 1px solid rgba(255,255,255,.15); border-radius: .3rem; color: rgba(255,255,255,.54); font-size: .58rem; font-weight: 700; white-space: nowrap; }
.nav-item.is-active .nav-tag { border-color: var(--line); color: var(--ink-faint); }
.sidebar-footer { padding: 1rem; border-top: 1px solid rgba(255,255,255,.09); }
.sidebar-switch, .sidebar-logout { display: flex; width: 100%; align-items: center; gap: .45rem; padding: .5rem .2rem; border: 0; background: none; color: rgba(255,255,255,.6); font-size: .75rem; text-align: left; text-decoration: none; }
.sidebar-switch:hover, .sidebar-logout:hover { color: #fff; }
.sidebar-close { display: none !important; }
.sidebar-scrim { display: none; }
.main-shell { display: flex; min-height: 100vh; margin-left: var(--sidebar-width); flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 35; display: flex; min-height: var(--topbar-height); align-items: center; padding: 0 clamp(1.1rem, 3vw, 2.2rem); border-bottom: 1px solid rgba(198, 208, 203, .8); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.topbar-context { min-width: 0; color: var(--ink-faint); font-size: .78rem; }
.topbar-context a { color: var(--ink-faint); text-decoration: none; }
.topbar-context a:hover { color: var(--brand-700); }
.breadcrumb-divider { margin: 0 .42rem; color: var(--line-strong); }
.topbar-actions { display: flex; align-items: center; gap: .7rem; margin-left: auto; }
.simulation-label { padding: .2rem .5rem; border: 1px solid #ead3b5; border-radius: 999px; background: var(--amber-50); color: #85501e; font-size: .65rem; font-weight: 700; }
.user-avatar { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; background: var(--brand-100); color: var(--brand-900); font-size: .75rem; font-weight: 800; }
.topbar-user { color: var(--ink-soft); font-size: .74rem; font-weight: 700; }
.menu-button { display: none !important; margin-right: .6rem; }
.icon-button { display: inline-grid; width: 2.35rem; height: 2.35rem; padding: .55rem; place-items: center; border: 0; border-radius: .6rem; background: transparent; color: currentColor; }
.icon-button:hover { background: rgba(0,0,0,.06); }
.icon-button .bi { font-size: 1.05rem; line-height: 1; }
.main-content { width: 100%; max-width: 96rem; margin: 0 auto; padding: clamp(1.35rem, 3.5vw, 2.5rem); flex: 1; outline: none; }
.app-footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.2rem clamp(1.35rem, 3.5vw, 2.5rem); border-top: 1px solid var(--line); color: var(--ink-faint); font-size: .68rem; }

/* Page structure */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.15rem; }
.page-title-group { min-width: 0; }
.eyebrow { margin: 0 0 .3rem; color: var(--brand-700); font-size: .69rem; font-weight: 800; letter-spacing: .1em; }
.page-title { margin: 0; color: var(--ink); font-size: clamp(1.5rem, 2vw, 2rem); line-height: 1.35; letter-spacing: -.02em; }
.page-lead { max-width: 52rem; margin: .55rem 0 0; color: var(--ink-soft); font-size: .88rem; }
.page-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: .6rem; }
.section { margin-top: 1.5rem; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.section-title { margin: 0; font-size: 1.05rem; line-height: 1.4; }
.section-subtitle { margin: .25rem 0 0; color: var(--ink-faint); font-size: .75rem; }
.section-link { flex: 0 0 auto; font-size: .78rem; font-weight: 700; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.layout-sidebar { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, .8fr); gap: 1rem; align-items: start; }
.span-2 { grid-column: span 2; }
.stack { display: grid; gap: 1rem; }

/* Cards and panels */
.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.05rem 1.2rem .9rem; border-bottom: 1px solid var(--line); }
.card-title { margin: 0; font-size: .93rem; line-height: 1.45; }
.card-description { margin: .25rem 0 0; color: var(--ink-faint); font-size: .73rem; }
.card-body { padding: 1.15rem 1.2rem; }
.card-footer { padding: .85rem 1.2rem; border-top: 1px solid var(--line); background: var(--surface-soft); border-radius: 0 0 var(--radius) var(--radius); }
.flat-card { box-shadow: none; }
.tinted-card { border-color: #cce1db; background: linear-gradient(145deg, var(--brand-50), #fff); }
.accent-card { border-color: #efd6b7; background: linear-gradient(145deg, var(--amber-50), #fff); }
.future-card { position: relative; border-style: dashed; background: #fbfafc; }
.future-flag { display: inline-flex; padding: .2rem .48rem; border-radius: .35rem; background: var(--purple-100); color: var(--purple-700); font-size: .65rem; font-weight: 800; }
.stat-card { position: relative; overflow: hidden; padding: 1.05rem 1.15rem; }
.stat-card::after { position: absolute; right: -1.3rem; bottom: -1.3rem; width: 4.3rem; height: 4.3rem; border-radius: 50%; background: var(--brand-50); content: ""; }
.stat-label { color: var(--ink-soft); font-size: .74rem; font-weight: 700; }
.stat-value { display: flex; align-items: baseline; gap: .25rem; margin-top: .25rem; font-size: 1.72rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.stat-value small { color: var(--ink-faint); font-size: .7rem; font-weight: 600; }
.stat-foot { position: relative; z-index: 1; margin-top: .6rem; color: var(--ink-faint); font-size: .68rem; }
.stat-change { color: var(--green-700); font-weight: 800; }
.hero-panel { position: relative; overflow: hidden; padding: clamp(1.3rem, 3vw, 2rem); border: 0; background: linear-gradient(130deg, var(--brand-950), var(--brand-800)); color: #fff; box-shadow: var(--shadow-md); }
.hero-panel::before { position: absolute; top: -55%; right: -8%; width: 24rem; height: 24rem; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; content: ""; }
.hero-panel::after { position: absolute; right: 12%; bottom: -70%; width: 18rem; height: 18rem; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; content: ""; }
.hero-panel > * { position: relative; z-index: 1; }
.hero-panel h2 { max-width: 38rem; margin: .35rem 0; font-size: clamp(1.25rem, 2.2vw, 1.8rem); line-height: 1.5; }
.hero-panel p { max-width: 44rem; margin: .45rem 0 1.1rem; color: rgba(255,255,255,.73); font-size: .82rem; }
.hero-kicker { color: #a9ded6; font-size: .7rem; font-weight: 800; letter-spacing: .09em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; }

/* Buttons and links */
.button { display: inline-flex; min-height: 2.55rem; align-items: center; justify-content: center; gap: .42rem; padding: .55rem .9rem; border: 1px solid transparent; border-radius: .62rem; background: var(--brand-700); color: #fff; font-size: .78rem; font-weight: 800; line-height: 1.25; text-align: center; text-decoration: none; transition: transform .12s ease, background .12s ease, box-shadow .12s ease; }
.button:hover { background: var(--brand-900); color: #fff; box-shadow: 0 5px 16px rgba(23, 74, 70, .16); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-secondary { border-color: var(--line-strong); background: #fff; color: var(--ink); }
.button-secondary:hover { border-color: var(--brand-600); background: var(--brand-50); color: var(--brand-900); }
.button-ghost { background: transparent; color: var(--brand-700); }
.button-ghost:hover { background: var(--brand-50); color: var(--brand-900); box-shadow: none; }
.button-amber { background: var(--amber-600); }
.button-amber:hover { background: var(--amber-700); }
.button-danger { border-color: #e7beba; background: #fff; color: var(--red-700); }
.button-danger:hover { background: var(--red-100); color: var(--red-700); }
.button-light { background: #fff; color: var(--brand-950); }
.button-light:hover { background: var(--brand-50); color: var(--brand-950); }
.button-outline-light { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.05); color: #fff; }
.button-outline-light:hover { background: rgba(255,255,255,.12); color: #fff; }
.button-sm { min-height: 2.1rem; padding: .38rem .65rem; font-size: .7rem; }
.button-lg { min-height: 3.05rem; padding: .7rem 1.2rem; font-size: .85rem; }
.button-block { width: 100%; }
.text-link { border: 0; background: none; color: var(--brand-700); font-size: .78rem; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }

/* Forms */
.filter-panel { padding: 1rem; }
.filter-grid { display: grid; grid-template-columns: minmax(13rem, 2fr) repeat(4, minmax(8rem, 1fr)) auto; gap: .75rem; align-items: end; }
.directory-filter-grid { grid-template-columns: minmax(15rem, 2fr) minmax(11rem, 1fr) auto; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-field { min-width: 0; }
.form-field-full { grid-column: 1 / -1; }
.form-field label, .field-label { display: block; margin: 0 0 .35rem; color: var(--ink-soft); font-size: .72rem; font-weight: 800; }
.required-mark { margin-left: .3rem; color: var(--red-700); font-size: .64rem; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; min-height: 2.65rem; padding: .56rem .68rem; border: 1px solid var(--line-strong); border-radius: .56rem; background: #fff; color: var(--ink); box-shadow: inset 0 1px 2px rgba(18,45,43,.02); }
textarea { min-height: 7rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9aa6a3; }
input:hover, select:hover, textarea:hover { border-color: #9cb0aa; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-600); outline: 3px solid rgba(39,134,123,.13); }
input[type="checkbox"], input[type="radio"] { width: 1rem; height: 1rem; accent-color: var(--brand-700); }
.checkbox-row { display: flex; align-items: flex-start; gap: .55rem; }
.checkbox-row label { margin: -.12rem 0 0; color: var(--ink); font-size: .78rem; }
.help-text, .form-field .helptext { display: block; margin: .3rem 0 0; color: var(--ink-faint); font-size: .67rem; }
.error-text, .errorlist { margin: .3rem 0 0; color: var(--red-700); font-size: .7rem; font-weight: 700; list-style: none; padding: 0; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--red-700); }
.form-actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; }
.django-form p { margin: 0 0 1rem; }
.django-form p > label { display: block; margin-bottom: .35rem; color: var(--ink-soft); font-size: .72rem; font-weight: 800; }
.django-form ul { margin: .35rem 0; padding-left: 1.2rem; }
.django-form ul.errorlist { padding-left: 0; }

/* Tables */
.table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; font-size: .78rem; }
.data-table th { padding: .72rem .85rem; border-bottom: 1px solid var(--line-strong); background: #f6f8f5; color: var(--ink-soft); font-size: .67rem; font-weight: 800; letter-spacing: .02em; text-align: left; white-space: nowrap; }
.data-table td { padding: .82rem .85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfa; }
.data-table .cell-actions { width: 1%; text-align: right; white-space: nowrap; }
.primary-cell { display: flex; min-width: 12rem; align-items: center; gap: .68rem; }
.person-avatar { display: grid; width: 2rem; height: 2rem; flex: 0 0 auto; place-items: center; border-radius: .55rem; background: var(--brand-100); color: var(--brand-900); font-size: .68rem; font-weight: 800; }
.primary-cell strong, .primary-cell small { display: block; }
.primary-cell strong { color: var(--ink); font-size: .79rem; }
.primary-cell small { color: var(--ink-faint); font-size: .66rem; }
.muted-cell { color: var(--ink-faint); }
.nowrap { white-space: nowrap; }
.row-link { color: var(--ink); text-decoration: none; }
.row-link:hover { color: var(--brand-700); text-decoration: underline; }
.mobile-label { display: none; }

/* Status and metadata */
.badge { display: inline-flex; align-items: center; gap: .28rem; padding: .2rem .48rem; border-radius: 999px; background: #eef1ef; color: var(--ink-soft); font-size: .65rem; font-weight: 800; line-height: 1.25; white-space: nowrap; }
.badge::before { width: .35rem; height: .35rem; border-radius: 50%; background: currentColor; content: ""; opacity: .75; }
.badge-certified, .badge-complete, .badge-paid, .badge-active, .badge-approved { background: var(--green-100); color: var(--green-700); }
.badge-due, .badge-pending, .badge-review, .badge-unpaid { background: var(--amber-100); color: var(--amber-700); }
.badge-progress, .badge-sent, .badge-submitted { background: var(--blue-100); color: var(--blue-700); }
.badge-expired, .badge-error, .badge-returned { background: var(--red-100); color: var(--red-700); }
.badge-future { background: var(--purple-100); color: var(--purple-700); }
.badge-neutral { background: #eef1ef; color: var(--ink-soft); }
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { display: inline-flex; padding: .2rem .46rem; border: 1px solid var(--line); border-radius: .4rem; background: #fafbf9; color: var(--ink-soft); font-size: .66rem; font-weight: 700; }
.meta-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; }
.meta-row { padding: .72rem .2rem; border-bottom: 1px solid var(--line); }
.meta-row:nth-last-child(-n+2) { border-bottom: 0; }
.meta-row dt { margin: 0 0 .2rem; color: var(--ink-faint); font-size: .67rem; font-weight: 700; }
.meta-row dd { margin: 0; color: var(--ink); font-size: .8rem; font-weight: 600; overflow-wrap: anywhere; }
.definition-list { margin: 0; }
.definition-row { display: grid; grid-template-columns: minmax(8rem, .38fr) minmax(0, 1fr); gap: 1rem; padding: .72rem 0; border-bottom: 1px solid var(--line); }
.definition-row:last-child { border-bottom: 0; }
.definition-row dt { color: var(--ink-faint); font-size: .7rem; font-weight: 700; }
.definition-row dd {
  min-width: 0;
  margin: 0;
  font-size: .79rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.support-note { display: flex; gap: .7rem; padding: .85rem 1rem; border: 1px solid #ead3b5; border-radius: .65rem; background: var(--amber-50); color: #714925; font-size: .76rem; }
.support-note > .bi { flex: 0 0 auto; margin-top: .15rem; font-size: .9rem; }
.support-note strong { display: block; margin-bottom: .15rem; color: #633a15; }
.correction-request { margin-bottom: 1rem; border-color: #e9bdb8; background: var(--red-100); color: var(--red-700); }
.correction-request strong { color: var(--red-700); }
.info-note { padding: .85rem 1rem; border-left: 3px solid var(--brand-600); border-radius: .15rem .55rem .55rem .15rem; background: var(--brand-50); color: var(--brand-900); font-size: .75rem; }
.simulation-note { padding: .82rem 1rem; border: 1px dashed #d4badf; border-radius: .6rem; background: #fbf8fd; color: #665074; font-size: .73rem; }

/* Activity, timeline and progress */
.activity-list, .alert-list, .notice-list { margin: 0; padding: 0; list-style: none; }
.activity-item { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: .7rem; align-items: start; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.activity-item-plain { grid-template-columns: minmax(0, 1fr) auto; }
.activity-item:first-child { padding-top: 0; }
.activity-item:last-child { padding-bottom: 0; border-bottom: 0; }
.activity-icon { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); font-size: .7rem; font-weight: 900; }
.activity-copy strong, .activity-copy span { display: block; }
.activity-copy strong { font-size: .76rem; }
.activity-copy span { margin-top: .12rem; color: var(--ink-faint); font-size: .67rem; }
.activity-time { color: var(--ink-faint); font-size: .64rem; white-space: nowrap; }
.alert-item { display: flex; align-items: flex-start; gap: .7rem; padding: .72rem 0; border-bottom: 1px solid var(--line); }
.alert-item:last-child { border-bottom: 0; }
.alert-count { display: grid; min-width: 2.2rem; height: 2.2rem; place-items: center; border-radius: .55rem; background: var(--amber-100); color: var(--amber-700); font-size: .72rem; font-weight: 900; }
.alert-copy { min-width: 0; flex: 1; }
.alert-copy strong { display: block; font-size: .76rem; }
.alert-copy span { display: block; margin-top: .1rem; color: var(--ink-faint); font-size: .67rem; }
.timeline { position: relative; margin: 0; padding: 0 0 0 1.1rem; list-style: none; }
.timeline::before { position: absolute; top: .4rem; bottom: .4rem; left: .24rem; width: 1px; background: var(--line-strong); content: ""; }
.timeline-item { position: relative; padding: 0 0 1rem .65rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { position: absolute; top: .35rem; left: -.99rem; width: .48rem; height: .48rem; border: 2px solid #fff; border-radius: 50%; background: var(--brand-600); box-shadow: 0 0 0 1px var(--brand-600); content: ""; }
.timeline-item strong { display: block; font-size: .76rem; }
.timeline-item p { margin: .18rem 0; color: var(--ink-soft); font-size: .7rem; }
.timeline-meta { color: var(--ink-faint); font-size: .64rem; }
.progress-bar { height: .52rem; overflow: hidden; border-radius: 999px; background: #e8ece9; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-700), #42a99a); }
.progress-meta { display: flex; justify-content: space-between; gap: 1rem; margin-top: .4rem; color: var(--ink-faint); font-size: .67rem; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; margin: 0; padding: 0; list-style: none; }
.step { position: relative; padding-top: 2.4rem; color: var(--ink-faint); font-size: .68rem; font-weight: 700; text-align: center; }
.step-marker { position: absolute; z-index: 2; top: 0; left: 50%; display: grid; width: 1.8rem; height: 1.8rem; place-items: center; border: 2px solid var(--line-strong); border-radius: 50%; background: #fff; color: var(--ink-faint); transform: translateX(-50%); }
.step::after { position: absolute; z-index: 1; top: .86rem; left: calc(-50% + .9rem); width: calc(100% - 1.8rem); height: 2px; background: var(--line); content: ""; }
.step:first-child::after { display: none; }
.step.is-done { color: var(--brand-700); }
.step.is-done .step-marker { border-color: var(--brand-700); background: var(--brand-700); color: #fff; }
.step.is-done::after, .step.is-current::after { background: var(--brand-600); }
.step.is-current { color: var(--ink); }
.step.is-current .step-marker { border-color: var(--brand-700); color: var(--brand-700); box-shadow: 0 0 0 4px var(--brand-100); }
.step.is-current.is-done .step-marker { color: #fff; }
.steps-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }

/* Charts */
.bar-list { display: grid; gap: .7rem; }
.bar-row { display: grid; grid-template-columns: minmax(5rem, .7fr) minmax(8rem, 2fr) 3.5rem; gap: .7rem; align-items: center; }
.bar-label { overflow: hidden; font-size: .7rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: .58rem; overflow: hidden; border-radius: 999px; background: #edf0ee; }
.bar-value { height: 100%; min-width: 3px; border-radius: inherit; background: var(--brand-600); }
.bar-number { color: var(--ink-soft); font-size: .68rem; font-weight: 700; text-align: right; }
.donut-wrap { display: flex; align-items: center; gap: 1.4rem; }
.donut { --value: 62; display: grid; width: 7.5rem; height: 7.5rem; flex: 0 0 auto; place-items: center; border-radius: 50%; background: conic-gradient(var(--brand-600) calc(var(--value) * 1%), #e5eae7 0); }
.donut::before { grid-area: 1 / 1; width: 5.5rem; height: 5.5rem; border-radius: 50%; background: #fff; content: ""; }
.donut-copy { z-index: 1; grid-area: 1 / 1; text-align: center; }
.donut-copy strong, .donut-copy small { display: block; }
.donut-copy strong { font-size: 1.35rem; }
.donut-copy small { color: var(--ink-faint); font-size: .62rem; }
.legend { display: grid; gap: .45rem; min-width: 0; }
.legend-item { display: grid; grid-template-columns: .55rem minmax(0, 1fr) auto; gap: .48rem; align-items: center; font-size: .69rem; }
.legend-dot { width: .48rem; height: .48rem; border-radius: 50%; background: var(--brand-600); }
.legend-dot.muted { background: #d5dcda; }

/* Detail tabs/sections */
.anchor-nav { position: sticky; top: calc(var(--topbar-height) + .7rem); z-index: 20; display: flex; overflow-x: auto; gap: .2rem; margin: 0 0 1rem; padding: .35rem; border: 1px solid var(--line); border-radius: .72rem; background: rgba(255,255,255,.94); box-shadow: var(--shadow-sm); scrollbar-width: none; }
.anchor-nav::-webkit-scrollbar { display: none; }
.anchor-nav a { flex: 0 0 auto; padding: .42rem .65rem; border-radius: .45rem; color: var(--ink-soft); font-size: .68rem; font-weight: 700; text-decoration: none; }
.anchor-nav a:hover { background: var(--brand-50); color: var(--brand-900); }
.detail-identity { display: flex; align-items: center; gap: .9rem; }
.detail-avatar { display: grid; width: 3.6rem; height: 3.6rem; flex: 0 0 auto; place-items: center; border-radius: .95rem; background: var(--brand-100); color: var(--brand-900); font-size: 1rem; font-weight: 900; }
.detail-identity h1 { margin: 0; font-size: 1.45rem; }
.detail-identity p { margin: .2rem 0 0; color: var(--ink-faint); font-size: .72rem; }

/* Empty states */
.empty-state { display: grid; min-height: 12rem; padding: 2rem; place-items: center; text-align: center; }
.empty-icon { display: grid; width: 3rem; height: 3rem; margin: 0 auto .8rem; place-items: center; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); font-size: 1rem; font-weight: 900; }
.empty-state h3 { margin: 0; font-size: .9rem; }
.empty-state p { max-width: 28rem; margin: .35rem auto 0; color: var(--ink-faint); font-size: .72rem; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border-top: 1px solid var(--line); color: var(--ink-faint); font-size: .68rem; }
.pagination-pages { display: flex; gap: .25rem; }
.page-link { display: grid; min-width: 2rem; height: 2rem; padding: 0 .35rem; place-items: center; border: 1px solid var(--line); border-radius: .45rem; background: #fff; color: var(--ink-soft); font-size: .68rem; font-weight: 700; text-decoration: none; }
.page-link:hover { border-color: var(--brand-600); background: var(--brand-50); }
.page-link.is-current { border-color: var(--brand-700); background: var(--brand-700); color: #fff; }

/* Messages */
.message-stack { display: grid; gap: .55rem; margin-bottom: 1rem; }
.message { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .72rem .9rem; border: 1px solid var(--line); border-radius: .65rem; background: #fff; box-shadow: var(--shadow-sm); font-size: .76rem; font-weight: 700; }
.message button { border: 0; background: transparent; color: currentColor; font-size: 1.1rem; }
.message-success { border-color: #b9dcc9; background: var(--green-100); color: var(--green-700); }
.message-warning { border-color: #edd0a8; background: var(--amber-100); color: var(--amber-700); }
.message-error { border-color: #e9bdb8; background: var(--red-100); color: var(--red-700); }

/* Member portal */
.next-action { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1rem; align-items: center; }
.next-action-icon { display: grid; width: 3.3rem; height: 3.3rem; place-items: center; border-radius: .9rem; background: var(--amber-100); color: var(--amber-700); font-size: 1.2rem; font-weight: 900; }
.next-action h2 { margin: 0; font-size: 1.12rem; }
.next-action p { margin: .25rem 0 0; color: var(--ink-soft); font-size: .76rem; }
.quick-link-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.quick-link { min-height: 7rem; padding: 1rem; border: 1px solid var(--line); border-radius: .75rem; background: #fff; color: var(--ink); text-decoration: none; transition: border .12s ease, transform .12s ease; }
.quick-link:hover { border-color: var(--brand-600); color: var(--brand-900); transform: translateY(-2px); }
.quick-link-icon { display: grid; width: 2rem; height: 2rem; margin-bottom: .65rem; place-items: center; border-radius: .52rem; background: var(--brand-50); color: var(--brand-700); font-size: .78rem; font-weight: 900; }
.quick-link strong { display: block; font-size: .77rem; }
.quick-link span { display: block; margin-top: .15rem; color: var(--ink-faint); font-size: .63rem; }
.notice-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .7rem; align-items: start; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.notice-item:last-child { border-bottom: 0; }
.notice-date { color: var(--ink-faint); font-size: .65rem; white-space: nowrap; }
.notice-copy strong { display: block; font-size: .76rem; }
.notice-copy p { margin: .2rem 0 0; color: var(--ink-soft); font-size: .68rem; }
.notice-audience { color: var(--ink-faint); font-size: .62rem; }
.web-push-control { display: grid; justify-items: end; gap: .2rem; }
.web-push-status { min-height: .9rem; color: var(--ink-faint); font-size: .61rem; line-height: 1.25; }
.web-push-status[data-state="success"] { color: var(--green-700); }
.web-push-status[data-state="error"] { color: var(--red-700); }
.web-push-control .button[aria-busy="true"] i { animation: feedback-spin .8s linear infinite; }

/* Digital card */
.credential-stage { display: grid; min-height: 33rem; padding: 2rem; place-items: center; border-radius: var(--radius-lg); background: radial-gradient(circle at 75% 15%, rgba(67,167,152,.18), transparent 28%), linear-gradient(145deg, #eef4f1, #dde8e3); }
.credential { position: relative; width: min(100%, 31rem); aspect-ratio: 1.586; overflow: hidden; padding: clamp(1.3rem, 4vw, 2rem); border-radius: 1.3rem; background: linear-gradient(140deg, #103a37 0%, #19655d 58%, #22867a 100%); color: #fff; box-shadow: 0 25px 55px rgba(16,47,45,.25); }
.credential::before, .credential::after { position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; content: ""; }
.credential::before { width: 18rem; height: 18rem; top: -9rem; right: -4rem; }
.credential::after { width: 11rem; height: 11rem; right: 1rem; bottom: -7rem; }
.credential-top, .credential-bottom { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.credential-label { color: #b4e5dc; font-size: .65rem; font-weight: 800; letter-spacing: .12em; }
.credential h2 { margin: .15rem 0 0; font-family: serif; font-size: clamp(1.2rem, 4vw, 1.75rem); }
.credential-seal { display: grid; width: 3rem; height: 3rem; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; font-family: serif; font-weight: 800; }
.credential-person { position: relative; z-index: 1; margin-top: clamp(1.2rem, 4vw, 2.3rem); }
.credential-person strong { display: block; font-size: clamp(1.1rem, 3.5vw, 1.55rem); letter-spacing: .08em; }
.credential-person span { color: rgba(255,255,255,.65); font-size: .65rem; }
.credential-bottom { position: absolute; right: clamp(1.3rem, 4vw, 2rem); bottom: clamp(1.2rem, 4vw, 1.8rem); left: clamp(1.3rem, 4vw, 2rem); align-items: flex-end; }
.credential-number small, .credential-number strong { display: block; }
.credential-number small { color: rgba(255,255,255,.58); font-size: .58rem; letter-spacing: .07em; }
.credential-number strong { margin-top: .15rem; font-size: .83rem; letter-spacing: .07em; }
.credential-validity { font-size: .65rem; text-align: right; }
.credential-validity small, .credential-validity strong { display: block; }
.credential-validity small { color: rgba(255,255,255,.58); }
.demo-watermark { position: absolute; z-index: 0; top: 48%; right: -1.3rem; color: rgba(255,255,255,.075); font-size: 4.5rem; font-weight: 900; letter-spacing: .08em; transform: rotate(-18deg); }

/* Login */
.login-body { min-height: 100vh; background: #f2f5f1; }
.login-shell { display: grid; min-height: 100vh; grid-template-columns: minmax(18rem, .8fr) minmax(34rem, 1.35fr); }
.login-brand { position: relative; display: flex; overflow: hidden; padding: clamp(2rem, 5vw, 4.5rem); flex-direction: column; justify-content: space-between; background: linear-gradient(150deg, var(--brand-950), var(--brand-800)); color: #fff; }
.login-brand::before { position: absolute; top: -10%; right: -30%; width: 30rem; height: 30rem; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; content: ""; }
.login-brand::after { position: absolute; bottom: -25%; left: -30%; width: 25rem; height: 25rem; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; content: ""; }
.login-brand > * { position: relative; z-index: 1; }
.login-brand .brand-mark { width: max-content; }
.login-story { max-width: 27rem; }
.login-story h1 { margin: 0 0 .9rem; font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.35; letter-spacing: -.04em; }
.login-story p { color: rgba(255,255,255,.7); font-size: .88rem; }
.login-foot { color: rgba(255,255,255,.45); font-size: .65rem; }
.login-content { display: grid; padding: clamp(1.5rem, 5vw, 5rem); place-items: center; }
.login-panel { width: min(100%, 47rem); }
.login-panel-header { margin-bottom: 1.5rem; }
.login-panel-header h2 { margin: 0; font-size: 1.55rem; }
.login-panel-header p { margin: .45rem 0 0; color: var(--ink-soft); font-size: .8rem; }
.role-login-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .75rem; }
.role-login-card { display: flex; min-width: 0; min-height: 12.5rem; padding: 1rem; flex-direction: column; border: 1px solid var(--line); border-radius: .85rem; background: #fff; box-shadow: var(--shadow-sm); }
.role-login-card:hover { border-color: #9ec6bd; box-shadow: 0 10px 26px rgba(18,45,43,.08); }
.role-login-icon { display: grid; width: 2.4rem; height: 2.4rem; place-items: center; border-radius: .65rem; background: var(--brand-100); color: var(--brand-900); font-size: 1rem; }
.role-login-card h3 { margin: .75rem 0 .25rem; font-size: .88rem; }
.role-login-card p { margin: 0 0 .9rem; flex: 1; color: var(--ink-faint); font-size: .72rem; }
.standard-login { margin-top: 1rem; }
.standard-login summary { cursor: pointer; color: var(--ink-soft); font-size: .72rem; font-weight: 700; text-align: center; }
.standard-login .card { margin-top: .7rem; }

/* Directory */
.profile-card { display: flex; min-width: 0; min-height: 100%; padding: 1rem; flex-direction: column; }
.profile-head { display: flex; align-items: flex-start; gap: .7rem; }
.profile-copy { min-width: 0; }
.profile-copy h3 { margin: 0; font-size: .84rem; }
.profile-copy p { margin: .1rem 0 0; color: var(--ink-faint); font-size: .66rem; }
.profile-summary { margin: .75rem 0; color: var(--ink-soft); font-size: .72rem; }
.profile-card .button { margin-top: auto; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid { grid-template-columns: minmax(12rem, 2fr) repeat(2, minmax(8rem, 1fr)); }
  .directory-filter-grid { grid-template-columns: minmax(12rem, 2fr) minmax(10rem, 1fr); }
  .filter-grid .filter-actions { grid-column: 1 / -1; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 900px) {
  :root { --topbar-height: 3.7rem; }
  .sidebar { width: min(20rem, 88vw); transform: translateX(-103%); transition: transform .2s ease; box-shadow: var(--shadow-md); }
  .menu-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 45; display: block; background: rgba(8,28,27,.5); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .menu-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .sidebar-close, .menu-button { display: inline-grid !important; }
  .sidebar-close { color: white; }
  .main-shell { margin-left: 0; }
  .topbar { padding: 0 1rem; }
  .simulation-label, .topbar-user { display: none; }
  .layout-sidebar { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: auto; padding: 1.5rem; }
  .login-story { margin: 3rem 0 2rem; }
  .login-foot { display: none; }
  .login-content { padding: 2rem 1.2rem 3rem; }
}

@media (max-width: 680px) {
  body { font-size: 14px; }
  .main-content { padding: 1.15rem .85rem 2rem; }
  .page-header { flex-direction: column; gap: .8rem; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .web-push-control { width: 100%; justify-items: stretch; }
  .web-push-status { text-align: left; }
  .grid-2, .grid-3, .grid-4, .form-grid { grid-template-columns: 1fr; }
  .span-2, .form-field-full { grid-column: auto; }
  .stat-card { padding: .9rem; }
  .filter-grid { grid-template-columns: 1fr; }
  .directory-filter-grid { grid-template-columns: minmax(0, 1fr); }
  .filter-grid .filter-actions { grid-column: auto; }
  .filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .card-header, .card-body { padding-right: .95rem; padding-left: .95rem; }
  .meta-list { grid-template-columns: 1fr; }
  .meta-row:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .definition-row { grid-template-columns: 1fr; gap: .15rem; }
  .app-footer { flex-direction: column; }
  .next-action { grid-template-columns: auto minmax(0, 1fr); }
  .next-action .button { grid-column: 1 / -1; width: 100%; }
  .quick-link-grid { grid-template-columns: 1fr 1fr; }
  .role-login-grid { grid-template-columns: 1fr; }
  .role-login-card { min-height: auto; }
  .role-login-card p { min-height: auto; }
  .login-story h1 { font-size: 1.7rem; }
  .login-story { margin: 2.3rem 0 1rem; }
  .steps { gap: 0; }
  .steps-7 { overflow-x: auto; grid-template-columns: repeat(7, minmax(5.2rem, 1fr)); padding: .3rem; }
  .step { font-size: .58rem; }
  .donut-wrap { align-items: flex-start; }
  .donut { width: 6.5rem; height: 6.5rem; }
  .donut::before { width: 4.8rem; height: 4.8rem; }
  .credential-stage { min-height: 25rem; padding: .7rem; }
  .credential { aspect-ratio: auto; min-height: 18rem; }
  .pagination { flex-direction: column; }

  .responsive-table thead { display: none; }
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table tr { padding: .75rem .9rem; border-bottom: 1px solid var(--line); }
  .responsive-table tbody tr:last-child { border-bottom: 0; }
  .responsive-table td { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .3rem 0; border: 0; text-align: right; }
  .responsive-table td:first-child { display: block; padding-bottom: .55rem; text-align: left; }
  .responsive-table .cell-actions { width: 100%; padding-top: .6rem; }
  .responsive-table .cell-actions .button { width: 100%; }
  .responsive-table .mobile-label { display: inline; color: var(--ink-faint); font-size: .64rem; font-weight: 700; text-align: left; }
  .responsive-table .primary-cell { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .page-actions, .anchor-nav, .button, .app-footer, .message-stack, .no-print { display: none !important; }
  .main-shell { margin: 0; }
  .main-content { max-width: none; padding: 0; }
  .card { break-inside: avoid; border-color: #aaa; box-shadow: none; }
  .credential-stage { min-height: 0; background: #fff; }
  .credential { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* User-action feedback */
.feedback-navigation-bar { position: fixed; z-index: 300; top: 0; left: 0; width: 34%; height: 3px; background: var(--brand-600); box-shadow: 0 1px 5px rgba(39,134,123,.28); opacity: 0; pointer-events: none; transform: translateX(-110%); }
body.is-feedback-navigating { cursor: progress; }
body.is-feedback-navigating .feedback-navigation-bar { opacity: 1; animation: feedback-navigation-progress .9s ease-in-out infinite; }
.is-feedback-acknowledged { filter: brightness(.93); }
form[aria-busy="true"] { cursor: progress; }
form[aria-busy="true"] .is-feedback-submitting { cursor: wait; opacity: .78; transform: none; box-shadow: none; }
form[aria-busy="true"] .feedback-spinner { font-size: .9rem; animation: feedback-spin .65s linear infinite; }
[data-copy][aria-busy="true"], [data-copy][aria-disabled="true"] { cursor: wait; opacity: .78; }
[data-copy][data-feedback-state="success"] { border-color: #9fcfb5; background: var(--green-100); color: var(--green-700); }
[data-copy][data-feedback-state="selected"] { border-color: #e4c28f; background: var(--amber-100); color: var(--amber-700); }
[data-copy][data-feedback-state="error"] { border-color: #e2aaa5; background: var(--red-100); color: var(--red-700); }
[data-reveal-target][aria-expanded="true"] { color: var(--brand-900); text-decoration-thickness: .14em; }
.menu-button[aria-expanded="true"] { background: rgba(0,0,0,.07); }
.is-feedback-revealed { animation: feedback-reveal .2s ease-out; }

@keyframes feedback-navigation-progress {
  from { transform: translateX(-110%); }
  to { transform: translateX(405%); }
}

@keyframes feedback-spin {
  to { transform: rotate(360deg); }
}

@keyframes feedback-reveal {
  from { opacity: .55; transform: translateY(-.2rem); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  body.is-feedback-navigating .feedback-navigation-bar { width: 100%; animation: none; transform: none; }
  .is-feedback-revealed { animation: none; }
}

@media print {
  .feedback-navigation-bar { display: none !important; }
}
