* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 0;
  background: #f5f5f7;
  color: #1c1c1e;
}

.view { min-height: 100vh; }

/* Login */
#login-view { display: flex; align-items: center; justify-content: center; }
.login-box {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.login-box h1 { margin: 0 0 0.5rem; font-size: 1.4rem; }
input, textarea, button {
  font: inherit;
  padding: 0.6rem;
  border-radius: 8px;
  border: 1px solid #d1d1d6;
}
button {
  background: #0071e3;
  color: white;
  border: none;
  cursor: pointer;
}
button:hover { background: #0060c0; }
.error { color: #d70015; font-size: 0.85rem; min-height: 1.2em; }

/* App */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: white;
  border-bottom: 1px solid #e5e5ea;
}
header h1 { font-size: 1.2rem; margin: 0; }
header div { display: flex; align-items: center; gap: 0.75rem; }
#user-email { color: #636366; font-size: 0.9rem; }
#logout-btn { background: #e5e5ea; color: #1c1c1e; }
#logout-btn:hover { background: #d1d1d6; }

main {
  display: grid;
  grid-template-columns: 380px 1fr;
  height: calc(100vh - 65px);
}
#message-list {
  border-right: 1px solid #e5e5ea;
  overflow-y: auto;
  background: white;
}
.msg-row {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid #f0f0f2;
  cursor: pointer;
}
.msg-row:hover { background: #f5f5f7; }
.msg-row.unread { font-weight: 600; }
.msg-row .subject { display: block; margin: 0.15rem 0; }
.msg-row .from, .msg-row .date { font-size: 0.8rem; color: #636366; font-weight: normal; }

#message-view { padding: 1.5rem; overflow-y: auto; }
.hint { color: #8e8e93; }

/* Compose modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.compose-box {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.compose-box h2 { margin: 0 0 0.4rem; font-size: 1.1rem; }
.compose-actions { display: flex; justify-content: flex-end; gap: 0.6rem; }
.compose-actions button[type="button"] { background: #e5e5ea; color: #1c1c1e; }
