.app-body {
  min-height: 100vh;
  cursor: default;
}

.nav-link {
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.app-shell {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 120px 28px 56px;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.app-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 300;
  line-height: 1;
  color: var(--white);
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: 18px;
  margin-bottom: 18px;
}

.app-grid-wide {
  grid-template-columns: 1fr 1fr;
}

.app-panel {
  border: 1px solid var(--card-border);
  background: rgba(7, 6, 15, 0.72);
  backdrop-filter: blur(18px);
  padding: 24px;
  border-radius: 6px;
}

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

.panel-heading h2,
.subhead {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
}

.field-label,
.metric-label {
  display: block;
  margin-bottom: 8px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(240, 238, 255, 0.48);
}

.app-input,
.app-textarea {
  width: 100%;
  margin-bottom: 14px;
  border: 1px solid rgba(124, 92, 191, 0.32);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
  padding: 13px 14px;
  outline: none;
}

.app-textarea {
  resize: vertical;
  min-height: 112px;
}

.app-input:focus,
.app-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(77, 217, 172, 0.1);
}

.app-button,
.icon-button {
  border: 1px solid rgba(77, 217, 172, 0.35);
  border-radius: 4px;
  background: rgba(77, 217, 172, 0.12);
  color: var(--white);
  cursor: pointer;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.app-button {
  padding: 13px 16px;
}

.app-button-small {
  padding: 9px 12px;
  font-size: 10px;
}

.app-button-secondary {
  border-color: rgba(124, 92, 191, 0.42);
  background: rgba(124, 92, 191, 0.12);
}

.app-button-danger {
  border-color: rgba(232, 126, 126, 0.42);
  background: rgba(232, 126, 126, 0.12);
}

.app-button:hover,
.icon-button:hover {
  background: rgba(77, 217, 172, 0.2);
  transform: translateY(-1px);
}

.app-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

.status-pill {
  border: 1px solid rgba(124, 92, 191, 0.3);
  border-radius: 999px;
  background: rgba(124, 92, 191, 0.1);
  color: var(--purple-light);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 9px 12px;
  white-space: nowrap;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.score-value {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 62px;
  font-weight: 300;
  line-height: 0.9;
  color: var(--white);
}

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

.metric-grid > div {
  min-height: 82px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 4px;
  padding: 14px;
}

.metric-grid strong {
  font-family: 'DM Mono', monospace;
  font-size: 17px;
  color: var(--white);
}

.panel-actions,
.split-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.split-actions .app-button {
  flex: 1 1 112px;
}

.muted-line {
  margin-top: 12px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  line-height: 1.6;
  color: rgba(240, 238, 255, 0.5);
  overflow-wrap: anywhere;
}

.messages-panel {
  margin-top: 18px;
}

.badges-panel {
  margin-bottom: 18px;
}

.ghost-panel {
  margin-bottom: 18px;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.badge-card {
  position: relative;
  min-height: 132px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.025);
  padding: 14px;
  opacity: 0.52;
}

.badge-card.earned {
  border-color: rgba(77, 217, 172, 0.34);
  background: rgba(77, 217, 172, 0.06);
  box-shadow: 0 0 24px rgba(77, 217, 172, 0.06);
  opacity: 1;
}

.badge-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border: 1px solid rgba(124, 92, 191, 0.35);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--purple-light);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
}

.badge-card.earned .badge-icon {
  border-color: rgba(77, 217, 172, 0.55);
  color: var(--green);
}

.badge-title {
  margin-bottom: 6px;
  color: var(--white);
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.badge-desc {
  color: rgba(240, 238, 255, 0.58);
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  line-height: 1.45;
}

.badge-state {
  position: absolute;
  top: 14px;
  right: 14px;
  color: rgba(240, 238, 255, 0.4);
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge-card.earned .badge-state {
  color: var(--green);
}

.message-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.message-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.message-item {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-left: 3px solid var(--purple);
  border-radius: 0 4px 4px 0;
  background: rgba(255, 255, 255, 0.025);
  padding: 14px;
}

.message-item.unlockable {
  border-left-color: var(--green);
}

.message-item.canceled {
  border-left-color: #e87e7e;
  opacity: 0.72;
}

.message-id {
  margin-bottom: 10px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--white);
  overflow-wrap: anywhere;
}

.message-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: rgba(240, 238, 255, 0.55);
}

.message-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.message-actions .app-button {
  padding: 9px 11px;
  font-size: 10px;
}

@media (max-width: 860px) {
  .app-header,
  .score-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-grid,
  .app-grid-wide,
  .message-columns,
  .badges-grid {
    grid-template-columns: 1fr;
  }

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

.chain-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  background: #b84a4a;
  color: #fff;
  font-family: "DM Mono", monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
  flex-wrap: wrap;
}

.passphrase-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 14px;
}

.passphrase-wrap .app-input {
  flex: 1;
  margin-bottom: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.toggle-vis-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 92, 191, 0.12);
  border: 1px solid rgba(124, 92, 191, 0.35);
  border-left: none;
  border-radius: 0 4px 4px 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 14px;
  line-height: 1;
  transition: background 0.2s;
  white-space: nowrap;
}

.toggle-vis-btn:hover {
  background: rgba(124, 92, 191, 0.24);
  color: var(--white);
}

.clickable {
  cursor: pointer;
  transition: opacity 0.15s;
}
.clickable:hover {
  opacity: 0.6;
}

.addr-link {
  color: var(--purple-light);
  text-decoration: none;
  transition: opacity 0.15s;
}
.addr-link:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* ── NOTIFICATION BELL ── */

.notif-bell {
  position: relative;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  transition: opacity 0.2s;
  line-height: 1;
}
.notif-bell:hover { opacity: 0.7; }

.notif-dot {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  background: #e74c3c;
  color: #fff;
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

.notif-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
  background: #120f1e;
  border: 1px solid rgba(124,92,191,0.3);
  border-radius: 6px;
  z-index: 200;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.notif-bell:hover .notif-dropdown,
.notif-bell:focus-within .notif-dropdown {
  display: block;
}

.notif-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(124,92,191,0.1);
  text-decoration: none;
  color: var(--white);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.02em;
  transition: background 0.15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(124,92,191,0.12); }
.notif-item.notif-new { background: rgba(77,217,172,0.06); }
.notif-item.notif-new:hover { background: rgba(77,217,172,0.12); }

.notif-text { flex: 1; }
.notif-time {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.notif-email-input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(124,92,191,0.3);
  border-radius: 4px;
  color: var(--white);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 7px 10px;
  outline: none;
  margin-bottom: 6px;
  box-sizing: border-box;
}
.notif-email-input:focus {
  border-color: var(--purple-light);
}

.notif-push-toggle {
  border-top: 1px solid rgba(124,92,191,0.15);
  padding: 8px 14px;
}

.push-btn {
  width: 100%;
  background: rgba(124,92,191,0.15);
  border: 1px solid rgba(124,92,191,0.35);
  border-radius: 4px;
  color: var(--white);
  cursor: pointer;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  padding: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.2s;
}
.push-btn:hover { background: rgba(124,92,191,0.25); }
.push-btn:disabled { opacity: 0.5; cursor: default; }

.notif-empty {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
}

.unlock-warn {
  color: #e8a04a;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.chain-warning strong {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chain-switch-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  padding: 5px 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.2s;
}

.chain-switch-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* ── LOADING SPINNER ── */

.app-button.is-loading {
  position: relative;
  pointer-events: none;
}

.app-button.is-loading::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 8px;
  border: 2px solid rgba(77, 217, 172, 0.3);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  vertical-align: middle;
}

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

/* Claimed message divider */
.claimed-divider {
  border: none;
  border-top: 1px solid rgba(124, 92, 191, 0.25);
  margin: 20px 0 16px;
}

.claimed-label {
  color: var(--green) !important;
  font-size: 11px !important;
}

/* ── Floating feedback button ── */
.feedback-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(124, 92, 191, 0.4);
  background: rgba(7, 6, 15, 0.85);
  backdrop-filter: blur(12px);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  color: var(--white);
}
.feedback-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(124, 92, 191, 0.3);
  border-color: var(--purple-light);
}

/* ── Feedback modal ── */
.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.feedback-modal-content {
  background: rgba(12, 10, 24, 0.96);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 28px;
  width: 380px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
.feedback-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.feedback-modal-header h3 {
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green);
  margin: 0;
}
.feedback-close-btn {
  background: none;
  border: none;
  color: rgba(240, 238, 255, 0.5);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.feedback-close-btn:hover {
  color: var(--white);
}

@media (max-width: 560px) {
  .app-shell {
    padding: 104px 18px 40px;
  }

  .app-panel {
    padding: 18px;
  }

  .metric-grid,
  .message-meta {
    grid-template-columns: 1fr;
  }

  .badge-card {
    min-height: 112px;
  }

  .nav-actions .nav-tag {
    display: none;
  }
}
