:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f8fafc;
  color: #0f172a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top right, #eef2ff 0%, #f8fafc 40%, #f8fafc 100%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e2e8f0;
  backdrop-filter: blur(8px);
}

.brand {
  font-weight: 800;
  color: #4f46e5;
  letter-spacing: -0.02em;
}

.menu {
  display: flex;
  gap: 8px;
}

.container {
  max-width: 1024px;
  margin: 24px auto;
  padding: 0 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.auth-card {
  max-width: 620px;
  margin: 20px auto;
}

.account-panel {
  background: linear-gradient(180deg, #eef2ff 0%, #ffffff 45%);
}

.row {
  display: flex;
  align-items: center;
}

.row.wrap {
  flex-wrap: wrap;
  gap: 12px;
}

.between {
  justify-content: space-between;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.btn {
  border: 1px solid #4f46e5;
  background: #4f46e5;
  color: #fff;
  border-radius: 10px;
  height: 38px;
  padding: 0 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.btn.primary {
  background: #4f46e5;
  border-color: #4f46e5;
}

.btn.secondary {
  background: #fff;
  color: #334155;
  border-color: #cbd5e1;
}

.btn.danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.input-like {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  color: #0f172a;
  overflow: hidden;
}

.input-like span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.with-action {
  justify-content: space-between;
  gap: 8px;
}

.icon-btn {
  border: 0;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
}

.icon-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.muted {
  color: #64748b;
}

.small {
  font-size: 13px;
}

.inbox-list {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}

.email-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
}

.email-item:last-child {
  border-bottom: 0;
}

.email-item:hover {
  background: #f8fafc;
}

.email-main {
  min-width: 0;
}

.email-main .from {
  margin: 0;
  font-weight: 600;
  font-size: 14px;
  color: #0f172a;
}

.email-main .subject {
  margin: 3px 0 0;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-meta {
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
}

.empty-state {
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 28px 18px;
  text-align: center;
  margin-top: 10px;
}

.empty-title {
  margin: 0 0 6px;
  color: #1e293b;
  font-weight: 700;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.mail-body {
  background: #0b1220;
  color: #dbeafe;
  border-radius: 10px;
  padding: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 120px;
}

.html-preview {
  width: 100%;
  min-height: 320px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
}

.error {
  color: #b91c1c;
  margin-top: 8px;
}

@media (max-width: 760px) {
  .account-grid {
    grid-template-columns: 1fr;
  }

  .email-item {
    flex-direction: column;
    align-items: flex-start;
  }
}
