:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --line: #d9ddd2;
  --text: #1f2a24;
  --muted: #667268;
  --primary: #155e4b;
  --primary-hover: #104b3c;
  --primary-pressed: #0c382e;
  --on-primary: #ffffff;
  --secondary: #eef1ec;
  --secondary-container: #dce8de;
  --secondary-container-hover: #d0ddcf;
  --secondary-container-pressed: #c3d0c3;
  --on-secondary-container: #24352b;
  --outline: #73796f;
  --danger-bg: #fff0ec;
  --danger-bg-hover: #ffdfd6;
  --danger-bg-pressed: #f4c8bb;
  --danger-text: #9f2f16;
  --error: #ba1a1a;
  --error-hover: #8c1d18;
  --error-pressed: #601410;
  --on-error: #ffffff;
  --button-state-layer: rgba(31, 42, 36, 0.08);
  --button-shadow: 0 1px 2px rgba(31, 42, 36, 0.18);
  --button-shadow-hover: 0 2px 5px rgba(31, 42, 36, 0.2);
  --active-bg: #dff3e8;
  --active-text: #14563b;
  --inactive-bg: #edf0f2;
  --inactive-text: #59646b;
  --deleted-surface: #f1f2ef;
  --deleted-line: #d5d8d0;
  --deleted-text: #6e756f;
  --deleted-muted: #8a918b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  align-items: center;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(31, 42, 36, 0.12);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  min-height: 52px;
  padding: 6px 24px;
  position: sticky;
  top: 0;
  transition: box-shadow 0.24s ease, gap 0.24s ease, min-height 0.24s ease, padding 0.24s ease;
  z-index: 30;
}

.brand {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
}

.brand-title {
  align-items: baseline;
  display: inline-flex;
  gap: 4px;
}

.brand-name {
  line-height: 1;
}

.brand-separator {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.brand-logo {
  display: block;
  height: 18px;
  width: auto;
}

.brand-version {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-left: auto;
  min-width: 0;
}

.nav-link {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  gap: 0;
  font-weight: 600;
  justify-content: center;
  min-height: 38px;
  padding: 8px;
  transition: background 0.18s ease, color 0.18s ease, gap 0.24s ease, padding 0.24s ease, width 0.24s ease;
  width: 38px;
}

.logout-form {
  display: inline-flex;
  margin: 0;
}

.logout-form .nav-link {
  font: inherit;
}

.nav-link:hover {
  background: var(--secondary);
  color: var(--text);
}

.nav-link.active {
  background: var(--active-bg);
  color: var(--active-text);
}

.nav-label {
  display: inline-block;
  max-width: 0;
  min-width: 0;
  opacity: 0;
  overflow: hidden;
  transform: scaleX(0.75);
  transform-origin: left center;
  transition: max-width 0.24s ease, opacity 0.18s ease, transform 0.24s ease;
  white-space: nowrap;
}

.page {
  margin: 0 auto;
  max-width: 1120px;
  padding: 28px 24px calc(104px + env(safe-area-inset-bottom));
}

.login-panel {
  display: grid;
  gap: 18px;
  margin: 8vh auto 0;
  max-width: 420px;
}

.login-form {
  gap: 16px;
}

.breadcrumbs {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 14px;
}

.breadcrumbs ol {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.breadcrumbs li + li::before {
  color: var(--muted);
  content: ">";
}

.breadcrumbs a {
  border-radius: 4px;
  color: var(--muted);
  padding: 2px 0;
}

.breadcrumbs a:hover {
  color: var(--text);
}

.breadcrumbs [aria-current="page"] {
  color: var(--text);
}

.page-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.page-header.compact {
  margin-top: 26px;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0;
}

h2 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0;
}

.muted {
  color: var(--muted);
  margin: 4px 0 0;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  letter-spacing: 0;
  min-height: 40px;
  min-width: 64px;
  padding: 0 24px;
  position: relative;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease, transform 0.12s ease;
  white-space: nowrap;
}

.button.primary {
  background: var(--primary);
  color: var(--on-primary);
}

.button.primary:hover {
  background: var(--primary-hover);
}

.button.primary:active {
  background: var(--primary-pressed);
  transform: translateY(1px);
}

.button.secondary {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.button.secondary:hover {
  background: var(--secondary-container-hover);
}

.button.secondary:active {
  background: var(--secondary-container-pressed);
  transform: translateY(1px);
}

.button.danger {
  background: var(--error);
  color: var(--on-error);
}

.button.danger:hover {
  background: var(--error-hover);
}

.button.danger:active {
  background: var(--error-pressed);
  transform: translateY(1px);
}

.button:disabled,
.button[aria-disabled="true"] {
  background: rgba(31, 42, 36, 0.12);
  box-shadow: none;
  color: rgba(31, 42, 36, 0.38);
  cursor: default;
  pointer-events: none;
}

.button:focus-visible {
  outline: 3px solid rgba(21, 94, 75, 0.24);
  outline-offset: 2px;
}

.button .material-icon {
  height: 18px;
  width: 18px;
}

.scroll-top-button {
  align-items: center;
  background: var(--secondary-container);
  border: 0;
  border-radius: 999px;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 14px));
  box-shadow: none;
  color: var(--on-secondary-container);
  cursor: pointer;
  display: inline-flex;
  height: 48px;
  justify-content: center;
  left: 50%;
  opacity: 0;
  padding: 0;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 8px);
  transition: background 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, transform 0.18s ease;
  width: 48px;
  z-index: 40;
}

.scroll-top-button:hover {
  background: var(--secondary-container-hover);
}

.scroll-top-button:focus-visible {
  outline: 3px solid rgba(21, 94, 75, 0.26);
  outline-offset: 3px;
}

.scroll-top-button.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.scroll-top-button .material-icon {
  height: 26px;
  width: 26px;
}

.global-fab {
  align-items: center;
  background: var(--primary);
  border: 0;
  border-radius: 999px;
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 18px));
  box-shadow: var(--button-shadow-hover);
  color: var(--on-primary);
  cursor: pointer;
  display: inline-flex;
  height: 56px;
  justify-content: center;
  position: fixed;
  right: max(22px, calc(env(safe-area-inset-right) + 18px));
  transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  width: 56px;
  z-index: 45;
}

.fab-menu {
  bottom: max(22px, calc(env(safe-area-inset-bottom) + 18px));
  position: fixed;
  right: max(22px, calc(env(safe-area-inset-right) + 18px));
  z-index: 45;
}

.fab-menu .global-fab {
  bottom: auto;
  position: static;
  right: auto;
}

.fab-menu.is-open .global-fab {
  transform: rotate(45deg);
}

.fab-menu-items {
  bottom: 68px;
  display: none;
  gap: 10px;
  min-width: 236px;
  position: absolute;
  right: 0;
}

.fab-menu.is-open .fab-menu-items,
.fab-menu:not(.is-js):focus-within .fab-menu-items {
  display: grid;
}

.fab-menu-item {
  align-items: center;
  background: var(--secondary-container);
  border: 1px solid rgba(31, 42, 36, 0.08);
  border-radius: 16px;
  box-shadow: var(--button-shadow-hover);
  color: var(--on-secondary-container);
  display: flex;
  font-weight: 800;
  gap: 14px;
  justify-content: space-between;
  min-height: 48px;
  padding: 8px 8px 8px 18px;
}

.fab-menu-item:hover {
  background: var(--secondary-container-hover);
}

.fab-menu-item:focus-visible {
  outline: 3px solid rgba(21, 94, 75, 0.26);
  outline-offset: 3px;
}

.fab-menu-item-icon {
  align-items: center;
  background: var(--primary);
  border-radius: 999px;
  color: var(--on-primary);
  display: inline-flex;
  flex: 0 0 auto;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.fab-menu-item-icon .material-icon {
  height: 22px;
  width: 22px;
}

.global-fab:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(31, 42, 36, 0.24);
  transform: translateY(-1px);
}

.fab-menu.is-open .global-fab:hover {
  transform: rotate(45deg);
}

.global-fab:focus-visible {
  outline: 3px solid rgba(21, 94, 75, 0.26);
  outline-offset: 3px;
}

.global-fab .material-icon {
  height: 28px;
  width: 28px;
}

.material-icon {
  display: inline-block;
  fill: currentColor;
  flex: 0 0 auto;
  height: 20px;
  width: 20px;
}

.nav-link .material-icon {
  height: 19px;
  width: 19px;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.asset-filter-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  margin-top: 10px;
}

.segmented-button-set {
  border: 1px solid var(--outline);
  border-radius: 999px;
  overflow: hidden;
}

.segmented-button {
  background: var(--surface);
  border: 0;
  border-radius: 0;
  color: var(--text);
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
}

.segmented-button + .segmented-button {
  border-left: 1px solid var(--outline);
}

.segmented-button:hover {
  background: var(--secondary);
}

.segmented-button.active {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.segmented-button.active:hover {
  background: var(--secondary-container-hover);
}

.segmented-check {
  align-items: center;
  color: var(--primary);
  display: inline-flex;
  flex: 0 0 auto;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.segmented-check .material-icon {
  height: 18px;
  width: 18px;
}

.segmented-count {
  align-items: center;
  background: rgba(31, 42, 36, 0.08);
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 20px;
  justify-content: center;
  min-width: 22px;
  padding: 0 6px;
}

.segmented-button.active .segmented-count {
  background: rgba(21, 94, 75, 0.14);
  color: var(--primary);
}

.table-shell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 720px;
  width: 100%;
}

.asset-table {
  min-width: 0;
}

.asset-table .actions {
  background: var(--surface);
  position: sticky;
  right: 0;
  z-index: 1;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 13px 16px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.strong {
  font-weight: 700;
}

.actions {
  text-align: right;
  white-space: nowrap;
  width: 220px;
}

.asset-table .actions {
  width: 64px;
}

.actions .button + .button {
  margin-left: 6px;
}

.button.icon-button {
  border-radius: 999px;
  height: 48px;
  min-height: 48px;
  min-width: 48px;
  padding: 0;
  width: 48px;
}

.button.icon-button .material-icon {
  height: 24px;
  width: 24px;
}

.object-with-status {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.object-link {
  border-radius: 4px;
}

.object-link:hover {
  color: var(--primary);
}

.clickable-card {
  cursor: pointer;
  padding-right: 52px;
  position: relative;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.card-cover-link {
  border-radius: inherit;
  inset: 0;
  position: absolute;
  z-index: 3;
}

.clickable-card .button,
.clickable-card button,
.clickable-card input,
.clickable-card select,
.clickable-card textarea,
.clickable-card [data-card-interactive] {
  position: relative;
  z-index: 4;
}

.card-chevron {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  height: 24px;
  justify-content: center;
  opacity: 0.82;
  pointer-events: none;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  z-index: 4;
}

.card-chevron .material-icon {
  height: 24px;
  width: 24px;
}

.history-deviation-indicator {
  align-items: center;
  background: #fff1d6;
  border: 1px solid #f0cf91;
  border-radius: 999px;
  color: #9a5b00;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  pointer-events: none;
  position: absolute;
  right: 46px;
  top: 14px;
  width: 30px;
  z-index: 4;
}

.history-deviation-indicator .material-icon {
  height: 19px;
  width: 19px;
}

.clickable-card:hover {
  border-color: #b9c0b6;
  box-shadow: 0 2px 7px rgba(31, 42, 36, 0.12);
}

.clickable-card:hover .card-chevron {
  color: var(--text);
  opacity: 1;
}

.clickable-card:active {
  transform: translateY(1px);
}

.card-cover-link:focus-visible {
  outline: 3px solid rgba(21, 94, 75, 0.24);
  outline-offset: 3px;
}

.asset-list-cell {
  display: grid;
  gap: 2px;
}

.asset-detail-title-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}

.asset-detail-title-row .object-with-status {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-detail-title-row .object-with-status .status-indicator {
  flex: 0 0 auto;
}

.asset-detail-title-row .object-with-status span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-detail-edit-button {
  width: auto;
}

.asset-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 26px;
}

.maintenance-meta-rows {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.maintenance-chip-row {
  padding-left: 0;
}

.maintenance-separated-row {
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 10px;
}

.asset-latest-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  overflow: hidden;
  padding: 14px;
  position: relative;
}

.asset-latest-card.clickable-card {
  padding-right: 52px;
}

.asset-latest-card-content {
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.asset-latest-card h2 {
  font-size: 18px;
}

.asset-maintenance-type-row {
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 10px;
}

.asset-latest-card.is-deleted {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

.asset-latest-card.is-deleted .muted {
  color: var(--deleted-muted);
}

.asset-latest-card.is-deleted .asset-maintenance-type-row {
  border-top-color: var(--deleted-line);
}

.asset-latest-card.is-deleted .asset-chip {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

.asset-chip {
  border-radius: 999px;
  border: 1px solid transparent;
  gap: 5px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  padding: 4px 8px;
}

.chip-muted {
  font-weight: 800;
  opacity: 0.62;
}

.asset-chip.tone-0 {
  background: #e5f3ff;
  border-color: #b9dcf4;
  color: #1d4f73;
}

.asset-chip.tone-1 {
  background: #eef7e8;
  border-color: #c8e2ba;
  color: #315f28;
}

.asset-chip.tone-2 {
  background: #fff1d6;
  border-color: #f0cf91;
  color: #754d12;
}

.asset-chip.tone-3 {
  background: #f3eaff;
  border-color: #d8c1f4;
  color: #593985;
}

.asset-chip.tone-4 {
  background: #e6f6f4;
  border-color: #b6ddd7;
  color: #1d5d57;
}

.asset-chip.tone-5 {
  background: #ffe8ea;
  border-color: #f3bbc1;
  color: #7b2631;
}

.asset-chip.tone-6 {
  background: #edf0f7;
  border-color: #c8cedd;
  color: #39445f;
}

.asset-chip.tone-7 {
  background: #f5efd9;
  border-color: #ddd09c;
  color: #5f5322;
}

.status-indicator {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 18px;
  height: 18px;
  justify-content: center;
  line-height: 1;
  width: 18px;
}

.status-indicator.active {
  color: #16a34a;
}

.status-indicator.inactive {
  color: #9ca3af;
}

.empty {
  color: var(--muted);
  padding: 28px 16px;
  text-align: center;
}

.empty.compact {
  padding: 16px 0 0;
  text-align: left;
}

.list-section {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.list-section:first-of-type {
  margin-top: 0;
}

.list-section > h2 {
  color: var(--muted);
  font-size: 16px;
  text-transform: uppercase;
}

.alert {
  background: var(--danger-bg);
  border: 1px solid #f3b8a9;
  border-radius: 8px;
  color: var(--danger-text);
  font-weight: 700;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.form-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  max-width: 620px;
  padding: 20px;
}

.form-panel.wide {
  max-width: 900px;
}

.maintenance-form-card {
  display: grid;
  gap: 16px;
  max-width: 900px;
}

.head-data-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  overflow: visible;
  padding: 14px;
  position: relative;
}

.maintenance-form-card .head-data-card {
  margin-bottom: 0;
}

.head-data-card > *:not(.deleted-card-watermark):not(.history-card-watermark) {
  position: relative;
  z-index: 1;
}

.head-data-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.head-data-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.head-data-field {
  min-width: 0;
}

.head-data-field-wide {
  grid-column: 1 / -1;
}

.head-data-note {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 12px;
}

.head-data-note h2 {
  font-size: 18px;
  margin: 0 0 8px;
}

.head-data-note p {
  margin: 0;
}

.head-data-card.is-muted {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

.head-data-card.is-muted .muted {
  color: var(--deleted-muted);
}

.head-data-card.is-muted .asset-chip {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

.head-data-card.is-muted .head-data-note {
  border-top-color: var(--deleted-line);
}

.filter-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
  min-inline-size: 0;
  padding: 18px;
}

.filter-panel > * {
  max-inline-size: 100%;
  min-inline-size: 0;
}

.filter-wide {
  grid-column: 1 / -1;
}

.filter-actions {
  align-items: end;
  display: flex;
  gap: 10px;
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  min-inline-size: 0;
  min-width: 0;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  max-width: 100%;
  min-inline-size: 0;
  min-height: 42px;
  min-width: 0;
  padding: 8px 10px;
  width: 100%;
}

input[type="date"],
input[type="datetime-local"] {
  appearance: none;
  box-sizing: border-box;
  display: block;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  overflow: hidden;
  -webkit-appearance: none;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value {
  max-inline-size: 100%;
  min-inline-size: 0;
  text-align: left;
}

input[type="date"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit {
  max-inline-size: 100%;
  min-inline-size: 0;
  overflow: hidden;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  border-radius: 999px;
  cursor: pointer;
  height: 24px;
  opacity: 0.68;
  padding: 4px;
  width: 24px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  background: var(--secondary);
  opacity: 1;
}

.unit-input {
  display: grid;
  min-width: 0;
  position: relative;
}

.unit-input .numeric-input {
  padding-right: 42px;
  text-align: right;
}

.input-unit {
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  pointer-events: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

textarea {
  resize: vertical;
}

.combobox-field {
  position: relative;
}

.combobox-field:focus-within {
  z-index: 30;
}

.resettable-field-shell {
  min-width: 0;
}

.resettable-input-shell {
  display: grid;
  min-width: 0;
  position: relative;
}

.resettable-input-shell input {
  padding-right: 44px;
}

.filter-field-shell {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 24px minmax(0, 1fr);
  min-width: 0;
}

.filter-field-icon {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.filter-field-icon .material-icon {
  height: 20px;
  width: 20px;
}

.filter-field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.combobox-input-shell {
  position: relative;
}

.combobox-input-shell .combobox-input {
  padding-right: 44px;
}

.combobox-clear {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  height: 32px;
  justify-content: center;
  position: absolute;
  right: 6px;
  top: 5px;
  width: 32px;
}

.combobox-clear .material-icon {
  height: 19px;
  width: 19px;
}

.combobox-clear:hover {
  background: var(--secondary);
  color: var(--text);
}

.combobox-clear[hidden] {
  display: none;
}

.combobox-results {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(31, 42, 36, 0.14);
  display: grid;
  left: 0;
  max-height: 280px;
  overflow-y: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 10;
}

.combobox-results[hidden] {
  display: none;
}

.combobox-option {
  background: transparent;
  border: 0;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  padding: 10px 12px;
  text-align: left;
}

.combobox-option:hover,
.combobox-option.active {
  background: var(--secondary);
}

.combobox-empty {
  color: var(--muted);
  padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(21, 94, 75, 0.18);
}

.checkbox-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.checkbox-row input {
  height: 18px;
  min-height: 18px;
  width: 18px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  position: relative;
  z-index: 1;
}

.position-list {
  display: grid;
  gap: 10px;
  position: relative;
}

.position-row.maintenance-position-item {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  overflow: visible;
  position: relative;
}

.position-row.maintenance-position-item:focus-within {
  z-index: 30;
}

.position-row .maintenance-position-number {
  border-radius: 7px 0 0 7px;
}

.position-row .maintenance-position-main {
  padding: 12px 0;
}

.position-row .combobox-input,
.position-row .position-deviation input {
  background: #fafbf8;
}

.position-form-fields {
  gap: 10px;
  min-width: 0;
}

.position-deviation {
  min-width: 0;
}

.position-deviation-input-shell {
  display: grid;
  min-width: 0;
  position: relative;
}

.position-deviation-input-shell input {
  padding-right: 84px;
}

.position-deviation-indicator {
  pointer-events: none;
  position: absolute;
  right: 42px;
  top: 6px;
}

.position-deviation-indicator[hidden] {
  display: none;
}

.position-deviation-clear {
  right: 6px;
}

.position-remove-button {
  align-self: center;
  margin-right: 14px;
}

.position-remove-button[hidden] {
  display: none;
}

.position-add-actions {
  display: flex;
  justify-content: flex-end;
  position: relative;
  z-index: 1;
}

.position-add-actions {
  margin-top: -2px;
}

.maintenance-detail-card {
  position: relative;
}

.maintenance-detail-card > *:not(.deleted-card-watermark):not(.history-card-watermark),
.result-item:not(.clickable-card) > *:not(.deleted-card-watermark) {
  position: relative;
  z-index: 1;
}

.maintenance-form-card > .head-data-card:focus-within,
.maintenance-form-card > .position-list:focus-within {
  z-index: 50;
}

.deleted-card-watermark {
  color: var(--deleted-text);
  opacity: 0.16;
  pointer-events: none;
  position: absolute;
  right: clamp(8px, 4vw, 38px);
  top: clamp(12px, 3vw, 28px);
  z-index: 0;
}

.deleted-card-watermark .material-icon {
  height: clamp(120px, 24vw, 260px);
  width: clamp(120px, 24vw, 260px);
}

.maintenance-detail-card .history-card-watermark {
  opacity: 0.16;
  right: clamp(8px, 4vw, 38px);
  top: clamp(12px, 3vw, 28px);
  transform: none;
}

.maintenance-detail-card .history-card-watermark .material-icon {
  height: clamp(120px, 24vw, 260px);
  width: clamp(120px, 24vw, 260px);
}

.deleted-status-label {
  color: var(--deleted-text);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 2px;
  text-transform: uppercase;
}

.maintenance-position-list {
  display: grid;
  gap: 10px;
}

.maintenance-position-item {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 48px minmax(0, 1fr);
  min-height: 68px;
  overflow: hidden;
}

.maintenance-position-item.has-deviation {
  grid-template-columns: 48px minmax(0, 1fr) minmax(180px, auto);
}

.maintenance-position-number {
  align-items: center;
  align-self: stretch;
  background: #e5f3ff;
  border-right: 1px solid #b9dcf4;
  color: #1d4f73;
  display: flex;
  font-size: 22px;
  font-weight: 800;
  justify-content: center;
}

.maintenance-position-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 12px 0;
}

.maintenance-position-main strong,
.maintenance-position-main span {
  overflow-wrap: anywhere;
}

.maintenance-position-main span {
  color: var(--muted);
  font-weight: 600;
}

.maintenance-position-deviation {
  align-items: center;
  color: #754d12;
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  justify-self: end;
  min-width: 0;
  padding: 12px 14px 12px 0;
  text-align: right;
}

.maintenance-position-deviation span:last-child {
  overflow-wrap: anywhere;
}

.maintenance-position-deviation-icon {
  align-items: center;
  background: #fff1d6;
  border: 1px solid #f0cf91;
  border-radius: 999px;
  color: #9a5b00;
  display: inline-flex;
  flex: 0 0 auto;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.maintenance-position-deviation-icon .material-icon {
  height: 19px;
  width: 19px;
}

.maintenance-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.maintenance-detail-card.is-deleted,
.maintenance-detail-card.is-muted {
  color: var(--deleted-text);
  overflow: hidden;
}

.maintenance-detail-card.is-deleted .head-data-card,
.maintenance-detail-card.is-muted .head-data-card {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
}

.maintenance-detail-card.is-deleted .muted,
.maintenance-detail-card.is-muted .muted,
.maintenance-detail-card.is-deleted .maintenance-position-main span,
.maintenance-detail-card.is-muted .maintenance-position-main span,
.result-item.is-deleted .muted,
.result-item.is-deleted .result-meta {
  color: var(--deleted-muted);
}

.maintenance-detail-card.is-deleted .asset-chip,
.maintenance-detail-card.is-muted .asset-chip,
.maintenance-detail-card.is-deleted .maintenance-position-deviation-icon,
.maintenance-detail-card.is-muted .maintenance-position-deviation-icon {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

.maintenance-detail-card.is-deleted .note-panel,
.maintenance-detail-card.is-muted .note-panel,
.maintenance-detail-card.is-deleted .head-data-note,
.maintenance-detail-card.is-muted .head-data-note,
.maintenance-detail-card.is-deleted .maintenance-position-item,
.maintenance-detail-card.is-muted .maintenance-position-item {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
}

.maintenance-detail-card.is-deleted .maintenance-separated-row,
.maintenance-detail-card.is-muted .maintenance-separated-row {
  border-top-color: var(--deleted-line);
}

.maintenance-detail-card.is-deleted .maintenance-position-number,
.maintenance-detail-card.is-muted .maintenance-position-number {
  background: var(--deleted-line);
  border-color: #c7cbc3;
  color: var(--deleted-text);
}

.maintenance-detail-card.is-deleted .maintenance-position-deviation,
.maintenance-detail-card.is-muted .maintenance-position-deviation {
  color: var(--deleted-text);
}

.result-item.is-deleted {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
  overflow: hidden;
  position: relative;
}

.result-item.is-deleted .history-deviation-indicator,
.asset-latest-card.is-deleted .history-deviation-indicator {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

.result-item.is-deleted .asset-chip {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

.result-item.is-deleted .deleted-card-watermark {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.result-item.is-deleted .deleted-card-watermark .material-icon {
  height: 110px;
  width: 110px;
}

.note-panel.is-deleted {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

tr.is-deleted {
  background: var(--deleted-surface);
  color: var(--deleted-text);
}

tr.is-deleted td {
  border-bottom-color: var(--deleted-line);
}

tr.is-deleted .button.secondary {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

.button.add-position-button {
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}

.button.add-position-button:hover {
  background: var(--secondary-container-hover);
}

.detail-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.detail-item,
.note-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.detail-item span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.detail-item strong {
  overflow-wrap: anywhere;
}

.note-panel {
  margin-bottom: 18px;
}

.note-panel h2 {
  font-size: 18px;
  margin: 0 0 8px;
}

.note-panel p {
  margin: 0;
}

.confirm-text {
  margin: 0;
}

.master-list {
  display: grid;
  gap: 14px;
}

.master-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.master-group-header,
.type-row {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.master-group-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  flex: 1 1 auto;
  font: inherit;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 48px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.master-group-toggle:focus-visible {
  border-radius: 8px;
  outline: 3px solid rgba(21, 94, 75, 0.24);
  outline-offset: 4px;
}

.master-category-link {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.master-category-title {
  align-items: center;
  display: inline-flex;
  min-width: 0;
}

.master-category-summary {
  align-items: center;
  background: rgba(31, 42, 36, 0.08);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  min-width: 42px;
  padding: 0 8px;
}

.master-category-chevron {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 auto;
  height: 24px;
  justify-content: center;
  transform: rotate(180deg);
  transition: color 0.16s ease, transform 0.16s ease;
  width: 24px;
}

.master-group-toggle[aria-expanded="true"] .master-category-chevron {
  color: var(--text);
  transform: rotate(0);
}

.master-category-chevron .material-icon {
  height: 24px;
  width: 24px;
}

.master-category-actions {
  display: inline-flex;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.master-group-panel[hidden] {
  display: none;
}

.master-add-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.maintenance-type-page-actions {
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
}

.type-list {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
}

.type-row {
  min-height: 42px;
}

.context-menu {
  flex: 0 0 auto;
  position: relative;
}

.context-menu summary {
  list-style: none;
}

.context-menu summary::-webkit-details-marker {
  display: none;
}

.context-menu-trigger {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  height: 40px;
  justify-content: center;
  padding: 0;
  width: 40px;
}

.context-menu-trigger:hover,
.context-menu-trigger:focus-visible {
  background: rgba(31, 42, 36, 0.08);
  color: var(--text);
  outline: none;
}

.context-menu-trigger .material-icon {
  height: 24px;
  width: 24px;
}

.context-menu-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(31, 42, 36, 0.16);
  display: grid;
  min-width: 190px;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
}

.context-menu:not([open]) .context-menu-panel {
  display: none;
}

.context-menu-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  font: inherit;
  font-weight: 700;
  gap: 10px;
  min-height: 40px;
  padding: 0 10px;
  text-align: left;
  width: 100%;
}

.context-menu-item:hover,
.context-menu-item:focus-visible {
  background: var(--secondary);
  outline: none;
}

.context-menu-item .material-icon {
  color: var(--muted);
  height: 20px;
  width: 20px;
}

.master-type-cell {
  min-width: 0;
}

.maintenance-type-chip {
  border-radius: 999px;
  border: 1px solid transparent;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  padding: 5px 9px;
}

.maintenance-type-chip.tone-0 {
  background: #e5f3ff;
  border-color: #b9dcf4;
  color: #1d4f73;
}

.maintenance-type-chip.tone-1 {
  background: #eef7e8;
  border-color: #c8e2ba;
  color: #315f28;
}

.maintenance-type-chip.tone-2 {
  background: #fff1d6;
  border-color: #f0cf91;
  color: #754d12;
}

.maintenance-type-chip.tone-3 {
  background: #f3eaff;
  border-color: #d8c1f4;
  color: #593985;
}

.maintenance-type-chip.tone-4 {
  background: #e6f6f4;
  border-color: #b6ddd7;
  color: #1d5d57;
}

.maintenance-type-chip.tone-5 {
  background: #ffe8ea;
  border-color: #f3bbc1;
  color: #7b2631;
}

.maintenance-type-chip.tone-6 {
  background: #edf0f7;
  border-color: #c8cedd;
  color: #39445f;
}

.maintenance-type-chip.tone-7 {
  background: #f5efd9;
  border-color: #ddd09c;
  color: #5f5322;
}

.type-section-title {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding-top: 12px;
  text-transform: uppercase;
}

.result-list {
  display: grid;
  gap: 10px;
}

.result-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px;
}

.result-item.clickable-card {
  padding-right: 86px;
}

.asset-card.is-muted {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

.asset-card.is-muted .asset-chip {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

.asset-card.is-muted .card-chevron {
  color: var(--deleted-muted);
}

.revision-card .maintenance-chip-row {
  margin-top: 8px;
}

.revision-card.is-muted {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

.revision-card.is-muted .asset-chip {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

.revision-card.is-muted .card-chevron {
  color: var(--deleted-muted);
}

.history-card-watermark {
  color: var(--deleted-text);
  opacity: 0.12;
  pointer-events: none;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 0;
}

.history-card-watermark .material-icon {
  height: 110px;
  width: 110px;
}

.revision-card.is-deleted .asset-chip {
  background: var(--deleted-surface);
  border-color: var(--deleted-line);
  color: var(--deleted-text);
}

.result-item h2 {
  font-size: 18px;
  margin: 0;
}

.result-item p {
  margin: 6px 0 0;
}

.result-meta {
  align-items: flex-end;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  font-size: 14px;
  font-weight: 700;
  gap: 4px;
  white-space: nowrap;
}

.load-more {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 640px) {
  .app-header {
    align-items: center;
    flex-direction: row;
    gap: 10px;
    min-height: 50px;
    padding: 6px 14px;
  }

  .page-header {
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .page-header > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
  }

  .nav {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
    margin-left: auto;
    width: auto;
  }

  .nav-link {
    justify-content: center;
    min-width: 0;
    padding: 8px 6px;
  }

  .nav-link .material-icon {
    height: 18px;
    width: 18px;
  }

  .page {
    padding: 22px 14px calc(104px + env(safe-area-inset-bottom));
  }

  .button {
    width: 100%;
  }

  .scroll-top-button {
    height: 48px;
    width: 48px;
  }

  .global-fab {
    height: 56px;
    width: 56px;
  }

  .page-header .button,
  .master-group-header .button {
    width: auto;
  }

  .button.icon-button {
    width: 48px;
  }

  .page-header .header-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .header-actions {
    flex-direction: column;
  }

  .header-actions.maintenance-type-page-actions {
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
  }

  .form-panel {
    padding: 16px;
  }

  .form-grid,
  .head-data-grid,
  .detail-grid,
  .filter-panel {
    grid-template-columns: 1fr;
  }

  .maintenance-position-item,
  .maintenance-position-item.has-deviation {
    align-items: stretch;
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .maintenance-position-item.has-deviation .maintenance-position-number {
    grid-row: 1 / 3;
  }

  .position-row .maintenance-position-number {
    grid-row: 1 / 3;
  }

  .maintenance-position-deviation {
    grid-column: 2;
    justify-self: start;
    padding: 0 12px 12px 0;
    text-align: left;
  }

  .position-remove-button {
    grid-column: 2;
    justify-self: end;
    margin: 0 12px 12px 0;
  }

  .maintenance-detail-actions {
    justify-content: flex-start;
  }

  .result-item {
    flex-direction: column;
  }

  .master-group-header {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .type-row {
    flex-direction: row;
  }

  .result-meta {
    align-items: flex-start;
  }
}
