/* ==========================================================================
   REMINDLY — Design tokens
   Palette: calm pine/teal on warm paper, single accent, sparing rust for overdue.
   Type: Fraunces (display/wordmark) + Inter (UI) + IBM Plex Mono (times/dates).
   Signature: the reminder "knot" — a loop-and-string motif standing in for
   the folk trick of tying a string around your finger to remember something.

   Copyright © Md. Hamidur Rhamn 2026 BD. All rights reserved.
   ========================================================================== */

:root {
  --bg: #F6F7F4;
  --surface: #FFFFFF;
  --surface-raised: #FFFFFF;
  --border: #E4E7E1;
  --text: #1B211E;
  --text-secondary: #666F69;
  --text-faint: #9AA39C;

  --accent: #2F5D4F;
  --accent-strong: #234639;
  --accent-soft: #E4EEE9;
  --accent-contrast: #F6FBF8;

  --warn: #B5533C;
  --warn-soft: #F7E9E4;
  --priority-high: #B5533C;
  --priority-medium: #B8862F;
  --priority-low: #5C7A6B;

  --shadow-sm: 0 1px 2px rgba(27, 33, 30, 0.06);
  --shadow-md: 0 6px 20px rgba(27, 33, 30, 0.08);
  --shadow-lg: 0 16px 40px rgba(27, 33, 30, 0.14);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --transition-fast: 120ms ease;
  --transition-med: 200ms ease;

  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #121613;
  --surface: #1A211D;
  --surface-raised: #1F2723;
  --border: #2B332E;
  --text: #ECF0ED;
  --text-secondary: #9DAAA3;
  --text-faint: #6E7A73;

  --accent: #6FA98F;
  --accent-strong: #8CC0A8;
  --accent-soft: #23332C;
  --accent-contrast: #0F1512;

  --warn: #D98567;
  --warn-soft: #322320;
  --priority-high: #D98567;
  --priority-medium: #D9B15E;
  --priority-low: #8AA79A;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: #121613;
    --surface: #1A211D;
    --surface-raised: #1F2723;
    --border: #2B332E;
    --text: #ECF0ED;
    --text-secondary: #9DAAA3;
    --text-faint: #6E7A73;
    --accent: #6FA98F;
    --accent-strong: #8CC0A8;
    --accent-soft: #23332C;
    --accent-contrast: #0F1512;
    --warn: #D98567;
    --warn-soft: #322320;
    --priority-high: #D98567;
    --priority-medium: #D9B15E;
    --priority-low: #8AA79A;
    color-scheme: dark;
  }
}

/* The native [hidden] attribute must always win over a component's own
   "display" declaration (flex/inline-flex components would otherwise
   re-appear despite being hidden). */
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition-med), color var(--transition-med);
}

h1, h2, h3 { font-family: var(--font-display); margin: 0; font-weight: 600; }

button { font-family: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; background: var(--accent);
  color: var(--accent-contrast); padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  z-index: 200; transition: top var(--transition-fast);
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   APP SHELL
   ========================================================================== */

.app-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 0.5rem; }
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.primary-nav {
  display: flex;
  gap: 0.25rem;
  margin-left: 0.25rem;
  overflow-x: auto;
}
.nav-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-btn:hover { background: var(--accent-soft); color: var(--text); }
.nav-btn.is-active { background: var(--accent); color: var(--accent-contrast); }

.icon-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  margin-left: auto;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }

.app-main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1.1rem 6rem;
}

.app-footer {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.1rem 1.5rem;
  text-align: center;
}
.app-footer p {
  font-size: 0.75rem;
  color: var(--text-muted, #8a8f87);
  opacity: 0.8;
}

/* ==========================================================================
   HERO / SUMMARY
   ========================================================================== */

.hero { padding: 0.5rem 0 1.1rem; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.4rem;
}
.hero-title {
  font-size: 1.6rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
}

.summary-row { display: flex; gap: 0.6rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.summary-pill {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
}
.summary-pill--warn { background: var(--warn-soft); border-color: transparent; }
.summary-count { font-family: var(--font-mono); font-weight: 500; font-size: 1rem; color: var(--text); }
.summary-pill--warn .summary-count { color: var(--warn); }
.summary-label { font-size: 0.82rem; color: var(--text-secondary); }

/* ==========================================================================
   QUICK ADD
   ========================================================================== */

.quick-add {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.quick-add input[type="text"] {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 1.02rem;
  font-family: var(--font-body);
  color: var(--text);
  padding: 0.3rem 0.1rem 0.7rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.7rem;
}
.quick-add input[type="text"]:focus { outline: none; border-color: var(--accent); }
.quick-add input[type="text"]::placeholder { color: var(--text-faint); }

.quick-add-row { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.quick-chip-group { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.quick-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.quick-chip:hover { border-color: var(--accent); color: var(--text); }
.quick-chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 500; }
html[data-theme="dark"] .quick-chip.is-active,
html[data-theme="system"] .quick-chip.is-active { color: var(--accent-strong); }

.btn-quick-save { padding: 0.5rem 1.15rem; font-size: 0.88rem; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.2rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--accent-soft); color: var(--accent-strong); }
.btn-secondary:hover { filter: brightness(0.97); }
.btn-danger { background: transparent; color: var(--warn); border: 1px solid var(--warn); }
.btn-danger:hover { background: var(--warn-soft); }

.btn-add-full { width: 100%; }

/* ==========================================================================
   TOOLBAR
   ========================================================================== */

.toolbar { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.3rem; }

.search-wrap { position: relative; }
.search-icon { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--text-faint); }
.search-wrap input {
  width: 100%;
  padding: 0.6rem 0.9rem 0.6rem 2.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
}
.search-wrap input:focus { outline: none; border-color: var(--accent); }

.filter-chips { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 2px; }
.filter-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-chip:hover { border-color: var(--accent); }
.filter-chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

/* ==========================================================================
   REMINDER LIST
   ========================================================================== */

.reminder-groups { display: flex; flex-direction: column; gap: 1.4rem; }
.reminder-group-title {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--text-faint);
  margin: 0 0 0.55rem 0.1rem;
}

.reminder-list { display: flex; flex-direction: column; gap: 0.6rem; list-style: none; margin: 0; padding: 0; }

.reminder-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.9rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}
.reminder-card:hover { box-shadow: var(--shadow-md); }
.reminder-card.is-overdue { border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.reminder-card.is-completed { opacity: 0.72; }

/* the "knot" checkbox — a loop of string that pulls taut into a knot when tied (completed) */
.knot-check {
  appearance: none;
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  border: 2px solid var(--text-faint);
  background: var(--surface);
  cursor: pointer;
  margin-top: 2px;
  position: relative;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.knot-check:hover { border-color: var(--accent); }
.knot-check:checked {
  border-color: var(--accent);
  background: var(--accent);
}
.knot-check:checked::after {
  content: "";
  position: absolute;
  left: 6px; top: 2px;
  width: 6px; height: 12px;
  border-right: 2px solid var(--accent-contrast);
  border-bottom: 2px solid var(--accent-contrast);
  transform: rotate(40deg);
}

.reminder-body { flex: 1; min-width: 0; }
.reminder-title {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 0.15rem;
  word-break: break-word;
}
.reminder-card.is-completed .reminder-title { text-decoration: line-through; text-decoration-color: var(--text-faint); }

.reminder-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.reminder-card.is-overdue .reminder-meta-time { color: var(--warn); font-weight: 500; }

.badge {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-priority-high { background: var(--warn-soft); color: var(--priority-high); }
.badge-priority-medium { background: color-mix(in srgb, var(--priority-medium) 18%, transparent); color: var(--priority-medium); }
.badge-priority-low { background: color-mix(in srgb, var(--priority-low) 18%, transparent); color: var(--priority-low); }
.badge-overdue { background: var(--warn-soft); color: var(--warn); }

.reminder-notes { font-size: 0.85rem; color: var(--text-secondary); margin: 0.3rem 0 0; }
.reminder-notify { font-size: 0.78rem; color: var(--text-faint); margin-top: 0.3rem; display: flex; align-items: center; gap: 0.3rem; }

.reminder-actions { display: flex; align-items: flex-start; gap: 0.2rem; position: relative; }
.reminder-actions .icon-btn { width: 32px; height: 32px; margin-left: 0; }

.menu {
  position: absolute;
  right: 0;
  top: 36px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 150px;
  z-index: 30;
  overflow: hidden;
}
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.85rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.86rem;
  cursor: pointer;
}
.menu button:hover { background: var(--accent-soft); }
.menu button.danger { color: var(--warn); }

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}
.empty-illustration { display: flex; justify-content: center; margin-bottom: 1rem; }
.empty-state h2 { font-size: 1.2rem; color: var(--text); margin-bottom: 0.4rem; }
.empty-state p { margin: 0 0 1.2rem; }

/* ==========================================================================
   CALENDAR VIEW
   ========================================================================== */

.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.calendar-header h2 { font-size: 1.1rem; }
.calendar-header .icon-btn { margin-left: 0; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
  margin-bottom: 1.3rem;
}
.cal-dow { text-align: center; font-size: 0.7rem; color: var(--text-faint); font-family: var(--font-mono); padding-bottom: 0.3rem; }
.cal-day {
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text);
  position: relative;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.cal-day:hover { border-color: var(--accent); }
.cal-day.is-muted { color: var(--text-faint); }
.cal-day.is-today { border-color: var(--accent); font-weight: 700; }
.cal-day.is-selected { background: var(--accent); color: var(--accent-contrast); }
.cal-day .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); margin-top: 2px; }
.cal-day.is-selected .dot { background: var(--accent-contrast); }
.cal-day.is-empty { visibility: hidden; }

.calendar-day-list h3 { font-size: 0.9rem; margin-bottom: 0.6rem; color: var(--text-secondary); font-weight: 500; }

/* ==========================================================================
   SETTINGS VIEW
   ========================================================================== */

.settings-title { font-size: 1.4rem; margin-bottom: 1.2rem; }
.settings-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.settings-group h2 { font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin-bottom: 0.7rem; font-family: var(--font-body); font-weight: 600; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.settings-row:first-of-type { border-top: none; padding-top: 0; }
.settings-row-title { font-size: 0.92rem; font-weight: 500; margin: 0; }
.settings-row-desc { font-size: 0.82rem; color: var(--text-secondary); margin: 0.15rem 0 0; }
.settings-note { font-size: 0.78rem; color: var(--text-faint); margin: 0.7rem 0 0; line-height: 1.5; }

.select-input, .text-input {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.6rem;
  font-size: 0.86rem;
  font-family: inherit;
}

.switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 44px; height: 24px; margin: 0; cursor: pointer; }
.switch-track {
  width: 42px; height: 24px; background: var(--border); border-radius: 999px; position: relative;
  transition: background var(--transition-fast);
}
.switch-track::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); top: 3px; left: 3px; transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.segmented-btn { border: none; background: var(--surface); color: var(--text-secondary); padding: 0.4rem 0.8rem; font-size: 0.82rem; cursor: pointer; }
.segmented-btn + .segmented-btn { border-left: 1px solid var(--border); }
.segmented-btn[aria-checked="true"] { background: var(--accent); color: var(--accent-contrast); }

/* ==========================================================================
   MODAL
   ========================================================================== */

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 20, 17, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100; padding: 0;
  backdrop-filter: blur(2px);
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--surface);
  width: 100%;
  max-width: 520px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1.3rem 1.3rem 1.6rem;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: sheet-up 220ms ease;
}
@keyframes sheet-up { from { transform: translateY(16px); opacity: 0.6; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }

@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: var(--radius-lg); }
}

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.modal-header h2 { font-size: 1.1rem; }
.modal-header .icon-btn { margin-left: 0; }

.modal--welcome { text-align: center; padding: 2rem 1.6rem; }
.modal--welcome p.eyebrow { justify-content: center; }
.modal--welcome h2 { font-size: 1.3rem; margin-bottom: 0.6rem; }
.modal--welcome p:not(.eyebrow) { color: var(--text-secondary); margin-bottom: 1.4rem; }

.modal-form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; min-width: 0; }
.field label { font-size: 0.85rem; font-weight: 500; color: var(--text); }
.field-group-label { font-size: 0.85rem; font-weight: 500; color: var(--text); margin: 0.2rem 0 -0.3rem; }
.optional-tag { font-weight: 400; color: var(--text-faint); font-size: 0.76rem; }

.field input, .field textarea, .field select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; }

.field-row { display: flex; gap: 0.8rem; }
@media (max-width: 420px) { .field-row { flex-direction: column; } }

.more-options { border-top: 1px solid var(--border); padding-top: 0.8rem; }
.more-options summary { cursor: pointer; font-size: 0.85rem; font-weight: 500; color: var(--accent-strong); list-style: none; }
.more-options summary::-webkit-details-marker { display: none; }
.more-options summary::before { content: "+ "; }
.more-options[open] summary::before { content: "− "; }
.more-options .field-row { margin-top: 0.8rem; }

.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; margin-top: 0.3rem; }

/* ==========================================================================
   FAB (mobile add button)
   ========================================================================== */

.fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 40;
}
.fab:hover { background: var(--accent-strong); }

/* ==========================================================================
   ALERTS (due reminder, in-app)
   ========================================================================== */

.alert-stack {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 2rem);
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  z-index: 150;
}
.due-alert {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow-lg);
  animation: alert-in 200ms ease;
}
@keyframes alert-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.due-alert-title { font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin: 0 0 0.15rem; }
.due-alert-text { font-size: 0.95rem; margin: 0 0 0.65rem; color: var(--text); }
.due-alert-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.due-alert-actions button {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.32rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  cursor: pointer;
}
.due-alert-actions button:hover { border-color: var(--accent); }
.due-alert-actions button.primary { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

/* ==========================================================================
   TOAST
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med), transform var(--transition-med);
  z-index: 200;
  max-width: 90%;
  text-align: center;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==========================================================================
   RESPONSIVE — TABLET / DESKTOP
   ========================================================================== */

@media (max-width: 460px) {
  .app-header { gap: 0.5rem; padding: 0.75rem 0.75rem; }
  .brand-name { font-size: 1.05rem; }
  .nav-btn { padding: 0.42rem 0.6rem; font-size: 0.82rem; }
}

@media (min-width: 860px) {
  .fab { display: none; }
  .app-main { padding: 2rem 1.5rem 4rem; }
  .hero-title { font-size: 1.9rem; }
  .toolbar { flex-direction: row; align-items: center; }
  .search-wrap { flex: 0 0 240px; }
  .btn-add-full { width: auto; order: -1; }
  .filter-chips { margin-left: auto; }
}