:root {
  --bg: #13111c;
  --card: rgba(26, 23, 38, 0.85);
  --border: rgba(255, 224, 102, 0.25);
  --accent: #ffd43b;
  --accent-text: #18141f;
  --text: #f3f0ff;
  --muted: #9f96b8;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg) url('/assets/bg.png') center/cover fixed no-repeat;
  min-height: 100vh;
}

#banana-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hidden { display: none !important; }

.card {
  position: relative;
  z-index: 1;
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}

.logo-img { max-height: 96px; margin: 0 auto; object-fit: contain; }
.logo-mini { height: 28px; object-fit: contain; }

input, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(12, 10, 18, 0.78);
  color: var(--text);
  font: inherit;
}

button {
  cursor: pointer;
  border-radius: 10px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
}

.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--text); border-color: var(--border); }
.full { width: 100%; }

.app-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100vh;
}

.topbar {
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand, .top-actions { display: flex; align-items: center; gap: 10px; }
.badge { font-size: 13px; color: var(--accent); }

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 190px 330px 1fr;
  gap: 12px;
}

.sidebar { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.sidebar hr { width: 100%; border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.folder-btn { text-align: left; background: transparent; color: var(--text); }
.folder-btn.active { background: rgba(255, 212, 59, 0.18); color: var(--accent); }

.msg-list, .msg-view { padding: 14px; overflow-y: auto; }

.msg-item {
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  cursor: pointer;
}
.msg-item:hover, .msg-item.active { background: rgba(255, 212, 59, 0.14); }
.msg-item.unread .msg-from::before {
  content: "● ";
  color: var(--accent);
}
.msg-from { font-weight: 700; font-size: 14px; }
.msg-subj { font-size: 13px; margin-top: 3px; }
.msg-date { font-size: 11px; color: var(--muted); margin-top: 3px; }

.view-head { border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 12px; }
.view-head h2 { margin: 0 0 6px; font-size: 18px; }
.view-meta { font-size: 13px; color: var(--muted); }
.view-body-text { white-space: pre-wrap; font-family: inherit; line-height: 1.5; margin: 0; }
.view-body-html { width: 100%; height: 65vh; border: none; border-radius: 8px; background: #fff; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.compose-card { width: 100%; max-width: 600px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.modal-head, .modal-foot { display: flex; justify-content: space-between; align-items: center; }
.muted { color: var(--muted); font-size: 14px; }
.error-text { color: #ff6b6b; font-size: 13px; }

@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; height: auto; }
  .app-wrap { height: auto; }
}

.attachments-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.att-chip {
  background: rgba(255, 212, 59, 0.14);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
}

.att-chip:hover {
  background: rgba(255, 212, 59, 0.26);
}

.file-picker {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.view-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.view-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-danger {
  background: rgba(255, 107, 107, 0.14);
  color: #ff8787;
  border: 1px solid rgba(255, 107, 107, 0.35);
}

.btn-danger:hover {
  background: rgba(255, 107, 107, 0.28);
}

.avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.avatar-img.clickable {
  cursor: pointer;
  transition: transform 0.15s ease;
}

.avatar-img.clickable:hover {
  transform: scale(1.08);
  border-color: var(--accent);
}

.msg-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.msg-row-body {
  min-width: 0;
  flex: 1;
}

.view-sender-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.search-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--card);
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.search-bar input {
  width: 100%;
}

.msg-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-warn {
  background: rgba(255, 212, 59, 0.14);
  color: var(--accent);
  border: 1px solid rgba(255, 212, 59, 0.35);
}

.btn-warn:hover {
  background: rgba(255, 212, 59, 0.26);
}
