/* N27 secure product surfaces: CYPH.27 and NULLXRE Mail Lab. */
:root {
  --secure-surface: rgba(11, 16, 22, 0.88);
  --secure-surface-strong: rgba(15, 21, 28, 0.94);
  --secure-line: rgba(255, 255, 255, 0.1);
  --secure-line-bright: rgba(255, 255, 255, 0.18);
  --secure-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  color-scheme: dark;
}

body.cyph-frontier,
body.n27-mail-page {
  background:
    radial-gradient(ellipse 68% 44% at 50% -8%, rgba(0, 196, 235, 0.09), transparent 60%),
    radial-gradient(ellipse 42% 34% at 94% 22%, rgba(154, 58, 160, 0.08), transparent 56%),
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    #020406;
  background-size: auto, auto, 72px 72px, 72px 72px, auto;
  background-attachment: fixed;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 1px solid rgba(0, 196, 235, 0.72);
  outline-offset: 3px;
}

/* CYPH secure chat */
.cyph-frontier .app-shell {
  background: transparent;
}

.cyph-frontier .sidebar,
.cyph-frontier .right-panel {
  background: rgba(5, 8, 12, 0.84);
  border-color: var(--secure-line);
  box-shadow: 12px 0 42px rgba(0, 0, 0, 0.16);
}

.cyph-frontier .right-panel {
  box-shadow: -12px 0 42px rgba(0, 0, 0, 0.16);
}

.cyph-frontier .sidebar-header {
  padding: 18px 16px 14px;
  border-bottom-color: var(--secure-line);
  background: linear-gradient(90deg, rgba(154, 58, 160, 0.06), transparent 74%);
}

.cyph-frontier .sidebar-logo {
  letter-spacing: 0.16em;
}

.cyph-frontier .self-profile {
  border-color: var(--secure-line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(15, 21, 28, 0.9), rgba(7, 10, 14, 0.84));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.cyph-frontier .sidebar-nav-tabs {
  border-bottom-color: var(--secure-line);
}

.cyph-frontier .sidebar-nav-tab.active {
  color: var(--cyan);
  text-shadow: 0 0 14px rgba(0, 196, 235, 0.28);
}

.cyph-frontier .buddy-item,
.cyph-frontier .room-item,
.cyph-frontier .enclave-item {
  border-radius: 9px;
  transition: transform 0.18s var(--secure-ease), background 0.18s ease, border-color 0.18s ease;
}

.cyph-frontier .buddy-item:hover,
.cyph-frontier .room-item:hover,
.cyph-frontier .enclave-item:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.045);
}

.cyph-frontier .buddy-item.active,
.cyph-frontier .room-item.active,
.cyph-frontier .enclave-item.active {
  background: linear-gradient(90deg, rgba(154, 58, 160, 0.14), rgba(154, 58, 160, 0.025));
  border-left-color: var(--violet);
}

.cyph-frontier .main-chat {
  background: rgba(3, 6, 9, 0.7);
}

.cyph-frontier .chat-tab-bar,
.cyph-frontier .chat-header {
  background: rgba(7, 10, 14, 0.84);
  border-color: var(--secure-line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.cyph-frontier .chat-header {
  padding: 16px 22px;
}

.cyph-frontier .chat-peer-name {
  font-size: 16px;
}

.cyph-frontier .e2ee-badge {
  border: 1px solid rgba(57, 217, 138, 0.3);
  border-radius: 999px;
  background: rgba(57, 217, 138, 0.06);
  padding: 5px 9px;
}

.cyph-frontier .messages {
  background: radial-gradient(ellipse 58% 34% at 50% 0%, rgba(154, 58, 160, 0.055), transparent 70%);
}

.cyph-frontier .msg-bubble {
  border-radius: 13px;
  border-color: var(--secure-line);
  background: linear-gradient(145deg, rgba(15, 21, 28, 0.92), rgba(7, 10, 14, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045), 0 10px 24px rgba(0, 0, 0, 0.14);
}

.cyph-frontier .msg-row.outgoing .msg-bubble {
  border-color: rgba(154, 58, 160, 0.42);
  background: linear-gradient(145deg, rgba(154, 58, 160, 0.16), rgba(80, 32, 86, 0.08));
}

.cyph-frontier .chat-input-bar {
  background: rgba(7, 10, 14, 0.9);
  border-top-color: var(--secure-line);
  padding: 14px 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.cyph-frontier .chat-input {
  border-radius: 11px;
  border-color: var(--secure-line);
  background: rgba(255, 255, 255, 0.035);
}

.cyph-frontier .chat-input:focus {
  border-color: rgba(0, 196, 235, 0.56);
  box-shadow: 0 0 0 3px rgba(0, 196, 235, 0.07);
}

.cyph-frontier .chat-send {
  border-radius: 10px;
  background: linear-gradient(135deg, #a94bb0, var(--violet)) !important;
  box-shadow: 0 8px 20px rgba(154, 58, 160, 0.18);
}

.cyph-frontier .rp-section {
  border-bottom-color: var(--secure-line);
}

.cyph-frontier .rp-terminal-log {
  border: 1px solid rgba(0, 196, 235, 0.14);
  border-radius: 10px;
  background: rgba(2, 5, 8, 0.82);
}

.cyph-frontier .cyph-modal-card,
.cyph-frontier #command-palette .command-palette-card {
  border: 1px solid var(--secure-line-bright);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(18, 24, 31, 0.97), rgba(7, 10, 14, 0.97));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Mail Lab secure enclave */
.n27-mail-page #app {
  background: transparent;
}

.n27-mail-page .top-bar {
  height: 58px;
  padding-inline: 24px;
  background: rgba(4, 7, 10, 0.82);
  border-bottom-color: var(--secure-line);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.n27-mail-page .top-bar .logo {
  color: var(--violet);
  text-shadow: 0 0 18px rgba(176, 38, 255, 0.22);
}

.n27-mail-page .top-bar .logo-tag {
  color: var(--muted);
}

.n27-mail-page #mail-ui {
  background: transparent;
  gap: 1px;
}

.n27-mail-page .sidebar,
.n27-mail-page .msg-stream,
.n27-mail-page .email-detail,
.n27-mail-page .right-panel {
  background: rgba(5, 8, 12, 0.84);
  border-color: var(--secure-line);
}

.n27-mail-page .sidebar {
  box-shadow: 12px 0 42px rgba(0, 0, 0, 0.16);
}

.n27-mail-page .sidebar-header,
.n27-mail-page .msg-stream-header,
.n27-mail-page .email-detail .header {
  border-bottom-color: var(--secure-line);
  background: linear-gradient(90deg, rgba(0, 196, 235, 0.045), transparent 74%);
}

.n27-mail-page .account-item,
.n27-mail-page .chat-item,
.n27-mail-page .folder-item {
  border-radius: 9px;
  transition: transform 0.18s var(--secure-ease), background 0.18s ease, border-color 0.18s ease;
}

.n27-mail-page .account-item:hover,
.n27-mail-page .chat-item:hover,
.n27-mail-page .folder-item:hover {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.045);
}

.n27-mail-page .account-item.active,
.n27-mail-page .chat-item.active,
.n27-mail-page .folder-item.active {
  background: linear-gradient(90deg, rgba(0, 196, 235, 0.12), rgba(0, 196, 235, 0.02));
  border-left-color: var(--cyan);
}

.n27-mail-page .enclave-status-widget {
  border-top-color: var(--secure-line);
  background: rgba(0, 196, 235, 0.025);
}

.n27-mail-page .msg-stream {
  background: linear-gradient(180deg, rgba(9, 13, 18, 0.88), rgba(3, 6, 9, 0.86));
}

.n27-mail-page .msg-stream .message-row,
.n27-mail-page .msg-stream .mail-row {
  border-bottom-color: rgba(255, 255, 255, 0.055);
  transition: background 0.18s ease, transform 0.18s var(--secure-ease);
}

.n27-mail-page .msg-stream .message-row:hover,
.n27-mail-page .msg-stream .mail-row:hover {
  background: rgba(0, 196, 235, 0.045);
  transform: translateX(2px);
}

.n27-mail-page .email-detail .security-banner,
.n27-mail-page .cyph-composer-status.ready {
  border: 1px solid rgba(57, 217, 138, 0.28);
  border-radius: 10px;
  background: rgba(57, 217, 138, 0.055);
}

.n27-mail-page .email-detail .body-container,
.n27-mail-page .compose-panel,
.n27-mail-page .settings-panel,
.n27-mail-page .enclave-status-widget {
  border-radius: 14px;
  border-color: var(--secure-line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.n27-mail-page .email-detail .action-dock button,
.n27-mail-page .nav-btn-ico,
.n27-mail-page .sidebar-toggle {
  border-radius: 9px;
  border-color: var(--secure-line);
}

.n27-mail-page .email-detail .action-dock button:hover,
.n27-mail-page .nav-btn-ico:hover,
.n27-mail-page .sidebar-toggle:hover {
  background: rgba(0, 196, 235, 0.07);
  border-color: rgba(0, 196, 235, 0.4);
}

@media (max-width: 768px) {
  .n27-mail-page .top-bar { padding-inline: 14px; }
  .cyph-frontier .chat-input-bar { padding-inline: 12px; }
  .cyph-frontier .msg-row { max-width: 92%; }
}

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