:root {
  color-scheme: light;
  --ink: #142033;
  --muted: #64748b;
  --line: #d7dee8;
  --panel: #ffffff;
  --bg: #f3f6f8;
  --accent: #0d9488;
  --accent-ink: #ffffff;
  font-family: "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

h1 { margin: 0 0 1.35rem; font-size: 1.5rem; font-weight: 600; text-align: center; }

.screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.card, .modal-card {
  width: min(400px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 28px rgba(15, 23, 42, 0.07);
  padding: 1.75rem 1.5rem;
}

label { display: block; font-size: 14px; font-weight: 500; margin: 0 0 0.35rem; }

label.remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.15rem 0 1.1rem;
  cursor: pointer;
}

.remember input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.pass-wrap { position: relative; margin-bottom: 0.65rem; }
.pass-wrap input { padding-right: 2.75rem; margin-bottom: 0; }
#username { margin-bottom: 0.85rem; }

.eye {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.eye svg { width: 22px; height: 22px; }
.eye:hover { color: var(--ink); background: rgba(215, 222, 232, 0.55); }
button.eye, button.eye[aria-pressed="true"] {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: transparent;
  color: var(--muted);
  border: none;
}

input, button { font: inherit; border-radius: 8px; }

input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

button {
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 14px;
  cursor: pointer;
}

button.ghost {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.card > button[type="submit"] { width: 100%; padding: 0.75rem 1rem; }

.error { min-height: 1.2em; margin: 0.6rem 0 0; color: #b42318; font-size: 14px; }

.home { min-height: 100vh; padding: 24px; }

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

.profile { position: relative; }

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.avatar svg { width: 22px; height: 22px; }

.menu {
  position: absolute;
  right: 0;
  top: 46px;
  width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  padding: 6px;
  display: grid;
  z-index: 5;
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-align: left;
  background: transparent;
  color: var(--ink);
  border: none;
  width: 100%;
}

.menu-btn:hover { background: #f4f6f8; }

.menu-icon { width: 22px; height: 22px; flex: none; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.mail-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mail-card h2 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 600; padding-right: 4.5rem; }
.mail-card .addr { margin: 0; color: var(--muted); word-break: break-all; }
.mail-card .status { margin: 10px 0 0; font-size: 14px; }

.mail-card .actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
}

.mail-card:hover .actions,
.mail-card:focus-within .actions {
  opacity: 1;
  pointer-events: auto;
}

.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.icon-btn svg { width: 18px; height: 18px; }

.modal-card .actions { display: flex; gap: 8px; }

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(20, 32, 51, 0.35);
  padding: 24px;
}
