.app-root,
.app-shell {
  min-height: 100vh;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  background: var(--bg);
  transition: grid-template-columns 180ms ease;
}

.main-area {
  position: relative;
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(rgba(6, 47, 40, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 47, 40, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto;
}

.main-area::before {
  content: "";
  position: fixed;
  inset: 86px 0 0 var(--sidebar);
  z-index: 0;
  pointer-events: none;
  background-image: url("../../assets/logo-mark.svg");
  background-repeat: repeat;
  background-size: 168px 168px;
  background-position: 36px 30px;
  opacity: 0.028;
}

.app-shell--sidebar-collapsed .main-area::before {
  left: var(--sidebar-collapsed);
}

.main-scroll {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  padding: 24px;
  min-width: 0;
  overflow-x: clip;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(6, 47, 40, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 47, 40, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto;
}

.boot-panel {
  width: min(620px, calc(100vw - 48px));
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.98), rgba(255, 253, 248, 0.92));
  box-shadow: var(--shadow), 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.boot-panel__mark {
  position: relative;
  width: 98px;
  height: 98px;
  display: grid;
  place-items: center;
}

.boot-panel__logo {
  position: relative;
  z-index: 1;
  width: 98px;
  height: 98px;
  overflow: visible;
}

.boot-panel__logo-card {
  transform-box: fill-box;
  transform-origin: center;
  stroke: rgba(14, 107, 87, 0.22);
  stroke-width: 1;
}

.boot-panel__logo-axis,
.boot-panel__logo-diagonal {
  transform-box: fill-box;
  transform-origin: center;
  stroke-dasharray: 22;
  stroke-dashoffset: 0;
}

.boot-panel__logo-identity,
.boot-panel__logo-identity-arc,
.boot-panel__logo-login-arrow {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.boot-panel__logo-identity-arc {
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
}

.boot-panel__logo-login-arrow-line {
  stroke-dasharray: 13;
  stroke-dashoffset: 13;
}

.boot-panel.is-loading .boot-panel__logo-card {
  animation: boot-logo-card-assemble 680ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.boot-panel.is-loading .boot-panel__logo-axis--horizontal {
  animation:
    boot-line-assemble 760ms cubic-bezier(0.22, 1, 0.36, 1) 80ms both,
    boot-line-horizontal 3.4s cubic-bezier(0.4, 0, 0.2, 1) 1040ms infinite;
}

.boot-panel.is-loading .boot-panel__logo-axis--vertical {
  animation:
    boot-line-assemble 760ms cubic-bezier(0.22, 1, 0.36, 1) 160ms both,
    boot-line-vertical 3.4s cubic-bezier(0.4, 0, 0.2, 1) 1040ms infinite;
}

.boot-panel.is-loading .boot-panel__logo-diagonal--forward {
  animation:
    boot-line-assemble 760ms cubic-bezier(0.22, 1, 0.36, 1) 260ms both,
    boot-line-forward 3.4s cubic-bezier(0.4, 0, 0.2, 1) 1040ms infinite;
}

.boot-panel.is-loading .boot-panel__logo-diagonal--back {
  animation:
    boot-line-assemble 760ms cubic-bezier(0.22, 1, 0.36, 1) 340ms both,
    boot-line-back 3.4s cubic-bezier(0.4, 0, 0.2, 1) 1040ms infinite;
}

.boot-panel.is-login-redirect .boot-panel__logo-card {
  animation: login-logo-card-redirect 1120ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.boot-panel.is-login-redirect .boot-panel__logo-axis--horizontal {
  animation: login-logo-line-route 1120ms cubic-bezier(0.22, 1, 0.36, 1) 60ms both;
}

.boot-panel.is-login-redirect .boot-panel__logo-axis--vertical {
  animation: login-logo-line-stand 1120ms cubic-bezier(0.22, 1, 0.36, 1) 120ms both;
}

.boot-panel.is-login-redirect .boot-panel__logo-diagonal--forward {
  animation: login-logo-diagonal-clear 1120ms cubic-bezier(0.22, 1, 0.36, 1) 190ms both;
}

.boot-panel.is-login-redirect .boot-panel__logo-diagonal--back {
  animation: login-logo-diagonal-clear 1120ms cubic-bezier(0.22, 1, 0.36, 1) 260ms both;
}

.boot-panel.is-login-redirect .boot-panel__logo-identity {
  animation: login-logo-identity-dot 1120ms cubic-bezier(0.22, 1, 0.36, 1) 360ms both;
}

.boot-panel.is-login-redirect .boot-panel__logo-identity-arc {
  animation: login-logo-identity-arc 1120ms cubic-bezier(0.22, 1, 0.36, 1) 430ms both;
}

.boot-panel.is-login-redirect .boot-panel__logo-login-arrow {
  animation:
    login-logo-enter-arrow 940ms cubic-bezier(0.22, 1, 0.36, 1) 520ms both,
    login-logo-arrow-loop 1320ms cubic-bezier(0.4, 0, 0.2, 1) 1520ms infinite;
}

.boot-panel.is-login-redirect .boot-panel__logo-login-arrow-line {
  animation: login-logo-enter-arrow-line 940ms cubic-bezier(0.22, 1, 0.36, 1) 520ms both;
}

.boot-panel__content {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.boot-panel__content p {
  color: var(--muted);
}

.boot-panel__loading {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  font-family: var(--font-ui);
  font-weight: 700;
}

.boot-panel__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

@keyframes boot-logo-card-assemble {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }

  64% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes boot-line-assemble {
  0% {
    opacity: 0;
    stroke-dashoffset: 22;
    transform: scale(0.82);
  }

  26% {
    opacity: 1;
  }

  100% {
    opacity: 1;
    stroke-dashoffset: 0;
    transform: scale(1);
  }
}

@keyframes boot-line-horizontal {
  0%,
  100% {
    stroke-dashoffset: 0;
    transform: translateX(0);
  }

  22% {
    stroke-dashoffset: 22;
    transform: translateX(0);
  }

  38% {
    stroke-dashoffset: 0;
    transform: translateX(0);
  }

  56% {
    transform: translateX(1.5px);
  }

  76% {
    transform: translateX(0);
  }
}

@keyframes boot-line-vertical {
  0%,
  100% {
    stroke-dashoffset: 0;
    transform: translateY(0);
  }

  28% {
    stroke-dashoffset: 22;
    transform: translateY(0);
  }

  44% {
    stroke-dashoffset: 0;
    transform: translateY(0);
  }

  58% {
    transform: translateY(-1.5px);
  }

  78% {
    transform: translateY(0);
  }
}

@keyframes boot-line-forward {
  0%,
  100% {
    stroke-dashoffset: 0;
    transform: translate(0, 0);
  }

  34% {
    stroke-dashoffset: 22;
    transform: translate(0, 0);
  }

  50% {
    stroke-dashoffset: 0;
    transform: translate(0, 0);
  }

  62% {
    transform: translate(1px, 1px);
  }

  82% {
    transform: translate(0, 0);
  }
}

@keyframes boot-line-back {
  0%,
  100% {
    stroke-dashoffset: 0;
    transform: translate(0, 0);
  }

  40% {
    stroke-dashoffset: 22;
    transform: translate(0, 0);
  }

  56% {
    stroke-dashoffset: 0;
    transform: translate(0, 0);
  }

  66% {
    transform: translate(-1px, 1px);
  }

  84% {
    transform: translate(0, 0);
  }
}

@keyframes login-logo-card-redirect {
  0% {
    opacity: 0;
    transform: scale(0.94);
  }

  34% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes login-logo-line-route {
  0% {
    opacity: 0;
    stroke-dashoffset: 22;
    transform: scaleX(0.72);
  }

  32% {
    opacity: 1;
    stroke-dashoffset: 0;
    transform: scaleX(1);
  }

  58% {
    opacity: 0.52;
    stroke-dashoffset: 0;
    transform: translateX(0);
  }

  100% {
    opacity: 0;
    stroke-dashoffset: -22;
    transform: translateX(7px);
  }
}

@keyframes login-logo-line-stand {
  0% {
    opacity: 0;
    stroke-dashoffset: 22;
    transform: scaleY(0.76);
  }

  32% {
    opacity: 1;
    stroke-dashoffset: 0;
    transform: scaleY(1);
  }

  64% {
    opacity: 0.46;
    transform: translateX(0);
  }

  100% {
    opacity: 0;
    stroke-dashoffset: 22;
    transform: translateX(3px);
  }
}

@keyframes login-logo-diagonal-clear {
  0% {
    opacity: 0;
    stroke-dashoffset: 22;
    transform: scale(0.86);
  }

  28% {
    opacity: 1;
    stroke-dashoffset: 0;
    transform: scale(1);
  }

  66% {
    opacity: 0.24;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    stroke-dashoffset: 22;
    transform: scale(0.94);
  }
}

@keyframes login-logo-identity-dot {
  0%,
  18% {
    opacity: 0;
    transform: translateY(2px) scale(0.78);
  }

  42% {
    opacity: 1;
    transform: translateY(0) scale(1.04);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes login-logo-identity-arc {
  0%,
  16% {
    opacity: 0;
    stroke-dashoffset: 26;
    transform: translateY(1px) scaleX(0.88);
  }

  44% {
    opacity: 1;
    stroke-dashoffset: 0;
    transform: translateY(0) scale(1.03);
  }

  100% {
    opacity: 1;
    stroke-dashoffset: 0;
    transform: translateY(0);
  }
}

@keyframes login-logo-enter-arrow {
  0%,
  18% {
    opacity: 0;
    transform: translateX(-4px);
  }

  48% {
    opacity: 1;
    transform: translateX(0);
  }

  72% {
    opacity: 1;
    transform: translateX(0.8px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes login-logo-enter-arrow-line {
  0%,
  18% {
    stroke-dashoffset: 13;
  }

  48%,
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes login-logo-arrow-loop {
  0%,
  100% {
    opacity: 1;
    transform: translateX(0);
  }

  38% {
    opacity: 1;
    transform: translateX(2.2px);
  }

  58% {
    opacity: 0.82;
    transform: translateX(2.2px);
  }

  80% {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 560px) {
  .boot-screen {
    align-items: start;
    padding: 42px 16px 20px;
  }

  .boot-panel {
    width: min(100%, calc(100vw - 32px));
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .boot-panel__mark {
    width: 70px;
    height: 70px;
  }

  .boot-panel__logo {
    width: 70px;
    height: 70px;
  }

  .boot-panel__content {
    gap: 8px;
  }

  .boot-panel__content h1 {
    font-size: 20px;
    line-height: 1.12;
  }

  .boot-panel__content p,
  .boot-panel__loading {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .boot-panel.is-loading .boot-panel__logo-card,
  .boot-panel.is-loading .boot-panel__logo-axis,
  .boot-panel.is-loading .boot-panel__logo-diagonal,
  .boot-panel.is-login-redirect .boot-panel__logo-card,
  .boot-panel.is-login-redirect .boot-panel__logo-axis,
  .boot-panel.is-login-redirect .boot-panel__logo-diagonal,
  .boot-panel.is-login-redirect .boot-panel__logo-identity,
  .boot-panel.is-login-redirect .boot-panel__logo-identity-arc,
  .boot-panel.is-login-redirect .boot-panel__logo-login-arrow,
  .boot-panel.is-login-redirect .boot-panel__logo-login-arrow-line {
    animation: none !important;
    stroke-dashoffset: 0 !important;
    transform: none !important;
  }

  .boot-panel.is-loading .boot-panel__logo-card,
  .boot-panel.is-loading .boot-panel__logo-axis,
  .boot-panel.is-loading .boot-panel__logo-diagonal,
  .boot-panel.is-login-redirect .boot-panel__logo-card,
  .boot-panel.is-login-redirect .boot-panel__logo-identity,
  .boot-panel.is-login-redirect .boot-panel__logo-identity-arc,
  .boot-panel.is-login-redirect .boot-panel__logo-login-arrow {
    opacity: 1 !important;
  }

  .boot-panel.is-login-redirect .boot-panel__logo-axis,
  .boot-panel.is-login-redirect .boot-panel__logo-diagonal {
    opacity: 0 !important;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 14px 20px;
  align-items: center;
  min-height: 72px;
  padding: 14px 24px;
  background: rgba(255, 253, 248, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar__title p {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-ui);
}

.topbar__title {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.topbar__title-text {
  min-width: 0;
}

.topbar-profile {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  padding: 5px 8px 5px 5px;
  font-family: var(--font-ui);
  font-weight: 700;
  white-space: nowrap;
}

.topbar__tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.session-notice {
  position: relative;
  z-index: 19;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  border-bottom: 1px solid rgba(181, 107, 20, 0.24);
  background: #fff4df;
  color: var(--ink);
  font-family: var(--font-ui);
}

.session-notice div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.session-notice strong {
  font-size: 14px;
}

.session-notice span {
  color: var(--muted);
  font-size: 13px;
}

.system-status {
  position: relative;
  font-family: var(--font-ui);
}

.system-status summary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 248, 0.78);
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}

.system-status summary::-webkit-details-marker {
  display: none;
}

.system-status summary:hover,
.system-status[open] summary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.system-status__track {
  display: inline-grid;
  grid-template-columns: repeat(4, 6px);
  gap: 3px;
}

.system-status__track i {
  width: 6px;
  height: 16px;
  border-radius: 999px;
  background: var(--surface-2);
}

.system-status__track .is-ok {
  background: var(--primary);
}

.system-status__track .is-warn {
  background: var(--warning);
}

.system-status__track .is-muted {
  background: var(--line-strong);
}

.system-status strong {
  font-size: 12px;
  white-space: nowrap;
}

.system-status__label-short,
.topbar__actions .button__label-short {
  display: none;
}

.system-status__panel {
  position: absolute;
  z-index: 35;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.system-status__panel div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: baseline;
}

.system-status__panel small {
  grid-column: 1 / -1;
  margin-top: -5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.system-status__panel span {
  color: var(--muted);
  font-size: 12px;
}

.system-status__panel strong {
  color: var(--ink);
  font-size: 12px;
}

.system-status__panel .link-button {
  justify-content: flex-start;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--danger);
}

.view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.view-header p {
  margin-top: 4px;
  color: var(--muted);
}

.view-header__actions,
.view-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.view-toolbar--stack {
  display: grid;
  align-items: stretch;
}

.view-body {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.key-row {
  display: grid;
  grid-template-columns: minmax(95px, 0.85fr) minmax(0, 1.15fr);
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.key-row span {
  color: var(--muted);
}

.key-row strong {
  font-family: var(--font-ui);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}
