/* InstaDeck - shared components: layout shell, sidebar, topbar, drawer, buttons, forms, cards, badges, toasts, loading overlay, secret field.
   Page-specific rules live in pages/<name>/<name>.css. Split from the legacy stylesheets in cascade order. */

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(42px, 30px, 0) scale(1.12);
  }
}

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px;
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-strong), #d946ef 55%, var(--accent-2));
  border-radius: 13px;
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.35);
  flex: none;
}

.brand__mark svg {
  width: 28px;
  height: 28px;
}

.brand__copy {
  display: flex;
  flex-direction: column;
  line-height: 1.18;
}

.brand__name {
  font-size: 1.256rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__tag {
  font-size: 1.125rem;
  color: var(--muted);
}

.brand__tag em {
  font-style: normal;
  color: var(--faint);
  font-size: 1.125rem;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 currentColor;
  }
  50% {
    box-shadow: 0 0 0 4px transparent;
  }
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 1.125rem;
  font-weight: 500;
}

.connection-pill__dot {
  width: 6px;
  height: 6px;
  background: var(--faint);
  border-radius: 50%;
}

.connection-pill.is-online .connection-pill__dot {
  background: var(--success);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}

.connection-pill.is-offline .connection-pill__dot {
  background: var(--danger);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: color var(--transition), background var(--transition), border-color var(--transition),
    transform var(--transition);
}

.icon-button:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.icon-button:active {
  transform: scale(0.94);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.icon-button--danger:hover {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.3);
  background: rgba(251, 113, 133, 0.08);
}

.icon-button--small {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.icon-button--small svg {
  width: 14px;
  height: 14px;
}

.icon-moon {
  display: none;
}

html[data-theme="light"] .icon-sun {
  display: none;
}

html[data-theme="light"] .icon-moon {
  display: block;
}

.main {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 26px 42px 30px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 40px;
}

.topbar__crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-size: 1.125rem;
  font-weight: 500;
}

.topbar__crumbs svg {
  width: 13px;
  height: 13px;
}

.topbar__crumbs strong {
  color: var(--text-soft);
  font-weight: 600;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.text-button {
  padding: 6px 2px;
  color: var(--muted);
  background: none;
  border: 0;
  font-size: 1.125rem;
  font-weight: 600;
  transition: color var(--transition);
}

.text-button:hover {
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  backdrop-filter: blur(14px);
}

.badge svg {
  width: 14px;
  height: 14px;
  color: var(--accent-2);
}

.panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(22px);
  overflow: hidden;
}

.panel--flow {
  min-height: 480px;
  padding: 34px;
  background: linear-gradient(150deg, rgba(23, 28, 46, 0.92), rgba(13, 17, 29, 0.9));
  border-color: rgba(255, 255, 255, 0.11);
}

html[data-theme="light"] .panel--flow {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(249, 250, 255, 0.94));
}

.panel__glow {
  position: absolute;
  top: -150px;
  right: -120px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.18), transparent 68%);
  pointer-events: none;
}

.workspace__aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel--summary {
  padding: 22px;
}

.panel--summary {
  background: linear-gradient(155deg, rgba(22, 27, 44, 0.9), rgba(12, 16, 27, 0.88));
}

html[data-theme="light"] .panel--summary {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.97), rgba(247, 249, 255, 0.94));
}

.panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 17px;
}

.panel__eyebrow {
  margin: 0 0 3px;
  color: var(--faint);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.panel__title {
  margin: 0;
  font-size: 1.212rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  color: var(--muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 1.125rem;
  font-weight: 700;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
  font-size: 1.125rem;
  font-weight: 600;
}

.field__label span {
  color: var(--faint);
  font-size: 1.125rem;
  font-weight: 500;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 50px;
  background: rgba(5, 8, 15, 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

html[data-theme="light"] .input-shell {
  background: rgba(255, 255, 255, 0.9);
}

.input-shell:focus-within {
  background: rgba(5, 8, 15, 0.72);
  border-color: rgba(167, 139, 250, 0.6);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

html[data-theme="light"] .input-shell:focus-within {
  background: #fff;
}

.input-shell.is-invalid {
  border-color: rgba(251, 113, 133, 0.55);
  box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.09);
}

.input-shell__icon {
  display: grid;
  place-items: center;
  width: 48px;
  color: var(--faint);
  flex: none;
}

.input-shell__icon svg {
  width: 17px;
  height: 17px;
}

.input-shell input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 14px 0 0;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
  font-size: 1.147rem;
}

.input-shell input::placeholder {
  color: var(--faint);
}

.input-shell__action {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-right: 4px;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 9px;
  flex: none;
  transition: color var(--transition), background var(--transition);
}

.input-shell__action:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.input-shell__action svg {
  width: 17px;
  height: 17px;
}

.field__error {
  margin: 0;
  color: var(--danger);
  font-size: 1.125rem;
  font-weight: 500;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: transform var(--transition), background var(--transition),
    border-color var(--transition), box-shadow var(--transition), color var(--transition);
}

.button svg {
  width: 16px;
  height: 16px;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0) scale(0.99);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.button--primary {
  min-height: 50px;
  color: #fff;
  background: linear-gradient(110deg, #7c3aed, #a855f7 48%, #0ea5e9);
  box-shadow: 0 12px 26px rgba(124, 58, 237, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.button--primary:hover {
  box-shadow: 0 16px 34px rgba(124, 58, 237, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.button--block {
  width: 100%;
}

.button--secondary {
  color: var(--text-soft);
  background: var(--surface-soft);
  border-color: var(--border-strong);
}

.button--secondary:hover {
  background: var(--surface-hover);
  border-color: rgba(167, 139, 250, 0.3);
}

.button--ghost {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.button--ghost:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.button--small {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 1.125rem;
}

.button__spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.button--secondary .button__spinner,
.button--ghost .button__spinner {
  border-color: rgba(148, 163, 184, 0.35);
  border-top-color: var(--text);
}

.button.is-loading {
  pointer-events: none;
}

.button.is-loading .button__spinner {
  display: block;
}

.button.is-loading .button__icon {
  display: none;
}

.clipboard-buffer {
  position: fixed;
  top: -1000px;
  left: -1000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.link-button {
  padding: 0;
  color: var(--accent);
  background: none;
  border: 0;
  font-size: 1.125rem;
  font-weight: 600;
  transition: color var(--transition);
}

.link-button:hover {
  color: var(--accent-2);
}

.link-button:disabled {
  color: var(--faint);
  cursor: not-allowed;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1.125rem;
  line-height: 1.58;
}

.notice svg {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  flex: none;
}

.notice strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-soft);
  font-size: 1.125rem;
}

.notice p {
  margin: 0;
  color: var(--muted);
}

.notice--info {
  background: rgba(96, 165, 250, 0.07);
  border-color: rgba(96, 165, 250, 0.16);
}

.notice--info svg {
  color: var(--info);
}

.notice--warn {
  background: rgba(251, 191, 36, 0.07);
  border-color: rgba(251, 191, 36, 0.16);
}

.notice--warn svg {
  color: var(--warning);
}

.account__hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  background: linear-gradient(130deg, rgba(139, 92, 246, 0.1), rgba(34, 211, 238, 0.05));
  border: 1px solid rgba(167, 139, 250, 0.16);
  border-radius: var(--radius-lg);
}

.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #fff;
  background: linear-gradient(135deg, #7c3aed, #db2777);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  font-size: 1.344rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  overflow: hidden;
  flex: none;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 13px;
  height: 13px;
  background: var(--success);
  border: 3px solid var(--surface-solid);
  border-radius: 50%;
}

.account__identity {
  min-width: 0;
  flex: 1;
}

.account__name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.344rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account__handle {
  margin-top: 1px;
  color: var(--muted);
  font-size: 1.125rem;
}

.verified {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #082f49;
  background: var(--accent-2);
  border-radius: 50%;
  flex: none;
}

.verified svg {
  width: 10px;
  height: 10px;
}

.account__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.empty-note {
  margin: 0;
  padding: 10px 2px;
  color: var(--faint);
  font-size: 1.125rem;
  line-height: 1.55;
}

.error-region {
  margin-bottom: 18px;
  animation: rise 300ms var(--ease) both;
}

.error-card {
  display: flex;
  gap: 13px;
  padding: 15px 16px;
  background: linear-gradient(130deg, rgba(251, 113, 133, 0.1), rgba(244, 63, 94, 0.04));
  border: 1px solid rgba(251, 113, 133, 0.22);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.error-card__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--danger);
  background: rgba(251, 113, 133, 0.1);
  border-radius: 10px;
  flex: none;
}

.error-card__icon svg {
  width: 17px;
  height: 17px;
}

.error-card__body {
  min-width: 0;
  flex: 1;
}

.error-card__topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.error-card__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 650;
}

.category-badge {
  padding: 2px 6px;
  color: var(--danger);
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.18);
  border-radius: 4px;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.error-card__message {
  margin: 0;
  color: var(--text-soft);
  font-size: 1.125rem;
  line-height: 1.5;
}

.error-card__hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.5;
}

.error-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
}

.error-code {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 1.125rem;
}

.error-card__actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  align-items: flex-start;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: auto;
  padding: 26px 2px 0;
  color: var(--faint);
  font-size: 1.125rem;
  line-height: 1.5;
}

.footer p {
  margin: 0;
}

.footer__version {
  flex: none;
  font-family: var(--font-mono);
  font-size: 1.125rem;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 340px;
  padding: 10px 14px;
  color: var(--text-soft);
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  font-size: 1.125rem;
  animation: toast-in 260ms var(--ease) both;
  pointer-events: auto;
}

.toast.is-leaving {
  animation: toast-out 220ms var(--ease) both;
}

.toast__icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  flex: none;
}

.toast__icon svg {
  width: 12px;
  height: 12px;
}

.toast--success .toast__icon {
  color: var(--success);
  background: rgba(52, 211, 153, 0.1);
}

.toast--error .toast__icon {
  color: var(--danger);
  background: rgba(251, 113, 133, 0.1);
}

.toast--info .toast__icon {
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.1);
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(7, 9, 16, 0.72);
  backdrop-filter: blur(10px);
  opacity: 1;
  transition: opacity 200ms var(--ease), visibility 200ms;
}

html[data-theme="light"] .loading-screen {
  background: rgba(242, 244, 251, 0.75);
}

.loading-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-screen__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 38px;
  text-align: center;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.loading-screen__spinner {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.loading-screen__title {
  margin: 0;
  font-size: 1.169rem;
  font-weight: 650;
}

.loading-screen__sub {
  margin: 0;
  color: var(--muted);
  font-size: 1.125rem;
}

.noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 100;
  padding: 14px;
  color: #fff;
  background: #111;
  border-radius: 10px;
  font-size: 1.125rem;
  text-align: center;
}

.noscript code {
  font-family: var(--font-mono);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
}

@media (max-width: 1180px) {
  .main {
      padding-inline: 30px;
    }
}

@media (max-width: 980px) {
  .shell {
      grid-template-columns: 1fr;
    }
  .brand {
      padding: 0;
    }
  .connection-pill {
      display: none;
    }
  .workspace__aside {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      align-items: start;
    }
  .panel--summary {
      grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
  .main {
      padding: 20px 16px 24px;
    }
  .brand__mark {
      width: 36px;
      height: 36px;
      border-radius: 11px;
    }
  .brand__mark svg {
      width: 24px;
      height: 24px;
    }
  .brand__name {
      font-size: 1.169rem;
    }
  .brand__tag {
      font-size: 1.125rem;
    }
  .topbar {
      min-height: 32px;
    }
  .badge {
      padding: 6px 9px;
      font-size: 1.125rem;
    }
  .panel--flow {
      padding: 22px 18px;
      border-radius: var(--radius-lg);
    }
  .workspace__aside {
      grid-template-columns: 1fr;
    }
  .panel--summary {
      padding: 18px;
      border-radius: var(--radius-lg);
    }
  .footer {
      flex-direction: column;
      align-items: flex-start;
      gap: 6px;
      padding-top: 20px;
    }
  .toast-region {
      right: 12px;
      bottom: 12px;
      left: 12px;
    }
  .toast {
      max-width: none;
    }
}

.brand__name,
.button,
.panel__title,
.panel__eyebrow,
.badge,
.icon-button,
.text-button,
.count-pill,
.category-badge {
  font-family: var(--font-pixel);
  letter-spacing: 0.02em;
}

.panel__glow {
  display: none !important;
}

.shell {
  background: transparent;
}

.main {
  background: transparent;
}

.topbar {
  border-bottom: 2px solid var(--border);
  background: var(--bg);
}

.topbar__crumbs,
.topbar__crumbs strong {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  text-transform: uppercase;
}

.brand__mark {
  border: 2px solid var(--border-strong);
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.brand__name {
  font-size: 1.256rem;
  text-transform: uppercase;
}

.brand__tag {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.connection-pill {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  text-transform: uppercase;
  border: 2px solid var(--border);
  padding: 4px 8px;
}

.connection-pill__dot {
  background: var(--muted);
  box-shadow: none;
}

.connection-pill.is-online .connection-pill__dot {
  background: var(--accent);
}

.icon-button {
  border: 2px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  box-shadow: 2px 2px 0 var(--border);
}

.icon-button:hover {
  background: var(--surface-hover);
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--border);
}

.icon-button:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.icon-button--danger {
  border-style: double;
}

.text-button {
  border-bottom: 2px solid var(--border-strong);
  color: var(--text);
}

.text-button:hover {
  background: var(--text);
  color: var(--bg);
}

.badge {
  border: 2px solid var(--border-strong);
  background: var(--bg);
  color: var(--text-soft);
  font-size: 1.125rem;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 var(--border);
}

.badge svg {
  color: var(--text);
}

.panel {
  background: var(--surface-solid);
  border: 2px solid var(--border-strong);
  box-shadow: var(--shadow-md);
}

.panel__eyebrow {
  color: var(--muted);
  font-size: 1.125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel__title {
  color: var(--text);
  font-size: 1.212rem;
  text-transform: uppercase;
}

.panel__header {
  border-bottom: 2px solid var(--border);
  padding-bottom: 12px;
}

.count-pill,
.category-badge {
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text-soft);
  font-size: 1.125rem;
  text-transform: uppercase;
  padding: 2px 6px;
}

.field__label {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.input-shell {
  background: var(--bg);
  border: 2px solid var(--border-strong);
  box-shadow: inset 2px 2px 0 var(--border);
}

.input-shell:focus-within {
  border-color: var(--accent);
  box-shadow: inset 2px 2px 0 var(--border), 3px 3px 0 var(--border-strong);
}

.input-shell input {
  background: transparent;
  color: var(--text);
}

.input-shell input::placeholder {
  color: var(--faint);
}

.input-shell__icon {
  color: var(--muted);
}

.input-shell.is-invalid {
  border-color: var(--text);
  border-style: double;
}

.field__error {
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  text-transform: uppercase;
}

.notice {
  border: 2px solid var(--border-strong);
  border-radius: 0;
  background: var(--surface-soft);
  color: var(--muted);
  box-shadow: 2px 2px 0 var(--border);
}

.notice svg {
  color: var(--text-soft);
}

.notice strong {
  color: var(--text);
}

.notice p {
  color: var(--muted);
}

.notice--info {
  border-color: var(--border-strong);
  border-style: solid;
  background: var(--surface-soft);
}

.notice--warn {
  border-color: var(--border-strong);
  border-style: dashed;
  background: var(--surface-soft);
}

.button {
  border: 2px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
  font-size: 1.125rem;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  transition: transform 60ms steps(2, end), box-shadow 60ms steps(2, end),
    background-color 60ms steps(2, end);
}

.button:hover {
  background: var(--surface-hover);
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 var(--border);
}

.button:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.button--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--shadow-md);
}

.button--primary:hover {
  background: var(--accent);
  filter: none;
  box-shadow: 2px 2px 0 var(--border);
}

.button--secondary {
  background: var(--surface-soft);
  border-color: var(--border-strong);
  color: var(--text);
}

.button--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-soft);
  box-shadow: none;
}

.button--ghost:hover {
  background: var(--surface-hover);
}

.button--small {
  font-size: 1.125rem;
  padding: 6px 9px;
}

.button--block {
  width: 100%;
}

.button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.button.is-copied,
.button.is-copied:hover {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
  transform: none;
}

.button__spinner,
.spinner,
.loading-screen__spinner {
  border-style: solid;
  border-width: 2px;
  border-color: var(--border) var(--accent) var(--accent) var(--border);
  background: transparent;
}

.account__hero {
  border-bottom: 2px solid var(--border);
}

.account__name {
  font-family: var(--font-pixel);
  font-size: 1.15rem;
  text-transform: uppercase;
}

.account__handle {
  color: var(--muted);
  font-size: 1.3rem;
}

.avatar {
  background: var(--surface-soft);
  border: 2px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-pixel);
  box-shadow: var(--shadow-sm);
}

.verified {
  background: var(--accent);
  color: var(--on-accent);
  border: 2px solid var(--accent);
}

.empty-note {
  color: var(--muted);
  font-size: 1.256rem;
}

.error-card {
  background: var(--bg);
  border: 2px solid var(--border-strong);
  border-left-width: 8px;
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.error-card__icon {
  color: var(--text);
}

.error-card__title {
  font-family: var(--font-pixel);
  font-size: 1.006rem;
  text-transform: uppercase;
}

.error-card__message {
  font-size: 1.344rem;
}

.error-card__hint {
  color: var(--muted);
  font-size: 1.256rem;
}

.error-code {
  border: 1px solid var(--border-strong);
  background: var(--surface-soft);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 1.125rem;
}

.footer {
  border-top: 2px solid var(--border);
  color: var(--muted);
  font-size: 1.212rem;
}

.footer__version {
  border: 1px solid var(--border);
  padding: 2px 6px;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  text-transform: uppercase;
}

.loading-screen {
  background: var(--bg);
}

.loading-screen__box {
  border: 2px solid var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
}

.loading-screen__title {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  text-transform: uppercase;
}

.loading-screen__sub {
  color: var(--muted);
  font-size: 1.256rem;
}

.toast {
  border: 2px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-md);
  font-size: 1.256rem;
}

.noscript {
  border: 2px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  text-transform: uppercase;
}

@keyframes pixel-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0.25;
  }
}

@media (max-width: 480px) {
  .app-main,
  .panel {
      min-width: 0;
    }
}

.pixel-plus,
.pixel-key {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1;
  vertical-align: -2px;
  margin-right: 5px;
}

.pixel-key {
  border-color: var(--border-strong);
  color: var(--text-soft);
}

.tile-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text-soft);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 5px;
}

.tile-badge.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.tile-badge.is-muted {
  border-style: dashed;
  color: var(--muted);
}

@keyframes pixel-blink {
  50% {
    opacity: 0.2;
  }
}

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-elevated);
  border-right: 2px solid var(--border-strong);
  z-index: 60;
}

.rail__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px 12px;
  flex: none;
}

.rail__toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 12px;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--border-strong);
  box-shadow: 2px 2px 0 var(--border);
  font-family: var(--font-pixel);
  font-size: 1.125rem;
  text-transform: uppercase;
}

.rail__toggle svg {
  width: 22px;
  height: 22px;
}

.rail__toggle-close {
  display: none;
}

.rail__toggle[aria-expanded="true"] .rail__toggle-open {
  display: none;
}

.rail__toggle[aria-expanded="true"] .rail__toggle-close {
  display: block;
}

.rail__scrim {
  display: none;
}

.rail__panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 4px;
  padding: 4px 16px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rail-account {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  color: var(--text);
  background: var(--surface-solid);
  border: 2px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.rail-account:hover {
  background: var(--surface-hover);
}

.rail-account__avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  overflow: hidden;
  background: var(--bg);
  border: 2px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 1.125rem;
}

.rail-account__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rail-account__avatar--empty svg {
  width: 26px;
  height: 26px;
}

.rail-account__copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.rail-account__copy strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 1.3rem;
  font-weight: 400;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.rail-account__handle {
  color: var(--muted);
  font-size: 1.2rem;
  overflow-wrap: anywhere;
}

.rail-account__status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 1.125rem;
  line-height: 1.15;
}

.rail-account__empty {
  color: var(--muted);
}

.rail-nav__group {
  margin: 18px 0 6px;
  padding: 0 4px;
  color: var(--muted);
  font-family: var(--font-pixel);
  font-size: 1.125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rail-nav__list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 2.75rem;
  padding: 6px 10px;
  color: var(--text-soft);
  background: transparent;
  border: 2px solid transparent;
  font-family: var(--font-sans);
  font-size: 1.375rem;
  letter-spacing: 0.02em;
  text-align: left;
  text-transform: uppercase;
}

.rail-link svg {
  width: 22px;
  height: 22px;
  flex: none;
}

.rail-link:hover {
  color: var(--text);
  background: var(--surface-hover);
  border-color: var(--border);
}

.rail-link[aria-current="page"] {
  color: var(--text);
  background: var(--surface-soft);
  border-color: var(--border-strong);
  box-shadow: inset 5px 0 0 var(--accent);
}

.rail-link__text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rail-link__count {
  margin-left: auto;
}

.rail__spacer {
  flex: 1 1 auto;
  min-height: 12px;
}

.rail__foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 2px dashed var(--border);
}

.rail__privacy {
  margin: 0;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.3;
}

.rail__foot .connection-pill {
  align-self: flex-start;
}

.rail__actions {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.rail__actions .icon-button {
  width: 44px;
  height: auto;
  min-height: 44px;
  flex: none;
}

.rail__signout {
  flex: 1 1 auto;
  justify-content: center;
  min-height: 44px;
}

.main > *,
.panel {
  scroll-margin-top: 16px;
}

.panel[tabindex="-1"]:focus {
  outline: none;
}

.panel[tabindex="-1"]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.status-dot {
  position: relative;
  display: inline-block;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  color: var(--text);
  background: currentColor;
  border: 2px solid currentColor;
}

.status-dot.is-wait {
  animation: pixel-blink 900ms steps(2, end) infinite;
}

.status-dot.is-warn {
  background: linear-gradient(135deg, currentColor 50%, transparent 50%);
}

.status-dot.is-off {
  background: transparent;
}

.status-dot.is-bad {
  background:
    linear-gradient(45deg, transparent 42%, currentColor 42%, currentColor 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, currentColor 42%, currentColor 58%, transparent 58%);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 3px 9px 3px 7px;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--border-strong);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.status-badge.is-ok {
  border-color: var(--accent);
}

.status-badge.is-wait,
.status-badge.is-off {
  border-style: dashed;
}

.status-badge.is-warn {
  border-style: dotted;
}

.status-badge.is-bad {
  border-style: double;
  border-width: 4px;
}

.button--danger:hover,
.button--danger:focus-visible {
  background: var(--text);
  color: var(--bg);
}

.account__real {
  color: var(--faint);
  font-size: 1.2rem;
}

.account__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.field__help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.3;
}

.text-button--danger {
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 5px;
}

.secret {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.secret__value {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: pre-wrap;
}

.secret.is-revealed .secret__value {
  color: var(--text);
}

.secret__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 980px) {
  .rail {
      height: auto;
      border-right: 0;
      border-bottom: 2px solid var(--border-strong);
    }
  .rail__bar {
      min-height: var(--bar-h);
      padding: 10px 16px;
    }
  .rail__toggle {
      display: inline-flex;
    }
  .rail__scrim {
      position: fixed;
      top: var(--bar-h);
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 1;
      display: block;
      background: rgba(0, 0, 0, 0.7);
    }
  .rail__scrim[hidden] {
      display: none !important;
    }
  html[data-theme="light"] .rail__scrim {
      background: rgba(255, 255, 255, 0.78);
    }
  .rail__panel {
      position: fixed;
      top: var(--bar-h);
      bottom: 0;
      left: 0;
      z-index: 2;
      width: min(340px, 88vw);
      padding: 14px 16px 18px;
      background: var(--bg-elevated);
      border-right: 2px solid var(--border-strong);
      border-top: 2px solid var(--border);
      box-shadow: 6px 0 0 var(--border);
      visibility: hidden;
      pointer-events: none;
      transform: translateX(-104%);
      transition: transform 110ms steps(3, end), visibility 0s linear 110ms;
    }
  .rail.is-open .rail__panel {
      visibility: visible;
      pointer-events: auto;
      transform: none;
      transition: transform 110ms steps(3, end), visibility 0s;
    }
  body.nav-open {
      overflow: hidden;
    }
  .main > *,
  .panel {
      scroll-margin-top: calc(var(--bar-h) + 12px);
    }
}

@media (max-width: 480px) {
  .brand__tag {
      display: none;
    }
}

.rail-nav {
  display: block;
}

.rail__toggle-text {
  line-height: 1;
}

.status-dot--static {
  animation: none;
}

.rail-account {
  position: relative;
  border-left-width: 6px;
  border-left-color: var(--accent);
  transition: background var(--transition);
}

.rail-account:hover {
  box-shadow: var(--shadow-md);
}

.rail-account:focus-visible,
.rail-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.rail-account__avatar.is-fallback {
  background: var(--surface-soft);
}

.rail-account__empty {
  font-size: 1.25rem;
}

.rail-link {
  position: relative;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.rail-link:hover svg,
.rail-link:focus-visible svg {
  color: var(--text);
}

.rail-link:active {
  background: var(--surface-soft);
}

.rail-link[aria-current="page"] {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}

.rail-link[aria-current="page"] svg {
  color: var(--on-accent);
}

.rail-link[aria-current="page"] .rail-link__count {
  color: var(--text);
  background: var(--bg);
  border-color: var(--bg);
}

.rail-link[aria-current="page"]:focus-visible {
  outline-color: var(--text);
  outline-offset: 3px;
}

.rail-link__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 3px 6px 0;
  line-height: 1;
  flex: none;
}

.rail-nav__group:first-child {
  margin-top: 14px;
}

.rail-link__text {
  flex: 1 1 auto;
}

.panel--flow {
  min-height: 0;
  max-width: 980px;
}

.button.is-copied {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.button.is-copy-failed {
  border-style: double;
  border-width: 3px;
}

.conn-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface-solid);
  border: 3px double var(--border-strong);
  font-size: 1.3rem;
}

.conn-notice__dot {
  width: 12px;
  height: 12px;
  flex: none;
  background: var(--text);
  animation: pixel-blink 900ms steps(2, end) infinite;
}

@media (max-width: 720px) {
  .panel--flow {
      padding: 22px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
  .conn-notice__dot {
      animation: none;
    }
}

/* ==========================================================================
   Shared additions for the multi-page architecture
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* brand is a link now */
a.brand {
  color: var(--text);
}

/* top bar: back link + current page */
.back-link {
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 1.125rem;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 5px;
  white-space: nowrap;
}

.back-link:hover,
.back-link:focus-visible {
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
}

.topbar__crumbs {
  flex-wrap: wrap;
}

.env-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  color: var(--muted);
  border: 2px solid var(--border);
  font-size: 1.125rem;
  text-transform: uppercase;
}

.env-pill__dot {
  width: 8px;
  height: 8px;
  background: var(--text);
}

/* page heading used by pages that are not the dashboard */
.page-head {
  margin: 22px 0 6px;
}

.page-title {
  margin: 4px 0 6px;
  font-size: 1.75rem;
  line-height: 1.15;
  text-shadow: none;
}

.page-lede {
  margin: 0;
  max-width: 72ch;
  color: var(--muted);
  font-size: 1.256rem;
}

/* links that look like buttons keep button metrics */
a.button {
  text-decoration: none;
}

a.button:hover {
  text-decoration: none;
}

.toast__link {
  margin-left: 6px;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---- secret field: masked credential, ALWAYS one line ------------------- */
.secret-field {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.secret-field__value {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  padding: 6px 10px;
  margin: 0;
  color: var(--text-soft);
  background: var(--bg);
  border: 2px solid var(--border);
  font-family: var(--font-mono);
  font-size: 1.3rem;
  line-height: 1.5;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  overflow-wrap: normal;
  word-break: normal;
  text-overflow: clip;
  scrollbar-width: thin;
}

.secret-field.is-revealed .secret-field__value {
  color: var(--text);
  border-color: var(--border-strong);
}

.secret-field__actions {
  display: inline-flex;
  flex: none;
  gap: 6px;
}

.secret-na {
  color: var(--text-soft);
}

.secret-hint {
  color: var(--muted);
  font-size: 1.2rem;
}

@media (max-width: 560px) {
  .secret-field {
    flex-direction: column;
    align-items: stretch;
  }
  .secret-field__actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .env-pill {
    display: none;
  }
}

/* ---- facts list, meta chip and section cards shared by Security and Password encryption ---- */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 10px 22px;
  margin: 0;
}

.facts__item {
  min-width: 0;
}

.facts__item--wide {
  grid-column: 1 / -1;
}

.facts__item dt {
  color: var(--muted);
  font-family: var(--font-pixel);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.facts__item dd {
  margin: 0;
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

.meta-chip {
  display: inline-block;
  padding: 1px 8px;
  background: var(--surface-soft);
  border: 2px solid var(--border-strong);
  font-size: 1.125rem;
  line-height: 1.4;
  /* "Retrieved from Instagram" / "Added by User" / "Added by Admin" are shown
     exactly as worded, not forced into capitals by the theme. */
  text-transform: none;
  white-space: nowrap;
}

.section-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.section-card {
  padding: 22px;
}

.section-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 14px;
}

.section-card__title {
  margin: 0;
  font-size: 1.431rem;
}

.section-card__lede {
  margin: 4px 0 0;
  max-width: 78ch;
  color: var(--muted);
  font-size: 1.2rem;
}

.section-card__sub {
  margin: 18px 0 8px;
  font-size: 1.169rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-width: 0;
  background: var(--bg);
  border: 2px solid var(--border-strong);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.25rem;
  line-height: 1.35;
}

.form-field textarea {
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--border);
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--faint);
}

.form-error {
  margin: 0;
  padding: 6px 9px;
  border: 2px dashed var(--border-strong);
  color: var(--text);
  font-size: 1.2rem;
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 1.15rem;
}


/* ---- Instagram restriction / recovery notice (shared by every page) ---- */
.restriction-notice {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
}

.restriction-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-left: 4px solid #d8453b;
}

.restriction-card.is-challenge_required {
  border-left-color: #d89a1b;
}

.restriction-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.restriction-card p {
  margin: 0;
  overflow-wrap: anywhere;
}

.restriction-card__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.restriction-card__meta {
  font-size: 0.85rem;
  opacity: 0.85;
}

.restriction-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.restriction-card__icon {
  display: inline-flex;
  flex: none;
  width: 24px;
  height: 24px;
  color: #d8453b;
}

.restriction-card.is-challenge_required .restriction-card__icon {
  color: #d89a1b;
}

.restriction-card__icon svg {
  width: 100%;
  height: 100%;
}

/* ---------------------------------------------------------------------------
   Collapsible sidebar (desktop). Collapsed = logo + icons only; labels stay available
   as tooltips (title) and accessible names (aria-label). Below 980px the drawer is used instead.
   --------------------------------------------------------------------------- */
.rail__collapse {
  display: none;
}

@media (min-width: 981px) {
  .shell {
    transition: grid-template-columns 200ms ease;
  }

  .rail {
    overflow-x: hidden;
  }

  .rail__collapse {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: none;
    padding: 0;
    color: var(--text);
    background: var(--bg);
    border: 2px solid var(--border-strong);
    box-shadow: 2px 2px 0 var(--border);
    cursor: pointer;
  }

  .rail__collapse:hover {
    background: var(--surface-hover);
  }

  .rail__collapse:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .rail__collapse svg {
    width: 20px;
    height: 20px;
    transition: transform 200ms ease;
  }

  html[data-rail="collapsed"] .shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  html[data-rail="collapsed"] .rail__collapse svg {
    transform: rotate(180deg);
  }

  html[data-rail="collapsed"] .rail__bar {
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
    padding: 14px 8px 10px;
  }

  html[data-rail="collapsed"] .brand {
    justify-content: center;
    padding: 0;
  }

  html[data-rail="collapsed"] .brand__copy,
  html[data-rail="collapsed"] .rail-nav__group,
  html[data-rail="collapsed"] .rail-link__text,
  html[data-rail="collapsed"] .rail-link__count,
  html[data-rail="collapsed"] .rail-account__copy,
  html[data-rail="collapsed"] .rail-account__empty,
  html[data-rail="collapsed"] .rail__privacy,
  html[data-rail="collapsed"] .rail__signout-text,
  html[data-rail="collapsed"] #connection-label {
    display: none;
  }

  html[data-rail="collapsed"] .rail__panel {
    padding: 4px 8px 12px;
    align-items: stretch;
  }

  html[data-rail="collapsed"] .rail-account {
    justify-content: center;
    padding: 6px 0;
    border-left-width: 2px;
  }

  html[data-rail="collapsed"] .rail-account__avatar {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  html[data-rail="collapsed"] .rail-nav__list {
    margin-bottom: 6px;
  }

  html[data-rail="collapsed"] .rail-link {
    justify-content: center;
    padding: 6px 0;
  }

  html[data-rail="collapsed"] .rail__foot {
    align-items: center;
    padding-top: 10px;
  }

  html[data-rail="collapsed"] .rail__foot .connection-pill {
    align-self: center;
    padding: 6px;
  }

  html[data-rail="collapsed"] .rail__actions {
    flex-direction: column;
    align-items: center;
  }

  html[data-rail="collapsed"] .rail__signout {
    flex: none;
    width: 44px;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shell,
  .rail__collapse svg {
    transition: none;
  }
}

/* ------------------------------------------------------------ web user (Phase 7) */
.rail-user {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px;
  border: 2px solid var(--border);
  background: var(--surface-soft);
}

.rail-user__copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
}

.rail-user__label {
  color: var(--muted);
  font-size: 1rem;
}

.rail-user__name {
  overflow-wrap: anywhere;
  color: var(--text);
}

.rail-user__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (min-width: 981px) {
  html[data-rail="collapsed"] .rail-user {
    padding: 6px;
    border-width: 1px;
  }

  html[data-rail="collapsed"] .rail-user__copy,
  html[data-rail="collapsed"] .rail-user__actions a {
    display: none;
  }
}

/* ------------------------------------------------------------ sign-in shell (Phase 7) */
.auth-shell {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 460px;
  margin: 0 auto;
  padding: 48px 16px;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.auth-card {
  width: 100%;
  padding: 22px;
}

.auth-card .page-title {
  margin-top: 4px;
}

.auth-card__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-card__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 0 0;
}

.auth-msg {
  margin: 10px 0;
}

.notice--error {
  border-color: var(--status-bad);
  color: var(--text);
}

.notice--success {
  border-color: var(--status-ok);
  color: var(--text);
}
