/* INBOX TRIAGE ROOM — pink/magenta accent */

:root {
  --accent: #ff2d78;
  --accent-dim: rgba(255, 45, 120, 0.18);
  --secondary: #00f5d4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: #050510;
  color: #d4d0c8;
  font-family: 'IBM Plex Sans', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

header {
  text-align: center;
  padding: 2.5rem 1.5rem 1.5rem;
  border-bottom: 1px solid rgba(255, 45, 120, 0.2);
  background: linear-gradient(180deg, rgba(255, 45, 120, 0.05), transparent);
}
.back-link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: 0.05em;
}
.back-link:hover { text-decoration: underline; }
h1 {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  color: #e8e6e3;
  margin: 1rem 0 0.5rem;
  letter-spacing: 0.05em;
}
.subtitle {
  font-style: italic;
  color: #706c68;
  font-size: 0.95rem;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.canvas-wrap {
  position: relative;
  background: #0a0a14;
  border: 1px solid rgba(255, 45, 120, 0.3);
  overflow: hidden;
  aspect-ratio: 16/9;
}
canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
}

.event-log {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 45, 120, 0.04);
  border-left: 2px solid var(--accent);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: #a8a4a0;
  max-height: 8rem;
  overflow-y: auto;
}
.event-log div { padding: 0.15rem 0; }
.event-log .urgent { color: #ff5555; }
.event-log .reply  { color: #ffdd55; }
.event-log .archive { color: #888; }
.event-log .snooze { color: #5588ff; }

.room-info {
  margin-top: 3rem;
  padding: 2rem;
  background: rgba(6, 4, 13, 0.6);
  border: 1px solid rgba(255, 45, 120, 0.2);
}
.room-info h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 1.3rem;
  color: #e8e6e3;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}
.room-info p { font-size: 1rem; line-height: 1.7; margin-bottom: 1rem; color: #d4d0c8; }
.room-info details { margin-top: 1rem; }
.room-info summary {
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
  padding: 0.4rem 0;
}
.room-info summary:hover { color: #fff; }
.room-info ul { margin-top: 0.8rem; padding-left: 1.2rem; }
.room-info li { padding: 0.35rem 0; color: #a8a4a0; font-size: 0.9rem; line-height: 1.5; }
.room-info code { background: rgba(255, 45, 120, 0.1); padding: 0.1rem 0.3rem; font-family: 'IBM Plex Mono', monospace; font-size: 0.85rem; }

footer {
  margin-top: 3rem;
  border-top: 1px solid rgba(255, 45, 120, 0.2);
  background: #050510;
}
.status-bar {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.8rem 1.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  color: #706c68;
  flex-wrap: wrap;
}
.status-bar .sep { color: #504c48; }
.status-bar .accent { color: var(--accent); }
.status-bar .ok { color: var(--secondary); }

.ticker {
  border-top: 1px solid rgba(255, 45, 120, 0.15);
  overflow: hidden;
  padding: 0.5rem 0;
}
.ticker-track {
  display: inline-block;
  white-space: nowrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: #504c48;
  letter-spacing: 0.1em;
  animation: tick 30s linear infinite;
}
.ticker-track span { margin: 0 1rem; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.draft-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}

.draft-modal-inner {
  background: #0a0a14;
  border: 2px solid #ff2d78;
  max-width: 540px;
  width: 100%;
  box-shadow: 0 0 40px rgba(255, 45, 120, 0.3);
  font-family: 'IBM Plex Mono', monospace;
}

.draft-modal-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid rgba(255, 45, 120, 0.3);
  background: rgba(255, 45, 120, 0.08);
}

.draft-modal-tag {
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.6rem;
  border: 1px solid currentColor;
}

.draft-modal-prompt {
  font-size: 0.85rem;
  color: #e8e6e3;
  font-weight: 600;
}

.draft-modal-email {
  padding: 1rem 1.2rem;
}

.draft-modal-row {
  display: flex;
  gap: 0.8rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 45, 120, 0.1);
  font-size: 0.8rem;
}

.draft-label {
  color: #706c68;
  width: 60px;
  flex-shrink: 0;
  font-weight: 600;
}

.draft-val {
  color: #d4d0c8;
  flex: 1;
  word-break: break-word;
}

.draft-modal-body {
  margin-top: 1rem;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border-left: 2px solid #ff2d78;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #d4d0c8;
  white-space: pre-wrap;
  min-height: 100px;
}

.draft-modal-actions {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.2rem;
  border-top: 1px solid rgba(255, 45, 120, 0.3);
  background: rgba(6, 4, 13, 0.6);
}

.draft-btn {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 1px solid currentColor;
  background: transparent;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 150ms;
  text-transform: uppercase;
}

.draft-btn-skip {
  color: #888;
}

.draft-btn-skip:hover {
  background: rgba(136, 136, 136, 0.15);
  color: #fff;
}

.draft-btn-edit {
  color: #ffdd33;
}

.draft-btn-edit:hover {
  background: rgba(255, 221, 51, 0.15);
  color: #fff;
}

.draft-btn-send {
  color: #00f5d4;
  border-color: #00f5d4;
  background: rgba(0, 245, 212, 0.1);
}

.draft-btn-send:hover {
  background: rgba(0, 245, 212, 0.25);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.3);
}

/* === In-scene draft toast (part of the simulation, not a splash) === */

.draft-toast {
  position: absolute;
  top: 12px;
  right: 12px;
  display: none;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.9rem;
  background: rgba(10, 10, 20, 0.95);
  border: 1px solid #ff2d78;
  border-left-width: 3px;
  font-family: 'IBM Plex Mono', monospace;
  cursor: pointer;
  z-index: 50;
  max-width: 280px;
  box-shadow: 0 0 24px rgba(255, 45, 120, 0.4);
  animation: toastSlide 400ms ease-out;
}

.draft-toast.show {
  display: flex;
}

@keyframes toastSlide {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.draft-toast-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.draft-toast-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.draft-toast-tag {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  align-self: flex-start;
}

.draft-toast-subject {
  font-size: 0.78rem;
  color: #e8e6e3;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-toast-meta {
  font-size: 0.65rem;
  color: #706c68;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-toast-hint {
  font-size: 0.55rem;
  color: #504c48;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* Canvas attention flash when draft is ready */
.canvas-wrap.attention {
  animation: attentionFlash 800ms ease-out;
}

@keyframes attentionFlash {
  0%   { box-shadow: 0 0 0 0 rgba(255, 45, 120, 0); }
  20%  { box-shadow: 0 0 0 4px rgba(255, 45, 120, 0.6); }
  100% { box-shadow: 0 0 0 0 rgba(255, 45, 120, 0); }
}

/* === Expanded draft detail (opens over canvas, not full page) === */

.draft-toast-expanded {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
  z-index: 100;
  padding: 1rem;
  animation: toastFade 200ms ease-out;
}

.draft-toast-expanded.show {
  display: flex;
}

@keyframes toastFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.draft-toast-expanded-inner {
  background: #0a0a14;
  border: 2px solid #ff2d78;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 0 40px rgba(255, 45, 120, 0.3);
  font-family: 'IBM Plex Mono', monospace;
  animation: toastExpand 300ms ease-out;
}

@keyframes toastExpand {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.draft-toast-close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: #706c68;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.3rem;
}

.draft-toast-close:hover {
  color: #fff;
}
