*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0f1117;
  --card: #171a22;
  --border: #2a3140;
  --text: #e8ecf4;
  --dim: #8b95a8;
  --accent: #5eead4;
  --accent-dim: rgba(94, 234, 212, 0.12);
  --accent2: #38bdf8;
  --danger: #f87171;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
}

.wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.brand {
  text-align: center;
  margin-bottom: 24px;
}

.brand-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(94, 234, 212, 0.2);
  border-radius: 99px;
  padding: 4px 10px;
  margin-bottom: 12px;
}

.brand h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand p {
  color: var(--dim);
  font-size: 11px;
  margin-top: 6px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}

.label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin-bottom: 8px;
}

.email-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.email-compose {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-width: 0;
  background: #0a0d12;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.local-input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  border: none;
  padding: 12px 14px;
  color: var(--accent);
  outline: none;
}

.local-input::placeholder {
  color: var(--dim);
  font-weight: 400;
}

.email-domain {
  display: flex;
  align-items: center;
  padding: 12px 14px 12px 0;
  font-size: 13px;
  color: var(--dim);
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}

.btn {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--accent);
  color: #0a0f0e;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.timer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.timer-bar {
  flex: 1;
  height: 4px;
  background: #0a0d12;
  border-radius: 99px;
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  width: 100%;
  transition: width 1s linear;
}

.timer.expired .timer-fill {
  background: var(--danger);
  width: 0 !important;
}

.timer.expired .timer-text {
  color: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.inbox-card {
  padding: 18px;
}

#inbox-panel {
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.inbox-empty {
  flex: 1;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inbox-empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.inbox-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(94, 234, 212, 0.35);
  background: rgba(94, 234, 212, 0.07);
  box-shadow: 0 0 24px rgba(94, 234, 212, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.inbox-empty-text {
  font-size: 12px;
  color: var(--dim);
  line-height: 1.6;
  text-align: center;
}

.inbox-loading {
  flex: 1;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--dim);
}

.mail-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mail-item {
  display: grid;
  grid-template-columns: minmax(88px, 32%) 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 12px;
  background: #0a0d12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.12s;
}

.mail-item:hover {
  background: #12161f;
}

.mail-from {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-subject {
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.mail-time {
  font-size: 10px;
  color: var(--dim);
  white-space: nowrap;
}

.detail-view {
  flex: 1;
  min-height: 280px;
  background: #0a0d12;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.back-link {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--border);
  background: #12161f;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent2);
  cursor: pointer;
}

.back-link:hover {
  background: #171b26;
}

.detail-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 6px;
  font-size: 11px;
  flex-wrap: wrap;
}

.detail-from .dim {
  color: var(--dim);
}

.detail-date {
  color: var(--dim);
  font-size: 10px;
}

.detail-subject {
  padding: 0 14px 12px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.detail-body {
  padding: 14px;
}

.mail-frame {
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.mail-text {
  font-size: 12px;
  line-height: 1.55;
  color: var(--dim);
  white-space: pre-wrap;
  word-break: break-word;
}

.err {
  color: var(--danger);
  font-size: 11px;
  margin-top: 10px;
}

.hidden { display: none !important; }

.site-footer {
  text-align: center;
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.04em;
  margin-top: 8px;
  padding-bottom: 8px;
}

.footer-handle {
  color: var(--accent);
  font-weight: 600;
}

@media (max-width: 420px) {
  .email-domain {
    font-size: 11px;
    padding-right: 10px;
  }

  .local-input {
    font-size: 12px;
    padding: 10px 12px;
  }

  .mail-item {
    grid-template-columns: minmax(72px, 36%) 1fr auto;
    gap: 6px;
    padding: 10px 12px;
  }

  .mail-from,
  .mail-subject {
    font-size: 11px;
  }
}
