* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  color: #1b1b1b;
  background: #faf9f8;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 48px;
  padding: 0 16px;
  background: #0078d4;
  color: white;
}

.topbar-title { font-weight: 600; }
.topbar-account { opacity: 0.85; font-size: 13px; }

.refresh-btn {
  margin-left: auto;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.refresh-btn:hover { background: rgba(255,255,255,0.25); }
.refresh-btn:disabled { opacity: 0.6; cursor: default; }

.last-sync { font-size: 12px; opacity: 0.8; min-width: 140px; text-align: right; }

.layout {
  display: flex;
  height: calc(100% - 48px);
}

.mail-list {
  width: 380px;
  min-width: 260px;
  overflow-y: auto;
  border-right: 1px solid #e1dfdd;
  background: white;
}

.mail-item {
  position: relative;
  padding: 10px 40px 10px 16px;
  border-bottom: 1px solid #f3f2f1;
  cursor: pointer;
}
.mail-item:hover { background: #f3f2f1; }
.mail-item.selected { background: #edebe9; }

.delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: #605e5c;
}
.delete-btn:hover { background: #e1dfdd; color: #a4262c; }
.delete-btn svg { width: 14px; height: 14px; }

.mail-item .row1 {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 2px;
}
.mail-item .from { color: #323130; }
.mail-item .date { color: #605e5c; white-space: nowrap; margin-left: 8px; }
.mail-item .subject { font-size: 13px; color: #323130; }
.mail-item .meta { font-size: 12px; color: #605e5c; margin-top: 2px; }

.mail-item.unread .from,
.mail-item.unread .subject {
  font-weight: 700;
}
.mail-item.unread .row1::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0078d4;
  margin-right: 6px;
  vertical-align: middle;
}

.attachment-badge {
  margin-left: 4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #605e5c;
  vertical-align: middle;
}
.attachment-badge svg { width: 12px; height: 12px; }

.att-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.att-title svg { width: 14px; height: 14px; }

.reading-pane {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  background: white;
}

.reading-pane h2 { margin: 0 0 8px 0; font-size: 20px; }

.reading-meta {
  font-size: 13px;
  color: #605e5c;
  margin-bottom: 16px;
  line-height: 1.6;
}
.reading-meta strong { color: #1b1b1b; }

.attachments-box {
  margin-bottom: 16px;
  padding: 10px 12px;
  background: #f3f2f1;
  border-radius: 4px;
  font-size: 13px;
}
.attachments-box .att-title { font-weight: 600; margin-bottom: 4px; }
.attachments-box ul { margin: 0; padding-left: 18px; }

.reading-body {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.reading-pane iframe {
  width: 100%;
  height: 60px;
  border: none;
  display: block;
}

.event-card-wrap {
  display: flex;
  justify-content: flex-start;
  margin-top: 20px;
}
.event-card {
  display: flex;
  border: 1px solid #e1dfdd;
  border-radius: 6px;
  overflow: hidden;
  max-width: 320px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.event-card-date {
  background: #0078d4;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  min-width: 56px;
}
.event-card-date .day { font-size: 22px; font-weight: 700; line-height: 1; }
.event-card-date .month { font-size: 11px; letter-spacing: 0.05em; margin-top: 2px; }
.event-card-info { padding: 10px 14px; font-size: 13px; }
.event-card-info .title { font-weight: 600; margin-bottom: 4px; }
.event-card-info .row { color: #605e5c; margin-top: 2px; }

.empty-state {
  padding: 32px;
  color: #605e5c;
  font-size: 14px;
  text-align: center;
}
