/* Shared colours and butterfly masthead follow the published KTF Evidence Library and Records apps. */
:root {
  color-scheme: light;
  --paper: #f6f7f8;
  --card: #fff;
  --ink: #253539;
  --muted: #56666b;
  --line: #dce2e4;
  --soft: #edf3f3;
  --masthead: #244c54;
  --accent: #256a70;
  --link: #24636a;
  --aqua: #72bdb7;
  --gold: #c5b77d;
  --field: #a5b3b7;
  --focus: #965300;
  --radius: .6rem;
  --gutter: clamp(1rem, 3vw, 2.5rem);
  --page-width: 88rem;
  font-family: Verdana, Geneva, sans-serif;
}
* { box-sizing: border-box; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
}
[hidden] { display: none !important; }
a { color: var(--link); text-underline-offset: .18em; }
button, input, select, textarea { font: inherit; }
button, summary { cursor: pointer; }
a, button, summary { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
h1 { font-size: clamp(1.75rem, 2.75vw, 2.35rem); line-height: 1.2; letter-spacing: -.04em; margin: 0 0 .45rem; }
h2 { font-size: 1.29rem; line-height: 1.3; letter-spacing: -.025em; margin: 0 0 .7rem; color: var(--masthead); }
h3 { font-size: 1.03rem; line-height: 1.35; margin: 1.4rem 0 .6rem; }
small { font-size: .82rem; }
.icon { width: 1.15rem; height: 1.15rem; flex: none; }
.skip-link { position: fixed; top: -7rem; left: 1rem; z-index: 12; padding: .65rem 1rem; background: #fff; }
.skip-link:focus { top: .5rem; }
.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; }

.masthead { background: var(--masthead); border-bottom: 3px solid var(--gold); color: #fff; }
.masthead-inner, .nav-inner, .workspace, .site-footer {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.4rem; padding-block: .65rem; }
.identity { display: inline-flex; align-items: center; gap: .7rem; color: #fff; text-decoration: none; min-width: 0; }
.brand-butterfly { display: block; width: 3.25rem; height: 2.5rem; overflow: hidden; flex: none; }
.brand-butterfly img { display: block; height: 100%; width: auto; max-width: none; }
.brand-title { font-size: 1.04rem; font-weight: 700; letter-spacing: .01em; line-height: 1.19; overflow-wrap: anywhere; }
.org-symbol { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; }
.org-symbol .icon { width: 2rem; height: 2rem; }
.masthead-tools, .member, .masthead-tools time, .header-button { display: flex; align-items: center; }
.masthead-tools { gap: 1.15rem; }
.masthead-tools time { gap: .5rem; color: #e3ecee; font-size: .83rem; }
.masthead-tools time .icon { width: 1rem; height: 1rem; }
.member { gap: .55rem; border-left: 1px solid #ffffff48; padding-left: 1.15rem; }
.member strong, .member small { display: block; line-height: 1.35; }
.member strong { max-width: 18rem; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; font-size: .86rem; }
.member small { color: #d4e5e5; font-size: .75rem; }
.avatar { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; color: #fff; background: #36636a; border: 1px solid #769599; font-weight: 700; }
.header-button { justify-content: center; gap: .4rem; min-height: 2.35rem; padding: .43rem .7rem; background: transparent; border: 1px solid #ffffff78; border-radius: .35rem; color: #fff; font-size: .85rem; }
.header-button:hover { background: #335f67; }
.header-button .icon { width: 1rem; height: 1rem; }
.masthead :focus-visible { outline-color: #f4c64e; }
.menu-button { display: none; }
.workspace-nav { background: var(--card); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; gap: clamp(.1rem, .6vw, .8rem); align-items: stretch; }
.nav-link { display: flex; align-items: center; justify-content: center; gap: .42rem; padding: .8rem clamp(.3rem,.6vw,.65rem); color: #40555b; border-bottom: 3px solid transparent; text-decoration: none; font-size: .85rem; white-space: nowrap; }
.nav-link .icon { width: 1rem; height: 1rem; }
.nav-link:hover { background: #f3f7f7; }
.nav-link.active { color: #1d555c; background: #eaf4f3; border-color: var(--accent); font-weight: 700; }
.site-footer { margin-top: auto; color: var(--muted); padding-block: 1.2rem 1.5rem; font-size: .8rem; }
.site-footer span { display: block; padding-top: .9rem; border-top: 1px solid var(--line); }
.workspace { flex: 1; padding-block: clamp(1.4rem,2.9vw,2.6rem) 1rem; }
.eyebrow { color: var(--accent); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; line-height: 1.4; margin: 0 0 .5rem; }
.page-head, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.page-head { margin-bottom: 1.4rem; align-items: flex-end; flex-wrap: wrap; }
.page-head > div { min-width: 0; }
.page-head p:last-child, .section-head p:last-child { margin-bottom: 0; }
.page-head h1:only-child { margin: 0; }
.subhead, .muted, .meta, .quiet, .empty, .helptext, small { color: var(--muted); }
.subhead { font-size: 1rem; margin-bottom: 0; }
.breadcrumb { font-size: .9rem; margin-bottom: .5rem; }
.toolbar, .button-row, .inline-form { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: .6rem; }
.btn, .button { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 2.5rem; padding: .49rem .9rem; color: var(--link); border: 1px solid var(--field); background: var(--card); border-radius: .35rem; text-decoration: none; font-size: .9rem; font-weight: 600; line-height: 1.35; text-align: center; }
.btn:hover, .button:hover { background: var(--soft); }
.btn.primary, .btn-primary, .button.primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn.primary:hover, .btn-primary:hover, .button.primary:hover { background: #1c555b; }
.btn .icon { width: 1rem; height: 1rem; }

.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1rem; margin-bottom: 1.15rem; }
.metric, .panel, .public-card { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); box-shadow: 0 2px 6px #162e3507; }
.metric { position: relative; padding: 1.05rem 1.1rem 1rem 1.35rem; text-decoration: none; color: var(--ink); }
.metric::before { content: ""; position: absolute; width: 3px; top: 1.15rem; bottom: 1.1rem; left: 0; border-radius: 0 3px 3px 0; background: var(--aqua); }
.metric:hover { border-color: #86afb2; }
.metric-title { display: flex; align-items: center; gap: .55rem; font-size: .9rem; font-weight: 700; }
.icon-pad, .empty-icon { display: inline-grid; place-items: center; flex: none; border-radius: .35rem; }
.icon-pad { width: 1.85rem; height: 1.85rem; background: #e8f2f1; color: var(--accent); }
.icon-pad.amber { color: #805a18; background: #fbf2dc; }
.icon-pad.blue { color: #3b647d; background: #eaf1f7; }
.icon-pad.violet { color: #5d547e; background: #f0eef7; }
.metric strong { display: block; color: var(--masthead); font-size: 2.25rem; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.045em; margin: .65rem 0 .2rem; }
.metric small { font-size: .8rem; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(0,1fr); gap: 1.15rem; align-items: start; }
.stack { display: grid; gap: 1.15rem; align-content: start; }
.panel, .meeting-card { padding: clamp(1rem,1.65vw,1.5rem); min-width: 0; }
.panel p:last-child { margin-bottom: 0; }
.section-head { margin-bottom: .85rem; }
.section-head h2 { margin: 0; }
.section-head .eyebrow { margin-bottom: .23rem; }
.section-head > .icon { color: var(--accent); }
.section-head > a { font-size: .88rem; font-weight: 600; }
.meeting-card { background: var(--masthead); color: #fff; border-radius: var(--radius); border-top: 3px solid var(--gold); }
.meeting-card .eyebrow, .meeting-card .section-head > .icon { color: #cce5e2; }
.meeting-card h2 { font-size: 1.45rem; color: #fff; }
.meeting-card > p { color: #e5eeee; font-size: .94rem; max-width: 34rem; }
.meeting-card .light { background: #fff; color: #23585e; border-color: #fff; }
.meeting-card .light:hover { background: #edf4f3; }
.meeting-card :focus-visible { outline-color: #f4c64e; }
.profile-rows { display: grid; gap: .7rem; }
.profile-row { display: grid; grid-template-columns: minmax(3rem,6rem) minmax(1rem,1fr) 2rem; align-items: center; gap: .5rem; font-size: .88rem; }
.profile-row b { text-align: right; }
.track { height: .48rem; background: #edf1f2; border-radius: .4rem; overflow: hidden; }
.track i { display: block; height: 100%; background: #528b75; }
.profile-row:nth-child(2) i { background: #bd994e; }
.profile-row:nth-child(3) i { background: #bc7450; }
.profile-row:nth-child(4) i { background: #a85c61; }
.empty-state { padding: 1.2rem .65rem .65rem; text-align: center; border-top: 1px solid var(--line); }
.empty-icon { width: 2.35rem; height: 2.35rem; border-radius: 50%; margin-bottom: .5rem; background: var(--soft); color: var(--accent); }
.empty-state strong { display: block; }
.empty-state p, .quiet { font-size: .92rem; margin: .35rem 0; }
.quiet { padding: .6rem 0; }
.record-list > a, .record-list > div { display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-top: 1px solid var(--line); padding: .8rem 0; color: inherit; text-decoration: none; }
.record-list > a:hover strong { color: var(--link); text-decoration: underline; }
.record-list strong, .record-list small { display: block; }
.record-list strong { font-size: .95rem; }
.record-list > a > div:last-child { text-align: right; }
ul.record-list { list-style: none; padding: 0; margin: .7rem 0; }
ul.record-list > li { padding: .65rem 0; border-top: 1px solid var(--line); }
.badge { display: inline-block; padding: .16rem .5rem; border-radius: .3rem; background: #e8f2f1; color: #295e61; font-weight: 650; font-size: .77rem; }
.badge.amber, .badge-alert { background: #fbefd5; color: #79510f; }
.badge.violet { background: #efedf7; color: #5f487c; }
.badge.blue { background: #e8f0f6; color: #355c78; }

.table-wrap, .table-scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { padding: .7rem .65rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
thead th { background: var(--soft); color: var(--masthead); font-size: .84rem; }
tbody tr:hover td { background: #f6f9f9; }
table a { font-weight: 600; }
.panel + .panel, .panel + .toolbar, .panel + .grid-2, .grid-2 + .panel { margin-top: 1rem; }
.stack > .panel + .panel, .grid-2 > .panel + .panel { margin-top: 0; }
.grid-2, .form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.form-grid { gap: .1rem 1.15rem; }
.field-wide { grid-column: 1 / -1; }
.detail-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(12rem,100%),1fr)); gap: 1rem; margin: .5rem 0 1.2rem; }
dt { color: var(--muted); font-size: .85rem; }
dd { margin: .1rem 0 0; overflow-wrap: anywhere; }
.panel form p, .field { margin: .85rem 0; }
.field label, form p > label { display: block; font-size: .9rem; font-weight: 650; margin: .2rem 0 .3rem; }
input:not([type=checkbox]):not([type=hidden]), textarea, select { max-width: 100%; min-width: 0; min-height: 2.6rem; padding: .5rem .65rem; border: 1px solid var(--field); border-radius: .3rem; color: var(--ink); background-color: #fff; }
input:not([type=checkbox]):not([type=hidden]), textarea, .field select, select[multiple] { width: 100%; }
select:not([multiple]) { appearance: none; padding-right: 2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='none' stroke='%23405f64' stroke-width='1.5' d='m3 5 4 4 4-4'/%3E%3C/svg%3E"); background-position: right .65rem center; background-repeat: no-repeat; }
input[type=checkbox] { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; }
textarea { resize: vertical; }
select[multiple] { min-height: 5rem; }
.field small, .helptext { display: block; font-size: .83rem; margin: .3rem 0; }
.errorlist { margin: .4rem 0; color: #8a3336; }
.message { background: #e9f3ed; border: 1px solid #c3d9cc; padding: .72rem .9rem; border-radius: .35rem; margin-bottom: 1rem; }
.message.error { color: #8a3336; background: #fff0ee; border-color: #efc9c3; }
.admin-form { max-width: 37rem; }
.admin-form select { min-width: 12rem; }
details { padding: .6rem 0; }
summary { color: var(--link); font-weight: 600; }
.audit-event { border-bottom: 1px solid var(--line); }
.audit-event summary small { display: block; font-size: .8rem; font-weight: 400; margin-left: 1.2rem; }
.audit-event td { max-width: 20rem; white-space: pre-wrap; }
.matrix { margin: 1rem 0; }
.matrix td { background: #f4f8f7; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: .75rem; color: var(--muted); font-size: .85rem; }
.empty { padding: 1.35rem .35rem .65rem; }
.empty h2 { margin-bottom: .4rem; }
.toolbar[role=search] { align-items: flex-end; margin-bottom: 1rem; }
.toolbar[role=search] .field { margin: 0; flex: 1 1 10rem; font-size: .9rem; font-weight: 650; }
.toolbar[role=search] select, .toolbar[role=search] input { display: block; width: 100%; margin-top: .32rem; }
.has-live-filters .apply-filters { display: none; }
.register-menu { position: relative; padding: 0; }
.register-menu summary { list-style: none; }
.register-menu summary::-webkit-details-marker { display: none; }
.register-menu summary::after { content: ""; width: .42rem; height: .42rem; margin: 0 .12rem .2rem .15rem; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.register-menu[open] summary::after { margin-bottom: -.2rem; transform: rotate(225deg); }
.register-menu-items { position: absolute; top: calc(100% + .25rem); left: 0; z-index: 2; min-width: max-content; padding: .25rem; background: var(--card); border: 1px solid var(--line); border-radius: .35rem; box-shadow: 0 4px 12px #162e351a; }
.register-menu-items a { display: block; padding: .55rem .7rem; font-size: .9rem; text-decoration: none; }
.register-menu-items a:hover { background: var(--soft); text-decoration: underline; }
.register-result-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .65rem; margin: 0 0 .75rem; font-size: .87rem; }
.register-result-tools .btn { min-height: 2.25rem; }
#register-results .table-scroll { position: relative; }
.register-table { min-width: 40rem; }
.register-table .register-rating { width: 7.5rem; min-width: 7.5rem; }
.register-rating .badge { max-width: 100%; }
.sort-link { position: relative; display: inline-flex; align-items: baseline; gap: .35rem; color: inherit; text-decoration: none; }
.sort-link:hover { text-decoration: underline; }
.sort-arrow { white-space: nowrap; color: var(--muted); }
th[aria-sort] .sort-arrow { color: var(--accent); }

.public-main { width: 100%; flex: 1; padding: clamp(2rem, 9vh, 6rem) var(--gutter); }
.public-card { max-width: 39rem; margin: 0 auto; border-top: 3px solid var(--aqua); padding: clamp(1.5rem,3.7vw,2.7rem); }
.public-card h1 { color: var(--masthead); font-size: clamp(1.7rem,3vw,2.3rem); }
.public-intro { margin: .9rem 0 1.5rem; max-width: 34rem; }
.login-btn { padding-inline: 1.15rem; }
.login-note, .setup-note { display: flex; gap: .5rem; align-items: center; }
.login-note { margin-top: .9rem; }
.login-note .icon { width: .95rem; }
.setup-note { align-items: flex-start; padding: 1rem; background: var(--soft); border: 1px solid var(--line); border-radius: .35rem; }
.setup-note p { color: var(--muted); font-size: .88rem; margin: .25rem 0 0; }

@media (max-width: 76rem) {
  .nav-link { font-size: .82rem; padding-inline: .4rem; }
  .nav-inner { gap: .2rem; }
}
@media (max-width: 68rem) {
  .masthead-inner { min-height: 3.9rem; }
  .has-menu .menu-button { display: inline-flex; }
  .nav-inner { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .1rem; padding-block: .45rem; }
  .nav-link { justify-content: flex-start; font-size: .9rem; border: 0; border-left: 3px solid transparent; padding: .55rem .7rem; border-radius: .25rem; }
  .nav-link.active { border-left-color: var(--accent); }
  .metrics { gap: .7rem; }
  .metric { padding: .9rem .9rem .85rem 1.05rem; }
}
@media (max-width: 52rem) {
  .masthead-tools { gap: .65rem; }
  .masthead-tools time { display: none; }
  .member { border: 0; padding: 0; }
  .dashboard-columns { grid-template-columns: minmax(0,1fr); }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .grid-2 { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 40rem) {
  .masthead-inner { gap: .5rem; }
  .brand-butterfly { width: 2.85rem; height: 2.2rem; }
  .identity { gap: .42rem; }
  .brand-title { font-size: .88rem; }
  .masthead-tools { gap: .35rem; }
  .member, .signout span { display: none; }
  .signout { min-width: 2.35rem; }
  .nav-inner { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .form-grid { display: block; }
  .dashboard-columns, .stack { gap: .9rem; }
  .metrics { margin-bottom: .9rem; }
  .metric-title { font-size: .82rem; gap: .35rem; }
  .metric strong { font-size: 1.85rem; }
  .icon-pad { width: 1.5rem; height: 1.5rem; }
  .icon-pad .icon { width: 1rem; height: 1rem; }
  .page-head { gap: .8rem; }
  .record-list > a, .record-list > div { flex-wrap: wrap; }
  .public-main { padding-block: 2rem; }
}
