/* ==========================================================================
   Taskette UI Theme Stylesheet
   Design Inspiration: Taskette Reference Project (Sleek Dark Glassmorphic Purple)
   Compatible with Legacy Browsers & Framework-less Vanilla HTML/JS
   ========================================================================== */

* {
  box-sizing: border-box;
}

::selection {
  background: rgba(168, 85, 247, 0.35);
  color: #ffffff;
}

html {
  min-width: 300px;
  background: #09090d;
  color: #f4f4f5;
  font-family: Fredoka, BaoChiKeAi, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #09090d;
  color: #f4f4f5;
}

body::before {
  display: none !important;
}

.site-header,
.page-shell,
footer {
  position: relative;
  z-index: 10;
}

body.modal-open {
  overflow: hidden;
}

body.modal-open .site-header,
body.modal-open footer {
  display: none !important;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: rgba(168, 85, 247, 0.2);
  touch-action: manipulation;
}

/* Accessibility Skip Link */
.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 16px;
  color: #ffffff;
  background: #7e22ce;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(126, 34, 206, 0.4);
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header Navigation Bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  min-height: 64px;
  padding: 8px max(24px, env(safe-area-inset-right)) 8px max(24px, env(safe-area-inset-left));
  background: rgba(18, 18, 24, 0.95);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* Authentication state is maintained by app.js for iOS 13 compatibility. */
body.unlogged .site-header {
  display: none !important;
}

.brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 44px;
  font-family: "Courier New", Courier, "Consolas", "Liberation Mono", monospace;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-shadow:
    2px 2px 0px #7e22ce,
    -1px -1px 0px rgba(255, 255, 255, 0.3),
    0 0 12px rgba(168, 85, 247, 0.7);
  image-rendering: pixelated;
}

.brand-mark {
  display: none !important;
}

.portal-status-group {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.toolbar-status {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}

.toolbar-status+.toolbar-status {
  margin-left: 8px;
}

.toolbar-label {
  margin-right: 6px;
  color: #9090a0;
  font-size: 12px;
  font-weight: 600;
}

.portal-status-group .status-value {
  display: inline;
  margin: 0;
  font-size: 13px;
  line-height: 1.25;
  color: #c084fc;
  font-weight: 700;
}

.account-actions {
  display: flex;
  align-items: center;
  margin-left: 12px;
}

.toolbar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  color: #e4e4e7;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.account-menu {
  position: relative;
  margin-left: 6px;
}

.toolbar-action:hover,
.toolbar-action:active {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.4);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.2);
}

.toolbar-action:focus,
.modal-close:focus,
.account-menu-item:focus {
  outline: 2px solid rgba(168, 85, 247, 0.6);
  outline-offset: 2px;
}

.account-menu-button::after {
  width: 6px;
  height: 6px;
  margin: -3px 1px 0 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.account-username {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 175px;
  padding: 6px;
  background: rgba(18, 18, 24, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(168, 85, 247, 0.1);
}

.account-menu-item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  color: #e4e4e7;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.account-menu-logout {
  color: #f87171;
}

.account-menu-item:hover,
.account-menu-item:active {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
}

.account-menu-logout:hover,
.account-menu-logout:active {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

/* Status Pills */
.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.04);
  font-size: 12.5px;
  font-weight: 600;
}

.state-pill.good {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(16, 185, 129, 0.12);
}

.state-pill.bad {
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.3);
  background: rgba(249, 115, 22, 0.12);
}

/* Keep this selector class-only because iOS 13 rejects newer relational selectors. */
body.unlogged {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  height: auto;
  min-height: var(--app-viewport-height, 100vh);
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

body.unlogged .page-shell {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  height: auto;
  min-height: var(--app-viewport-height, 100vh);
  max-height: none;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  margin: 0 auto;
  box-sizing: border-box;
}

body.unlogged #loadingPanel,
body.unlogged #authPanel {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  margin-top: 0;
  margin-bottom: 0;
}

/* A global notice must never stretch across a flexible centering grid row. */
body.unlogged #globalMessage {
  align-self: start;
  justify-self: center;
  width: 100%;
  max-width: 360px;
  min-height: 0;
}

.page-shell {
  width: calc(100% - 32px);
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 0 60px;
}

.eyebrow,
.step-label {
  margin: 0;
  color: #c084fc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Cards & Glassmorphic Containers */
.card {
  background: rgba(18, 18, 24, 0.85);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 24px;
  box-shadow:
    0 25px 60px -15px rgba(0, 0, 0, 0.7),
    0 0 30px rgba(168, 85, 247, 0.05);
  padding: 32px;
}

.card h2 {
  margin: 6px 0 8px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: #f4f4f5;
  letter-spacing: -0.01em;
}

.centered {
  text-align: center;
}

.centered p {
  max-width: 470px;
  margin-left: auto;
  margin-right: auto;
  color: #9090a0;
}

/* Auth Specific Registration / Login Card */
.auth-card {
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
  background: rgba(20, 20, 26, 0.88);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.auth-heading {
  order: 1;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 14px;
}

.icon-circle {
  display: none !important;
}

.auth-heading h2 {
  font-family: "Courier New", Courier, "Consolas", "Liberation Mono", monospace;
  font-size: 26px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.08em;
  text-shadow:
    2px 2px 0px #7e22ce,
    -1px -1px 0px rgba(255, 255, 255, 0.3),
    0 0 14px rgba(168, 85, 247, 0.75);
  image-rendering: pixelated;
  text-transform: none;
  margin: 0 0 4px;
}

.auth-heading p {
  display: none !important;
}

.auth-message {
  order: 2;
  width: 100%;
  margin: 0 0 2px;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.4;
}

#loginForm input::-webkit-input-placeholder {
  color: transparent !important;
}

#loginForm input::-moz-placeholder {
  color: transparent !important;
}

#loginForm input:-ms-input-placeholder {
  color: transparent !important;
}

#loginForm input::placeholder {
  color: transparent !important;
}

/* Bottom Mode Switch Link (Replacing top tabs with bottom switch link) */
.auth-tabs {
  order: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding-top: 14px;
  background: transparent !important;
  border: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 11.5px;
  color: #71717a;
}

.auth-tabs::before {
  content: "没有账号？ ";
  color: #71717a;
  font-size: 11.5px;
  white-space: pre;
}

body.auth-mode-register .auth-tabs::before {
  content: "已有账号？ ";
}

body:not(.auth-mode-register) .auth-tabs #showLogin {
  display: none !important;
}

body.auth-mode-register .auth-tabs #showRegister {
  display: none !important;
}

.auth-tab {
  display: inline-block !important;
  min-height: auto !important;
  padding: 0 !important;
  color: #c084fc !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  font-weight: 700 !important;
  font-size: 11.5px !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
  transition: color 0.15s ease !important;
}

.auth-tab:hover {
  color: #e9d5ff !important;
}

.auth-tab.active {
  background: transparent !important;
  box-shadow: none !important;
}

/* Form Controls & Inputs */
form {
  order: 2;
  margin-top: 14px;
}

.auth-form label:not(:first-child) {
  margin-top: 16px;
}

label {
  display: block;
  margin-bottom: 6px;
  color: #a1a1aa;
  font-family: "Courier New", Courier, "Consolas", monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  color: #f4f4f5;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  font-size: 13.5px;
  outline: none;
  transition: all 0.2s ease;
}

input::-webkit-input-placeholder {
  color: #52525b;
}

input::-moz-placeholder {
  color: #52525b;
}

input:-ms-input-placeholder {
  color: #52525b;
}

input::placeholder {
  color: #52525b;
}

input:focus {
  border-color: rgba(168, 85, 247, 0.7);
  background: rgba(255, 255, 255, 0.07);
  box-shadow:
    0 0 0 3px rgba(168, 85, 247, 0.25),
    0 0 15px rgba(168, 85, 247, 0.15);
}

.field-hint {
  margin: 8px 0 16px;
  color: #71717a;
  font-size: 12.5px;
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.button:focus,
.text-button:focus,
.text-link:focus,
a:focus {
  outline: 2px solid rgba(168, 85, 247, 0.6);
  outline-offset: 2px;
}

.button:active:not([disabled]) {
  transform: scale(0.98);
}

.button[disabled] {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Primary Button */
.button-primary {
  color: #ffffff;
  background: #7e22ce;
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 4px 16px rgba(126, 34, 206, 0.4);
}

.button-primary:hover:not([disabled]) {
  background: #9333ea;
  box-shadow: 0 6px 20px rgba(147, 51, 234, 0.6);
}

.button-secondary {
  color: #e4e4e7;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.button-secondary:hover:not([disabled]) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.button-success {
  color: #ffffff;
  background: linear-gradient(135deg, #10b981 0%, #047857 100%);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 8px 24px -4px rgba(16, 185, 129, 0.4);
}

.button-success:hover:not([disabled]) {
  background: linear-gradient(135deg, #34d399 0%, #059669 100%);
}

.button-danger {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.25);
}

.button-danger:hover:not([disabled]) {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.text-button,
.text-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  margin: 8px 14px 0 0;
  padding: 0;
  color: #c084fc;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 600;
  transition: color 0.15s ease;
}

.text-button:hover,
.text-link:hover {
  color: #e9d5ff;
}

.text-button.loading-retry {
  min-height: 44px;
  margin: 8px auto 0;
  padding: 0 12px;
}

/* Spinner Animation */
.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #a855f7;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.muted,
.status-detail,
.step p,
.qr-panel p {
  color: #9090a0;
}

.status-value {
  display: block;
  margin: 2px 0;
  font-size: 20px;
}

.status-value.success {
  color: #34d399;
}

.status-value.warning {
  color: #fb923c;
}

/* Steps List styling */
.workflow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.workflow-head .state-pill {
  margin-left: 12px;
}

.workflow-body {
  margin-top: 20px;
}

.step {
  display: none;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.step.active {
  display: block;
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.04);
}

.step-content {
  flex: 1 1 auto;
  min-width: 0;
}

.step h3 {
  margin: 0 0 6px;
  font-size: 18px;
  color: #f4f4f5;
}

.step p {
  margin: 0 0 16px;
}

.manager-steps {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.manager-steps .step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.step.done .step-number {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.verification-box {
  padding: 0;
}

.verification-box .button+.button,
.manager-actions .button+.button {
  margin-top: 10px;
}

#pairBackButton {
  display: inline-block;
  margin-top: 18px;
}

.countdown {
  margin-bottom: 14px;
  color: #fb923c;
  font-weight: 700;
  text-align: center;
}

.qr-panel {
  margin-top: 14px;
  text-align: center;
}

.qr-panel+.button {
  margin-top: 14px;
}

.qr-panel img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto 12px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  image-rendering: pixelated;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Notices & Alert Banners */
.notice {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
}

.notice-info {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.25);
}

.notice-warning {
  color: #ffedd5;
  background: rgba(251, 146, 60, 0.1);
  border-color: rgba(251, 146, 60, 0.25);
}

.notice-error {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.25);
}

/* Toast Floating Capsule */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 1000;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  color: #f4f4f5;
  background: rgba(18, 18, 24, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: 999px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(168, 85, 247, 0.25);
  transform: translateX(-50%);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  pointer-events: none;
}

.toast-warning {
  color: #ffedd5;
  border-color: rgba(251, 146, 60, 0.4);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.7),
    0 0 20px rgba(251, 146, 60, 0.25);
}

/* Modal Overlay & Dialog */
.modal-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow: hidden;
  background: rgba(0, 0, 0, 0.85);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.notification-dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 540px;
  max-height: min(680px, calc(100dvh - max(24px, env(safe-area-inset-top) + env(safe-area-inset-bottom))));
  margin: auto;
  padding: 0;
  overflow: hidden;
  background: #121218;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8), 0 0 30px rgba(168, 85, 247, 0.15);
  color: #f4f4f5;
  box-sizing: border-box;
}

.notification-dialog h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.notification-dialog form {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 24px max(24px, env(safe-area-inset-bottom)) 24px;
  margin: 0;
}

.modal-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: rgba(24, 24, 32, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-close {
  flex: 0 0 auto;
  min-height: 38px;
  margin-left: 16px;
  padding: 6px 14px;
  color: #a1a1aa;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}

.modal-close:hover,
.modal-close:active {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.notification-providers {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.notification-providers legend {
  margin-bottom: 10px;
  font-weight: 700;
  color: #a1a1aa;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.notification-provider {
  display: flex;
  align-items: flex-start;
  min-height: 58px;
  margin: 0;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.notification-provider+.notification-provider {
  margin-top: 8px;
}

.notification-provider:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(168, 85, 247, 0.3);
}

.notification-provider:focus-within {
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.25);
}

.notification-provider input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  margin: 3px 12px 0 0;
  padding: 0;
  accent-color: #a855f7;
  box-shadow: none;
}

.notification-provider span,
.notification-provider strong,
.notification-provider small {
  display: block;
}

.notification-provider-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.notification-provider .notification-provider-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-provider .notification-provider-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 8px;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.notification-provider strong {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #f4f4f5;
  text-transform: none;
  letter-spacing: 0;
}

.notification-provider small {
  margin-top: 3px;
  color: #9090a0;
  font-size: 12.5px;
  font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  text-transform: none;
  letter-spacing: 0;
}

.notification-result {
  min-height: 22px;
  margin: 4px 0 14px;
  color: #9090a0;
  font-size: 13.5px;
}

.notification-result.error {
  color: #fca5a5;
}

.notification-result.success {
  color: #34d399;
}

.manager-check-result {
  min-height: 0;
  margin: 12px 0 0;
  text-align: center;
}

.notification-help-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin: 0 0 12px;
  color: #c084fc;
  font-weight: 600;
  text-underline-offset: 3px;
}

.notification-help-link:hover,
.notification-help-link:active {
  color: #e9d5ff;
}

.notification-help-link-after-input {
  margin-top: 4px;
}

.notification-actions {
  display: flex;
  gap: 10px;
}

.notification-actions .button {
  flex: 1 1 0;
}

.notification-guide {
  margin: 0;
  padding: 18px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.notification-dialog.notification-guide-dialog {
  width: 100%;
  max-width: 360px;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.notification-guide-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.notification-guide-copy h2 {
  margin: 0 0 4px;
  color: inherit;
  font-size: 17px;
  line-height: 1.35;
}

.notification-guide-actions {
  display: flex;
  margin-top: 16px;
  gap: 8px;
}

.notification-guide-actions .button {
  flex: 0 1 auto;
  width: auto;
  min-width: 92px;
  min-height: 40px;
  padding: 8px 14px;
}

/* Footer Styling */
/* Footer Styling */
footer {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  padding: 0 16px;
  color: #71717a;
  text-align: center;
  font-size: 12px;
  z-index: 10;
  pointer-events: none;
}

.noscript {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 14px;
  color: #ffffff;
  background: #dc2626;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
}

[hidden] {
  display: none !important;
}

/* Prevent iOS Safari auto-zoom on input focus */
@media screen and (max-width: 768px) {

  input,
  textarea,
  select,
  .field input {
    font-size: 16px !important;
  }
}

/* Responsive Media Queries */
@media (max-width: 560px) {
  .site-header {
    flex-wrap: wrap;
    padding: 8px max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
  }

  .brand {
    order: 1;
  }

  .account-actions {
    order: 2;
    margin-left: auto;
  }

  .toolbar-action {
    padding-left: 10px;
    padding-right: 10px;
  }

  .account-username {
    max-width: 90px;
  }

  .portal-status-group {
    order: 3;
    flex: 1 0 100%;
    margin: 8px 0 0;
  }

  .toolbar-status {
    flex: 1 1 0;
    justify-content: center;
    min-width: 0;
  }

  .page-shell {
    width: calc(100% - 20px);
    padding-top: 20px;
  }

  .card {
    padding: 22px 18px;
    border-radius: 18px;
  }

  .workflow-body {
    margin-top: 16px;
  }

  .step {
    padding: 16px;
  }

  .notification-actions {
    display: block;
  }

  .notification-actions .button+.button {
    margin-top: 8px;
  }

  .notification-guide {
    padding: 16px;
  }

  .notification-guide-actions {
    margin-top: 14px;
  }

  body.modal-open {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  body.modal-open .modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #09090d !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    overflow: hidden !important;
  }

  body.modal-open .notification-dialog {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100dvh !important;
    max-width: 100% !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #09090d !important;
    overflow: hidden !important;
  }

  body.modal-open .modal-head {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 64px !important;
    padding-top: max(36px, calc(env(safe-area-inset-top) + 12px)) !important;
    padding-right: max(20px, env(safe-area-inset-right)) !important;
    padding-bottom: 14px !important;
    padding-left: max(20px, env(safe-area-inset-left)) !important;
    background: #121218 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  body.modal-open .modal-head h2 {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #f4f4f5 !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  body.modal-open .modal-close {
    min-height: 38px !important;
    padding: 6px 18px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #c084fc !important;
    background: rgba(168, 85, 247, 0.15) !important;
    border: 1px solid rgba(168, 85, 247, 0.3) !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
  }

  body.modal-open .notification-dialog form {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-top: 20px !important;
    padding-right: max(20px, env(safe-area-inset-right)) !important;
    padding-bottom: max(40px, calc(env(safe-area-inset-bottom) + 20px)) !important;
    padding-left: max(20px, env(safe-area-inset-left)) !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
