:root {
  color-scheme: light;
  --bg: #f7f3e8;
  --card: rgba(255, 252, 245, 0.88);
  --ink: #1d2a22;
  --muted: #5d685f;
  --line: rgba(16, 56, 39, 0.12);
  --accent: #0b6e4f;
  --accent-strong: #064e37;
  --shadow: 0 24px 60px rgba(18, 57, 42, 0.12);
  --notif-bg: #fdf9f0;
  --notif-selected-bg: #d6ece3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(242, 196, 98, 0.35), transparent 30%),
    radial-gradient(circle at bottom right, rgba(11, 110, 79, 0.18), transparent 28%),
    linear-gradient(180deg, #f5efe1, var(--bg));
}

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

.card {
  width: min(720px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 0.95;
}

.lede {
  margin: 16px 0 0;
  max-width: 52ch;
  font-size: 1.1rem;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: var(--accent);
}

button.secondary {
  color: var(--ink);
  background: #e8dcc2;
}

button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.status {
  margin-top: 20px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  white-space: pre-wrap;
  word-break: break-word;
}

.notes {
  margin-top: 24px;
  color: var(--muted);
}

.notes ol {
  padding-left: 20px;
}

code {
  font-family: "Courier New", monospace;
}

@media (max-width: 640px) {
  .card {
    padding: 22px;
    border-radius: 22px;
  }
}

/* ── Notification History ─────────────────────────────────────────────── */

.notification-history {
  margin-top: 32px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.notification-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.notification-history-title {
  margin: 0;
  font-size: 1.25rem;
}

.sort-controls {
  display: flex;
  gap: 8px;
}

.sort-btn {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  background: #e8dcc2;
  color: var(--ink);
}

.sort-btn.active {
  background: var(--accent);
  color: #fff;
}

.notification-history-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.multiselect-controls {
  display: flex;
  gap: 8px;
}

.delete-selected-btn {
  background: #c0392b;
  color: #fff;
}

.delete-selected-btn:disabled {
  background: #e8a49a;
}

.notification-list-container {
  position: relative;
}

.notification-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.notification-empty {
  color: var(--muted);
  font-style: italic;
  padding: 12px 0;
}

/* ── Notification item with swipe-to-delete ─────────────────────────────── */

.notification-item {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  flex-shrink: 0;
}

.notif-delete-btn {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 80px;
  background: #c0392b;
  color: #fff;
  border: none;
  border-radius: 0 14px 14px 0;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.notif-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--notif-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  position: relative;
  z-index: 1;
  transition: transform 0.22s ease;
  will-change: transform;
}

.notification-item.selected .notif-inner {
  background: var(--notif-selected-bg);
}

/* ── Checkbox ────────────────────────────────────────────────────────────── */

.notif-checkbox {
  display: none;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.notification-item.multi-select-mode .notif-checkbox {
  display: block;
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notification-body {
  font-size: 1rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 8px;
}

.notification-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.notification-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
}

.notification-time {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: "Courier New", monospace;
}

/* ── Select-to-here bar ──────────────────────────────────────────────────── */

.select-to-here-bar {
  display: flex;
  justify-content: center;
  padding: 6px 0 2px;
}

.select-to-here-bar[hidden] {
  display: none;
}

.select-to-here-btn {
  padding: 7px 18px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11, 110, 79, 0.25);
}
