:root {
  --ink: #142320;
  --muted: #66716d;
  --paper: #f4f0e8;
  --surface: #fffdf9;
  --surface-soft: #f8f5ef;
  --line: #ded8cd;
  --forest: #173b35;
  --forest-deep: #0e2925;
  --mint: #dfeee7;
  --success: #2f7b62;
  --success-soft: #e6f2ec;
  --copper: #b65f3e;
  --copper-soft: #f6e7df;
  --warning: #ad6b22;
  --warning-soft: #fbefda;
  --shadow: 0 18px 50px rgba(24, 43, 38, 0.08);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(207, 224, 211, 0.55), transparent 24rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(182, 95, 62, 0.32);
  outline-offset: 2px;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  width: 256px;
  flex-direction: column;
  padding: 28px 20px 22px;
  color: #f5f2e8;
  background:
    linear-gradient(170deg, rgba(255, 255, 255, 0.04), transparent 34%),
    var(--forest-deep);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 8px 28px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #fffaf0;
  font-family: Georgia, serif;
  font-size: 15px;
  letter-spacing: 0.05em;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 500;
}

.brand div > span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.primary-nav {
  display: grid;
  gap: 7px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.68);
  background: transparent;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.is-active {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.nav-item.is-active::after {
  width: 5px;
  height: 5px;
  margin-left: auto;
  border-radius: 50%;
  background: #dba17d;
  content: "";
}

.nav-icon {
  color: #dba17d;
  font-family: Georgia, serif;
  font-size: 12px;
}

.sidebar-status {
  margin-top: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.05);
}

.status-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #69c294;
  box-shadow: 0 0 0 5px rgba(105, 194, 148, 0.12);
}

.sidebar-status p {
  margin: 11px 0 13px;
  color: rgba(255, 255, 255, 0.57);
  font-size: 12px;
  line-height: 1.5;
}

.sidebar-status > span {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
}

.local-only {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 8px 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
}

.main-content {
  min-height: 100vh;
  margin-left: 256px;
  padding: 0 42px 60px;
}

.topbar {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(20, 35, 32, 0.08);
}

.topbar h1 {
  margin: 3px 0 0;
  font-family: Georgia, serif;
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0;
  color: var(--copper);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.load-progress-host {
  min-height: 104px;
  margin: 18px 0 16px;
}

.load-progress {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(170px, 0.55fr) minmax(370px, 1.4fr);
  gap: 22px;
  align-items: center;
  min-height: 104px;
  padding: 18px 20px;
  overflow: hidden;
  border: 1px solid rgba(20, 35, 32, 0.09);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 249, 0.88);
  box-shadow: 0 7px 30px rgba(24, 43, 38, 0.035);
  transition: border-color 220ms ease, background 220ms ease;
}

.load-progress.is-complete {
  border-color: rgba(47, 123, 98, 0.2);
  background: linear-gradient(90deg, rgba(230, 242, 236, 0.92), rgba(255, 253, 249, 0.9));
}

.load-progress.has-error {
  border-color: rgba(173, 107, 34, 0.24);
}

.load-progress-copy,
.load-progress-copy strong,
.load-progress-copy span {
  display: block;
}

.load-progress-copy strong {
  margin: 3px 0 4px;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 500;
}

.load-progress-copy > span:last-child {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.load-progress-kicker {
  color: var(--copper);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.load-progress-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.load-progress-value span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.load-progress-value strong {
  color: var(--forest);
  font-size: 16px;
}

.load-progress progress {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 99px;
  appearance: none;
}

.load-progress progress::-webkit-progress-bar {
  border-radius: 99px;
  background: #e9e4da;
}

.load-progress progress::-webkit-progress-value {
  border-radius: 99px;
  background: linear-gradient(90deg, var(--copper), var(--success));
  transition: width 450ms ease;
}

.load-progress progress::-moz-progress-bar {
  border-radius: 99px;
  background: linear-gradient(90deg, var(--copper), var(--success));
}

.load-progress-phases {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.load-progress-phases li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(20, 35, 32, 0.035);
}

.load-progress-phases li > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgba(20, 35, 32, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.load-progress-phases strong,
.load-progress-phases small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.load-progress-phases strong {
  color: var(--ink);
  font-size: 10px;
}

.load-progress-phases small {
  margin-top: 2px;
  font-size: 9px;
}

.load-progress-phases .is-running > span {
  color: white;
  background: var(--copper);
  animation: progress-pulse 1.35s ease-in-out infinite;
}

.load-progress-phases .is-complete > span {
  color: white;
  background: var(--success);
}

.load-progress-phases .is-error > span {
  color: white;
  background: var(--warning);
}

.live-stage {
  position: relative;
  transition: opacity 220ms ease, transform 220ms ease, border-color 220ms ease;
}

.live-stage.is-pending {
  opacity: 0.48;
}

.live-stage.is-loading {
  opacity: 0.72;
}

.live-stage.is-loading::after {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--copper), transparent);
  background-size: 45% 100%;
  content: "";
  animation: stage-scan 1.45s linear infinite;
}

.live-stage.is-ready {
  opacity: 1;
  animation: stage-reveal 320ms ease-out both;
}

.live-stage.has-load-error {
  border-color: rgba(173, 107, 34, 0.35);
  opacity: 0.72;
}

@keyframes progress-pulse {
  50% { transform: scale(0.82); opacity: 0.72; }
}

@keyframes stage-scan {
  from { background-position: -80% 0; }
  to { background-position: 180% 0; }
}

@keyframes stage-reveal {
  from { transform: translateY(4px); }
  to { transform: translateY(0); }
}

.install-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(23, 59, 53, 0.18);
  border-radius: 999px;
  color: var(--forest);
  background: var(--mint);
  font-size: 11px;
  font-weight: 750;
}

.install-button[hidden],
.is-profile-hidden {
  display: none !important;
}

.prototype-badge,
.prototype-lock,
.safe-label {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.prototype-badge {
  padding: 8px 12px;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.63);
  border: 1px solid var(--line);
}

.prototype-badge.is-live {
  color: var(--success);
  border-color: rgba(47, 123, 98, 0.22);
  background: var(--success-soft);
}

.prototype-badge.has-warning {
  color: var(--warning);
  border-color: rgba(173, 107, 34, 0.22);
  background: var(--warning-soft);
}

.avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--forest);
  font-size: 12px;
  font-weight: 700;
}

.view {
  padding-top: 32px;
}

.view[hidden] {
  display: none;
}

.hero-card {
  position: relative;
  display: grid;
  min-height: 310px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  color: white;
  background:
    radial-gradient(circle at 86% 28%, rgba(184, 139, 93, 0.35), transparent 17rem),
    linear-gradient(135deg, #173c35 0%, #102e29 70%);
  box-shadow: var(--shadow);
}

.hero-card::after {
  position: absolute;
  right: -90px;
  bottom: -170px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow:
    0 0 0 42px rgba(255, 255, 255, 0.025),
    0 0 0 84px rgba(255, 255, 255, 0.018);
  content: "";
}

.hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
  max-width: 730px;
  padding: 44px 50px;
}

.hero-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-status:not([data-state="success"]) .status-dot {
  background: #c9ba96;
  box-shadow: 0 0 0 5px rgba(201, 186, 150, 0.12);
}

.hero-status[data-state="failed"] .status-dot {
  background: #ef9b88;
}

.safe-label[data-state="warning"] {
  color: var(--warning);
  background: var(--warning-soft);
}

.safe-label[data-state="unknown"] {
  color: var(--muted);
  background: transparent;
}

.hero-copy h2 {
  max-width: 650px;
  margin: 20px 0 12px;
  font-family: Georgia, serif;
  font-size: clamp(31px, 4vw, 48px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.hero-copy p {
  max-width: 650px;
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 15px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.button {
  min-height: 43px;
  padding: 0 17px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 750;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button-primary {
  border: 1px solid #dca384;
  color: #1d2c29;
  background: #e5ae8d;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.12);
}

.button-secondary {
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.button-outline {
  border: 1px solid rgba(23, 59, 53, 0.22);
  color: var(--forest);
  background: var(--surface);
}

.button-block {
  width: 100%;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.metric-card,
.panel {
  border: 1px solid rgba(20, 35, 32, 0.08);
  background: rgba(255, 253, 249, 0.9);
  box-shadow: 0 7px 30px rgba(24, 43, 38, 0.035);
}

.metric-card {
  min-height: 124px;
  padding: 22px;
  border-radius: var(--radius-md);
}

.metric-card span,
.metric-card strong {
  display: block;
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-card strong {
  margin: 12px 0 6px;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 500;
}

.metric-detail {
  color: var(--success);
  font-size: 12px;
}

.metric-card-countdown .metric-label::after {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(50, 122, 92, 0.1);
  content: "";
  vertical-align: 1px;
  animation: countdown-breathe 2s ease-in-out infinite;
}

.metric-card .backup-countdown {
  overflow: hidden;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: clamp(18px, 1.8vw, 23px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.metric-card-countdown.is-due .metric-label::after {
  background: var(--warning);
  box-shadow: 0 0 0 4px rgba(183, 116, 38, 0.12);
}

.metric-card-countdown.is-due .backup-countdown,
.metric-card-countdown.is-due .metric-detail {
  color: var(--warning);
}

@keyframes countdown-breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.88);
  }

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

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.7fr);
  gap: 16px;
}

.panel {
  border-radius: var(--radius-md);
}

.timeline-panel,
.storage-panel {
  padding: 25px;
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading h2,
.section-heading h2,
.restore-header h2 {
  margin: 5px 0 0;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.text-button {
  padding: 5px;
  border: 0;
  color: var(--copper);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
}

.snapshot-strip {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 30px;
}

.snapshot-strip::before {
  position: absolute;
  top: 10px;
  right: 15%;
  left: 15%;
  height: 1px;
  background: var(--line);
  content: "";
}

.snapshot-point {
  position: relative;
  z-index: 1;
  padding: 30px 10px 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: center;
}

.snapshot-point::before {
  position: absolute;
  top: 2px;
  left: 50%;
  width: 15px;
  height: 15px;
  border: 4px solid var(--surface);
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
  content: "";
  transform: translateX(-50%);
}

.snapshot-point.warning::before {
  background: var(--warning);
  box-shadow: 0 0 0 1px var(--warning);
}

.snapshot-point.is-latest::before {
  box-shadow: 0 0 0 1px var(--success), 0 0 0 6px var(--success-soft);
}

.snapshot-point strong,
.snapshot-point span {
  display: block;
}

.snapshot-point strong {
  font-size: 13px;
}

.snapshot-point span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.safe-label {
  padding: 6px 9px;
  color: var(--success);
  background: var(--success-soft);
}

.storage-body {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 22px;
}

.storage-ring {
  display: grid;
  width: 108px;
  height: 108px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--copper) var(--usage), #e8e4db var(--usage));
}

.storage-ring::before {
  grid-area: 1 / 1;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.storage-ring div {
  z-index: 1;
  grid-area: 1 / 1;
  text-align: center;
}

.storage-ring strong,
.storage-ring span {
  display: block;
}

.storage-ring strong {
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 500;
}

.storage-ring span {
  color: var(--muted);
  font-size: 10px;
}

.storage-stats {
  display: grid;
  flex: 1;
  gap: 8px;
  margin: 0;
}

.storage-stats div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.storage-stats dt {
  color: var(--muted);
}

.storage-stats dd {
  margin: 0;
  font-weight: 750;
}

.coverage-section {
  padding-top: 38px;
}

.muted,
.toolbar-caption {
  color: var(--muted);
  font-size: 12px;
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.coverage-card {
  min-height: 155px;
  padding: 19px;
  border: 1px solid rgba(20, 35, 32, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 249, 0.72);
}

.coverage-icon,
.tree-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--forest);
  background: var(--mint);
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 700;
}

.coverage-card h3 {
  margin: 17px 0 7px;
  font-size: 14px;
}

.coverage-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.coverage-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
}

.page-section-heading {
  padding: 8px 0 26px;
}

/* Il popover deve superare anche gli stacking context delle schede successive. */
.page-section-heading.has-open-calendar,
.restore-step.has-open-calendar {
  position: relative;
  z-index: 30;
}

.section-intro,
.restore-header p {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  color: var(--muted);
  font-size: 11px;
}

.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-dot.success {
  background: var(--success);
}

.legend-dot.warning {
  background: var(--warning);
}

.history-layout,
.explorer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
}

.history-list {
  position: relative;
  display: grid;
  align-self: start;
  align-content: start;
  gap: 10px;
  padding-left: 68px;
}

.history-list::before {
  position: absolute;
  z-index: 0;
  top: 18px;
  bottom: 18px;
  left: 27px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(145, 109, 39, 0.16), rgba(47, 123, 98, 0.5), rgba(145, 109, 39, 0.2));
  content: "";
}

.history-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(20, 35, 32, 0.08);
  border-radius: var(--radius-md);
  color: inherit;
  background: rgba(255, 253, 249, 0.8);
  text-align: left;
  transition: border 160ms ease, transform 160ms ease, background 160ms ease;
}

.timeline-node {
  position: absolute;
  top: 50%;
  left: -68px;
  display: grid;
  width: 54px;
  min-height: 54px;
  place-content: center;
  padding: 5px 3px;
  border: 1px solid rgba(145, 109, 39, 0.25);
  border-radius: 18px;
  color: #76581f;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 6px 18px rgba(50, 42, 26, 0.08), inset 0 1px rgba(255, 255, 255, 0.82);
  line-height: 1;
  text-align: center;
  transform: translateY(-50%);
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.timeline-node::after {
  position: absolute;
  top: 50%;
  right: -15px;
  width: 15px;
  height: 1px;
  background: rgba(145, 109, 39, 0.24);
  content: "";
}

.timeline-node strong,
.timeline-node span,
.timeline-node small {
  display: block;
}

.timeline-node strong {
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 600;
}

.timeline-node span {
  margin-top: 2px;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.11em;
}

.timeline-node small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
}

.timeline-node.is-continuation {
  left: -48px;
  width: 14px;
  min-height: 14px;
  padding: 0;
  border-color: rgba(47, 123, 98, 0.34);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(255, 253, 249, 0.76);
}

.timeline-node.is-continuation::after {
  right: -35px;
  width: 35px;
}

.timeline-node.is-continuation i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}

.history-card:hover,
.history-card.is-selected {
  border-color: rgba(47, 123, 98, 0.38);
  background: var(--surface);
  transform: translateY(-1px);
}

.history-card:hover .timeline-node,
.history-card.is-selected .timeline-node {
  border-color: rgba(47, 123, 98, 0.52);
  color: var(--success);
  background: #fffefa;
}

.history-card.has-warning .timeline-node {
  border-color: rgba(196, 135, 42, 0.42);
  color: #8a5e19;
}

.history-card.has-warning .timeline-node.is-continuation i {
  background: var(--warning);
}

.history-time {
  padding-right: 16px;
  border-right: 1px solid var(--line);
}

.history-time strong,
.history-time span {
  display: block;
}

.history-time strong {
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 500;
}

.history-time span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.history-main strong,
.history-main span {
  display: block;
}

.history-main strong {
  font-size: 14px;
}

.history-main span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.retention-summary {
  display: grid;
  gap: 5px;
  justify-items: end;
}

.retention-flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.retention-badge,
.expiry-badge,
.retention-tier-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(91, 77, 47, 0.14);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(91, 77, 47, 0.06);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.retention-tier-badge {
  border-color: rgba(47, 123, 98, 0.18);
  color: var(--success);
  background: rgba(47, 123, 98, 0.08);
}

.retention-tier-badge.is-manual {
  border-color: rgba(145, 109, 39, 0.18);
  color: #76581f;
  background: rgba(222, 188, 103, 0.14);
}

.expiry-badge {
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.expiry-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.expiry-copy strong {
  font-size: inherit;
  font-weight: 850;
}

.retention-badge.is-protected {
  border-color: rgba(143, 107, 35, 0.22);
  color: #75571d;
  background: rgba(222, 188, 103, 0.2);
}

.retention-icon,
.expiry-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.detail-list .retention-badge {
  font-size: 11px;
}

.detail-list .retention-tier-badge {
  font-size: 11px;
}

.retention-policy-copy {
  display: grid;
  width: 100%;
  gap: 3px;
  color: var(--ink);
  line-height: 1.35;
  text-align: right;
}

.retention-policy-copy strong {
  color: var(--forest);
  font-size: 12px;
}

.retention-policy-copy span {
  font-size: 11px;
  font-weight: 700;
}

.retention-policy-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.retention-policy-copy.is-protected strong {
  color: #75571d;
}

.detail-list .retention-policy-row {
  align-items: start;
}

.detail-list .expiry-badge {
  max-width: 100%;
  align-items: flex-start;
  justify-content: flex-start;
  font-size: 11px;
  line-height: 1.3;
  text-align: left;
  white-space: normal;
}

.detail-list .expiry-icon {
  margin-top: 2px;
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 10px;
  font-weight: 800;
}

.status-pill.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.history-detail,
.item-detail,
.restore-summary {
  position: sticky;
  top: 24px;
  align-self: start;
  padding: 26px;
}

.detail-kicker {
  color: var(--copper);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.history-detail h3,
.item-detail h3,
.restore-summary h3 {
  margin: 8px 0 16px;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 500;
}

.detail-note {
  padding: 13px;
  border-radius: 11px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 12px;
  line-height: 1.5;
}

.detail-note.warning {
  color: #7b4a17;
  background: var(--warning-soft);
}

.detail-list,
.restore-summary dl {
  display: grid;
  gap: 11px;
  margin: 20px 0 0;
}

.detail-list div,
.restore-summary dl div {
  display: grid;
  grid-template-columns: minmax(105px, 0.7fr) minmax(0, 1.3fr);
  align-items: center;
  gap: 20px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.detail-list dt,
.restore-summary dt {
  color: var(--muted);
}

.detail-list dd,
.restore-summary dd {
  display: flex;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-end;
  margin: 0;
  font-weight: 750;
  text-align: right;
  overflow-wrap: anywhere;
}

.detail-list dd > :is(.retention-tier-badge, .retention-badge, .expiry-badge) {
  max-width: 100%;
}

.history-maintenance {
  display: grid;
  gap: 13px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.history-maintenance-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.history-maintenance-heading .ui-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--success);
}

.history-maintenance-heading strong,
.history-maintenance-heading span {
  display: block;
}

.history-maintenance-heading strong {
  font-size: 12px;
}

.history-maintenance-heading span,
.history-maintenance-note {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.history-maintenance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.history-maintenance-actions .button {
  min-height: 40px;
  padding-right: 12px;
  padding-left: 12px;
  font-size: 10px;
}

.button-danger {
  border: 1px solid rgba(157, 57, 52, 0.34);
  color: #7e2724;
  background: rgba(255, 242, 238, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.button-danger:not(:disabled):hover {
  background: rgba(252, 226, 220, 0.94);
  box-shadow: 0 8px 22px rgba(126, 39, 36, 0.12);
}

.maintenance-inline-status {
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 10px;
  line-height: 1.45;
}

.maintenance-inline-status.has-error {
  color: #8a312e;
  background: rgba(252, 226, 220, 0.78);
}

.select-field {
  display: grid;
  gap: 6px;
  min-width: 230px;
}

.select-field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.select-field select {
  min-height: 42px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
}

.select-field-wide {
  max-width: 470px;
  margin-top: 16px;
}

.snapshot-calendar-field {
  position: relative;
  z-index: 7;
  display: grid;
  min-width: min(590px, 52vw);
  gap: 6px;
}

.history-heading-tools {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.history-heading-tools .snapshot-calendar-field {
  min-width: min(520px, 48vw);
}

.restore-snapshot-calendar {
  width: min(100%, 470px);
  min-width: 0;
  margin-top: 16px;
}

.snapshot-calendar-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.snapshot-calendar-trigger {
  display: grid;
  min-height: 48px;
  grid-template-columns: 18px minmax(0, 1fr) 12px 14px;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(172, 142, 80, 0.32);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.86);
  box-shadow: 0 8px 24px rgba(72, 56, 30, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  text-align: left;
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
}

.snapshot-calendar-trigger > svg:first-child {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--copper);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.snapshot-calendar-trigger-label {
  overflow: hidden;
  font-size: 14px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snapshot-calendar-chevron {
  width: 14px;
  height: 14px;
  transition: transform 160ms ease;
}

.snapshot-calendar-trigger[aria-expanded="true"] .snapshot-calendar-chevron {
  transform: rotate(180deg);
}

.snapshot-calendar-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: min(100%, 430px);
  padding: 16px;
  border: 1px solid rgba(172, 142, 80, 0.24);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 24px 70px rgba(50, 40, 24, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(30px) saturate(140%);
  -webkit-backdrop-filter: blur(30px) saturate(140%);
}

.snapshot-calendar-popover[hidden] {
  display: none;
}

.snapshot-calendar-heading {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.snapshot-calendar-heading strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  text-align: center;
  text-transform: capitalize;
}

.snapshot-calendar-heading button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.72);
}

.snapshot-calendar-weekdays,
.snapshot-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.snapshot-calendar-weekdays {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.snapshot-calendar-grid {
  gap: 4px;
}

.snapshot-calendar-empty,
.snapshot-calendar-day {
  min-height: 50px;
}

.snapshot-calendar-day {
  display: grid;
  align-content: space-between;
  justify-items: center;
  padding: 6px 3px 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #53605c;
  font-size: 10px;
}

.snapshot-calendar-day.is-today {
  border-color: rgba(182, 95, 62, 0.28);
}

.snapshot-calendar-day.is-selected-day {
  color: var(--forest);
  background: rgba(229, 239, 230, 0.72);
}

.snapshot-calendar-markers {
  display: flex;
  min-height: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.calendar-marker {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #9ca39f;
  box-shadow: 0 0 0 2px rgba(255, 253, 248, 0.9);
}

button.calendar-marker {
  cursor: pointer;
  transition: filter 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button.calendar-marker:hover,
button.calendar-marker:focus-visible,
.calendar-marker.is-selected {
  box-shadow: 0 0 0 2px #fffdf8, 0 0 0 4px rgba(23, 59, 53, 0.42);
  filter: saturate(1.2);
}

.calendar-marker.is-success {
  background: #2f7b62;
}

.calendar-marker.is-partial {
  background: #d78a2e;
}

.calendar-marker.is-failed {
  background: #bd4e49;
}

.calendar-marker.is-absent {
  width: 7px;
  height: 7px;
  background: #c8cbc8;
  box-shadow: none;
  opacity: 0.72;
}

.calendar-marker.is-neutral {
  background: #7b7466;
}

.calendar-marker.is-full {
  border-radius: 2px;
  transform: rotate(45deg);
}

button.calendar-marker.is-full:hover,
button.calendar-marker.is-full:focus-visible,
.calendar-marker.is-full.is-selected {
  transform: rotate(45deg) scale(1.12);
}

.snapshot-calendar-legend {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.snapshot-calendar-legend > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.snapshot-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 8px;
}

.explorer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.explorer-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.segmented-control {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.72);
}

.segmented-control button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
}

.segmented-control button.is-active {
  color: white;
  background: var(--forest);
  box-shadow: 0 4px 12px rgba(14, 41, 37, 0.15);
}

.segmented-control button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.live-mode-help {
  color: var(--muted);
  font-size: 11px;
}

.search-field {
  display: flex;
  min-width: min(520px, 70%);
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.search-field span {
  color: var(--copper);
  font-size: 20px;
}

.search-field input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.search-field input::placeholder {
  color: #9a9e9a;
}

.tree-panel {
  min-height: 520px;
  padding: 12px;
}

.actual-tree-toolbar {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  padding: 5px 8px 12px;
  border-bottom: 1px solid var(--line);
}

.tree-back {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--forest);
  background: var(--surface);
}

.tree-breadcrumb {
  min-width: 0;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.tree-folder-search {
  position: relative;
  z-index: 4;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

.tree-folder-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
  gap: 8px;
}

.tree-folder-query {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid rgba(150, 116, 49, 0.24);
  border-radius: 11px;
  background: rgba(255, 253, 247, 0.82);
}

.tree-folder-sort {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 9px;
  border: 1px solid rgba(150, 116, 49, 0.24);
  border-radius: 11px;
  background: rgba(255, 253, 247, 0.82);
}

.tree-folder-sort span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
}

.tree-folder-sort select {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 10px;
}

.tree-folder-search-icon {
  width: 17px;
  height: 17px;
  color: var(--copper);
}

.tree-folder-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
}

.tree-folder-search-hint {
  display: block;
  margin: 5px 3px 0;
  color: var(--muted);
  font-size: 8px;
}

.actual-root-section {
  padding: 12px 7px 2px;
}

.actual-root-heading {
  margin: 3px 6px 8px;
  color: var(--copper);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.actual-node {
  display: grid;
  width: 100%;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border: 0;
  border-radius: 10px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.actual-node:hover,
.actual-node.is-selected {
  background: var(--surface-soft);
}

.actual-node-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  color: var(--forest);
  background: var(--mint);
  font-family: Georgia, serif;
  font-size: 10px;
  font-weight: 700;
}

.actual-node-icon.file {
  color: var(--copper);
  background: var(--copper-soft);
}

.actual-node-label {
  min-width: 0;
}

.actual-node-label strong,
.actual-node-label span {
  display: block;
}

.actual-node-label strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actual-node-label span {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actual-node-meta {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.actual-node-list {
  overflow: visible;
}

.actual-node-list.is-streaming {
  min-height: 220px;
}

.tree-pagination {
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(150px, 1fr) minmax(110px, auto);
  align-items: center;
  gap: 12px;
  padding: 13px 8px 3px;
  border-top: 1px solid var(--line);
}

.tree-pagination-top {
  padding: 10px 8px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

.tree-pagination[hidden] {
  display: none;
}

.tree-pagination > span,
.tree-pagination > span strong,
.tree-pagination > span small {
  display: block;
  text-align: center;
}

.tree-pagination > span strong {
  color: var(--ink);
  font-size: 11px;
}

.tree-pagination > span small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.tree-pagination .button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 10px;
}

.tree-loading,
.tree-message {
  display: grid;
  min-height: 300px;
  place-items: center;
  padding: 40px;
  color: var(--muted);
  text-align: center;
}

.tree-read-progress {
  width: min(100%, 430px);
  text-align: left;
}

.tree-read-progress-copy strong,
.tree-read-progress-copy span {
  display: block;
}

.tree-read-progress-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.tree-read-progress-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.tree-read-progress progress {
  width: 100%;
  height: 8px;
  margin-top: 15px;
  accent-color: var(--success);
}

.tree-stream-progress {
  display: grid;
  position: sticky;
  top: 0;
  z-index: 2;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 18px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.9);
  box-shadow: 0 8px 22px rgba(72, 56, 30, 0.06);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.tree-progress-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.tree-progress-value span {
  color: var(--muted);
  font-size: 9px;
}

.tree-progress-value strong {
  color: var(--copper);
  font-size: 12px;
}

.tree-stream-progress progress {
  width: 100%;
  height: 7px;
  grid-column: 1 / -1;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
  -webkit-appearance: none;
}

.tree-stream-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(91, 78, 52, 0.11);
}

.tree-stream-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success), var(--gold));
  transition: width 220ms ease;
}

.tree-stream-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--success), var(--gold));
}

.tree-stream-progress.is-complete {
  border-bottom-color: rgba(53, 116, 90, 0.22);
  background: rgba(236, 246, 239, 0.92);
}

.tree-stream-progress.has-error {
  border-bottom-color: rgba(182, 95, 62, 0.28);
  background: rgba(252, 239, 232, 0.94);
}

.tree-message strong,
.tree-message p {
  display: block;
}

.tree-message p {
  max-width: 330px;
  margin: 7px auto 0;
  font-size: 11px;
  line-height: 1.5;
}

.search-result-count {
  padding: 12px 13px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.tree-group {
  margin-bottom: 7px;
  border: 1px solid transparent;
  border-radius: 12px;
  overflow: hidden;
}

.tree-group.is-selected {
  border-color: rgba(47, 123, 98, 0.2);
  background: var(--surface-soft);
}

.tree-group-header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.tree-label strong,
.tree-label span {
  display: block;
}

.tree-label strong {
  font-size: 13px;
}

.tree-label span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.tree-size {
  color: var(--muted);
  font-size: 11px;
}

.tree-children {
  display: grid;
  gap: 2px;
  padding: 0 12px 12px 62px;
}

.tree-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 15px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  color: #42504c;
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.tree-child:hover:not(:disabled),
.tree-child:focus-visible {
  color: var(--forest);
  background: white;
  transform: translateX(2px);
}

.tree-child:focus-visible {
  outline: 2px solid rgba(53, 116, 90, 0.28);
  outline-offset: 1px;
}

.tree-child:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.tree-child small {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #929894;
}

.tree-child-arrow {
  width: 12px;
  height: 12px;
  transition: transform 160ms ease;
}

.tree-child:hover:not(:disabled) .tree-child-arrow,
.tree-child:focus-visible .tree-child-arrow {
  transform: translateX(2px);
}

.empty-state {
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}

.item-path {
  display: block;
  overflow-wrap: anywhere;
  padding: 12px;
  border-radius: 10px;
  color: var(--forest);
  background: var(--surface-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  line-height: 1.55;
}

.item-detail ul {
  margin: 18px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.detail-action,
.restore-explorer-link {
  margin-top: 18px;
}

.restore-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding: 8px 0 26px;
}

.prototype-lock {
  padding: 8px 11px;
  color: var(--warning);
  background: var(--warning-soft);
  white-space: nowrap;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 22px;
  padding: 16px 22px;
  border: 1px solid rgba(20, 35, 32, 0.08);
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.68);
  list-style: none;
}

.stepper li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}

.stepper li:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: 13px;
  width: min(65px, 25%);
  height: 1px;
  background: var(--line);
  content: "";
}

.stepper span {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-size: 10px;
  font-weight: 800;
}

.stepper .is-current {
  color: var(--forest);
  font-weight: 750;
}

.stepper .is-current span {
  border-color: var(--forest);
  color: white;
  background: var(--forest);
}

.restore-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: 16px;
}

.restore-form {
  display: grid;
  gap: 12px;
}

.restore-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 18px;
  padding: 24px;
}

.step-number {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: var(--forest);
  background: var(--mint);
  font-family: Georgia, serif;
  font-size: 15px;
}

.step-content h3 {
  margin: 3px 0 0;
  font-size: 15px;
}

.step-content > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.inline-alert {
  margin-top: 13px;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.5;
}

.warning-alert {
  color: #7b4a17;
  background: var(--warning-soft);
}

.restore-options {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.restore-empty {
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px dashed #c8c1b5;
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 11px;
  line-height: 1.5;
}

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

.restore-selection {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.restore-selection-label {
  min-width: 0;
}

.restore-selection-label strong,
.restore-selection-label small {
  display: block;
}

.restore-selection-label strong {
  font-size: 12px;
}

.restore-selection-label small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.restore-selection > button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--copper);
  background: var(--copper-soft);
  font-size: 18px;
}

.restore-option {
  display: flex;
  min-height: 62px;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.restore-option:has(input:checked) {
  border-color: rgba(47, 123, 98, 0.5);
  background: var(--success-soft);
}

.restore-option:has(input:disabled) {
  cursor: not-allowed;
  opacity: 0.48;
}

.restore-option input {
  width: 17px;
  height: 17px;
  accent-color: var(--success);
}

.restore-option strong,
.restore-option small {
  display: block;
}

.restore-option strong {
  font-size: 12px;
}

.restore-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.destination-box {
  display: grid;
  gap: 8px;
  margin-top: 15px;
  padding: 15px;
  border: 1px dashed #c8c1b5;
  border-radius: 11px;
  background: var(--surface-soft);
}

.destination-box span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.destination-box code {
  overflow-wrap: anywhere;
  color: var(--forest);
  font-size: 11px;
}

.destination-box small {
  color: var(--muted);
  font-size: 10px;
}

.restore-summary dl {
  margin-bottom: 21px;
}

.restore-safety {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 19px 0;
  padding: 13px;
  border-radius: 11px;
  color: var(--success);
  background: var(--success-soft);
}

.restore-safety span {
  font-weight: 900;
}

.restore-confirmation {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid rgba(182, 95, 62, 0.24);
  border-radius: 1rem;
  background: var(--surface-soft);
}

.restore-confirmation[hidden] {
  display: none;
}

.restore-confirmation label,
.restore-confirmation p,
.restore-confirmation small {
  display: block;
}

.restore-confirmation label {
  color: var(--ink);
  font-weight: 750;
}

.restore-confirmation p {
  margin: 0.55rem 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.restore-confirmation code {
  color: var(--copper);
  font-weight: 800;
}

.restore-confirmation input {
  width: 100%;
  min-height: 2.8rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  text-transform: uppercase;
}

.restore-confirmation input:focus {
  outline: 2px solid rgba(182, 95, 62, 0.32);
  outline-offset: 2px;
}

.restore-confirmation small {
  margin-top: 0.55rem;
  color: var(--muted);
  line-height: 1.45;
}

.restore-safety p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}

.disabled-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.disabled-note.is-success {
  color: var(--success);
}

.disabled-note.is-error {
  color: var(--warning);
}

.is-public-profile .primary-nav {
  grid-template-rows: auto auto;
}

@media (max-width: 1180px) {
  .main-content {
    padding-right: 28px;
    padding-left: 28px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .load-progress {
    grid-template-columns: minmax(210px, 0.8fr) minmax(170px, 0.55fr);
  }

  .load-progress-phases {
    grid-column: 1 / -1;
  }

  .coverage-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .overview-grid,
  .history-layout,
  .explorer-layout,
  .restore-layout {
    grid-template-columns: 1fr;
  }

  .history-detail,
  .item-detail,
  .restore-summary {
    position: static;
  }
}

@media (max-width: 800px) {
  .page-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .snapshot-calendar-field {
    width: 100%;
    min-width: 0;
  }

  .history-heading-tools {
    width: 100%;
    justify-items: stretch;
  }

  .snapshot-calendar-popover {
    right: auto;
    left: 0;
    width: min(100%, 430px);
  }

  .sidebar {
    position: fixed;
    inset: auto 0 0;
    width: auto;
    height: 72px;
    padding: 8px 12px;
  }

  .brand,
  .sidebar-status,
  .local-only {
    display: none;
  }

  .primary-nav {
    display: grid;
    height: 100%;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .is-public-profile .primary-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 6px 4px;
    font-size: 9px;
    text-align: center;
  }

  .nav-item.is-active::after {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 0 18px 100px;
  }

  .topbar {
    min-height: 92px;
  }

  .load-progress-host {
    min-height: 0;
    margin-top: 12px;
  }

  .load-progress {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .load-progress-phases {
    grid-column: auto;
  }

  .prototype-badge {
    display: none;
  }

  .install-button {
    min-height: 34px;
    padding: 0 10px;
    font-size: 10px;
  }

  .hero-copy {
    padding: 34px 28px;
  }

  .coverage-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .restore-header,
  .explorer-toolbar,
  .explorer-mode-row {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    min-width: 100%;
  }

  .tree-stream-progress {
    grid-template-columns: 1fr;
  }

  .tree-progress-value {
    justify-content: space-between;
  }

  .tree-pagination {
    grid-template-columns: 1fr 1fr;
  }

  .tree-folder-control-row {
    grid-template-columns: 1fr;
  }

  .tree-pagination > span {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .stepper {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stepper li::after {
    display: none;
  }
}

@media (max-width: 540px) {
  .topbar-actions .avatar {
    display: none;
  }

  .metric-grid,
  .coverage-grid,
  .restore-options {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 105px;
  }

  .load-progress-phases {
    grid-template-columns: 1fr;
  }

  .history-list {
    gap: 9px;
    padding-left: 50px;
  }

  .history-list::before {
    left: 19px;
  }

  .history-card {
    grid-template-columns: 50px 1fr;
    gap: 10px;
    padding: 13px;
  }

  .timeline-node {
    left: -52px;
    width: 42px;
    min-height: 48px;
    border-radius: 15px;
  }

  .timeline-node::after {
    right: -11px;
    width: 11px;
  }

  .timeline-node strong {
    font-size: 16px;
  }

  .timeline-node span {
    font-size: 8px;
  }

  .timeline-node small {
    font-size: 7px;
  }

  .timeline-node.is-continuation {
    left: -37px;
    width: 12px;
    min-height: 12px;
  }

  .timeline-node.is-continuation::after {
    right: -26px;
    width: 26px;
  }

  .history-card .retention-summary,
  .history-card .status-pill {
    grid-column: 2;
  }

  .history-card .retention-summary {
    justify-items: start;
  }

  .history-card .retention-flags {
    justify-content: flex-start;
  }

  .detail-list div,
  .restore-summary dl div {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .detail-list dd,
  .restore-summary dd {
    justify-content: flex-start;
    text-align: left;
  }

  .retention-policy-copy {
    text-align: left;
  }

  .storage-body {
    align-items: flex-start;
    flex-direction: column;
  }

  .snapshot-point {
    padding-right: 2px;
    padding-left: 2px;
  }

  .snapshot-point strong {
    font-size: 11px;
  }

  .restore-step {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Caput Mundi visual system: Roman night, warm gold and translucent glass. */
:root {
  --ink: #211f1a;
  --muted: #706b60;
  --paper: #e9e1d3;
  --surface: rgba(255, 253, 247, 0.78);
  --surface-soft: rgba(246, 240, 229, 0.72);
  --line: rgba(79, 68, 47, 0.16);
  --forest: #26231d;
  --forest-deep: #11100d;
  --mint: #eee2bc;
  --success: #35745a;
  --success-soft: rgba(221, 239, 228, 0.8);
  --copper: #967431;
  --copper-soft: rgba(239, 224, 184, 0.72);
  --warning: #9b5e22;
  --warning-soft: rgba(248, 229, 194, 0.82);
  --gold: #d9bd72;
  --gold-bright: #f0d992;
  --glass: rgba(255, 253, 247, 0.62);
  --glass-strong: rgba(255, 253, 247, 0.78);
  --glass-dark: rgba(19, 18, 15, 0.82);
  --shadow: 0 24px 64px rgba(53, 43, 26, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

html {
  background: #e2d8c8;
}

body {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(circle at 84% -8%, rgba(217, 189, 114, 0.34), transparent 31rem),
    radial-gradient(circle at 12% 88%, rgba(139, 157, 132, 0.23), transparent 34rem),
    linear-gradient(135deg, #eee8dd 0%, #e5dccd 50%, #eee8dd 100%);
  background-attachment: fixed;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(82, 69, 43, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(82, 69, 43, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  content: "";
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.ui-icon,
.nav-icon,
.status-shield,
.scope-icon,
.button-icon,
.search-icon,
.help-shortcuts svg,
.help-topic-icon svg,
.help-chevron,
.help-hero-mark svg,
.help-note svg,
.help-warning svg,
.help-safety-card li svg,
.help-empty svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sidebar {
  width: 276px;
  overflow: hidden;
  border-right: 1px solid rgba(217, 189, 114, 0.18);
  background:
    radial-gradient(circle at 0 0, rgba(217, 189, 114, 0.13), transparent 20rem),
    linear-gradient(155deg, rgba(24, 23, 19, 0.97), rgba(10, 10, 8, 0.98));
  box-shadow: 18px 0 55px rgba(21, 18, 12, 0.18);
  backdrop-filter: blur(26px) saturate(125%);
}

.sidebar::before,
.sidebar::after {
  position: absolute;
  pointer-events: none;
  border: 1px solid rgba(217, 189, 114, 0.1);
  border-bottom: 0;
  border-radius: 90px 90px 0 0;
  content: "";
}

.sidebar::before {
  right: -44px;
  bottom: -1px;
  width: 150px;
  height: 260px;
}

.sidebar::after {
  right: 54px;
  bottom: -1px;
  width: 92px;
  height: 170px;
}

.brand {
  position: relative;
  z-index: 1;
  padding: 0 3px 29px;
}

.brand img {
  display: block;
  width: 100%;
  max-width: 226px;
  height: auto;
}

.primary-nav,
.sidebar-status,
.local-only {
  position: relative;
  z-index: 1;
}

.nav-item {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: rgba(255, 252, 244, 0.62);
}

.nav-item:hover {
  border-color: rgba(217, 189, 114, 0.12);
  background: rgba(255, 255, 255, 0.055);
}

.nav-item.is-active {
  border-color: rgba(217, 189, 114, 0.2);
  background: linear-gradient(105deg, rgba(217, 189, 114, 0.16), rgba(255, 255, 255, 0.055));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 24px rgba(0, 0, 0, 0.12);
}

.nav-icon {
  width: 19px;
  height: 19px;
  color: var(--gold);
}

.nav-item.is-active::after {
  width: 6px;
  height: 6px;
  background: var(--gold-bright);
  box-shadow: 0 0 14px rgba(240, 217, 146, 0.75);
}

.sidebar-status {
  border-color: rgba(217, 189, 114, 0.14);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
}

.status-shield {
  width: 18px;
  height: 18px;
  color: #75c89d;
}

.scope-icon {
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.main-content {
  margin-left: 276px;
  padding-right: clamp(22px, 3.2vw, 52px);
  padding-left: clamp(22px, 3.2vw, 52px);
}

.topbar {
  position: relative;
  border-bottom-color: rgba(73, 62, 42, 0.11);
}

.topbar::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  width: 92px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
  content: "";
}

.topbar h1,
.hero-copy h2,
.panel-heading h2,
.section-heading h2,
.restore-header h2,
.history-detail h3,
.item-detail h3,
.restore-summary h3,
.help-hero h2,
.help-safety-card h3 {
  font-family: Georgia, "Times New Roman", serif;
}

.eyebrow,
.detail-kicker,
.load-progress-kicker {
  color: var(--copper);
  letter-spacing: 0.16em;
}

.button,
.install-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
}

.button-icon {
  width: 17px;
  height: 17px;
}

.button-primary {
  border-color: #c9a958;
  color: #211b0f;
  background: linear-gradient(135deg, #efd98f, #cfae58);
  box-shadow: 0 10px 24px rgba(125, 92, 28, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.button-secondary,
.button-outline,
.install-button {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(16px) saturate(130%);
}

.button-outline,
.install-button {
  border-color: rgba(107, 86, 43, 0.22);
  background: rgba(255, 253, 247, 0.58);
}

.load-progress,
.metric-card,
.panel,
.coverage-card,
.history-card,
.segmented-control,
.search-field {
  border-color: rgba(82, 69, 43, 0.14);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.71), rgba(255, 250, 239, 0.48));
  box-shadow: 0 18px 48px rgba(72, 56, 30, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px) saturate(138%);
  -webkit-backdrop-filter: blur(24px) saturate(138%);
}

.load-progress.is-complete {
  border-color: rgba(53, 116, 90, 0.24);
  background: linear-gradient(120deg, rgba(228, 242, 233, 0.75), rgba(255, 252, 244, 0.62));
}

.hero-card {
  isolation: isolate;
  border: 1px solid rgba(217, 189, 114, 0.22);
  background:
    radial-gradient(circle at 88% 22%, rgba(217, 189, 114, 0.2), transparent 17rem),
    linear-gradient(135deg, rgba(30, 29, 24, 0.97), rgba(12, 12, 10, 0.98));
  box-shadow: 0 30px 74px rgba(36, 29, 18, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.hero-card::before {
  position: absolute;
  inset: auto 0 0 36%;
  z-index: -1;
  height: 86%;
  opacity: 0.5;
  background:
    radial-gradient(ellipse at 50% 100%, transparent 0 38%, rgba(217, 189, 114, 0.17) 39% 40%, transparent 41%) 0 0 / 150px 190px repeat-x;
  content: "";
  mask-image: linear-gradient(to right, transparent, black 22%);
}

.hero-card::after {
  right: -84px;
  bottom: -178px;
  border-color: rgba(217, 189, 114, 0.17);
  box-shadow: 0 0 0 42px rgba(217, 189, 114, 0.035), 0 0 0 84px rgba(217, 189, 114, 0.02);
}

.hero-status {
  color: rgba(255, 251, 240, 0.72);
}

.hero-copy p {
  color: rgba(255, 251, 240, 0.67);
}

.coverage-card {
  position: relative;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.coverage-card::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.25), transparent 37%);
  content: "";
}

.coverage-card:hover {
  border-color: rgba(150, 116, 49, 0.28);
  box-shadow: 0 22px 48px rgba(72, 56, 30, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  transform: translateY(-3px);
}

.coverage-icon,
.tree-icon,
.actual-node-icon,
.help-topic-icon {
  color: #7f6226;
  background: linear-gradient(145deg, rgba(240, 217, 146, 0.74), rgba(217, 189, 114, 0.3));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.coverage-icon .ui-icon,
.tree-icon .ui-icon,
.actual-node-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.actual-node-icon.file {
  color: #8c6730;
  background: rgba(239, 224, 184, 0.62);
}

.storage-ring {
  background: conic-gradient(var(--gold) var(--usage), rgba(91, 78, 52, 0.12) var(--usage));
  box-shadow: 0 12px 30px rgba(82, 66, 34, 0.12);
}

.storage-ring::before {
  background: rgba(255, 253, 247, 0.84);
  box-shadow: inset 0 1px 0 white;
}

.segmented-control button.is-active {
  color: #fff9e9;
  background: linear-gradient(135deg, #302b20, #171510);
  box-shadow: 0 7px 18px rgba(28, 23, 15, 0.2);
}

.search-icon {
  width: 19px;
  height: 19px;
  color: var(--copper);
}

.search-field span {
  font-size: inherit;
}

.help-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 30px;
  min-height: 220px;
  align-items: center;
  overflow: hidden;
  padding: 36px 42px;
  border-color: rgba(217, 189, 114, 0.25);
  color: #fffaf0;
  background:
    radial-gradient(circle at 88% 18%, rgba(217, 189, 114, 0.2), transparent 16rem),
    linear-gradient(135deg, rgba(34, 31, 24, 0.97), rgba(14, 13, 11, 0.98));
}

.help-hero::before {
  position: absolute;
  right: 7%;
  bottom: -92px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(217, 189, 114, 0.15);
  border-radius: 50%;
  box-shadow: 0 0 0 32px rgba(217, 189, 114, 0.03), 0 0 0 64px rgba(217, 189, 114, 0.018);
  content: "";
}

.help-hero-copy {
  position: relative;
  z-index: 1;
}

.help-hero h2 {
  max-width: 700px;
  margin: 9px 0 13px;
  font-size: clamp(31px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.help-hero p:last-child {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 250, 240, 0.68);
  font-size: 14px;
  line-height: 1.7;
}

.help-hero-mark {
  position: relative;
  z-index: 1;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  justify-self: center;
  border: 1px solid rgba(217, 189, 114, 0.38);
  border-radius: 50%;
  color: var(--gold-bright);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 20px 40px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
}

.help-hero-mark svg {
  width: 42px;
  height: 42px;
  stroke-width: 1.35;
}

.help-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0 14px;
}

.help-search-field {
  flex: 1;
  max-width: 680px;
}

.help-shortcuts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.help-shortcuts button {
  display: flex;
  min-width: 0;
  min-height: 74px;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid rgba(82, 69, 43, 0.14);
  border-radius: 15px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
  text-align: left;
  backdrop-filter: blur(18px);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.help-shortcuts button:hover {
  border-color: rgba(150, 116, 49, 0.3);
  background: rgba(255, 253, 247, 0.72);
  transform: translateY(-2px);
}

.help-shortcuts svg {
  width: 24px;
  height: 24px;
  color: var(--copper);
}

.help-shortcuts span,
.help-shortcuts strong,
.help-shortcuts small {
  display: block;
  min-width: 0;
}

.help-shortcuts strong {
  font-size: 12px;
}

.help-shortcuts small {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.help-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.55fr);
  gap: 16px;
  align-items: start;
}

.help-topics {
  display: grid;
  gap: 10px;
}

.help-topic {
  overflow: hidden;
  border: 1px solid rgba(82, 69, 43, 0.14);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 250, 239, 0.47));
  box-shadow: 0 14px 38px rgba(72, 56, 30, 0.07), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(22px) saturate(135%);
}

.help-topic[hidden] {
  display: none;
}

.help-topic summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  gap: 13px;
  align-items: center;
  min-height: 76px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.help-topic summary::-webkit-details-marker {
  display: none;
}

.help-topic summary > span:nth-child(2),
.help-topic summary strong,
.help-topic summary small {
  display: block;
}

.help-topic summary strong {
  font-size: 13px;
}

.help-topic summary small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.help-topic-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
}

.help-topic-icon svg {
  width: 21px;
  height: 21px;
}

.help-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 180ms ease;
}

.help-topic[open] .help-chevron {
  transform: rotate(180deg);
}

.help-topic-body {
  padding: 2px 24px 23px 73px;
  border-top: 1px solid rgba(82, 69, 43, 0.1);
}

.help-topic-body ol {
  display: grid;
  gap: 9px;
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.62;
}

.help-topic-body strong {
  color: var(--ink);
}

.help-topic-body code {
  padding: 2px 5px;
  border-radius: 5px;
  color: #654c1d;
  background: rgba(217, 189, 114, 0.18);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.help-note,
.help-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 13px;
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.5;
}

.help-note {
  color: #37614f;
  background: rgba(221, 239, 228, 0.74);
}

.help-warning {
  color: #84501e;
  background: rgba(248, 229, 194, 0.76);
}

.help-note svg,
.help-warning svg {
  width: 17px;
  height: 17px;
}

.help-action {
  margin-top: 16px;
}

.help-safety-card {
  position: sticky;
  top: 24px;
  padding: 27px;
  border-color: rgba(217, 189, 114, 0.24);
  color: #fffaf0;
  background:
    radial-gradient(circle at 90% 0, rgba(217, 189, 114, 0.17), transparent 15rem),
    linear-gradient(145deg, rgba(35, 32, 24, 0.97), rgba(14, 13, 10, 0.98));
  box-shadow: 0 24px 58px rgba(40, 31, 17, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.help-safety-card .detail-kicker {
  color: var(--gold);
}

.help-safety-card h3 {
  margin: 10px 0 22px;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.12;
}

.help-safety-card ul {
  display: grid;
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.help-safety-card li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(255, 250, 240, 0.67);
  font-size: 11px;
}

.help-safety-card li svg {
  width: 16px;
  height: 16px;
  color: #75c89d;
}

.help-public-note {
  margin: 13px 0 0;
  color: rgba(255, 250, 240, 0.46);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.help-empty {
  display: grid;
  min-height: 230px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.help-empty[hidden] {
  display: none;
}

.help-empty svg {
  width: 32px;
  height: 32px;
  color: var(--copper);
}

.help-empty strong,
.help-empty span {
  display: block;
}

.help-empty strong {
  color: var(--ink);
}

.help-empty span {
  font-size: 11px;
}

.stepper {
  grid-template-columns: repeat(5, 1fr);
  border-color: rgba(82, 69, 43, 0.14);
  background: rgba(255, 253, 247, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(18px);
}

.stepper .is-complete {
  color: var(--success);
  font-weight: 700;
}

.stepper .is-complete span {
  border-color: var(--success);
  color: white;
  background: var(--success);
}

.stepper .is-current span {
  border-color: #9c7c38;
  color: #211b0f;
  background: var(--gold-bright);
  box-shadow: 0 0 0 5px rgba(217, 189, 114, 0.15);
}

.restore-simulation {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 15px;
  padding: 14px;
  border: 1px solid rgba(82, 69, 43, 0.13);
  border-radius: 13px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.48);
}

.simulation-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: var(--copper);
  background: var(--copper-soft);
}

.simulation-icon .ui-icon {
  width: 19px;
  height: 19px;
}

.restore-simulation strong,
.restore-simulation > div > span {
  display: block;
}

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

.restore-simulation > div > span {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.5;
}

.restore-simulation.is-running {
  border-color: rgba(150, 116, 49, 0.24);
}

.restore-simulation.is-running .simulation-icon {
  animation: progress-pulse 1.35s ease-in-out infinite;
}

.restore-simulation.is-complete {
  border-color: rgba(53, 116, 90, 0.22);
  color: #3e6756;
  background: rgba(221, 239, 228, 0.57);
}

.restore-simulation.is-complete .simulation-icon {
  color: white;
  background: var(--success);
}

.restore-simulation.impact-high {
  border-color: rgba(155, 94, 34, 0.28);
  background: rgba(248, 229, 194, 0.58);
}

.restore-simulation.impact-high .simulation-icon {
  background: var(--warning);
}

.restore-simulation.is-failed {
  border-color: rgba(155, 94, 34, 0.28);
  color: #84501e;
  background: rgba(248, 229, 194, 0.62);
}

.simulation-copy {
  min-width: 0;
}

.simulation-copy ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.simulation-copy li,
.simulation-copy p {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  font-size: 9px;
  line-height: 1.45;
}

.simulation-copy .ui-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.simulation-copy p {
  margin-top: 10px;
  color: #84501e;
}

.maintenance-planner {
  margin-top: 16px;
  padding: 27px;
}

.maintenance-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.maintenance-heading h2 {
  margin: 5px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
}

.maintenance-heading p:last-child {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.planning-badge {
  display: inline-flex;
  max-width: 280px;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(91, 78, 52, 0.08);
  font-size: 9px;
  font-weight: 750;
  text-align: center;
}

.planning-badge.impact-low,
.planning-badge.impact-medium {
  color: var(--success);
  background: var(--success-soft);
}

.planning-badge.impact-high {
  color: var(--warning);
  background: var(--warning-soft);
}

.maintenance-grid {
  display: grid;
  grid-template-columns: 1fr 0.65fr 1.25fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 22px;
}

.planner-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.planner-field > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.planner-field input,
.planner-field select {
  width: 100%;
  min-height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.72);
}

.planner-button {
  min-width: 190px;
}

.maintenance-assurance {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.maintenance-assurance svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--success);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.detail-actions {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.detail-actions .detail-action {
  margin-top: 0;
}

.snapshot-maintenance-modal {
  width: min(680px, calc(100vw - 40px));
  max-width: none;
  max-height: min(820px, calc(100dvh - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(203, 173, 104, 0.32);
  border-radius: 25px;
  color: var(--ink);
  background: rgba(247, 243, 234, 0.98);
  box-shadow: 0 34px 110px rgba(5, 9, 8, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(34px) saturate(135%);
  -webkit-backdrop-filter: blur(34px) saturate(135%);
}

.snapshot-maintenance-modal::backdrop {
  background: rgba(7, 10, 9, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.snapshot-maintenance-shell {
  display: grid;
  max-height: min(820px, calc(100dvh - 40px));
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.snapshot-maintenance-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(91, 78, 52, 0.12);
}

.snapshot-maintenance-header h2 {
  margin: 5px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 500;
}

.snapshot-maintenance-symbol {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(217, 189, 114, 0.28);
  border-radius: 15px;
  color: #f7dfa0;
  background: linear-gradient(145deg, #243f38, #102a25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 20px rgba(16, 42, 37, 0.18);
}

.snapshot-maintenance-symbol svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.snapshot-maintenance-body {
  min-height: 240px;
  padding: 24px;
  overflow-y: auto;
}

.snapshot-maintenance-loading,
.snapshot-maintenance-alert {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 17px;
  border: 1px solid rgba(194, 145, 54, 0.2);
  border-radius: 16px;
  color: #6f4b13;
  background: rgba(255, 246, 219, 0.72);
}

.snapshot-maintenance-loading {
  min-height: 170px;
  align-items: center;
  justify-content: center;
}

.snapshot-maintenance-alert.has-error {
  color: #812f2b;
  background: rgba(252, 226, 220, 0.8);
}

.snapshot-maintenance-alert.is-success {
  color: var(--success);
  background: var(--success-soft);
}

.snapshot-maintenance-alert .ui-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.snapshot-maintenance-loading strong,
.snapshot-maintenance-alert strong,
.snapshot-maintenance-loading p,
.snapshot-maintenance-alert p {
  display: block;
}

.snapshot-maintenance-loading strong,
.snapshot-maintenance-alert strong {
  color: var(--ink);
  font-size: 14px;
}

.snapshot-maintenance-loading p,
.snapshot-maintenance-alert p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.55;
}

.maintenance-spinner {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 3px solid rgba(23, 59, 53, 0.16);
  border-top-color: var(--success);
  border-radius: 50%;
  animation: snapshot-maintenance-spin 0.8s linear infinite;
}

@keyframes snapshot-maintenance-spin {
  to { transform: rotate(360deg); }
}

.snapshot-maintenance-checks,
.snapshot-maintenance-facts {
  display: grid;
  gap: 0;
  margin: 18px 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  list-style: none;
}

.snapshot-maintenance-checks li,
.snapshot-maintenance-facts li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.snapshot-maintenance-checks li:last-child,
.snapshot-maintenance-facts li:last-child {
  border-bottom: 0;
}

.snapshot-maintenance-checks .ui-icon {
  width: 16px;
  height: 16px;
  color: var(--success);
}

.snapshot-maintenance-facts li {
  justify-content: space-between;
}

.snapshot-confirmation-field {
  display: grid;
  gap: 8px;
  margin-top: 19px;
}

.snapshot-confirmation-field > span {
  color: var(--muted);
  font-size: 11px;
}

.snapshot-confirmation-field input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(157, 57, 52, 0.28);
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.84);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  text-transform: uppercase;
}

.snapshot-confirmation-field input:focus {
  outline: 3px solid rgba(182, 95, 62, 0.15);
  border-color: rgba(157, 57, 52, 0.48);
}

.snapshot-maintenance-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 24px;
  border-top: 1px solid rgba(91, 78, 52, 0.12);
  color: var(--muted);
  background: rgba(255, 253, 249, 0.68);
  font-size: 10px;
}

.snapshot-maintenance-footer > div {
  display: flex;
  gap: 8px;
}

.file-preview-modal {
  width: min(1180px, calc(100vw - 40px));
  height: min(860px, calc(100vh - 40px));
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(203, 173, 104, 0.3);
  border-radius: 24px;
  color: var(--ink);
  background: rgba(247, 243, 234, 0.97);
  box-shadow: 0 34px 110px rgba(5, 9, 8, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(34px) saturate(135%);
  -webkit-backdrop-filter: blur(34px) saturate(135%);
}

.file-preview-modal::backdrop {
  background: rgba(7, 10, 9, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.file-preview-shell {
  display: grid;
  height: 100%;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.file-preview-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(91, 78, 52, 0.12);
}

.file-preview-header h2 {
  margin: 5px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
}

.file-preview-path {
  display: block;
  max-width: min(820px, 72vw);
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(91, 78, 52, 0.16);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.66);
  font-size: 24px;
  line-height: 1;
}

.file-preview-meta {
  display: flex;
  min-height: 38px;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 7px 24px;
  border-bottom: 1px solid rgba(91, 78, 52, 0.1);
}

.file-preview-meta span {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--forest);
  background: rgba(225, 238, 229, 0.76);
  font-size: 9px;
  font-weight: 750;
}

.file-preview-content {
  min-height: 0;
  overflow: auto;
  background: rgba(255, 253, 249, 0.7);
  overscroll-behavior: contain;
}

.file-preview-loading,
.file-preview-error,
.file-preview-success {
  display: grid;
  min-height: 100%;
  place-content: center;
  justify-items: center;
  gap: 9px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.file-preview-loading strong,
.file-preview-error strong,
.file-preview-success strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
}

.file-preview-loading span,
.file-preview-error span,
.file-preview-success span {
  max-width: 480px;
  font-size: 11px;
  line-height: 1.55;
}

.file-preview-loading progress {
  width: min(360px, 70vw);
  height: 7px;
  margin-top: 8px;
  accent-color: var(--success);
}

.file-preview-error svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--warning);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.file-preview-success svg {
  width: 38px;
  height: 38px;
  fill: none;
  stroke: var(--success);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.diff-status-message {
  min-height: 100%;
}

.diff-preview {
  min-width: max-content;
  min-height: 100%;
  color: #dce8e1;
  background: #101714;
}

.diff-file-labels {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  min-width: 760px;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #9eb0a7;
  background: rgba(12, 18, 15, 0.97);
  font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  backdrop-filter: blur(12px);
}

.diff-file-labels strong:first-child {
  color: #e59689;
}

.diff-file-labels span:last-child strong {
  color: #80cda9;
}

.diff-lines {
  min-width: 760px;
  padding: 8px 0 18px;
}

.diff-line {
  display: grid;
  min-height: 20px;
  grid-template-columns: 46px 46px 24px minmax(640px, 1fr);
  font: 10.5px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.diff-line > span,
.diff-line > code {
  min-height: 20px;
  padding-top: 1px;
  padding-bottom: 1px;
}

.diff-old-line,
.diff-new-line {
  padding-right: 9px;
  border-right: 1px solid rgba(255, 255, 255, 0.055);
  color: #607168;
  background: rgba(6, 11, 8, 0.32);
  text-align: right;
  user-select: none;
}

.diff-marker {
  color: #6f8077;
  text-align: center;
  user-select: none;
}

.diff-line code {
  display: block;
  padding-right: 24px;
  padding-left: 6px;
  white-space: pre;
}

.diff-added {
  background: rgba(39, 116, 78, 0.24);
}

.diff-added .diff-marker {
  color: #80d5aa;
}

.diff-added .diff-new-line {
  color: #7fbd9e;
  background: rgba(32, 105, 69, 0.25);
}

.diff-removed {
  background: rgba(147, 58, 48, 0.24);
}

.diff-removed .diff-marker {
  color: #ee9b8d;
}

.diff-removed .diff-old-line {
  color: #c38379;
  background: rgba(125, 45, 38, 0.26);
}

.diff-hunk,
.diff-meta {
  margin: 7px 0;
  color: #90b8d8;
  background: rgba(59, 91, 116, 0.23);
}

.diff-hunk code,
.diff-meta code {
  grid-column: 2 / -1;
  padding-left: 8px;
}

.diff-hunk .diff-old-line,
.diff-hunk .diff-new-line,
.diff-hunk .diff-marker,
.diff-meta .diff-old-line,
.diff-meta .diff-new-line,
.diff-meta .diff-marker {
  display: none;
}

.diff-truncated {
  position: sticky;
  bottom: 0;
  padding: 10px 18px;
  color: #ead096;
  background: rgba(75, 57, 20, 0.96);
  font-size: 10px;
}

.file-preview-meta .diff-chip-added {
  color: #1c6647;
  background: rgba(188, 231, 207, 0.8);
}

.file-preview-meta .diff-chip-removed {
  color: #8b3d31;
  background: rgba(239, 201, 193, 0.82);
}

.source-preview {
  display: grid;
  min-width: max-content;
  min-height: 100%;
  grid-template-columns: auto minmax(720px, 1fr);
  color: #dce8e1;
  background: #101714;
}

.source-preview pre {
  min-height: 100%;
  margin: 0;
  padding-top: 20px;
  padding-bottom: 24px;
  font: 11px/1.72 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  tab-size: 2;
}

.source-line-numbers {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 54px;
  padding-right: 13px;
  padding-left: 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #64756d;
  background: #0c120f;
  text-align: right;
  user-select: none;
}

.source-code {
  padding-right: 28px;
  padding-left: 18px;
  white-space: pre;
}

.syntax-comment {
  color: #71857a;
  font-style: italic;
}

.syntax-string {
  color: #d8bd7f;
}

.syntax-property,
.syntax-section,
.syntax-tag {
  color: #75bfa6;
}

.syntax-keyword {
  color: #d98568;
  font-weight: 650;
}

.syntax-number,
.syntax-variable,
.syntax-entity {
  color: #8fb8dd;
}

.pdf-preview {
  width: 100%;
  height: 100%;
  min-height: 560px;
  border: 0;
  background: #525659;
}

.image-preview {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 26px;
  background:
    linear-gradient(45deg, rgba(91, 78, 52, 0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(91, 78, 52, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(91, 78, 52, 0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(91, 78, 52, 0.05) 75%),
    #f8f5ee;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.image-preview img {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(27, 34, 31, 0.18);
}

.file-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px 13px 24px;
  border-top: 1px solid rgba(91, 78, 52, 0.12);
  color: var(--muted);
  font-size: 9px;
}

@media (max-width: 1180px) {
  .help-shortcuts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .help-layout {
    grid-template-columns: 1fr;
  }

  .help-safety-card {
    position: static;
  }

  .maintenance-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .planner-button {
    min-width: 0;
  }
}

@media (max-width: 800px) {
  .sidebar {
    width: auto;
    border-top: 1px solid rgba(217, 189, 114, 0.2);
    border-right: 0;
    background: rgba(16, 15, 12, 0.92);
    backdrop-filter: blur(26px) saturate(130%);
  }

  .sidebar::before,
  .sidebar::after {
    display: none;
  }

  .primary-nav {
    grid-template-columns: repeat(6, 1fr);
  }

  .is-public-profile .primary-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .nav-item {
    min-height: 0;
  }

  .nav-icon {
    width: 20px;
    height: 20px;
  }

  .main-content {
    margin-left: 0;
  }

  .help-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 30px 27px;
  }

  .help-hero-mark {
    display: none;
  }

  .help-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .help-search-field {
    max-width: none;
  }

  .stepper {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 12px;
  }

  .stepper li {
    flex-direction: column;
    gap: 5px;
    font-size: 8px;
    text-align: center;
  }

  .stepper li::after {
    display: none;
  }

  .maintenance-heading {
    flex-direction: column;
  }

  .maintenance-grid {
    grid-template-columns: 1fr;
  }

  .planning-badge {
    max-width: none;
  }
}

@media (max-width: 540px) {
  .snapshot-calendar-trigger {
    min-height: 46px;
    grid-template-columns: 16px minmax(0, 1fr) 10px 12px;
    gap: 8px;
    padding: 0 11px;
  }

  .snapshot-calendar-trigger-label {
    font-size: 12px;
  }

  .snapshot-calendar-popover {
    padding: 12px;
    border-radius: 16px;
  }

  .snapshot-calendar-empty,
  .snapshot-calendar-day {
    min-height: 45px;
  }

  .snapshot-calendar-grid {
    gap: 2px;
  }

  .help-shortcuts {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .help-shortcuts button {
    min-width: 150px;
    scroll-snap-align: start;
  }

  .help-topic summary {
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    gap: 10px;
    padding: 13px;
  }

  .help-topic-icon {
    width: 38px;
    height: 38px;
  }

  .help-topic-body {
    padding: 2px 16px 20px 18px;
  }

  .help-hero h2 {
    font-size: 34px;
  }

  .simulation-copy ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .file-preview-modal {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .file-preview-header {
    padding: 16px 17px 13px;
  }

  .file-preview-header h2 {
    font-size: 21px;
  }

  .file-preview-path {
    max-width: calc(100vw - 86px);
  }

  .file-preview-meta {
    padding-right: 17px;
    padding-left: 17px;
  }

  .source-preview {
    grid-template-columns: auto minmax(620px, 1fr);
  }

  .file-preview-footer {
    padding: 10px 13px;
  }

  .file-preview-footer > span {
    display: none;
  }

  .file-preview-footer .button {
    width: 100%;
  }

  .pdf-preview {
    min-height: 100%;
  }
}

.app-version-button {
  display: grid;
  min-height: 44px;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 9px;
  padding: 5px 6px 5px 13px;
  border: 1px solid rgba(84, 69, 42, 0.14);
  border-radius: 15px;
  color: var(--forest);
  background: linear-gradient(135deg, rgba(255, 253, 249, 0.84), rgba(247, 241, 228, 0.72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 6px 18px rgba(45, 37, 24, 0.06);
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.app-version-button:hover {
  transform: translateY(-1px);
  border-color: rgba(182, 95, 62, 0.32);
  box-shadow: 0 8px 24px rgba(23, 59, 53, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.app-version-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.app-version-copy small {
  color: var(--muted);
  font-size: 8px;
  font-variant-caps: all-small-caps;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1;
}

#app-version-label {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.025em;
  line-height: 1.08;
}

.app-version-symbol {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(166, 118, 31, 0.2);
  border-radius: 10px;
  color: var(--copper);
  background: rgba(255, 255, 255, 0.52);
}

.app-version-symbol svg {
  width: 14px;
  height: 14px;
}

.app-version-button.has-update {
  border-color: rgba(47, 123, 98, 0.34);
  background: var(--success-soft);
  box-shadow: 0 0 0 4px rgba(47, 123, 98, 0.08);
}

.app-update-banner {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  display: grid;
  width: min(520px, calc(100vw - 48px));
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid rgba(217, 189, 114, 0.3);
  border-radius: 19px;
  color: #fffdf8;
  background: linear-gradient(135deg, rgba(19, 51, 45, 0.97), rgba(11, 31, 28, 0.97));
  box-shadow: 0 24px 68px rgba(5, 14, 12, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(28px) saturate(130%);
  -webkit-backdrop-filter: blur(28px) saturate(130%);
}

.app-update-banner[hidden] {
  display: none !important;
}

.app-update-symbol {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(240, 217, 146, 0.26);
  border-radius: 14px;
  color: var(--gold-bright);
  background: rgba(217, 189, 114, 0.1);
  font-size: 24px;
  animation: update-symbol-pulse 1.8s ease-in-out infinite;
}

.app-update-copy,
.app-update-copy strong,
.app-update-copy span {
  display: block;
  min-width: 0;
}

.app-update-copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 500;
}

.app-update-copy span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 9px;
  line-height: 1.45;
}

.app-update-copy progress {
  width: 100%;
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
}

.app-update-copy progress::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.app-update-copy progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), #f0d992);
  transition: width 180ms ease;
}

.app-update-banner .button {
  min-height: 36px;
  white-space: nowrap;
}

.app-update-dismiss {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.08);
  font-size: 19px;
}

@keyframes update-symbol-pulse {
  50% { transform: rotate(20deg); background: rgba(217, 189, 114, 0.16); }
}

.app-info-modal {
  width: min(880px, calc(100vw - 40px));
  max-width: none;
  max-height: min(900px, calc(100dvh - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(203, 173, 104, 0.32);
  border-radius: 26px;
  color: var(--ink);
  background: rgba(247, 243, 234, 0.97);
  box-shadow: 0 34px 110px rgba(5, 9, 8, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(34px) saturate(135%);
  -webkit-backdrop-filter: blur(34px) saturate(135%);
}

.app-info-modal::backdrop {
  background: rgba(7, 10, 9, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.app-info-shell {
  max-height: min(900px, calc(100dvh - 40px));
  overflow-y: auto;
}

.app-info-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 17px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(91, 78, 52, 0.12);
  background: rgba(247, 243, 234, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.app-info-header img {
  width: 184px;
  height: 92px;
  padding: 12px 16px;
  object-fit: contain;
  border-radius: 20px;
  background: var(--forest-deep);
  box-shadow: 0 12px 30px rgba(14, 41, 37, 0.18);
}

.app-info-header h2,
.app-info-intro h3,
.app-info-sections h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.app-info-header h2 {
  margin: 3px 0 4px;
  font-size: 26px;
}

.app-info-header p,
.app-info-header time {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.app-info-header p strong {
  color: var(--forest);
}

.app-info-close {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(91, 78, 52, 0.16);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  font-size: 24px;
}

.app-info-intro {
  margin: 24px;
  padding: 24px;
  border: 1px solid rgba(217, 189, 114, 0.24);
  border-radius: 20px;
  color: white;
  background:
    radial-gradient(circle at 90% 10%, rgba(217, 189, 114, 0.28), transparent 16rem),
    linear-gradient(135deg, var(--forest), var(--forest-deep));
}

.app-info-intro .detail-kicker {
  color: var(--gold-bright);
}

.app-info-intro h3 {
  margin: 8px 0 7px;
  font-size: 27px;
}

.app-info-intro p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.65;
}

.app-info-sections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 0 24px 24px;
}

.app-info-sections > section {
  padding: 28px;
  border: 1px solid rgba(91, 78, 52, 0.13);
  border-radius: 19px;
  background: rgba(255, 253, 249, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.app-info-sections h3 {
  margin: 6px 0 20px;
  font-size: 25px;
}

.app-info-sections ul {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-info-sections li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.app-info-sections li .ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--success);
}

.app-info-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 24px;
  border-top: 1px solid rgba(91, 78, 52, 0.12);
  color: var(--muted);
  background: rgba(255, 253, 249, 0.6);
  font-size: 11px;
}

@media (max-width: 800px) {
  .app-update-banner {
    right: 14px;
    bottom: 86px;
    width: calc(100vw - 28px);
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .app-update-symbol {
    width: 38px;
    height: 38px;
  }

  .app-update-banner .button {
    grid-column: 2 / -1;
    width: 100%;
  }

  .app-update-dismiss {
    grid-column: 3;
    grid-row: 1;
  }

  .app-info-modal {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 22px;
  }

  .app-info-shell {
    max-height: calc(100dvh - 24px);
  }
}

@media (max-width: 540px) {
  .topbar-actions {
    gap: 7px;
  }

  .app-version-button {
    min-height: 36px;
    grid-template-columns: minmax(0, 1fr) 26px;
    gap: 7px;
    padding: 4px 5px 4px 10px;
  }

  .app-version-copy small {
    display: none;
  }

  .app-version-symbol {
    width: 26px;
    height: 26px;
  }

  .app-info-header {
    grid-template-columns: minmax(0, 1fr) 36px;
    gap: 12px;
    padding: 15px;
  }

  .app-info-header img {
    grid-row: 1;
    grid-column: 1;
    width: 154px;
    height: 77px;
    padding: 10px 13px;
    border-radius: 17px;
  }

  .app-info-header > div {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .app-info-close {
    grid-row: 1;
    grid-column: 2;
  }

  .app-info-header h2 {
    font-size: 20px;
  }

  .app-info-close {
    width: 36px;
    height: 36px;
  }

  .app-info-intro {
    margin: 15px;
    padding: 20px;
  }

  .app-info-intro h3 {
    font-size: 23px;
  }

  .history-maintenance-actions {
    grid-template-columns: 1fr;
  }

  .snapshot-maintenance-modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 21px;
  }

  .snapshot-maintenance-shell {
    max-height: calc(100dvh - 20px);
  }

  .snapshot-maintenance-header,
  .snapshot-maintenance-body {
    padding-right: 16px;
    padding-left: 16px;
  }

  .snapshot-maintenance-header h2 {
    font-size: 21px;
  }

  .snapshot-maintenance-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 13px 16px;
  }

  .snapshot-maintenance-footer > div,
  .snapshot-maintenance-footer .button {
    width: 100%;
  }

  .snapshot-maintenance-footer > div {
    flex-direction: column-reverse;
  }

  .app-info-sections {
    padding: 0 15px 15px;
  }

  .app-info-sections > section {
    padding: 21px;
  }

  .app-info-sections li {
    font-size: 13px;
  }

  .app-info-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 13px 15px;
  }
}

/* Accesso amministrativo: gate indipendente dalla console operativa. */
.auth-gate {
  position: relative;
  z-index: 1000;
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(340px, 0.9fr) minmax(520px, 1.1fr);
  overflow: hidden;
  color: #f9f5e9;
  background:
    radial-gradient(circle at 8% 8%, rgba(221, 185, 101, 0.16), transparent 25rem),
    radial-gradient(circle at 88% 85%, rgba(76, 150, 125, 0.2), transparent 30rem),
    #0b211d;
}

body.auth-ready .auth-gate {
  display: none;
}

body:not(.auth-ready) {
  overflow: hidden;
}

body:not(.auth-ready) .app-shell,
body:not(.auth-ready) .app-update-banner {
  visibility: hidden;
}

.auth-atmosphere,
.auth-atmosphere span {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-atmosphere span {
  width: 260px;
  height: 260px;
  border: 1px solid rgba(222, 188, 103, 0.12);
  border-radius: 44% 56% 63% 37% / 55% 36% 64% 45%;
  filter: blur(0.1px);
}

.auth-atmosphere span:nth-child(1) {
  top: -110px;
  left: 30%;
  transform: rotate(24deg);
}

.auth-atmosphere span:nth-child(2) {
  inset: auto auto -120px -80px;
  width: 360px;
  height: 360px;
  border-color: rgba(116, 185, 159, 0.11);
  transform: rotate(-18deg);
}

.auth-atmosphere span:nth-child(3) {
  inset: 24% -150px auto auto;
  width: 310px;
  height: 310px;
  transform: rotate(42deg);
}

.auth-brand-panel,
.auth-card-wrap {
  position: relative;
  z-index: 1;
}

.auth-brand-panel {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  padding: clamp(38px, 6vw, 82px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.035), transparent 55%);
}

.auth-brand-panel > img {
  width: min(300px, 80%);
  height: auto;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.18));
}

.auth-brand-copy {
  max-width: 560px;
  margin: auto 0;
  padding: 48px 0;
}

.auth-brand-copy .eyebrow,
.auth-card .eyebrow,
.step-up-shell .eyebrow {
  color: #d9b96b;
}

.auth-brand-copy h1 {
  max-width: 520px;
  margin: 14px 0 22px;
  font-family: Georgia, serif;
  font-size: clamp(40px, 5vw, 72px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.auth-brand-copy > p:last-child {
  max-width: 520px;
  margin: 0;
  color: rgba(248, 244, 233, 0.66);
  font-size: clamp(15px, 1.35vw, 19px);
  line-height: 1.7;
}

.auth-trust-list {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 12px;
  list-style: none;
}

.auth-trust-list li {
  display: flex;
  align-items: center;
  gap: 11px;
  color: rgba(248, 244, 233, 0.76);
  font-size: 12px;
}

.auth-trust-list svg,
.auth-privacy-note svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: #6eb597;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.auth-preview-label {
  width: fit-content;
  margin-top: 26px;
  padding: 7px 11px;
  border: 1px solid rgba(222, 188, 103, 0.2);
  border-radius: 999px;
  color: rgba(248, 244, 233, 0.58);
  background: rgba(222, 188, 103, 0.07);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.auth-card-wrap {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: clamp(24px, 5vw, 72px);
  overflow-y: auto;
  background: rgba(245, 240, 230, 0.055);
  backdrop-filter: blur(22px);
}

.auth-card {
  position: relative;
  width: min(100%, 610px);
  padding: clamp(30px, 4vw, 54px);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 34px;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.93), rgba(247, 242, 232, 0.87)),
    var(--paper);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.3), inset 0 1px rgba(255, 255, 255, 0.9);
}

.auth-card-mark {
  position: absolute;
  top: -25px;
  right: 32px;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 1px solid rgba(222, 188, 103, 0.4);
  border-radius: 19px;
  color: #e0c176;
  background: #14352d;
  box-shadow: 0 16px 30px rgba(10, 35, 29, 0.22);
  transform: rotate(5deg);
}

.auth-card-mark svg,
.auth-factory-note svg,
.step-up-symbol svg,
.account-security-list svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.auth-panel {
  display: none;
}

.auth-panel.is-visible {
  display: block;
  animation: auth-panel-enter 240ms ease both;
}

@keyframes auth-panel-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-panel h2,
.step-up-shell h2 {
  margin: 7px 0 11px;
  font-family: Georgia, serif;
  font-size: clamp(30px, 4vw, 43px);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.auth-panel > p:not(.eyebrow),
.step-up-shell > p:not(.eyebrow) {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.auth-field {
  display: grid;
  margin-top: 15px;
  gap: 7px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.auth-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid rgba(91, 78, 52, 0.19);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 254, 250, 0.84);
  box-shadow: inset 0 1px 2px rgba(20, 35, 32, 0.025);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.auth-field input:focus {
  border-color: rgba(47, 123, 98, 0.58);
  outline: 0;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 123, 98, 0.1);
}

.auth-field small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
}

.auth-code-field input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.26em;
  text-align: center;
}

.auth-factory-note {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 4px;
  padding: 14px 16px;
  border: 1px solid rgba(173, 107, 34, 0.17);
  border-radius: 15px;
  color: #76581f;
  background: rgba(251, 239, 218, 0.72);
  font-size: 11px;
  line-height: 1.5;
}

.auth-submit {
  min-height: 52px;
  margin-top: 22px;
  justify-content: center;
}

.auth-message {
  margin-top: 15px;
  padding: 11px 13px;
  border: 1px solid rgba(174, 79, 64, 0.2);
  border-radius: 12px;
  color: #8d3e34;
  background: rgba(248, 229, 224, 0.78);
  font-size: 11px;
  line-height: 1.45;
}

.auth-text-action {
  display: block;
  margin: 14px auto 0;
  padding: 4px;
  border: 0;
  color: var(--success);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.auth-loading {
  display: flex;
  margin-top: 30px;
  gap: 7px;
}

.auth-loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: auth-pulse 1s ease-in-out infinite alternate;
}

.auth-loading span:nth-child(2) { animation-delay: 160ms; }
.auth-loading span:nth-child(3) { animation-delay: 320ms; }

@keyframes auth-pulse {
  from { opacity: 0.28; transform: translateY(0); }
  to { opacity: 1; transform: translateY(-5px); }
}

.auth-qr-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
  margin: 22px 0;
  padding: 18px;
  border: 1px solid rgba(47, 123, 98, 0.14);
  border-radius: 22px;
  background: rgba(223, 238, 231, 0.56);
}

.auth-qr {
  display: grid;
  min-height: 190px;
  place-items: center;
  padding: 10px;
  border-radius: 17px;
  background: #fffdf9;
  box-shadow: 0 12px 28px rgba(20, 53, 45, 0.08);
}

.auth-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.auth-qr-help {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.auth-qr-help strong {
  color: var(--ink);
  font-size: 12px;
}

.auth-qr-help code {
  overflow-wrap: anywhere;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.recovery-code-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 20px 0 14px;
}

.recovery-code-list code {
  padding: 10px;
  border: 1px solid rgba(91, 78, 52, 0.11);
  border-radius: 10px;
  color: var(--forest);
  background: rgba(255, 255, 255, 0.72);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}

.auth-confirmation-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.auth-confirmation-check input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--success);
}

.auth-privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 18px 0 0 !important;
  color: var(--muted);
  font-size: 10px !important;
}

.auth-footer {
  margin: 16px 0 0;
  color: rgba(248, 244, 233, 0.45);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.account-modal,
.step-up-modal {
  width: min(92vw, 580px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 26px;
  color: var(--ink);
  background: rgba(249, 246, 239, 0.97);
  box-shadow: 0 34px 90px rgba(15, 30, 26, 0.34);
}

.account-modal::backdrop,
.step-up-modal::backdrop {
  background: rgba(8, 22, 19, 0.64);
  backdrop-filter: blur(9px);
}

.account-modal-shell > header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 14px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.account-modal-shell h2 {
  margin: 3px 0;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 500;
}

.account-modal-shell header span,
.account-modal-shell footer > span {
  color: var(--muted);
  font-size: 11px;
}

.account-modal-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: var(--forest);
  font-family: Georgia, serif;
  font-size: 17px;
}

.account-security-list {
  display: grid;
  padding: 10px 24px;
}

.account-security-list > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.account-security-list > div:last-child {
  border-bottom: 0;
}

.account-security-list svg {
  color: var(--success);
}

.account-security-list span,
.account-security-list strong,
.account-security-list small {
  display: block;
}

.account-security-list strong {
  font-size: 12px;
}

.account-security-list small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.account-security-list b {
  color: var(--success);
  font-size: 10px;
}

.account-modal-shell footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
}

.step-up-shell {
  display: block;
  padding: 34px;
}

.step-up-symbol {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  place-items: center;
  border-radius: 18px;
  color: #e0c176;
  background: var(--forest);
}

.step-up-actions {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 10px;
  margin-top: 22px;
}

.guide-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  align-items: center;
  min-height: 220px;
  padding: 40px 44px;
  overflow: hidden;
  color: #f8f1df;
  background:
    radial-gradient(circle at 88% 30%, rgba(232, 197, 112, 0.3), transparent 14rem),
    linear-gradient(135deg, #173c35, #102e29 72%);
}

.guide-hero h2 {
  margin: 8px 0 12px;
  font-family: Georgia, serif;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 500;
}

.guide-hero p:last-child {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 17px;
  line-height: 1.65;
}

.guide-hero-mark {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  justify-self: end;
  border: 1px solid rgba(240, 217, 146, 0.32);
  border-radius: 34px;
  color: var(--gold-bright);
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(6deg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 24px 55px rgba(0, 0, 0, 0.18);
}

.guide-hero-mark svg {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.7fr);
  align-items: start;
  gap: 24px;
  margin-top: 24px;
}

.guide-layout.has-operational-result {
  grid-template-columns: minmax(0, 1fr);
}

.guide-layout.has-operational-result .guide-summary {
  display: none;
}

.guide-workspace,
.guide-summary {
  padding: 30px;
}

.guide-workspace {
  min-height: 560px;
}

.guide-summary {
  position: sticky;
  top: 24px;
}

.guide-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(73, 60, 35, 0.12);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.guide-progress-row progress {
  width: min(250px, 45%);
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: rgba(21, 59, 51, 0.11);
  appearance: none;
}

.guide-progress-row progress::-webkit-progress-bar {
  border-radius: 999px;
  background: rgba(21, 59, 51, 0.11);
}

.guide-progress-row progress::-webkit-progress-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--forest), var(--gold));
}

.guide-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  margin: 14px 0 24px;
  color: var(--muted);
}

.guide-breadcrumb button {
  padding: 5px 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}

.guide-breadcrumb button:hover,
.guide-breadcrumb button[aria-current="step"] {
  color: var(--forest);
  text-decoration-color: currentColor;
}

.guide-question-heading {
  max-width: 760px;
  margin-bottom: 25px;
}

.guide-question-heading h3,
.guide-result-heading h3 {
  margin: 7px 0 10px;
  font-family: Georgia, serif;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 500;
  line-height: 1.12;
}

.guide-question-heading > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

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

.guide-option {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 14px;
  min-height: 102px;
  padding: 17px;
  border: 1px solid rgba(73, 60, 35, 0.14);
  border-radius: 19px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.48);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.guide-option:hover {
  border-color: rgba(139, 108, 46, 0.42);
  background: rgba(255, 255, 255, 0.78);
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(54, 43, 23, 0.1);
}

.guide-option.is-urgent {
  border-color: rgba(169, 79, 62, 0.28);
  background: rgba(255, 239, 232, 0.64);
}

.guide-option-icon,
.guide-result-heading > span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  color: var(--forest);
  background: rgba(52, 119, 96, 0.11);
}

.guide-option.is-urgent .guide-option-icon {
  color: #8e493c;
  background: rgba(169, 79, 62, 0.11);
}

.guide-option svg,
.guide-result-heading svg,
.guide-answer-grid svg,
.guide-safety-note svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.guide-option > svg {
  width: 17px;
  height: 17px;
  color: var(--gold-dark);
}

.guide-option-title,
.guide-option small {
  display: block;
}

.guide-option-title {
  margin-bottom: 5px;
  font-size: 17px;
  font-variant-caps: all-small-caps;
  font-weight: 600;
  letter-spacing: 0.055em;
}

.guide-option small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.guide-result-heading {
  display: flex;
  align-items: center;
  gap: 17px;
}

.guide-result-heading h3 {
  margin-bottom: 0;
}

.guide-result-summary {
  margin: 24px 0;
  padding: 20px 22px;
  border-radius: 18px;
  color: #215d4c;
  background: rgba(73, 154, 124, 0.11);
  font-size: 16px;
  line-height: 1.6;
}

.guide-resource-details {
  margin: 0 0 22px;
  padding: 22px;
  border: 1px solid rgba(73, 60, 35, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.46);
}

.guide-resource-details dl {
  display: grid;
  gap: 0;
  margin: 15px 0 18px;
}

.guide-resource-details dl > div {
  display: grid;
  grid-template-columns: minmax(120px, 0.34fr) minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(73, 60, 35, 0.09);
}

.guide-resource-details dt {
  color: var(--ink);
  font-weight: 750;
}

.guide-resource-details dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.guide-resource-location,
.guide-resource-attention {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  border-radius: 16px;
}

.guide-resource-location {
  color: #245e50;
  background: rgba(73, 154, 124, 0.1);
}

.guide-resource-attention {
  margin-top: 10px;
  color: #7b4c28;
  background: rgba(193, 134, 68, 0.11);
}

.guide-resource-location svg,
.guide-resource-attention svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.guide-resource-label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-variant-caps: all-small-caps;
  font-weight: 600;
  letter-spacing: 0.07em;
}

.guide-resource-location p,
.guide-resource-attention p {
  margin: 0;
  line-height: 1.5;
}

.guide-operational-result {
  margin-top: 22px;
}

.guide-operational-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.guide-operational-heading h4 {
  margin: 5px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 500;
}

.guide-operational-counter {
  min-width: 58px;
  padding: 8px 12px;
  border: 1px solid rgba(156, 117, 45, 0.2);
  border-radius: 999px;
  color: var(--gold-dark);
  background: rgba(217, 189, 114, 0.12);
  text-align: center;
  font-weight: 600;
}

.guide-operational-counter.is-complete {
  border-color: rgba(52, 119, 96, 0.2);
  color: #24614f;
  background: rgba(73, 154, 124, 0.11);
}

.guide-operational-counter.has-error {
  border-color: rgba(151, 63, 52, 0.24);
  color: #8a3e35;
  background: rgba(176, 75, 61, 0.1);
}

.guide-operational-counter.has-warning {
  border-color: rgba(176, 119, 35, 0.25);
  color: #825817;
  background: rgba(222, 166, 67, 0.13);
}

.guide-operation-list {
  display: grid;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(73, 60, 35, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.46);
  list-style: none;
}

.guide-operation-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  min-height: 82px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(73, 60, 35, 0.09);
}

.guide-operation-row:last-child {
  border-bottom: 0;
}

.guide-operation-state {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-top: 2px;
  border-radius: 50%;
  color: var(--gold-dark);
  background: rgba(217, 189, 114, 0.12);
}

.guide-operation-state svg,
.guide-operational-outcome svg,
.guide-refresh-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.guide-operation-row.is-complete .guide-operation-state {
  color: #27705a;
  background: rgba(73, 154, 124, 0.12);
}

.guide-operation-row.is-error .guide-operation-state {
  color: #98483e;
  background: rgba(176, 75, 61, 0.11);
}

.guide-operation-row.is-warning .guide-operation-state {
  color: #8b5b12;
  background: rgba(222, 166, 67, 0.15);
}

.guide-operation-label {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 14px;
  font-variant-caps: all-small-caps;
  font-weight: 600;
  letter-spacing: 0.075em;
}

.guide-operation-value {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}

.guide-operation-row.is-error .guide-operation-value {
  color: #843d34;
}

.guide-operation-row.is-warning .guide-operation-value {
  color: #76501a;
}

.guide-operation-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.guide-metric-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.guide-metric-chart {
  --chart-line: #a6761f;
  --chart-fill: rgba(190, 143, 50, 0.2);
  min-width: 0;
  margin: 0;
  padding: 13px 14px 10px;
  border: 1px solid rgba(62, 53, 36, 0.13);
  border-radius: 14px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(20, 23, 20, 0.96), rgba(29, 31, 27, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 12px 28px rgba(38, 31, 20, 0.1);
}

.guide-metric-chart.is-green {
  --chart-line: #63ba91;
  --chart-fill: rgba(67, 151, 112, 0.22);
}

.guide-metric-chart.is-copper {
  --chart-line: #d08a5c;
  --chart-fill: rgba(191, 112, 65, 0.21);
}

.guide-metric-chart figcaption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255, 251, 240, 0.62);
  font-size: 13px;
  font-variant-caps: all-small-caps;
  font-weight: 600;
  letter-spacing: 0.075em;
}

.guide-chart-heading {
  display: grid;
  gap: 3px;
}

.guide-metric-chart .guide-chart-heading small {
  color: rgba(255, 251, 240, 0.55);
  font-size: 10px;
  font-variant-caps: normal;
  font-weight: 400;
  letter-spacing: 0;
}

.guide-metric-current {
  color: #fffaf0;
  font-size: 16px;
  font-variant-caps: normal;
  font-weight: 500;
  letter-spacing: 0;
}

.guide-metric-chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.guide-chart-plot {
  position: relative;
  margin-top: 6px;
}

.guide-chart-plot svg {
  outline: none;
  touch-action: pan-y;
}

.guide-chart-plot svg:focus-visible {
  border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(229, 196, 111, 0.34);
}

.guide-metric-chart .chart-grid {
  stroke: rgba(255, 255, 255, 0.09);
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
}

.guide-metric-chart .chart-average {
  stroke: rgba(255, 249, 227, 0.48);
  stroke-width: 0.5;
  stroke-dasharray: 5 5;
  vector-effect: non-scaling-stroke;
}

.guide-metric-chart .chart-threshold {
  stroke: rgba(173, 69, 52, 0.78);
  stroke-width: 0.55;
  stroke-dasharray: 5 5;
  vector-effect: non-scaling-stroke;
}

.guide-metric-chart .chart-area {
  fill: var(--chart-fill);
  opacity: 0.5;
  stroke: none;
}

.guide-metric-chart .chart-line {
  fill: none;
  stroke: var(--chart-line);
  stroke-width: 1.125;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.guide-metric-chart .chart-point {
  fill: var(--chart-line);
  stroke: #fff9e9;
  stroke-width: 0.45;
  vector-effect: non-scaling-stroke;
}

.guide-metric-chart .chart-live-marker line {
  stroke: rgba(255, 251, 240, 0.34);
  stroke-width: 0.55;
  stroke-dasharray: 2 3;
  vector-effect: non-scaling-stroke;
}

.guide-metric-chart .chart-live-marker circle {
  fill: #fff9e9;
  stroke: var(--chart-line);
  stroke-width: 1.3;
  vector-effect: non-scaling-stroke;
}

.guide-chart-empty {
  margin: 12px 0;
  color: rgba(255, 251, 240, 0.57);
  font-size: 11px;
}

.guide-metric-chart .chart-crosshair {
  pointer-events: none;
  stroke: rgba(255, 251, 240, 0.46);
  stroke-width: 0.55;
  stroke-dasharray: 2.5 3.5;
  vector-effect: non-scaling-stroke;
}

.guide-metric-chart .chart-selected-point {
  pointer-events: none;
  fill: #151815;
  stroke: var(--chart-line);
  stroke-width: 1.15;
  vector-effect: non-scaling-stroke;
}

.guide-chart-tooltip {
  position: absolute;
  z-index: 2;
  display: grid;
  min-width: 132px;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 250, 235, 0.18);
  border-radius: 8px;
  color: rgba(255, 251, 240, 0.68);
  background: rgba(9, 12, 10, 0.94);
  box-shadow: 0 9px 24px rgba(0, 0, 0, 0.26);
  font-size: 9px;
  line-height: 1.3;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 9px));
  white-space: nowrap;
}

.guide-chart-tooltip.aligns-left {
  transform: translate(calc(-100% - 8px), calc(-100% - 8px));
}

.guide-chart-tooltip.aligns-right {
  transform: translate(8px, calc(-100% - 8px));
}

.guide-chart-tooltip-value {
  color: #fffaf0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.guide-metric-chart text {
  fill: rgba(255, 251, 240, 0.42);
  font-size: 10px;
}

.guide-metric-chart small {
  display: block;
  margin-top: 2px;
  color: rgba(255, 251, 240, 0.5);
  font-size: 10px;
}

.guide-operation-spinner {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: guide-spinner 720ms linear infinite;
}

@keyframes guide-spinner {
  to { transform: rotate(360deg); }
}

.guide-operational-outcome {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 14px 0;
  padding: 17px 18px;
  border: 1px solid rgba(52, 119, 96, 0.16);
  border-radius: 18px;
  color: #24614f;
  background: rgba(73, 154, 124, 0.1);
}

.guide-operational-outcome.has-error {
  border-color: rgba(151, 63, 52, 0.2);
  color: #843d34;
  background: rgba(176, 75, 61, 0.09);
}

.guide-operational-outcome > svg,
.guide-operational-outcome > .guide-operation-spinner {
  flex: 0 0 auto;
  margin-top: 2px;
}

.guide-operational-outcome strong,
.guide-operational-outcome span {
  display: block;
}

.guide-operational-outcome span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.guide-refresh-button {
  min-width: 190px;
}

.guide-operational-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.guide-refresh-button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.guide-operational-verdict {
  margin-top: 16px;
}

.guide-operational-verdict li.is-error,
.guide-operational-verdict section.has-error,
.guide-operational-verdict .guide-result-safety.has-error {
  color: #843d34;
}

.guide-operational-verdict li.is-warning {
  color: #76501a;
}

.guide-operational-verdict li.is-warning svg {
  color: #9a6515;
}

.guide-operational-verdict li.is-error svg {
  color: #98483e;
}

.guide-operational-verdict li.is-loading .guide-operation-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  color: var(--gold-dark);
}

.guide-verdict-summary {
  min-height: 72px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
}

.guide-assurance-label {
  color: currentColor;
  font-size: 1.08em;
  font-variant-caps: all-small-caps;
  font-weight: 600;
  letter-spacing: 0.055em;
}

.guide-operational-verdict section.has-error .guide-verdict-summary {
  color: #843d34;
}

.guide-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.guide-answer-grid section {
  padding: 20px;
  border: 1px solid rgba(73, 60, 35, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.38);
}

.guide-answer-grid ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.guide-answer-grid li,
.guide-result-safety,
.guide-safety-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.guide-answer-grid li svg,
.guide-result-safety svg {
  width: 17px;
  height: 17px;
  color: var(--success);
  flex: 0 0 auto;
}

.guide-answer-grid p {
  margin: 14px 0;
  line-height: 1.6;
}

.guide-result-safety {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.guide-navigation {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

.guide-navigation .button[hidden] {
  display: none;
}

.guide-reset-button {
  border-color: rgba(151, 63, 52, 0.28);
  color: #8f392f;
  background: rgba(255, 248, 245, 0.62);
}

.guide-reset-button:hover {
  border-color: rgba(151, 63, 52, 0.48);
  color: #7b342c;
  background: rgba(255, 239, 234, 0.82);
}

.guide-summary h3 {
  margin: 8px 0 18px;
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 500;
}

.guide-summary ol {
  display: grid;
  gap: 9px;
  margin: 0 0 25px;
  padding: 0 0 0 21px;
  color: var(--muted);
  line-height: 1.45;
}

.guide-safety-note {
  padding: 18px;
  border-radius: 17px;
  color: #215d4c;
  background: rgba(73, 154, 124, 0.1);
  font-size: 13px;
  line-height: 1.5;
}

.guide-safety-note svg {
  flex: 0 0 auto;
}

@media (max-width: 1050px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .guide-summary {
    position: static;
  }
}

@media (max-width: 720px) {
  .guide-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 30px 25px;
  }

  .guide-hero-mark {
    display: none;
  }

  .guide-workspace,
  .guide-summary {
    padding: 22px 18px;
  }

  .guide-progress-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .guide-progress-row progress {
    width: 100%;
  }

  .guide-options,
  .guide-answer-grid {
    grid-template-columns: 1fr;
  }

  .guide-option {
    min-height: 92px;
  }

  .guide-resource-details {
    padding: 18px 16px;
  }

  .guide-resource-details dl > div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .guide-operational-heading {
    align-items: flex-start;
  }

  .guide-operation-row {
    min-height: 92px;
    padding: 15px 14px;
  }

  .guide-refresh-button {
    width: 100%;
  }

  .guide-operational-actions .button {
    width: 100%;
  }

  .guide-navigation .button {
    flex: 1 1 0;
  }
}

@media (max-width: 900px) {
  .auth-gate {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-card-wrap {
    padding: 46px 18px;
  }
}

@media (max-width: 540px) {
  .auth-card-wrap {
    display: block;
    padding: 28px 12px 34px;
  }

  .auth-card {
    padding: 30px 18px 22px;
    border-radius: 24px;
  }

  .auth-card-mark {
    top: -17px;
    right: 20px;
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .auth-panel h2,
  .step-up-shell h2 {
    font-size: 30px;
  }

  .auth-qr-layout {
    grid-template-columns: 1fr;
  }

  .auth-qr {
    width: min(100%, 230px);
    margin: 0 auto;
  }

  .recovery-code-list {
    grid-template-columns: 1fr;
  }

  .account-modal-shell > header {
    grid-template-columns: 48px minmax(0, 1fr) 36px;
    padding: 18px;
  }

  .account-modal-shell footer {
    align-items: stretch;
    flex-direction: column;
    padding: 16px 18px;
  }

  .account-security-list {
    padding: 8px 18px;
  }

  .step-up-shell {
    padding: 26px 18px;
  }

  .step-up-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-update-symbol {
    animation: none;
  }

  .auth-panel.is-visible,
  .auth-loading span {
    animation: none;
  }
}
