@font-face {
  font-family: Inter;
  src: url("fonts/inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Oswald;
  src: url("fonts/oswald.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #eef4f7;
  --panel: #ffffff;
  --header: #86bddb;
  --ink: #203243;
  --muted: #5c6e79;
  --link: #416376;
  --link-hover: #203243;
  --button: #416376;
  --button-hover: #203243;
  --button-text: #ffffff;
  --focus: #416376;
  --gold: #d7c826;
  --line: #d4e0e6;
  --soft: #f4f8fa;
  --soft-blue: #e2eef4;
  --green: #276348;
  --green-bg: #e6f2eb;
  --warning: #75530d;
  --warning-bg: #f8efd4;
  --red: #9c3f36;
  --red-bg: #fae9e5;
  --shadow: 0 8px 28px rgb(32 50 67 / 10%);
  --text-font: Inter, system-ui, sans-serif;
  --heading-font: Oswald, Impact, sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page: #222222;
  --panel: #2b2b2b;
  --header: #111111;
  --ink: #dddddd;
  --muted: #a6afb3;
  --link: #5ac9f2;
  --link-hover: #9adff8;
  --button: #099dd7;
  --button-hover: #5ac9f2;
  --button-text: #111111;
  --focus: #5ac9f2;
  --gold: #d7c826;
  --line: #454b4e;
  --soft: #303638;
  --soft-blue: #20343d;
  --green: #8fd4aa;
  --green-bg: #1d392b;
  --warning: #edd27e;
  --warning-bg: #443a20;
  --red: #f0a097;
  --red-bg: #442a28;
  --shadow: 0 8px 28px rgb(0 0 0 / 28%);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    color-scheme: dark;
    --page: #222222;
    --panel: #2b2b2b;
    --header: #111111;
    --ink: #dddddd;
    --muted: #a6afb3;
    --link: #5ac9f2;
    --link-hover: #9adff8;
    --button: #099dd7;
    --button-hover: #5ac9f2;
    --button-text: #111111;
    --focus: #5ac9f2;
    --line: #454b4e;
    --soft: #303638;
    --soft-blue: #20343d;
    --green: #8fd4aa;
    --green-bg: #1d392b;
    --warning: #edd27e;
    --warning-bg: #443a20;
    --red: #f0a097;
    --red-bg: #442a28;
    --shadow: 0 8px 28px rgb(0 0 0 / 28%);
  }
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.55 var(--text-font);
  transition: background-color .18s ease, color .18s ease;
}
a { color: var(--link); }
a:hover { color: var(--link-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
::selection { background: var(--soft-blue); color: var(--ink); }

.topbar {
  min-height: 78px;
  padding: 12px max(4vw, 22px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--header);
  border-top: 4px solid var(--gold);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}
.brand {
  min-width: 240px;
  display: flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--ink); }
.brand-logo { width: 154px; max-height: 46px; object-fit: contain; object-position: left center; }
.brand-logo-dark { display: none; }
html[data-theme="dark"] .brand-logo-light { display: none; }
html[data-theme="dark"] .brand-logo-dark { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .brand-logo-light { display: none; }
  html:not([data-theme]) .brand-logo-dark { display: block; }
}
.brand-divider { width: 1px; height: 39px; background: color-mix(in srgb, var(--ink) 35%, transparent); }
.brand-product {
  font: 500 16px/.98 var(--heading-font);
  letter-spacing: .09em;
}
nav { display: flex; align-items: center; justify-content: flex-end; gap: 19px; flex-wrap: wrap; }
nav a, .link-button {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
nav a:hover, .link-button:hover { color: var(--link-hover); }
nav .nav-cta {
  padding: 9px 14px;
  color: var(--button-text);
  background: var(--button);
  border-radius: 4px;
}
nav .nav-cta:hover { color: var(--button-text); background: var(--button-hover); }
.link-button {
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--ink) 25%, transparent);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font: 600 12px var(--text-font);
  cursor: pointer;
}
.link-button:hover { background: color-mix(in srgb, var(--panel) 32%, transparent); }
.user-chip { color: var(--ink); font-size: 11px; font-weight: 600; }
.inline-form { display: inline; }

.shell { width: min(1160px, 100% - 44px); min-height: calc(100vh - 156px); margin: 0 auto; padding: 30px 0 72px; }
.hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 43px;
  padding: 38px 42px 36px;
  border-top: 4px solid var(--gold);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.hero::after {
  content: "TOOLS";
  position: absolute;
  right: 20px;
  bottom: -41px;
  color: color-mix(in srgb, var(--header) 17%, transparent);
  font: 700 clamp(90px, 15vw, 190px)/1 var(--heading-font);
  letter-spacing: .03em;
  pointer-events: none;
}
.hero h1, .page-heading h1, .detail-main h1, .login-panel h1, .error-state h1 {
  margin: 5px 0 12px;
  font: 500 clamp(35px, 5vw, 52px)/1.08 var(--heading-font);
  letter-spacing: .01em;
}
.hero > p:not(.eyebrow) { max-width: 530px; margin: 0 0 21px; color: var(--muted); font-size: 16px; }
.hero .button, .hero > p, .hero .eyebrow { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 7px; color: var(--link); font-size: 10px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.hero .eyebrow { color: var(--link); }
.button {
  min-height: 40px;
  padding: 9px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  font: 650 12px var(--text-font);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, transform .15s;
}
.button:hover { transform: translateY(-1px); }
.button-primary { color: var(--button-text); background: var(--button); }
.button-primary:hover { color: var(--button-text); background: var(--button-hover); }
.button-secondary { color: var(--link); background: var(--panel); border-color: var(--line); }
.button-secondary:hover { color: var(--link-hover); background: var(--soft); }
.button-accent { color: #203243; background: var(--gold); }
.button-accent:hover { color: #203243; filter: brightness(.96); }
.button-quiet { min-height: 34px; padding: 6px 9px; color: var(--link); background: transparent; }
.button-quiet:hover { background: var(--soft-blue); }

.section-head, .page-heading { margin: 0 0 20px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.section-head h2, .content-section h2 { margin: 0; font: 500 28px/1.2 var(--heading-font); }
.section-head > .muted { margin: 0; font-size: 12px; }
.count {
  min-width: 26px;
  height: 24px;
  margin-left: 5px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  vertical-align: 4px;
  border-radius: 20px;
  background: var(--soft-blue);
  color: var(--link);
  font: 650 12px var(--text-font);
}
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tool-card { overflow: hidden; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 3px 10px rgb(32 50 67 / 5%); transition: transform .16s, box-shadow .16s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-image { height: 186px; display: grid; place-items: center; position: relative; overflow: hidden; background: var(--soft-blue); text-decoration: none; }
.card-image img, .detail-photo img { width: 100%; height: 100%; object-fit: cover; }
.image-placeholder { color: color-mix(in srgb, var(--link) 34%, transparent); font: 600 27px/.95 var(--heading-font); letter-spacing: .08em; text-align: center; transform: rotate(-6deg); }
.availability { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--line); background: var(--panel); color: var(--green); font-size: 10px; font-weight: 700; }
.card-image .availability { position: absolute; bottom: 11px; left: 11px; }
.availability i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.availability-busy { color: var(--warning); }
.availability-inline { margin-left: 8px; background: var(--green-bg); border-color: transparent; }
.card-body { padding: 15px 16px 14px; }
.card-body .eyebrow { margin-bottom: 5px; }
.dot { padding: 0 4px; color: var(--muted); }
.card-body h3 { margin: 0; font: 500 22px/1.2 var(--heading-font); }
.card-body h3 a, .list-card a { color: var(--ink); text-decoration: none; }
.card-body h3 a:hover, .list-card a:hover { color: var(--link); }
.card-description { height: 42px; overflow: hidden; margin: 8px 0 13px; color: var(--muted); font-size: 12px; }
.card-meta { padding-top: 10px; display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.card-meta span:last-child { color: var(--muted); }
.empty-state { padding: 44px 22px; border: 1px dashed var(--line); background: var(--panel); text-align: center; }
.empty-state h3 { margin: 9px 0 4px; font: 500 24px var(--heading-font); }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.empty-icon { width: 40px; height: 40px; margin: auto; display: grid; place-items: center; background: var(--green-bg); color: var(--green); border-radius: 50%; font-weight: 700; }
.breadcrumb { margin: 0 0 22px; color: var(--muted); font-size: 12px; }
.breadcrumb a { color: var(--link); text-decoration: none; }
.detail-layout { display: grid; grid-template-columns: .92fr 1.08fr; align-items: start; gap: 38px; }
.detail-photo { height: 370px; display: grid; place-items: center; overflow: hidden; background: var(--soft-blue); border: 1px solid var(--line); }
.image-placeholder.large { font-size: 39px; }
.detail-main h1 { margin: 4px 0 9px; font-size: 43px; }
.lead { margin: 0 0 18px; color: var(--muted); }
.status { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 3px; background: var(--green-bg); color: var(--green); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.status-out_of_service, .status-lost { background: var(--red-bg); color: var(--red); }
.status-retired { background: var(--soft); color: var(--muted); }
.status-reserved { background: var(--warning-bg); color: var(--warning); }
.spec-list { margin: 22px 0 25px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; border-top: 1px solid var(--line); }
.spec-list div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.spec-list dt { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.spec-list dd { margin: 3px 0 0; font-size: 12px; font-weight: 600; }
.spec-wide { grid-column: 1 / -1; }
.preserve-lines { white-space: pre-line; }
.action-card { padding: 19px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--gold); box-shadow: var(--shadow); }
.action-card > form:not(.reservation-form) label { display: block; margin-bottom: 6px; }
.action-card > form:not(.reservation-form) input { display: block; margin-bottom: 12px; }
.action-card h2 { margin: 0 0 3px; font: 500 23px var(--heading-font); }
.action-card p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.action-card a:not(.button) { color: var(--link); }
.reservation-form { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.inline-actions, .form-actions { display: flex; align-items: center; gap: 9px; }
.select, .input, .textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); font: 13px var(--text-font); }
.field { margin: 12px 0; }
.field label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; }
.field input[readonly] { color: var(--muted); }
.inline-actions .select { max-width: 150px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label, .edit-form label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 650; }
.form-grid.compact { margin-top: 14px; grid-template-columns: 1fr 1fr; }
.form-grid.compact button { grid-column: 1 / -1; justify-self: start; }
.field-wide { grid-column: 1 / -1; }
.page-heading { align-items: center; margin: 3px 0 32px; }
.page-heading h1 { margin: 4px 0 0; font-size: 39px; }
.page-heading p:not(.eyebrow) { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.content-section { margin: 38px 0; }
.content-section .section-head { align-items: center; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 11px; text-align: left; }
th { background: var(--soft); color: var(--muted); font-size: 9px; letter-spacing: .09em; text-transform: uppercase; }
th, td { padding: 12px 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
td .button { min-height: 32px; font-size: 10px; }
.stack-list { display: grid; gap: 9px; }
.list-card { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--panel); border: 1px solid var(--line); }
.list-card h3 { margin: 2px 0; font: 500 21px var(--heading-font); }
.list-card p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 11px; }
.list-actions { display: flex; align-items: center; gap: 8px; }
.list-actions form { margin: 0; }
.compact-empty { padding: 25px; }
.compact-empty h3 { font-size: 19px; }
.edit-form, .login-panel { padding: 24px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--gold); box-shadow: var(--shadow); }
.form-actions { margin-top: 20px; }
.required { color: var(--red); font-size: 9px; }
.edit-form small { color: var(--muted); font-weight: 400; }
.login-panel { max-width: 570px; margin: 38px auto; }
.login-panel h1 { font-size: 33px; }
.login-panel > p:not(.eyebrow) { color: var(--muted); font-size: 12px; }
.role-list { margin-top: 21px; display: grid; gap: 8px; }
.role-option { padding: 12px; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--panel); border: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.role-option:hover { border-color: var(--link); background: var(--soft); }
.role-option > span:nth-child(2) { flex: 1; }
.role-option b, .role-option small { display: block; }
.role-option small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.role-icon { width: 34px; height: 34px; display: grid; place-items: center; background: var(--soft-blue); color: var(--link); font-size: 17px; }
.flash-stack { margin: 0 0 18px; display: grid; gap: 7px; }
.flash { padding: 10px 13px; border-left: 4px solid var(--green); background: var(--green-bg); color: var(--green); font-size: 12px; }
.flash-warning { border-color: var(--warning); background: var(--warning-bg); color: var(--warning); }
.flash-error { border-color: var(--red); background: var(--red-bg); color: var(--red); }
.error-state { max-width: 640px; margin: 55px auto; }
.error-state .button { margin-top: 18px; }
.footer { padding: 17px max(4vw, 22px); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 10px; }
.theme-control { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.theme-choices { display: flex; gap: 2px; }
.theme-choice { min-height: 30px; padding: 4px 8px; border: 1px solid transparent; border-radius: 3px; background: transparent; color: var(--muted); font: 600 11px var(--text-font); cursor: pointer; }
.theme-choice:hover { color: var(--ink); background: var(--soft); }
.theme-choice[aria-pressed="true"] { border-color: var(--line); background: var(--soft-blue); color: var(--ink); }
.muted { color: var(--muted); }
.search-form { margin: 20px 0; display: flex; align-items: end; gap: 10px; }
.search-form label { font-weight: 600; }
.search-form .input { max-width: 320px; }
@media (max-width: 640px) { .search-form { align-items: stretch; flex-direction: column; } }
.catalog-search { margin: 0 0 24px; padding: 15px; display: grid; grid-template-columns: minmax(220px, 2fr) minmax(155px, 1fr) minmax(165px, 1fr) auto; align-items: end; gap: 12px; background: var(--panel); border: 1px solid var(--line); }
.catalog-search-field { min-width: 0; }
.catalog-search-field label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 650; }
.catalog-search-field .input, .catalog-search-field .select { min-height: 44px; }
.catalog-search-actions { display: flex; align-items: center; gap: 12px; }
.catalog-search-actions .button { min-height: 44px; }
.catalog-clear { color: var(--link); font-size: 12px; white-space: nowrap; }
.catalog-results-head { margin-top: 0; }
.catalog-results-head .muted { text-align: right; }
.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; }

@media (max-width: 850px) {
  .topbar { align-items: flex-start; padding: 11px 20px; gap: 16px; }
  .brand { min-width: 195px; gap: 9px; }
  .brand-logo { width: 125px; max-height: 40px; }
  nav { gap: 10px; }
  nav a { font-size: 11px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: 1fr; gap: 23px; }
  .detail-photo { height: 310px; }
  .catalog-search { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-search-field:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .topbar { position: static; flex-direction: column; }
  .brand { min-width: 0; }
  nav { justify-content: flex-start; gap: 8px 14px; }
  .user-chip { display: none; }
  .shell { width: min(100% - 30px, 1160px); padding: 20px 0 48px; }
  .hero { margin-bottom: 32px; padding: 28px 23px; }
  .hero h1 { font-size: 39px; }
  .hero::after { right: -2px; font-size: 92px; }
  .tool-grid { grid-template-columns: 1fr; }
  .card-image { height: 205px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .catalog-search { grid-template-columns: 1fr; }
  .catalog-search-field:first-child { grid-column: auto; }
  .catalog-search-actions { align-items: stretch; flex-direction: column; }
  .catalog-search-actions .button { width: 100%; }
  .catalog-results-head .muted { text-align: left; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading h1 { font-size: 34px; }
  .detail-main h1 { font-size: 37px; }
  .detail-photo { height: 260px; }
  .form-grid, .form-grid.compact, .spec-list { grid-template-columns: 1fr; }
  .field-wide, .spec-wide { grid-column: auto; }
  .inline-actions { align-items: stretch; flex-direction: column; }
  .inline-actions .select { max-width: none; }
  .list-card { align-items: flex-start; flex-direction: column; }
  .list-actions { flex-wrap: wrap; }
  .footer { padding: 16px; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
.availability-card { margin: 22px 0; padding: 17px; background: var(--panel); border: 1px solid var(--line); }
.availability-card h2 { margin: 0 0 4px; font: 500 23px var(--heading-font); }
.availability-card > p { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.schedule-list { display: grid; gap: 8px; }
.schedule-entry { display: grid; grid-template-columns: minmax(130px, .8fr) minmax(0, 1.2fr); gap: 12px; padding: 10px; background: var(--soft); border-left: 3px solid var(--gold); }
.schedule-entry .eyebrow { margin-bottom: 2px; }
.schedule-entry p { margin: 2px 0; font-size: 12px; }
@media (max-width: 600px) { .schedule-entry { grid-template-columns: 1fr; gap: 4px; } }
.retirement-warning { margin-bottom: 20px; padding: 16px; border: 1px solid var(--warning); background: var(--warning-bg); color: var(--warning); }
.retirement-warning h2 { margin: 0 0 5px; font: 500 23px var(--heading-font); }
.retirement-warning p { margin: 0 0 8px; }
.retirement-warning ul { margin: 0; padding-left: 20px; }
