/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  --bg: #f3ece0;
  --bg-elev: #faf5ec;
  --bg-card: #fffbf3;
  --ink: #1a1715;
  --ink-soft: #5a544c;
  --ink-faint: #a39c92;
  --line: #d8cfc1;
  --line-soft: #e8e0d2;
  --accent: #c8553d;
  --danger: #a83c2c;
  --shadow-sm: 0 1px 2px rgba(26, 23, 21, 0.05);
  --shadow-md: 0 2px 6px rgba(26, 23, 21, 0.06), 0 12px 28px rgba(26, 23, 21, 0.08);
  --shadow-lg: 0 8px 16px rgba(26, 23, 21, 0.08), 0 24px 60px rgba(26, 23, 21, 0.14);
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 18px;
  --tap: 44px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --tabbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  background-image:
    radial-gradient(at 12% 18%, rgba(200, 85, 61, 0.06), transparent 40%),
    radial-gradient(at 88% 82%, rgba(122, 149, 119, 0.05), transparent 45%);
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

input {
  font: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
}

input[type='text'],
input[type='password'] {
  font-size: 16px; /* prevent iOS zoom on focus */
}

em { font-style: italic; }
small { font-size: 11px; color: var(--ink-faint); text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ─── Login ──────────────────────────────────────────────── */
.login-view {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 32px 24px 28px;
  box-shadow: var(--shadow-md);
}

.login-mark {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 12px;
  line-height: 1;
}

.login-card h1 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 36px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.login-sub {
  color: var(--ink-soft);
  margin-bottom: 22px;
  font-size: 14px;
}

.login-card form { display: flex; flex-direction: column; gap: 14px; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label > span,
.note-field > span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  font-weight: 500;
}

input[type='text'],
input[type='password'] {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 13px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  min-height: var(--tap);
}

input:focus {
  border-color: var(--accent);
  background: #fff;
}

button[type='submit'],
.primary {
  background: var(--ink);
  color: var(--bg-elev);
  padding: 13px 16px;
  border-radius: var(--r-md);
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.08s;
  margin-top: 4px;
  min-height: var(--tap);
}

.primary:active { background: #2a2520; transform: scale(0.98); }

.primary-block {
  width: 100%;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
}

.danger {
  background: var(--danger);
  color: #fff;
  padding: 13px 16px;
  border-radius: var(--r-md);
  font-weight: 500;
  transition: background 0.15s, transform 0.08s;
  min-height: var(--tap);
}

.danger:active { background: #872f22; transform: scale(0.98); }

.error {
  color: var(--accent);
  font-size: 13px;
  text-align: center;
  margin-top: 4px;
}

.hint {
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 16px;
}

/* ─── App layout ─────────────────────────────────────────── */
.app-view {
  min-height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}

.content {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 16px 24px;
}

/* ─── Top bar ────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex: 1; }
.brand-mark { font-family: 'Fraunces', serif; color: var(--accent); font-size: 20px; flex-shrink: 0; }
.brand h1 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chip-color, var(--accent));
  flex-shrink: 0;
}

.icon-btn {
  width: var(--tap);
  height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink-soft);
  transition: background 0.15s, color 0.15s;
}

.icon-btn:active {
  background: var(--bg-elev);
  color: var(--ink);
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  padding: 4px;
  z-index: 20;
  animation: dropdown-in 0.12s ease-out;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 14px;
  color: var(--ink);
  text-align: left;
  transition: background 0.12s;
}

.menu-item:active { background: var(--bg-elev); }
.menu-item svg { color: var(--ink-soft); flex-shrink: 0; }

/* ─── Bottom tab bar ─────────────────────────────────────── */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-card);
  border-top: 1px solid var(--line-soft);
  z-index: 30;
  box-shadow: 0 -1px 6px rgba(26, 23, 21, 0.04);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-faint);
  padding: 6px 4px;
  transition: color 0.15s;
  position: relative;
}

.tab svg { transition: transform 0.15s; }

.tab.is-active {
  color: var(--accent);
}

.tab.is-active svg {
  transform: translateY(-1px);
}

.tab.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
}

/* ─── Page header ────────────────────────────────────────── */
.page-header { margin-bottom: 16px; }

.page-header h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 26px;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.page-sub { color: var(--ink-soft); font-size: 14px; }

/* ─── Legend ─────────────────────────────────────────────── */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.legend .chip {
  background: transparent;
  border-color: var(--line);
  font-weight: 400;
  color: var(--ink-soft);
  max-width: none;
}

/* ─── Calendar ───────────────────────────────────────────── */
.calendar-wrap {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 14px 12px;
  box-shadow: var(--shadow-sm);
}

.calendar-nav {
  display: grid;
  grid-template-columns: var(--tap) 1fr var(--tap) auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.calendar-nav h2 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: -0.01em;
  text-align: center;
  text-transform: capitalize;
}

.nav-btn {
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
}

.nav-btn:active { background: #fff; transform: scale(0.94); }

.today-btn {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0 12px;
  height: var(--tap);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink-soft);
  font-weight: 500;
  white-space: nowrap;
}

.today-btn:active { color: var(--ink); background: var(--bg-elev); }

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  margin-bottom: 4px;
  padding: 0 2px;
}

.weekdays span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  text-align: center;
  font-weight: 600;
}

.weekdays .we { color: var(--accent); opacity: 0.6; }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }

.day {
  aspect-ratio: 1 / 1.15;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  padding: 4px 4px 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  min-height: 50px;
}

.day:active { transform: scale(0.94); background: #fff; border-color: var(--line); }
.day.outside { opacity: 0.32; cursor: default; pointer-events: none; }
.day.today { border-color: var(--ink); border-width: 1.5px; background: #fff; }
.day.weekend .day-num { color: var(--ink-faint); }

.day-num {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

.day.today .day-num { color: var(--accent); font-weight: 600; }

.day-marks {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: center;
  justify-content: center;
  min-height: 6px;
}

.mark {
  height: 5px;
  flex: 1 1 auto;
  min-width: 6px;
  max-width: 16px;
  border-radius: 2px;
}

.mark.mine { height: 7px; }

/* Wider screens: bigger calendar */
@media (min-width: 540px) {
  .day { aspect-ratio: 1 / 1.05; min-height: 64px; padding: 6px 7px; }
  .day-num { font-size: 16px; text-align: left; }
  .day-marks { justify-content: flex-start; }
  .mark { max-width: none; }
  .calendar-wrap { padding: 18px; }
  .weekdays span { font-size: 12px; }
}

@media (min-width: 720px) {
  .topbar { padding: 14px 24px; }
  .brand h1 { font-size: 24px; }
  .content { padding: 20px 24px 32px; }
  .calendar-nav h2 { font-size: 24px; }
}

/* ─── History view ───────────────────────────────────────── */
.history-list {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.history-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-faint);
  font-style: italic;
  font-size: 14px;
}

.history-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: start;
  gap: 4px 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.history-item:last-child { border-bottom: none; }

.history-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  grid-row: 1 / span 2;
}

.history-text { font-size: 14px; min-width: 0; }
.history-action { color: var(--ink); line-height: 1.45; }
.history-action strong { font-weight: 500; }
.history-verb { color: var(--ink-soft); }

.history-date-target {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 500;
}

.history-note {
  color: var(--ink-soft);
  font-size: 13px;
  margin-top: 3px;
  font-style: italic;
  word-break: break-word;
}

.history-note del { color: var(--ink-faint); margin-right: 6px; }

.history-time {
  color: var(--ink-faint);
  font-size: 11px;
  white-space: nowrap;
  grid-column: 2;
  margin-top: 2px;
}

@media (min-width: 540px) {
  .history-item {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto;
    padding: 14px 18px;
  }
  .history-dot { grid-row: 1; }
  .history-time { grid-column: 3; margin-top: 4px; }
  .history-note { grid-column: 2; }
}

/* ─── Admin view ─────────────────────────────────────────── */
.admin-list {
  display: grid;
  gap: 10px;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.admin-card-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.admin-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', serif;
  font-size: 16px;
  color: #fffbf3;
  font-weight: 500;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.admin-card-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }

.admin-card-display {
  font-weight: 500;
  font-size: 15px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-badge {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--ink);
  color: var(--bg-elev);
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 500;
}

.admin-badge.you { background: var(--accent); }

.admin-card-username {
  font-size: 13px;
  color: var(--ink-soft);
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.admin-card-actions .action-btn:first-child { grid-column: 1 / -1; }

.action-btn {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink-soft);
  font-weight: 500;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.08s;
  min-height: var(--tap);
  text-align: center;
}

.action-btn:active {
  background: #fff;
  color: var(--ink);
  border-color: var(--ink);
  transform: scale(0.97);
}

.action-btn.danger-action {
  color: var(--danger);
  border-color: rgba(168, 60, 44, 0.25);
}

.action-btn.danger-action:active {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.action-btn:disabled {
  opacity: 0.4;
  pointer-events: none;
}

@media (min-width: 540px) {
  .admin-card { flex-direction: row; align-items: center; gap: 14px; }
  .admin-card-id { flex: 1; }
  .admin-card-actions { display: flex; gap: 6px; flex-shrink: 0; }
  .admin-card-actions .action-btn:first-child { grid-column: auto; }
  .action-btn { font-size: 12px; padding: 8px 12px; min-height: auto; }
}

/* ─── Panel / modal ──────────────────────────────────────── */
/* CRITICAL: [hidden] must override display:flex below.
   The HTML `hidden` attribute applies `display: none` from the user-agent
   stylesheet, but a class-level `display: flex` rule has higher specificity
   and would silently win — leaving every modal visible on page load. */
[hidden] { display: none !important; }

.panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadein 0.18s ease-out;
}

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.panel-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 23, 21, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.panel-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 22px 20px calc(22px + var(--safe-bottom));
  box-shadow: var(--shadow-lg);
  animation: slideup 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes slideup { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (min-width: 720px) {
  .panel { align-items: center; padding: 24px; }
  .panel-card {
    border-radius: var(--r-lg);
    padding: 24px 22px 26px;
    max-height: 88dvh;
  }
}

.panel-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: var(--tap);
  height: var(--tap);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-faint);
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
}

.panel-close:active { color: var(--ink); background: var(--bg-elev); }

.panel-date {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-transform: capitalize;
  margin-bottom: 8px;
  padding-right: 40px;
}

.panel-sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin-bottom: 14px;
  word-break: break-word;
}

.panel-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; min-height: 12px; }

.panel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  font-size: 14px;
}

.panel-item .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.panel-item .name { font-weight: 500; }
.panel-item .note {
  color: var(--ink-soft);
  font-size: 13px;
  margin-left: auto;
  font-style: italic;
  text-align: right;
  word-break: break-word;
}

.panel-empty { color: var(--ink-faint); font-size: 13px; font-style: italic; padding: 4px 2px; }

.panel-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  padding-top: 16px;
}

.note-field input { width: 100%; }
.note-field { display: flex; flex-direction: column; gap: 6px; }

.panel-buttons { display: flex; gap: 8px; margin-top: 8px; flex-direction: column; }

.panel-buttons button {
  flex: 1;
  padding: 13px 14px;
  border-radius: var(--r-md);
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s, border-color 0.15s, transform 0.08s;
  min-height: var(--tap);
}

@media (min-width: 540px) {
  .panel-buttons { flex-direction: row; }
}

.ghost {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--ink);
}

.ghost:active { background: #fff; transform: scale(0.98); }

.ghost-small {
  font-size: 13px;
  padding: 0 14px;
  height: var(--tap);
  border-radius: var(--r-md);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ─── User form ──────────────────────────────────────────── */
.form-stack { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }

.input-with-button {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.input-with-button input { flex: 1; min-width: 0; }

.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: transform 0.1s, border-color 0.15s;
  position: relative;
}

.color-swatch:active { transform: scale(0.92); }

.color-swatch.is-selected {
  border-color: var(--ink);
}

.color-swatch.is-selected::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 2px solid var(--bg-card);
  border-radius: 50%;
  pointer-events: none;
}

.checkbox-row {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  cursor: pointer;
  padding: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  min-height: var(--tap);
}

.checkbox-row input[type='checkbox'] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--ink);
  flex-shrink: 0;
  -webkit-appearance: checkbox;
  appearance: checkbox;
}

.checkbox-row > span {
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.35;
}

/* ─── Toast ──────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg-elev);
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-width: calc(100vw - 32px);
  text-align: center;
  animation: toast-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast.toast-success { background: #4a6b4d; }
.toast.toast-error { background: var(--danger); }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ─── Hover only on devices that have it ─────────────────── */
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { background: var(--bg-elev); color: var(--ink); }
  .menu-item:hover { background: var(--bg-elev); }
  .nav-btn:hover { background: #fff; border-color: var(--line); }
  .today-btn:hover { color: var(--ink); background: var(--bg-elev); }
  .day:hover { background: #fff; border-color: var(--line); }
  .primary:hover { background: #2a2520; }
  .danger:hover { background: #872f22; }
  .ghost:hover { background: #fff; }
  .panel-close:hover { color: var(--ink); background: var(--bg-elev); }
  .action-btn:hover { background: #fff; color: var(--ink); border-color: var(--ink); }
  .action-btn.danger-action:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
  .color-swatch:hover { transform: scale(1.08); }
  .tab:hover { color: var(--ink-soft); }
  .tab.is-active:hover { color: var(--accent); }
}
