:root {
  color: #152c26;
  background: #f4f7f5;
  font: 16px/1.5 Inter, "Segoe UI", sans-serif;
  --muted: #4e645b;
  --line: #d6e1db;
  --accent: #175d42;
  --surface: #fff;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid #28744e; outline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 4vw, 2.75rem); letter-spacing: -0.035em; line-height: 1.15; }
h2 { font-size: 1.2rem; letter-spacing: -0.015em; }
.shell { width: min(100% - 3rem, 70rem); margin-inline: auto; }
.skip-link { position: absolute; top: -5rem; left: 1rem; z-index: 1; padding: 0.75rem; background: white; }
.skip-link:focus { top: 0.5rem; }
.site-header { background: #102f25; color: #fff; }
.site-header a { color: inherit; }
.site-header :focus-visible { outline-color: #b5ebc6; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 2.25rem; padding-block: 0.75rem; }
.brand { display: inline-flex; align-items: baseline; gap: 0.55rem; text-decoration: none; }
.brand strong { font-size: 1.13rem; letter-spacing: 0.06em; }
.brand span { color: #bce5d2; }
.header-inner nav, .account { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.header-inner nav a { padding: 0.45rem 0.65rem; border-radius: 0.35rem; text-decoration: none; }
.header-inner nav a:hover, .header-inner nav a[aria-current] { background: #255140; }
.account { margin-inline-start: auto; font-size: 0.875rem; }
.quiet { color: #fff; background: transparent; border: 1px solid #80a393; border-radius: 0.35rem; padding: 0.45rem 0.7rem; }
.quiet:hover { background: #255140; }
.alert-bell { position: relative; display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 0.35rem; color: inherit; background: transparent; border: 0; anchor-name: --alert-bell; }
.alert-bell:hover { background: #255140; }
.alert-count { position: absolute; top: 0; right: 0; padding: 0.05rem 0.34rem; background: #b52332; color: white; border-radius: 1rem; font-size: 0.72rem; }
.alert-popup { position: fixed; inset: 3.75rem 1rem auto auto; margin: 0; width: min(22rem, calc(100vw - 2rem)); max-height: min(28rem, 75vh); overflow: auto; padding: 1rem; color: #152c26; border: 1px solid var(--line); border-radius: 0.65rem; box-shadow: 0 0.5rem 1.5rem #152c2630; }
@supports (top: anchor(bottom)) {
  .alert-popup { position-anchor: --alert-bell; top: calc(anchor(bottom) + 0.25rem); right: max(1rem, anchor(right)); }
}
.alert-popup h2, .alert-popup form, .alert-popup p { margin-bottom: 0.65rem; }
.site-header .alert-popup a { color: var(--accent); }
.alert-popup .button { display: block; width: 100%; text-align: left; overflow-wrap: anywhere; }
.account-name { anchor-name: --account-name; overflow-wrap: anywhere; max-width: min(18rem, 65vw); }
.account-popup ul { margin: 0; padding-inline-start: 1.2rem; }
.account-popup li + li { margin-top: 0.45rem; }
.account-popup form { margin: 0.85rem 0 0; }
@supports (top: anchor(bottom)) {
  .account-popup { position-anchor: --account-name; }
}
.policy-copy p { margin-block: 0.6rem 1rem; max-width: 74ch; }
.policy-consent { margin: 0.8rem 0; }
.policy-consent label { display: inline-flex; align-items: baseline; gap: 0.55rem; }
.policy-consent input { width: auto; min-height: auto; }
[data-assignee-search] { position: relative; }
.assignee-options { position: absolute; inset: 2.75rem 0 auto; z-index: 2; max-height: 15rem; overflow: auto; margin: 0; padding: 0.25rem; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 0.4rem; box-shadow: 0 0.4rem 1rem #152c2626; }
.assignee-options li { padding: 0.55rem 0.65rem; cursor: pointer; overflow-wrap: anywhere; }
.assignee-options li:hover, .assignee-options [aria-selected="true"] { background: #e9f3ed; }
.field-status { margin-inline-start: 0.35rem; color: var(--muted); font-size: 0.8rem; font-weight: 400; }
.dev-banner { padding-block: 0.55rem; background: #e8efe1; color: #34472f; font-size: 0.85rem; border-bottom: 1px solid var(--line); }
.main { padding-block: clamp(1.7rem, 4.5vw, 3.5rem); min-height: 65vh; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1rem; border-top: 1px solid var(--line); padding-block: 1.25rem; color: var(--muted); font-size: 0.85rem; }
.page-heading { margin-bottom: 1.65rem; overflow-wrap: anywhere; }
.page-heading p { color: var(--muted); margin-top: 0.5rem; }
.heading-actions, .section-heading { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.55rem 1rem; border: 1px solid #9db1a7; border-radius: 0.4rem; background: white; color: var(--accent); text-decoration: none; font-weight: 650; }
.button:hover { background: #e9f3ed; }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: #124733; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 0.65rem; }
.tag { color: var(--accent); font-family: "IBM Plex Mono", Consolas, monospace; font-size: 0.875rem; font-weight: 650; overflow-wrap: anywhere; }
.status { display: inline-block; border-radius: 0.28rem; padding: 0.16rem 0.55rem; color: #145038; background: #e4f2e9; font-size: 0.8rem; font-weight: 650; white-space: nowrap; }
.status.retired { color: #4d5755; background: #edf0ef; }
.status.in_repair { color: #664606; background: #fcf1d7; }
.equipment-grid, .history { margin: 0; padding: 0; list-style: none; }
.equipment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.equipment-grid li, .fields > div, .details > div { min-width: 0; }
.equipment-card { display: flex; flex-direction: column; height: 100%; color: inherit; padding: 1.15rem; text-decoration: none; overflow-wrap: anywhere; }
.equipment-card:hover { border-color: var(--accent); }
.card-top, .detail-meta { display: flex; align-items: center; gap: 0.6rem; }
.card-top { justify-content: space-between; }
.equipment-card h2 { margin-top: 0.75rem; }
.equipment-card p { color: var(--muted); margin-block: 0.25rem 1rem; }
.card-link { margin-top: auto; color: var(--accent); font-size: 0.875rem; font-weight: 650; }
.empty { padding: 1rem; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 0 0 1.5rem; }
.metrics div { padding: 1rem 1.2rem; }
.metrics dt { color: var(--muted); font-weight: 600; }
.metrics dd { margin: 0.35rem 0 0; font-size: 2rem; line-height: 1.15; font-weight: 700; }
.section-heading { padding: 1rem 1.2rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { background: #eef3f0; color: #375247; white-space: nowrap; font-size: 0.85rem; }
tbody tr:last-child td { border-bottom: 0; }
.search { margin-bottom: 1rem; }
.search label, .fields label { display: block; margin-bottom: 0.35rem; font-weight: 650; }
.search div, .form-actions, .pagination { display: flex; align-items: center; flex-wrap: wrap; gap: 0.75rem; }
.search input { max-width: 24rem; flex: 1 1 12rem; }
.pagination { margin-top: 1rem; }
.back { display: inline-block; margin-bottom: 0.8rem; }
.detail-meta { margin-bottom: 0.55rem; }
.detail-panel { margin-bottom: 1rem; padding: clamp(1rem, 3vw, 1.5rem); }
.details, .fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.75rem; margin: 0; }
.details { margin-top: 1rem; }
.details dt { color: var(--muted); font-size: 0.875rem; font-weight: 650; }
.details dd { margin: 0.25rem 0 0; overflow-wrap: anywhere; }
.wide { grid-column: 1 / -1; }
.multiline { white-space: pre-wrap; }
.history { margin-top: 0.75rem; }
.history li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.3rem 1rem; padding-block: 0.65rem; border-top: 1px solid var(--line); }
.history span { color: var(--muted); }
input, select, textarea { width: 100%; min-height: 2.75rem; padding: 0.45rem 0.6rem; color: inherit; background: white; border: 1px solid #9db1a7; border-radius: 0.35rem; }
input:disabled { background: #edf2ef; color: var(--muted); }
.fields .checkbox-label { display: inline-flex; align-items: center; gap: 0.5rem; }
.checkbox-label input { width: 1.2rem; min-height: 1.2rem; margin: 0; }
.fields small { display: block; margin-top: 0.3rem; color: var(--muted); }
.form-actions { margin-top: 1.3rem; }
.errorlist { margin: 0.25rem 0 0; padding-inline-start: 1.2rem; color: #9b2424; }
.notice { padding: 0.75rem 1rem; margin-bottom: 1rem; border-radius: 0.4rem; overflow-wrap: anywhere; }
.warning { background: #fcf1d7; color: #664606; }
.success { background: #e4f2e9; color: #145038; }
.sign-in { max-width: 31rem; margin-inline: auto; }
.identity-list { overflow: hidden; }
.identity { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; padding: 0.9rem 1.15rem; color: var(--accent); background: #fff; border: 0; border-bottom: 1px solid var(--line); }
.identity:last-child { border-bottom: 0; }
.identity:hover { background: #eef6f0; }
.identity:focus-visible { outline-offset: -4px; }
.identity small { display: block; color: var(--muted); }

@media (max-width: 42rem) {
  .shell { width: calc(100% - 2rem); }
  .header-inner { gap: 0.45rem 1rem; }
  .header-inner nav { order: 3; flex-basis: 100%; }
  .header-inner nav a { min-height: 2.75rem; padding: 0.55rem 0.7rem; }
  .account span { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); gap: 0.65rem; }
  .fields { grid-template-columns: 1fr; }
  .details { gap: 0.85rem 0.65rem; }
}
