:root {
  color-scheme: light;
  --ink: #162a48;
  --muted: #4b607b;
  --brand: #28348b;
  --blue: #416ca9;
  --page: #f3f6fb;
  --border: #d3deec;
  --white: #fff;
  font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); }
a { color: var(--brand); text-underline-offset: .17em; }
a:hover { color: #17517f; }
:focus-visible { outline: 3px solid #3475ba; outline-offset: 3px; }
.skip { position: absolute; transform: translateY(-160%); background: var(--white); z-index: 1; padding: 1rem; }
.skip:focus { transform: none; }
.masthead { background: var(--white); border-bottom: 1px solid var(--border); }
.mast-inner {
  max-width: 90rem; min-height: 76px; margin: auto; padding: .8rem clamp(1rem, 3vw, 2.5rem);
  display: flex; align-items: center; justify-content: space-between; gap: .75rem 1rem;
}
.brand { display: inline-flex; gap: .8rem; align-items: center; font-weight: 720; color: var(--ink); text-decoration: none; }
.brand img { display: block; width: 82px; height: auto; }
.nav-link, .dashboard-nav { font-size: .89rem; font-weight: 620; }
.layout { max-width: 67rem; padding: clamp(1.7rem, 4vw, 3.2rem) clamp(1rem, 4vw, 2.6rem) 4rem; margin: auto; }
.layout.wide { max-width: 90rem; }
.page-head { margin: 0 0 1.4rem; }
.page-head p { color: var(--muted); margin: .4rem 0 0; font-size: 1rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.95rem, 4vw, 2.7rem); line-height: 1.12; letter-spacing: -.045em; }
h2 { font-size: 1.27rem; letter-spacing: -.025em; line-height: 1.3; }
h3 { font-size: 1.06rem; line-height: 1.4; }
p { max-width: 70ch; }
p + p { margin-top: .5rem; }
h2 + p, h3 + p { margin-top: .45rem; }
main > section + section, main > .notice + section { margin-top: 1.15rem; }
.panel { padding: clamp(1rem, 2.5vw, 1.5rem); background: var(--white); border: 1px solid var(--border); border-radius: 14px; }
.panel.narrow { max-width: 36rem; }
.muted, td small, th small, .people-list small { color: var(--muted); }
.account-banner {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
  padding: clamp(1.3rem, 4vw, 2.1rem); color: var(--white); border-radius: 16px;
  background: linear-gradient(120deg, #142945 0%, #243979 60%, #344795 100%);
}
.account-banner h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); }
.account-banner p:not(.banner-label) { color: #e0eafa; }
.account-banner .banner-label, .banner-label { color: #d1e5fb; font-weight: 670; font-size: .92rem; margin-bottom: .28rem; }
.banner-meta { align-self: stretch; display: flex; flex-direction: column; align-items: flex-start; }
.banner-meta strong { font-size: 1.28rem; margin-bottom: .6rem; }
.module-banner { margin-bottom: 1.1rem; }
.button, button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 40px;
  padding: .55rem .85rem; border: 1px solid var(--brand); border-radius: 8px; background: var(--brand);
  color: var(--white); font: inherit; font-size: .88rem; font-weight: 650; cursor: pointer; text-decoration: none;
}
.button:hover, button:hover { color: var(--white); background: #192663; }
.button.secondary { color: var(--brand); border-color: #bcccdf; background: var(--white); }
.button.secondary:hover { color: var(--brand); background: #eaf1fa; }
.button.on-banner { color: #142a56; background: #dceafb; border-color: #dceafb; }
.button.on-banner:hover { background: var(--white); }
.button.quiet { color: #dfedff; background: transparent; border-color: transparent; padding-left: 0; text-decoration: underline; }
.button.quiet:hover { color: var(--white); background: transparent; }
.actions, .section-head { display: flex; gap: .65rem 1rem; flex-wrap: wrap; align-items: center; }
.section-head { justify-content: space-between; }
.dashboard-nav { margin: 0 0 1rem; }
h2 + .tool-grid, .panel p + .actions, .section-head + p, .panel > h2 + .fields { margin-top: .9rem; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: .9rem; }
.tool-card { display: flex; flex-direction: column; align-items: flex-start; }
.tool-card p { color: var(--muted); margin: .5rem 0 1rem; }
.tool-card a { margin-top: auto; }
.fields { display: grid; gap: .88rem; }
form.fields { margin-top: 1rem; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: block; font-size: .9rem; font-weight: 650; }
input, select { font: inherit; font-weight: 450; }
input:not([type=checkbox],[type=hidden]), select {
  display: block; width: 100%; min-width: 0; min-height: 41px; margin-top: .28rem; padding: .5rem .62rem;
  color: var(--ink); background: var(--white); border: 1px solid #aebfd5; border-radius: 7px;
}
input[readonly] { background: #f1f5fb; }
.check { display: flex; align-items: baseline; gap: .5rem; font-weight: 520; }
input[type=checkbox] { accent-color: var(--brand); align-self: center; margin: .2rem .1rem; }
fieldset { margin: 0; padding: .3rem .85rem .75rem; border: 1px solid var(--border); border-radius: 8px; }
fieldset .check { margin-top: .4rem; }
legend { padding: 0 .25rem; font-weight: 650; font-size: .92rem; }
.term { margin-top: -.5rem; font-size: .87rem; }
.notice {
  display: block; margin-bottom: .9rem; border: 1px solid #b8cce4; border-radius: 9px;
  background: #eaf2fd; color: #193969; padding: .68rem .82rem;
}
.notice.success { color: #195743; border-color: #a9d0be; background: #edf7f0; }
.notice.error { color: #862d30; border-color: #d6abb0; background: #fff1f1; }
.notice.error a { color: inherit; display: block; }
.field-error { color: #862d30; font-size: .9rem; margin-top: .25rem; }
[aria-invalid=true] { border-color: #b3484e !important; }
.tag { display: inline-block; font-size: .77rem; font-weight: 690; padding: .18rem .46rem; border-radius: 6px; white-space: nowrap; }
.tag.green { color: #1b654e; background: #e8f4ec; }
.tag.blue { color: #25528d; background: #e7f0fc; }
.tag.neutral { color: #425676; background: #ebeff6; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel > .section-head, .table-panel .empty { padding: .95rem 1.15rem; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; min-width: 55rem; }
thead { color: #324967; background: #edf3fa; }
th, td { padding: .83rem 1rem; vertical-align: top; border-top: 1px solid var(--border); }
thead th { font-size: .8rem; font-weight: 700; }
td small, th small, .module-line { display: block; margin-top: .18rem; }
tbody tr:hover { background: #f8fbff; }
tbody .selected-company, tbody .selected-company:hover { background: #e4effb; }
.selected-company th[scope="row"] { box-shadow: inset 4px 0 #3475ba; }
.selection-mark { color: #234f86; font-weight: 690; }
.row-actions, .admin-side { display: grid; gap: .45rem; }
.row-actions a { font-weight: 650; }
.admin-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1rem; align-items: start; margin-top: 1rem; }
.admin-side { gap: 1rem; }
.project-list, .people-list { list-style: none; padding: 0; margin: .7rem 0; border-top: 1px solid var(--border); }
.project-list li, .people-list li { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.people-list li { display: flex; gap: .4rem .8rem; flex-wrap: wrap; justify-content: space-between; align-items: start; }
.people-list small { display: block; }
.other-actions { margin-top: 1rem; color: var(--muted); }
.other-actions summary { cursor: pointer; margin-bottom: .5rem; }
.mail-card pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.portal-footer {
  display: flex; justify-content: center; flex-wrap: wrap; gap: .45rem 1rem;
  margin: 0 clamp(1rem, 3vw, 2.5rem); padding: 1rem 0 1.4rem; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .79rem;
}
.version-details { margin: 0; }
.version-details div { padding: .65rem 0; border-top: 1px solid var(--border); display: grid; gap: .3rem 1rem; grid-template-columns: minmax(10rem, 1fr) 2fr; }
.version-details div:first-child { border-top: 0; }
.version-details dt { font-weight: 680; }
.version-details dd { margin: 0; }

@media (max-width: 760px) {
  .admin-grid, .fields.two, .version-details div { grid-template-columns: 1fr; }
  .mast-inner { min-height: 59px; }
  .brand { gap: .4rem; }
  .brand img { width: 58px; }
  .nav-link { font-size: .78rem; }
}
