* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #111; font-family: -apple-system, sans-serif; color: #F5F2ED; min-height: 100vh; }

/* ============ Top bar ============ */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(20, 20, 20, .95);
  backdrop-filter: blur(12px);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.topbar-title .title { font-size: 20px; font-weight: 700; }
.topbar-title .subtitle { font-size: 13px; color: rgba(245, 242, 237, .5); font-family: monospace; margin-top: 2px; }

.topbar-actions { display: flex; align-items: center; gap: 16px; }
.mode-toggle {
  display: flex; gap: 4px;
  background: rgba(255, 255, 255, .08);
  padding: 4px; border-radius: 10px;
}
.mode-toggle[hidden] { display: none; }
.mode-btn {
  padding: 8px 20px; background: transparent; border: none;
  color: rgba(245, 242, 237, .6); cursor: pointer;
  border-radius: 7px; font-size: 13px;
  font-family: monospace; letter-spacing: .06em; font-weight: 700;
  transition: all .15s;
}
.mode-btn.active {
  background: #2C5F8A; color: #fff;
  box-shadow: 0 2px 8px rgba(44, 95, 138, .4);
}
.mode-btn:hover:not(.active) { background: rgba(255, 255, 255, .12); color: #F5F2ED; }

.action-btn {
  padding: 8px 16px;
  background: rgba(44, 95, 138, .2);
  border: 1px solid rgba(91, 155, 213, .4);
  color: #5B9BD5;
  cursor: pointer;
  border-radius: 7px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  transition: all .15s;
}
.action-btn:hover { background: rgba(44, 95, 138, .35); color: #F5F2ED; }
.action-btn.primary {
  background: #2C5F8A;
  color: #fff;
  border-color: #2C5F8A;
}
.action-btn.primary:hover { background: #3A7AB0; }
.comment-count {
  display: inline-block;
  background: #C9563C;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  margin-left: 6px;
  font-weight: 900;
}
.comment-count.zero { background: rgba(255,255,255,.15); color: rgba(245,242,237,.5); }

#btn-copy-mode.active {
  background: #C9943E;
  color: #1A1816;
  border-color: #C9943E;
}

/* ============ View base ============ */
.view { display: none; padding: 40px; }
.view.active { display: block; }

/* ============ Lightbox for attachment preview ============ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: pointer;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0,0,0,.9);
}

/* ============ Toast notification ============ */
.toast {
  position: fixed;
  bottom: 40px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(44, 95, 138, .95);
  color: #fff;
  padding: 14px 24px;
  border-radius: 10px;
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .6);
  z-index: 300;
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
