.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot__card {
  width: min(520px, 100%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.boot__title {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: 0.2px;
}

.boot__subtitle {
  margin-top: 6px;
  color: var(--muted);
}

.boot__error {
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow: auto;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(17, 24, 39, 0.68);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

:root[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.72);
}

.topbar__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  width: 100%;
}

.topbar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}

.nav {
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 100%;
}

.menuBtn {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menuIcon {
  width: 20px;
  height: 14px;
  position: relative;
}

.menuIcon span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  opacity: 0.9;
}

.menuIcon span:nth-child(1) {
  top: 0;
}
.menuIcon span:nth-child(2) {
  top: 6px;
}
.menuIcon span:nth-child(3) {
  top: 12px;
}

.mobileMenu {
  display: none;
  border-top: 1px solid var(--border);
  padding: 12px 16px 16px;
  max-width: 100%;
}

.mobileMenu__grid {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 10px;
}

.mobileMenu__nav {
  display: grid;
  gap: 10px;
}

.mobileMenu__actions {
  display: grid;
  gap: 10px;
}

.mobileMenu.is-open {
  display: block;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  word-break: normal;
  overflow-wrap: normal;
  flex-shrink: 0;
}

.brand span {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.brand .pill {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.12);
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 13px;
}

:root[data-theme="light"] .badge {
  background: rgba(15, 23, 42, 0.04);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
  flex-shrink: 0;
}

.dot--ok {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}

.spacer {
  flex: 1;
}

.btn {
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  min-height: 44px;
  max-width: 100%;
  width: auto;
  white-space: nowrap;
}

:root[data-theme="light"] .btn {
  background: rgba(15, 23, 42, 0.04);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.55);
}

.btn--primary {
  border-color: rgba(96, 165, 250, 0.55);
  background: rgba(96, 165, 250, 0.18);
}

.btn--danger {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(251, 113, 133, 0.12);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.switch input {
  appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  position: relative;
  outline: none;
  flex-shrink: 0;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--muted);
  transition: left 120ms ease, background 120ms ease;
}

.switch input:checked {
  background: rgba(52, 211, 153, 0.18);
  border-color: rgba(52, 211, 153, 0.55);
}

.switch input:checked::after {
  left: 21px;
  background: var(--ok);
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.14);
  outline: none;
  min-height: 44px;
  font-size: 16px;
  max-width: 100%;
  width: 100%;
}

textarea.input {
  min-height: 120px;
}

:root[data-theme="light"] .input {
  background: rgba(15, 23, 42, 0.03);
}

.input:focus {
  border-color: rgba(96, 165, 250, 0.65);
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.12);
}

.row {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

.grid {
  display: grid;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
}

/* Texto: que nunca "rompa" el layout en mobile */
.page,
.panel,
.card,
.pill,
.badge,
.toast,
.page__title,
.page__subtitle {
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.entry__title,
.entry__subtitle {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.toastHost {
  position: fixed;
  right: 14px;
  bottom: 14px;
  display: grid;
  gap: 10px;
  z-index: 50;
}

.toast {
  width: min(420px, calc(100vw - 28px));
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(17, 24, 39, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* Responsive mobile */
@media (max-width: 767px) {
  .topbar__inner {
    padding: 10px 12px;
    gap: 8px;
  }

  .topbar__right {
    display: none;
  }

  .nav {
    display: none;
  }

  .menuBtn {
    display: inline-flex;
  }

  /* Badge de estado siempre visible en mobile — es el único indicador online/offline */
  .badge {
    display: inline-flex;
    font-size: 12px;
    padding: 4px 8px;
  }

  /* En mobile: botones full-width dentro del menú hamburguesa */
  .mobileMenu .btn {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .badge {
    font-size: 11px;
    padding: 4px 6px;
  }
}

:root[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.88);
}

.toast__title {
  font-weight: 700;
}

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