:root {
  --page: #edf5ee;
  --card: #ffffff;
  --card-soft: #f7fbf5;
  --line: #dbe8dc;
  --line-strong: #b8cdb7;
  --text: #0d1b14;
  --muted: #526174;
  --faint: #9aaba6;
  --gold: #f5b823;
  --gold-soft: #fff7df;
  --green: #2fad5b;
  --green-deep: #527a39;
  --green-soft: #eaf6ea;
  --blue: #3b82f6;
  --blue-soft: #eaf2ff;
  --red: #ff5864;
  --red-soft: #fff0f1;
  --purple: #7a45ff;
  --shadow: 0 18px 48px rgba(31, 48, 73, 0.12);
  --shadow-soft: 0 10px 28px rgba(31, 48, 73, 0.08);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display-font: "Cormorant Garamond", Georgia, serif;
}

[data-theme="dark"] {
  --page: #08100c;
  --card: #111b16;
  --card-soft: #18251d;
  --line: #2e4235;
  --line-strong: #526b56;
  --text: #f5fbf4;
  --muted: #aab9ad;
  --faint: #778779;
  --gold-soft: rgba(245, 184, 35, 0.14);
  --green-soft: rgba(16, 179, 111, 0.15);
  --blue-soft: rgba(59, 130, 246, 0.15);
  --red-soft: rgba(255, 88, 100, 0.15);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.18);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse at 5% 82%, rgba(65, 116, 64, 0.22), transparent 30%),
    radial-gradient(ellipse at 93% 88%, rgba(104, 140, 84, 0.18), transparent 32%),
    linear-gradient(158deg, transparent 0 65%, rgba(97, 144, 87, 0.14) 65% 72%, transparent 72%),
    linear-gradient(26deg, transparent 0 66%, rgba(191, 214, 180, 0.28) 66% 73%, transparent 73%),
    var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 12% 12%, rgba(127, 160, 107, 0.09), transparent 34%),
    radial-gradient(ellipse at 86% 82%, rgba(96, 139, 83, 0.1), transparent 35%),
    linear-gradient(160deg, transparent 0 68%, rgba(109, 145, 91, 0.08) 68% 75%, transparent 75%),
    var(--page);
}

html.is-overlay-open,
body.is-overlay-open {
  height: 100%;
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(245, 184, 35, 0.3);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 14px clamp(12px, 3vw, 42px) 28px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.brand,
.top-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand h1 {
  margin: 0;
  color: var(--text);
  font-family: var(--display-font);
  font-size: clamp(27px, 2vw, 34px);
  font-weight: 700;
  line-height: 1;
}

.brand-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-note {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  color: var(--text);
}

.profile-note[hidden] {
  display: none;
}

.profile-note span,
.profile-note small {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-note span {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.05;
}

.profile-note small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
}

.brand-mark {
  width: 50px;
  height: 48px;
  flex: 0 0 50px;
  position: relative;
  display: inline-block;
  color: var(--green-deep);
  filter: drop-shadow(0 8px 10px rgba(49, 77, 38, 0.18));
}

[data-theme="dark"] .brand-mark {
  color: #9bbd74;
}

.brand-mark::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 12px;
  width: 34px;
  height: 29px;
  border-radius: 7px;
  background: currentColor;
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 25px;
  height: 25px;
  border: 5px solid currentColor;
  border-radius: 50%;
  background: #f7f4e7;
}

.brand-mark span {
  position: absolute;
  left: 11px;
  top: 24px;
  z-index: 1;
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 2px;
  background: #eef3dd;
  box-shadow: 12px 0 #eef3dd, 0 11px #eef3dd, 12px 11px #eef3dd;
}

.brand-mark span::before {
  content: "";
  position: absolute;
  left: -2px;
  top: -19px;
  width: 7px;
  height: 18px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 24px 0 currentColor;
}

.brand-mark span::after {
  content: "";
  position: absolute;
  left: 24px;
  top: 6px;
  z-index: 2;
  width: 15px;
  height: 15px;
  background:
    linear-gradient(#2d4029, #2d4029) 4px 1px / 3px 10px no-repeat,
    linear-gradient(#2d4029, #2d4029) 4px 8px / 9px 3px no-repeat;
}

.month-switcher {
  justify-content: center;
  gap: 18px;
}

.month-switcher strong {
  min-width: 230px;
  text-align: center;
  color: var(--text);
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: clamp(24px, 2.1vw, 32px);
  font-weight: 700;
}

/* Header action icons */
.top-actions {
  justify-content: flex-end;
  gap: 9px;
}

.divider {
  width: 1px;
  height: 34px;
  background: rgba(82, 122, 57, 0.22);
}

.icon-btn {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  font-size: 32px;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.top-actions .icon-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  font-size: 0;
}

[data-theme="dark"] .icon-btn {
  background: var(--card-soft);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.92);
  color: var(--green-deep);
}

[data-theme="dark"] .icon-btn:hover {
  background: rgba(156, 189, 118, 0.12);
  color: #c9e2b3;
  box-shadow: 0 0 0 1px rgba(156, 189, 118, 0.12), 0 10px 24px rgba(0, 0, 0, 0.18);
}

.icon-btn:active {
  box-shadow: inset 0 0 0 1px currentColor;
}

.icon-btn.subtle {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(82, 122, 57, 0.14);
  background: rgba(255, 255, 255, 0.7);
  font-size: 28px;
}

.calendar-toolbar .icon-btn.subtle {
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.calendar-toolbar .icon-btn.subtle:hover {
  background: rgba(82, 122, 57, 0.1);
  color: var(--green-deep);
  box-shadow: 0 0 0 1px rgba(82, 122, 57, 0.12), 0 10px 24px rgba(82, 122, 57, 0.14);
}

.calendar-toolbar .icon-btn.subtle:active {
  background: rgba(82, 122, 57, 0.16);
  box-shadow: 0 0 0 1px rgba(82, 122, 57, 0.2), inset 0 0 0 1px rgba(82, 122, 57, 0.16);
}

[data-theme="dark"] .calendar-toolbar .icon-btn.subtle {
  background: transparent;
  color: #d8e5d4;
}

[data-theme="dark"] .calendar-toolbar .icon-btn.subtle:hover {
  background: rgba(156, 189, 118, 0.12);
  color: #c9e2b3;
  box-shadow: 0 0 0 1px rgba(156, 189, 118, 0.16), 0 10px 24px rgba(0, 0, 0, 0.18);
}

.mode-btn {
  background: rgba(255, 255, 255, 0.68);
  border-radius: 50%;
}

.mode-btn.is-active {
  color: var(--gold);
}

.theme-icon {
  width: 21px;
  height: 21px;
  display: block;
  background: currentColor;
}

.top-actions .theme-icon,
.top-actions .bell-icon,
.top-actions .gear-icon {
  width: 18px;
  height: 18px;
}

[data-theme="light"] .theme-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E") center / contain no-repeat;
}

[data-theme="dark"] .theme-icon {
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M21 14.5A8.5 8.5 0 0 1 9.5 3a9 9 0 1 0 11.5 11.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M21 14.5A8.5 8.5 0 0 1 9.5 3a9 9 0 1 0 11.5 11.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.sun-icon {
  width: 21px;
  height: 21px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41'/%3E%3C/svg%3E") center / contain no-repeat;
}

.moon-icon {
  width: 21px;
  height: 21px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M21 14.5A8.5 8.5 0 0 1 9.5 3a9 9 0 1 0 11.5 11.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M21 14.5A8.5 8.5 0 0 1 9.5 3a9 9 0 1 0 11.5 11.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.gear-icon,
.bell-icon,
.trash-icon,
.save-icon,
.calc-icon,
.note-icon,
.tag-icon {
  display: inline-block;
  position: relative;
}

.gear-icon {
  width: 21px;
  height: 21px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.5A3.5 3.5 0 1 0 12 8a3.5 3.5 0 0 0 0 7.5Z'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 .6V20a2 2 0 0 1-4 0v-.09a1.7 1.7 0 0 0-1-.51 1.7 1.7 0 0 0-1.88.34l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-.6-1H4a2 2 0 0 1 0-4h.09c.17-.38.35-.72.51-1a1.7 1.7 0 0 0-.34-1.88l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.7 1.7 0 0 0 9 4.6a1.7 1.7 0 0 0 1-.6V4a2 2 0 0 1 4 0v.09c.38.17.72.35 1 .51a1.7 1.7 0 0 0 1.88-.34l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.7 1.7 0 0 0 19.4 9c.22.31.4.65.51 1H20a2 2 0 0 1 0 4h-.09c-.11.35-.29.69-.51 1Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15.5A3.5 3.5 0 1 0 12 8a3.5 3.5 0 0 0 0 7.5Z'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06A1.7 1.7 0 0 0 15 19.4a1.7 1.7 0 0 0-1 .6V20a2 2 0 0 1-4 0v-.09a1.7 1.7 0 0 0-1-.51 1.7 1.7 0 0 0-1.88.34l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.7 1.7 0 0 0 4.6 15a1.7 1.7 0 0 0-.6-1H4a2 2 0 0 1 0-4h.09c.17-.38.35-.72.51-1a1.7 1.7 0 0 0-.34-1.88l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.7 1.7 0 0 0 9 4.6a1.7 1.7 0 0 0 1-.6V4a2 2 0 0 1 4 0v.09c.38.17.72.35 1 .51a1.7 1.7 0 0 0 1.88-.34l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.7 1.7 0 0 0 19.4 9c.22.31.4.65.51 1H20a2 2 0 0 1 0 4h-.09c-.11.35-.29.69-.51 1Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.gear-icon::before {
  content: none;
}

.bell-icon {
  width: 21px;
  height: 21px;
  display: block;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.27 21a2 2 0 0 0 3.46 0'/%3E%3Cpath d='M18 8a6 6 0 1 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.27 21a2 2 0 0 0 3.46 0'/%3E%3Cpath d='M18 8a6 6 0 1 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9'/%3E%3C/svg%3E") center / contain no-repeat;
}

.notification-btn.is-on {
  color: var(--green-deep);
  box-shadow: 0 0 0 1px rgba(82, 122, 57, 0.1), 0 9px 22px rgba(82, 122, 57, 0.12);
}

.notification-btn.is-blocked {
  color: #c95f5f;
}

.notification-btn { position: relative; }
.notification-count {
  position: absolute;
  top: -3px;
  right: -3px;
  display: grid;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  place-items: center;
  border: 1.5px solid var(--card);
  border-radius: 999px;
  background: #e44752;
  color: #fff;
  font: 800 8px/1 var(--font);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 3px rgba(36, 26, 28, 0.18);
  pointer-events: none;
}
.notification-count[hidden] { display: none !important; }

.summary-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(82, 122, 57, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  padding: 20px 0;
  margin-bottom: 16px;
  overflow: hidden;
}

.summary-card article {
  min-width: 0;
  padding: 4px 24px;
  border-left: 1px solid rgba(82, 122, 57, 0.12);
  position: relative;
  overflow: hidden;
}

.summary-card article::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -30px;
  width: 190px;
  height: 84px;
  border-radius: 50% 0 0 0;
  background:
    linear-gradient(145deg, transparent 0 40%, rgba(125, 167, 121, 0.15) 40% 53%, transparent 53%),
    linear-gradient(152deg, transparent 0 50%, rgba(82, 122, 57, 0.12) 50% 67%, transparent 67%);
  pointer-events: none;
}

.summary-card article > * {
  position: relative;
  z-index: 1;
}

.summary-card article:first-child {
  border-left: 0;
}

.summary-card span {
  display: block;
  color: #34463f;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-card em {
  margin-left: 14px;
  color: var(--muted);
  font-style: normal;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(27px, 2.7vw, 40px);
  line-height: 1;
  font-weight: 900;
  color: #050a08;
}

[data-theme="dark"] .summary-card,
[data-theme="dark"] .calendar-card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .setup-card,
[data-theme="dark"] .entry-modal,
[data-theme="dark"] .settings-card,
[data-theme="dark"] .confirm-card {
  background: rgba(17, 27, 22, 0.9);
  border-color: rgba(151, 185, 145, 0.16);
}

[data-theme="dark"] .summary-card strong,
[data-theme="dark"] .summary-card span,
[data-theme="dark"] .brand h1 {
  color: var(--text);
}

.summary-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: 16px;
}

.calendar-card,
.info-card,
.setup-card,
.entry-modal,
.settings-card,
.confirm-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(82, 122, 57, 0.13);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.calendar-card {
  padding: 20px 22px 26px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(250, 253, 249, 0.78)),
    radial-gradient(ellipse at 4% 10%, rgba(111, 149, 93, 0.12), transparent 26%),
    radial-gradient(ellipse at 94% 86%, rgba(111, 149, 93, 0.12), transparent 30%);
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 16px;
}

.calendar-toolbar .icon-btn:last-child {
  justify-self: end;
}

.calendar-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.calendar-heading strong {
  color: var(--text);
  font-family: var(--display-font);
  font-size: clamp(30px, 3.3vw, 52px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.calendar-heading strong span {
  color: var(--green-deep);
}

[data-theme="dark"] .calendar-heading strong span {
  color: #9bbd74;
}

.today-btn {
  min-width: 0;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--green-deep);
  font-size: 18px;
  font-weight: 800;
}

[data-theme="dark"] .today-btn {
  color: #9bbd74;
}

.weekday-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
}

.weekday-row {
  margin-bottom: 6px;
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(82, 122, 57, 0.16);
}

.weekday-row span {
  text-align: center;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.calendar-grid {
  min-height: 370px;
  overflow: hidden;
  border: 1px solid rgba(82, 122, 57, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .calendar-grid {
  border-color: rgba(173, 200, 163, 0.12);
  background: rgba(229, 238, 223, 0.07);
}

.day-cell {
  min-width: 0;
  min-height: 58px;
  border: 0;
  border-right: 1px solid rgba(82, 122, 57, 0.14);
  border-bottom: 1px solid rgba(82, 122, 57, 0.14);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  padding: 5px;
  position: relative;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

[data-theme="dark"] .day-cell {
  border-right-color: rgba(173, 200, 163, 0.1);
  border-bottom-color: rgba(173, 200, 163, 0.1);
  color: #e7eee4;
}

.day-cell:hover {
  background: rgba(82, 122, 57, 0.06);
  box-shadow: inset 0 0 0 1px rgba(82, 122, 57, 0.16);
}

[data-theme="dark"] .day-cell:hover {
  background: rgba(156, 189, 118, 0.1);
  box-shadow: inset 0 0 0 1px rgba(156, 189, 118, 0.16);
}

.day-cell:nth-child(7n) {
  border-right: 0;
}

.day-cell:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.day-cell.is-muted {
  background: rgba(244, 248, 243, 0.42);
  color: #98a7a1;
  pointer-events: none;
}

[data-theme="dark"] .day-cell.is-muted {
  background: rgba(255, 255, 255, 0.025);
  color: rgba(170, 185, 173, 0.48);
}

.day-cell.is-today::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  width: 0;
  height: 0;
  border-top: 14px solid var(--green);
  border-right: 14px solid transparent;
  border-radius: 0;
  pointer-events: none;
  z-index: 0;
}

.day-cell.is-selected {
  border-color: rgba(82, 122, 57, 0.42);
  background: rgba(234, 246, 234, 0.78);
  box-shadow: inset 0 0 0 1px rgba(82, 122, 57, 0.28);
}

[data-theme="dark"] .day-cell.is-selected {
  background: rgba(156, 189, 118, 0.16);
  box-shadow: inset 0 0 0 1px rgba(156, 189, 118, 0.28);
}

.day-cell.has-entry::after {
  content: none;
}

.day-cell.is-holiday {
  border-color: var(--gold);
}

.day-cell.is-double {
  border-color: var(--red);
}

.day-cell.is-rest {
  background: rgba(226, 233, 224, 0.7);
}

[data-theme="dark"] .day-cell.is-rest {
  background: rgba(255, 255, 255, 0.04);
}

.day-cell.is-absent {
  border-color: var(--red);
}

.day-num {
  font-size: clamp(15px, 1.25vw, 18px);
  font-weight: 700;
}

.day-meta {
  min-height: 16px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 800;
}

.day-entry-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--green);
}

.day-cell.is-rest .day-entry-dot { background: #8a9b8a; }
.day-cell.is-holiday .day-entry-dot { background: var(--gold); }
.day-cell.is-double .day-entry-dot,
.day-cell.is-absent .day-entry-dot { background: var(--red); }

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-card {
  padding: 11px 12px;
  border-radius: 14px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.9), rgba(249, 253, 248, 0.78)),
    radial-gradient(ellipse at 100% 0%, rgba(111, 149, 93, 0.11), transparent 28%);
}

.info-card h2 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.info-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10.8px;
  line-height: 1.38;
}

.legend-list,
.status-grid {
  list-style: none;
  padding: 0;
  margin: 0;
}

.legend-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 7px;
  border-bottom: 1px solid rgba(82, 122, 57, 0.12);
  padding: 4px 0;
  color: var(--muted);
  font-size: 11.2px;
}

.legend-list li:last-child {
  border-bottom: 0;
}

.legend-list strong {
  color: var(--muted);
  font-size: 11.2px;
  font-weight: 800;
  white-space: nowrap;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot.green { background: var(--green); }
.dot.blue { background: var(--blue); }
.dot.yellow { background: var(--gold); }
.dot.red { background: var(--red); }

.status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 8px;
  row-gap: 6px;
}

.status-grid li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11.2px;
}

.status {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 2px solid var(--line);
  display: inline-block;
  flex: 0 0 auto;
}

.status.today {
  border-color: var(--green);
  background: var(--green);
}

.status.selected,
.status.holiday {
  border-color: var(--gold);
}

.status.rest {
  background: repeating-linear-gradient(-45deg, transparent 0 5px, var(--line) 5px 8px);
}

.status.absent,
.status.double {
  border-color: var(--red);
}

.reset-btn {
  width: min(100%, 226px);
  height: 33px;
  min-height: 33px;
  align-self: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 88, 100, 0.4);
  background: var(--red-soft);
  color: #f10f20;
  font-size: 12.5px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.reset-btn:hover {
  background: #f10f20;
  color: #fff;
  box-shadow: 0 10px 22px rgba(255, 88, 100, 0.2);
}

.trash-icon {
  width: 14px;
  height: 16px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 3px 3px;
}

.trash-icon::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 2px;
  background: currentColor;
  top: -5px;
  left: -4px;
  border-radius: 999px;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(231, 238, 235, 0.72);
  backdrop-filter: blur(16px) saturate(0.92);
  overscroll-behavior: contain;
}

[data-theme="dark"] .overlay {
  background: rgba(0, 0, 0, 0.68);
}

.overlay[hidden] {
  display: none;
}

.entry-modal {
  width: min(100%, 820px);
  max-height: 92vh;
  overflow-y: auto;
  padding: 34px 72px 38px;
  border-color: var(--text);
}

.setup-card,
.settings-card,
.confirm-card {
  width: min(100%, 560px);
  padding: 32px;
}

#profileOverlay {
  align-items: center;
  overflow: hidden;
  padding: 12px;
}

.profile-setup-card {
  width: min(92vw, 460px);
  min-height: 372px;
  max-height: calc(100dvh - 24px);
  overflow: hidden;
  border: 1px solid rgba(91, 105, 127, 0.24);
  border-radius: 16px;
  padding: 0;
  display: grid;
  grid-template-columns: 190px 270px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(42, 59, 82, 0.16);
}

.profile-visual-panel {
  min-height: 372px;
  overflow: hidden;
  background: #f3efd8;
  position: relative;
}

.profile-visual-panel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.profile-visual-panel::after {
  content: "";
  position: absolute;
  top: 0;
  right: 14px;
  width: 24px;
  height: 64px;
  background: #6f824e;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  z-index: 2;
}

.profile-form-panel {
  min-width: 0;
  display: grid;
  align-content: center;
  padding: 20px 14px 20px 18px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 88% 5%, rgba(93, 126, 66, 0.28), transparent 28%),
    radial-gradient(ellipse at 16% 18%, rgba(206, 225, 174, 0.42), transparent 30%),
    radial-gradient(ellipse at 82% 38%, rgba(222, 235, 198, 0.55), transparent 28%),
    radial-gradient(ellipse at 18% 58%, rgba(119, 151, 86, 0.24), transparent 26%),
    radial-gradient(ellipse at 76% 82%, rgba(151, 176, 116, 0.26), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 251, 240, 0.78) 52%, rgba(236, 244, 225, 0.9) 100%);
}

.profile-form-panel::before,
.profile-form-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
  filter: blur(12px);
}

.profile-form-panel::before {
  inset: -18px;
  opacity: 0.58;
  border-radius: 0;
  background:
    radial-gradient(ellipse at 96% 6%, rgba(91, 123, 63, 0.42), transparent 24%),
    radial-gradient(ellipse at 12% 28%, rgba(211, 229, 180, 0.56), transparent 24%),
    radial-gradient(ellipse at 70% 48%, rgba(120, 153, 88, 0.28), transparent 20%),
    radial-gradient(ellipse at 34% 88%, rgba(219, 233, 190, 0.6), transparent 25%);
}

.profile-form-panel::after {
  inset: 0;
  opacity: 0.34;
  border-radius: 0;
  background:
    linear-gradient(118deg, transparent 0 15%, rgba(83, 117, 55, 0.22) 22%, transparent 34%),
    linear-gradient(42deg, transparent 0 58%, rgba(129, 159, 96, 0.2) 68%, transparent 80%),
    radial-gradient(ellipse at 6% 84%, rgba(82, 119, 57, 0.26), transparent 22%),
    radial-gradient(ellipse at 92% 76%, rgba(219, 234, 193, 0.56), transparent 25%);
}

.profile-form-panel > * {
  position: relative;
  z-index: 1;
}

.profile-setup-intro {
  display: grid;
  justify-items: start;
  text-align: left;
  margin-bottom: 11px;
}

.profile-clock {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 9px;
  background:
    conic-gradient(var(--gold) 0 75%, transparent 75% 100%),
    #fff7dc;
  position: relative;
}

.profile-clock::before {
  content: "";
  width: 64%;
  height: 64%;
  border-radius: 50%;
  background: var(--card);
  position: absolute;
}

.profile-clock span {
  width: 36%;
  height: 36%;
  border: 2px solid var(--text);
  border-top-color: transparent;
  border-right-color: transparent;
  border-radius: 0 0 0 5px;
  position: relative;
  z-index: 1;
  transform: translate(2px, -2px);
}

.profile-clock span::before,
.profile-clock span::after {
  content: "";
  position: absolute;
  background: var(--text);
  border-radius: 999px;
}

.profile-clock span::before {
  width: 2px;
  height: 15px;
  left: -2px;
  bottom: -2px;
}

.profile-clock span::after {
  width: 15px;
  height: 2px;
  left: -2px;
  bottom: -2px;
}

.profile-setup-intro h2 {
  width: 100%;
  margin: 0;
  color: #17251d;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 18px;
  line-height: 1.12;
  font-weight: 700;
  white-space: nowrap;
}

.profile-setup-intro i {
  width: 38px;
  height: 3px;
  border-radius: 999px;
  background: #687c4c;
  margin: 7px 0 8px;
}

.profile-setup-intro p {
  width: 226px;
  margin: 0;
  color: #64708a;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 500;
}

.profile-setup-intro p span {
  display: block;
  white-space: nowrap;
}

.profile-form-stack {
  width: min(100%, 226px);
  margin: 0;
  display: grid;
  gap: 4px;
}

.profile-form-stack label {
  display: grid;
  gap: 3px;
}

.profile-form-stack label > span {
  color: #111827;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
}

[data-theme="dark"] .profile-form-stack label > span {
  color: var(--text);
}

.profile-input-field {
  min-height: 31px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 20px rgba(48, 72, 49, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.profile-input-field:focus-within {
  border-color: #6b7f4c;
  box-shadow: 0 0 0 1px rgba(104, 124, 76, 0.16);
}

.profile-input-icon {
  width: 13px;
  height: 13px;
  margin-left: 9px;
  flex: 0 0 13px;
  background: #6f7a90;
  -webkit-mask: var(--profile-input-icon) center / contain no-repeat;
  mask: var(--profile-input-icon) center / contain no-repeat;
}

.profile-input-user {
  --profile-input-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21a8 8 0 0 0-16 0'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}

.profile-input-nickname {
  --profile-input-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='11' r='2'/%3E%3Cpath d='M7 16a3 3 0 0 1 4 0M14 10h4M14 14h4'/%3E%3C/svg%3E");
}

.profile-input-work {
  --profile-input-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2'/%3E%3Cpath d='M8 7V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M3 12h18'/%3E%3C/svg%3E");
}

.profile-input-status {
  --profile-input-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-8 0v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M4 21h16'/%3E%3C/svg%3E");
}

.profile-input-regular {
  --profile-input-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

.profile-input-rate {
  --profile-input-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v10M15 9.5c-.6-.7-1.5-1-2.8-1-1.5 0-2.7.8-2.7 2s1 1.7 2.7 2c1.8.4 2.8.9 2.8 2.1 0 1.3-1.2 2.1-2.9 2.1-1.2 0-2.3-.4-3.1-1.2'/%3E%3C/svg%3E");
}

.profile-form-stack input,
.profile-form-stack select {
  width: 100%;
  min-width: 0;
  min-height: 30px;
  border: 0;
  outline: 0;
  border-radius: 8px;
  padding: 5px 9px 5px 8px;
  color: var(--text);
  background: transparent;
  font-size: 11.5px;
  font-weight: 500;
  appearance: none;
}

.profile-input-field.has-caret {
  position: relative;
}

.profile-input-field.has-caret::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid #6f7a90;
  border-bottom: 2px solid #6f7a90;
  transform: rotate(45deg);
  position: absolute;
  right: 12px;
  top: 10px;
  pointer-events: none;
}

.profile-input-field.has-caret select {
  padding-right: 25px;
}

.profile-form-stack input:focus-visible,
.profile-form-stack select:focus-visible {
  outline: 0;
  box-shadow: none;
}

.profile-form-stack input::placeholder {
  color: #818da6;
  opacity: 1;
}

.profile-actions {
  width: min(100%, 226px);
  margin: 11px 0 0;
}

.profile-save-btn {
  width: 100%;
  min-height: 33px;
  border: 0;
  border-radius: 8px;
  background: #59733f;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(89, 115, 63, 0.22);
  transition: background-color 180ms ease, color 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.profile-save-btn:hover {
  background: #111318;
  color: #fff;
  filter: none;
  box-shadow: 0 12px 24px rgba(17, 19, 24, 0.24);
}

.profile-save-btn:active {
  background: #050608;
  color: #fff;
  filter: none;
}

.profile-save-icon {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 5px;
  position: relative;
  flex: 0 0 auto;
}

.profile-save-icon::before {
  content: "";
  position: absolute;
  left: 5px;
  top: -2px;
  width: 9px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.profile-save-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 4px;
  height: 7px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.modal-head h2 {
  margin: 0;
  font-size: clamp(32px, 3.2vw, 49px);
  line-height: 1.05;
  font-weight: 900;
}

.settings-card .modal-head h2,
.setup-card .modal-head h2,
.confirm-card h2 {
  font-size: 32px;
}

.modal-head p,
.confirm-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 22px;
}

.round-close {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 58px;
  line-height: 1;
}

.time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 38px;
  margin-bottom: 28px;
}

.time-grid label:first-child {
  border-right: 2px solid var(--line);
  padding-right: 38px;
}

.icon-field span,
.option-block h3,
.note-field > span {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #535e72;
  font-size: 20px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.icon-field i {
  width: 31px;
  height: 31px;
  border: 5px solid currentColor;
  border-left: 0;
  border-radius: 3px;
  position: relative;
}

.icon-field i::before {
  content: "";
  position: absolute;
  width: 23px;
  height: 5px;
  background: currentColor;
  left: -18px;
  top: 8px;
  border-radius: 999px;
}

.icon-field i::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-left: 5px solid currentColor;
  border-bottom: 5px solid currentColor;
  transform: rotate(45deg);
  left: -20px;
  top: 3px;
}

.icon-field.in span {
  color: var(--green);
}

.icon-field.out span {
  color: #f0323d;
}

.icon-field.out i {
  transform: rotate(180deg);
}

.hours-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: -4px 0 28px;
}

.hours-preview article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-soft);
  padding: 13px 16px;
}

.hours-preview span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.hours-preview strong {
  display: block;
  color: var(--text);
  font-size: 26px;
  font-weight: 900;
  margin-top: 3px;
}

input,
textarea {
  width: 100%;
  border: 2px solid #9eabc1;
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  padding: 16px 20px;
  min-height: 74px;
  font-size: 28px;
  font-weight: 600;
}

textarea {
  min-height: 118px;
  resize: vertical;
  font-size: 23px;
  color: var(--muted);
}

.option-block {
  margin-bottom: 28px;
}

.mini-icon,
.calc-icon,
.note-icon,
.tag-icon {
  flex: 0 0 auto;
}

.mini-icon.bars {
  width: 32px;
  height: 32px;
  border-bottom: 10px solid #f59e0b;
  border-left: 8px solid #f59e0b;
  box-shadow: 11px 0 0 -1px #f59e0b, 22px 0 0 -4px #f59e0b;
  border-radius: 4px;
}

.mini-icon.coins {
  width: 34px;
  height: 25px;
}

.mini-icon.coins::before,
.mini-icon.coins::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 12px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 8px 0 var(--purple), 0 16px 0 var(--purple);
}

.mini-icon.coins::after {
  left: 12px;
  top: 6px;
}

.segmented {
  display: grid;
  gap: 16px;
}

.segmented.two {
  grid-template-columns: 1fr 1fr;
}

.segmented.three {
  grid-template-columns: repeat(3, 1fr);
}

.segmented button,
.quick-actions button {
  min-height: 88px;
  border: 2px solid #9eabc1;
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.segmented button small {
  display: block;
  font-size: 20px;
  font-weight: 700;
}

.segmented button.is-active {
  border-color: var(--gold);
  background: var(--gold-soft);
}

.pay-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  padding: 22px 0;
  margin-bottom: 24px;
}

.pay-preview span {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #535e72;
  font-size: 25px;
  font-weight: 900;
}

.pay-preview strong,
.pay-preview output {
  color: var(--green);
  font-size: 32px;
  font-weight: 900;
}

.calc-icon {
  width: 38px;
  height: 44px;
  background: var(--green);
  border-radius: 5px;
}

.calc-icon::before {
  content: "";
  position: absolute;
  inset: 7px 7px auto;
  height: 7px;
  background: white;
  border-radius: 2px;
  box-shadow: 0 14px 0 white, 11px 14px 0 white, 22px 14px 0 white, 0 25px 0 white, 11px 25px 0 white, 22px 25px 0 white;
}

.note-icon {
  width: 36px;
  height: 42px;
  border-radius: 4px;
  background: var(--blue);
}

.note-icon::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 10px;
  width: 20px;
  height: 4px;
  background: white;
  border-radius: 999px;
  box-shadow: 0 10px 0 white, 0 20px 0 white;
}

.note-field {
  display: block;
  margin-bottom: 28px;
}

.note-field small {
  color: var(--muted);
  font-size: 18px;
}

.note-field > small {
  display: block;
  text-align: right;
  margin-top: 8px;
}

.tag-icon {
  width: 30px;
  height: 30px;
  background: #687386;
  clip-path: polygon(0 0, 72% 0, 100% 28%, 100% 100%, 0 100%);
  transform: rotate(45deg);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.quick-actions button.is-active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  border-top: 2px solid var(--line);
  padding-top: 28px;
}

.primary-btn,
.ghost-btn,
.save-btn,
.danger-btn {
  min-height: 78px;
  border-radius: 8px;
  border: 2px solid var(--line-strong);
  padding: 0 34px;
  font-size: 24px;
  font-weight: 900;
}

.primary-btn {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--text);
}

.ghost-btn {
  background: var(--card);
  color: var(--text);
}

.save-btn {
  border-color: var(--green);
  background: var(--green);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.danger-btn {
  border-color: var(--red);
  background: var(--red);
  color: white;
}

.save-icon {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: white;
}

.save-icon::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 20px;
  height: 10px;
  background: var(--green);
  border-radius: 2px;
}

.save-icon::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 5px;
  width: 16px;
  height: 12px;
  border-radius: 2px;
  background: var(--green);
}

/* Work Entry modal: compact sizing aligned with Profile Setup and Settings */
#entryOverlay {
  align-items: center;
  padding: 12px;
}

#entryOverlay .entry-modal {
  width: min(92vw, 360px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  padding: 18px 17px 17px;
  border: 1px solid rgba(91, 105, 127, 0.24);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 92% 4%, rgba(93, 126, 66, 0.16), transparent 28%),
    radial-gradient(ellipse at 10% 16%, rgba(206, 225, 174, 0.34), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 252, 245, 0.95) 62%, rgba(239, 247, 229, 0.98) 100%);
  box-shadow: 0 18px 46px rgba(42, 59, 82, 0.16);
}

.entry-modal .modal-head {
  gap: 14px;
  width: min(100%, 310px);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 14px;
}

.entry-modal .modal-head h2 {
  color: #17251d;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 20px;
  line-height: 1.18;
  font-weight: 700;
}

.entry-modal .modal-head p {
  margin-top: 4px;
  color: #64708a;
  font-size: 11.5px;
  line-height: 1.25;
  font-weight: 500;
}

.entry-modal .round-close {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #263d35;
  font-size: 31px;
  box-shadow: none;
  transition: color 160ms ease, transform 160ms ease;
}

.entry-modal .round-close:hover {
  color: #59733f;
  transform: scale(1.08);
}

.entry-modal .time-grid {
  width: min(100%, 310px);
  margin-left: auto;
  margin-right: auto;
  gap: 10px;
  margin-bottom: 9px;
}

.entry-modal .time-grid label:first-child {
  border-right: 1px solid var(--line);
  padding-right: 10px;
}

.entry-modal .icon-field span,
.entry-modal .option-block h3,
.entry-modal .note-field > span {
  gap: 4px;
  margin-bottom: 5px;
  font-size: 9.5px;
  line-height: 1.1;
  color: #4d5966;
}

.entry-modal .icon-field i {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 0;
  background: currentColor;
  flex: 0 0 13px;
  -webkit-mask: var(--entry-time-icon) center / contain no-repeat;
  mask: var(--entry-time-icon) center / contain no-repeat;
}

.entry-modal .icon-field i::before {
  content: none;
}

.entry-modal .icon-field i::after {
  content: none;
}

.entry-modal .icon-field.in {
  --entry-time-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'/%3E%3Cpath d='m10 17 5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3C/svg%3E");
}

.entry-modal .icon-field.out {
  --entry-time-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='m16 17 5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/svg%3E");
}

.entry-modal .icon-field.out i {
  transform: none;
}

.entry-modal input,
.entry-modal textarea {
  min-height: 27px;
  border: 1px solid rgba(89, 115, 63, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 500;
  box-shadow: 0 8px 20px rgba(48, 72, 49, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.entry-modal .time-input {
  cursor: pointer;
  caret-color: transparent;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  text-align: center;
}

.entry-modal input:focus,
.entry-modal textarea:focus {
  border-color: #6b7f4c;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(104, 124, 76, 0.16), 0 8px 20px rgba(48, 72, 49, 0.06);
  outline: 0;
}

.entry-modal textarea {
  min-height: 62px;
  resize: none;
}

.entry-modal .hours-preview {
  width: min(100%, 310px);
  gap: 6px;
  margin: 0 auto 10px;
}

.entry-modal .hours-preview article {
  min-height: 31px;
  border: 1px solid rgba(89, 115, 63, 0.28);
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.entry-modal .hours-preview span,
.entry-modal .hours-input-card label {
  color: #4d5966;
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.entry-modal .hours-preview strong,
.entry-modal .hours-input-card input {
  margin-top: 2px;
  font-size: 13px;
  text-align: center;
}

.entry-modal .hours-input-card input {
  width: 100%;
  min-height: 18px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  font-weight: 900;
  box-shadow: none;
}

.entry-modal .hours-input-card input::placeholder {
  color: #7b8796;
  font-size: 9px;
  font-weight: 700;
  opacity: 0.86;
}

.entry-modal .option-block,
.entry-modal .note-field {
  width: min(100%, 310px);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 11px;
}

.entry-modal .mini-icon.bars {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 0;
  background: #f59e0b;
  box-shadow: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 16v-4M12 16V8M17 16v-7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='M7 16v-4M12 16V8M17 16v-7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.entry-modal .mini-icon.coins {
  width: 13px;
  height: 13px;
  background: #7a45ff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='8' ry='3'/%3E%3Cpath d='M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5'/%3E%3Cpath d='M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='8' ry='3'/%3E%3Cpath d='M4 5v6c0 1.7 3.6 3 8 3s8-1.3 8-3V5'/%3E%3Cpath d='M4 11v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.entry-modal .mini-icon.coins::before,
.entry-modal .mini-icon.coins::after {
  content: none;
}

.entry-modal .mini-icon.coins::after {
  left: 6px;
  top: 3px;
}

.entry-modal .segmented,
.entry-modal .quick-actions {
  gap: 10px;
}

.entry-modal .segmented button,
.entry-modal .quick-actions button {
  min-height: 27px;
  border: 1px solid rgba(89, 115, 63, 0.28);
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.7);
  color: #17251d;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(48, 72, 49, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.76);
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.entry-modal .segmented button:hover,
.entry-modal .segmented button:focus-visible {
  border-color: #111318;
  background: #111318;
  color: #fff;
  box-shadow: 0 12px 24px rgba(17, 19, 24, 0.18);
}

.entry-modal .segmented button.is-active {
  border-color: #59733f;
  background: rgba(89, 115, 63, 0.12);
  color: #3f6233;
}

.entry-modal #modifierGroup [data-modifier="none"]:hover,
.entry-modal #modifierGroup [data-modifier="none"]:focus-visible,
.entry-modal #modifierGroup [data-modifier="none"].is-active {
  border-color: #2fad5b;
  color: #25864a;
  background: rgba(47, 173, 91, 0.1);
  box-shadow: 0 10px 20px rgba(47, 173, 91, 0.12);
}

.entry-modal #modifierGroup [data-modifier="holiday"]:hover,
.entry-modal #modifierGroup [data-modifier="holiday"]:focus-visible,
.entry-modal #modifierGroup [data-modifier="holiday"].is-active {
  border-color: #f5b823;
  color: #946b06;
  background: rgba(245, 184, 35, 0.14);
  box-shadow: 0 10px 20px rgba(245, 184, 35, 0.14);
}

.entry-modal #modifierGroup [data-modifier="double"]:hover,
.entry-modal #modifierGroup [data-modifier="double"]:focus-visible,
.entry-modal #modifierGroup [data-modifier="double"].is-active {
  border-color: #ff5864;
  color: #d82f3b;
  background: rgba(255, 88, 100, 0.1);
  box-shadow: 0 10px 20px rgba(255, 88, 100, 0.12);
}

.entry-modal .quick-actions button:hover,
.entry-modal .quick-actions button:focus-visible {
  background: rgba(255, 255, 255, 0.78);
}

.entry-modal #restDayBtn:hover,
.entry-modal #restDayBtn:focus-visible,
.entry-modal #restDayBtn.is-active {
  border-color: #2fad5b;
  color: #25864a;
  background: rgba(47, 173, 91, 0.1);
  box-shadow: 0 10px 20px rgba(47, 173, 91, 0.12);
}

.entry-modal #excusedBtn:hover,
.entry-modal #excusedBtn:focus-visible,
.entry-modal #excusedBtn.is-active {
  border-color: #8d99aa;
  color: #5d6878;
  background: rgba(141, 153, 170, 0.12);
  box-shadow: 0 10px 20px rgba(87, 98, 113, 0.1);
}

.entry-modal #clearDayBtn:hover,
.entry-modal #clearDayBtn:focus-visible {
  border-color: #ff5864;
  color: #d82f3b;
  background: rgba(255, 88, 100, 0.1);
  box-shadow: 0 10px 20px rgba(255, 88, 100, 0.12);
}

.entry-modal .quick-actions button.is-active {
  border-color: #59733f;
  background: rgba(89, 115, 63, 0.12);
  color: #3f6233;
}

.entry-modal #restDayBtn.is-active {
  border-color: #2fad5b;
  color: #25864a;
  background: rgba(47, 173, 91, 0.1);
}

.entry-modal #excusedBtn.is-active {
  border-color: #8d99aa;
  color: #5d6878;
  background: rgba(141, 153, 170, 0.12);
}

.entry-modal .segmented button small {
  font-size: 9px;
}

.entry-modal #rateTypeGroup button small {
  display: inline;
  margin-left: 3px;
  font-size: 10.5px;
}

.entry-modal .pay-preview {
  width: min(100%, 310px);
  min-height: 27px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-left: auto;
  margin-right: auto;
  gap: 12px;
  border: 1px solid rgba(89, 115, 63, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 8px 20px rgba(48, 72, 49, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  padding: 6px 9px;
  margin-bottom: 10px;
}

.entry-modal .pay-preview span,
.entry-modal .pay-preview strong,
.entry-modal .pay-preview output {
  gap: 8px;
  color: #4d5966;
  font-size: 13px;
}

.entry-modal .pay-preview output {
  color: var(--green-deep);
  font-weight: 800;
  min-width: 78px;
  text-align: right;
}

.entry-modal .calc-icon {
  width: 13px;
  height: 13px;
  border-radius: 0;
  background: var(--green);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Cpath d='M8 7h8M8 11h2M12 11h2M16 11h0M8 15h2M12 15h2M16 15h0'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Cpath d='M8 7h8M8 11h2M12 11h2M16 11h0M8 15h2M12 15h2M16 15h0'/%3E%3C/svg%3E") center / contain no-repeat;
}

.entry-modal .calc-icon::before {
  content: none;
}

.entry-modal .note-icon {
  width: 13px;
  height: 13px;
  border-radius: 0;
  background: var(--blue);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6M8 13h8M8 17h5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z'/%3E%3Cpath d='M14 2v6h6M8 13h8M8 17h5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.entry-modal .note-icon::before {
  content: none;
}

.entry-modal .note-field small {
  font-size: 10px;
}

.entry-modal .note-field > small {
  margin-top: 4px;
}

.entry-modal .tag-icon {
  width: 13px;
  height: 13px;
  background: #687386;
  transform: none;
  clip-path: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41 13.42 20.58a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82Z'/%3E%3Ccircle cx='7.5' cy='7.5' r='.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41 13.42 20.58a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82Z'/%3E%3Ccircle cx='7.5' cy='7.5' r='.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

.entry-modal .modal-actions {
  width: min(100%, 310px);
  margin-left: auto;
  margin-right: auto;
  gap: 10px;
  border-top-width: 1px;
  padding-top: 11px;
}

.entry-modal .ghost-btn,
.entry-modal .save-btn {
  min-height: 27px;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 800;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.entry-modal .save-btn {
  border: 0;
  background: #59733f;
  color: #fff;
  gap: 8px;
  box-shadow: 0 10px 24px rgba(89, 115, 63, 0.22);
}

.entry-modal .save-btn:hover {
  background: #111318;
  color: #fff;
  box-shadow: 0 12px 24px rgba(17, 19, 24, 0.24);
}

.entry-modal .ghost-btn {
  border: 1px solid #111318;
  background: rgba(255, 255, 255, 0.7);
  color: #17251d;
}

.entry-modal .ghost-btn:hover {
  border-color: #111318;
  background: #111318;
  color: #fff;
}

.entry-modal .save-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  border: 2px solid currentColor;
  border-radius: 5px;
  background: transparent;
}

.entry-modal .save-icon::before {
  left: 5px;
  top: -2px;
  width: 9px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  background: transparent;
  border-radius: 0;
}

.entry-modal .save-icon::after {
  left: 5px;
  right: 5px;
  bottom: 4px;
  width: auto;
  height: 7px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
  background: transparent;
}

.profile-save-icon,
.save-icon {
  width: 13px !important;
  height: 13px !important;
  flex: 0 0 13px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: currentColor !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2Z'/%3E%3Cpath d='M17 21v-8H7v8M7 3v5h8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2Z'/%3E%3Cpath d='M17 21v-8H7v8M7 3v5h8'/%3E%3C/svg%3E") center / contain no-repeat;
}

.profile-save-icon::before,
.profile-save-icon::after,
.save-icon::before,
.save-icon::after {
  content: none !important;
}

.trash-icon {
  width: 13px !important;
  height: 13px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: currentColor !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M19 6l-1 15H6L5 6'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M19 6l-1 15H6L5 6'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.trash-icon::before,
.trash-icon::after {
  content: none !important;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-grid label,
.reminder-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-grid span,
.toggle-line span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.form-grid input,
.reminder-row input {
  min-height: 56px;
  font-size: 18px;
}

.reminder-row {
  margin-top: 22px;
}

.toggle-line {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.toggle-line input {
  width: 24px;
  min-height: 24px;
}

#settingsOverlay {
  align-items: center;
  padding: 12px;
}

.settings-card {
  width: min(92vw, 270px);
  height: min(529px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  border: 1px solid rgba(91, 105, 127, 0.22);
  border-radius: 16px;
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 54px rgba(42, 59, 82, 0.17);
}

.settings-head {
  min-height: 86px;
  margin: 0;
  padding: 17px 17px 13px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 88% 10%, rgba(111, 149, 93, 0.13), transparent 28%),
    linear-gradient(168deg, transparent 0 60%, rgba(214, 224, 193, 0.62) 60% 76%, transparent 76%),
    linear-gradient(135deg, #fffdf6 0%, #faf8ed 56%, #eef3e3 100%);
}

.settings-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(82, 122, 57, 0.12);
}

.settings-head h2 {
  color: #173024;
  font-family: var(--display-font);
  font-size: 26px;
  line-height: 0.95;
  font-weight: 700;
}

.settings-head p {
  margin-top: 6px;
  color: #647282;
  font-size: 14.5px;
  line-height: 1.1;
  font-weight: 500;
}

.settings-card .round-close {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: #263d35;
  font-size: 27px;
  box-shadow: none;
  position: relative;
  z-index: 2;
  transition: color 160ms ease, transform 160ms ease;
}

.settings-card .round-close:hover {
  background: transparent;
  color: #59733f;
  transform: scale(1.08);
}

.settings-leaf {
  position: absolute;
  right: 30px;
  bottom: 7px;
  width: 54px;
  height: 42px;
  opacity: 0.82;
}

.settings-leaf::before,
.settings-leaf::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 24px;
  height: 40px;
  background: linear-gradient(145deg, #92ad7c, #4c7242);
  border-radius: 100% 0 100% 0;
  transform-origin: bottom center;
}

.settings-leaf::before {
  left: 18px;
  transform: rotate(-28deg);
}

.settings-leaf::after {
  right: 6px;
  transform: rotate(28deg) scaleX(-1);
}

/* Settings section */
.settings-card .form-grid {
  width: min(100%, 204px);
  margin: 14px auto 0;
  padding: 0;
  grid-template-columns: 1fr;
  gap: 6px;
}

.settings-card .form-grid label,
.settings-card .reminder-row {
  gap: 3px;
}

.settings-card .form-grid label > span,
.settings-card .toggle-line span {
  color: #4d5966;
  font-size: 9.5px;
  font-weight: 800;
}

.settings-input-wrap {
  height: 31px;
  min-height: 31px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 8px 20px rgba(48, 72, 49, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.settings-input-wrap:focus-within {
  border-color: #6b7f4c;
  box-shadow: 0 0 0 1px rgba(104, 124, 76, 0.16);
  background: #fff;
}

.settings-input-wrap i {
  width: 13px;
  height: 13px;
  margin-left: 9px;
  flex: 0 0 13px;
  background: #6f7a90;
  position: relative;
  -webkit-mask: var(--settings-icon) center / contain no-repeat;
  mask: var(--settings-icon) center / contain no-repeat;
}

.settings-input-wrap i::before {
  content: none;
}

.settings-user {
  --settings-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21a8 8 0 0 0-16 0'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}

.settings-nickname {
  --settings-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='11' r='2'/%3E%3Cpath d='M7 16a3 3 0 0 1 4 0M14 10h4M14 14h4'/%3E%3C/svg%3E");
}

.settings-work {
  --settings-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='13' rx='2'/%3E%3Cpath d='M8 7V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M3 12h18'/%3E%3C/svg%3E");
}

.settings-rate {
  --settings-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v10M15 9.5c-.6-.7-1.5-1-2.8-1-1.5 0-2.7.8-2.7 2s1 1.7 2.7 2c1.8.4 2.8.9 2.8 2.1 0 1.3-1.2 2.1-2.9 2.1-1.2 0-2.3-.4-3.1-1.2'/%3E%3C/svg%3E");
}

.settings-status {
  --settings-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 21v-2a4 4 0 0 0-8 0v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M4 21h16'/%3E%3C/svg%3E");
}

.settings-regular {
  --settings-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

.settings-time {
  --settings-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
}

.settings-card input,
.settings-card select {
  width: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 5px 9px 5px 8px;
  font-size: 11.5px;
  font-weight: 500;
  appearance: none;
}

.settings-time input {
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
}

.settings-time input {
  min-height: 0;
  height: auto;
  cursor: pointer;
  caret-color: transparent;
}

.settings-card input:focus-visible {
  outline: 0;
  box-shadow: none;
}

.settings-input-wrap.has-caret::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid #6f7a90;
  border-bottom: 2px solid #6f7a90;
  transform: rotate(45deg);
  position: absolute;
  right: 12px;
  top: 10px;
  pointer-events: none;
}

.settings-input-wrap.has-caret input,
.settings-input-wrap.has-caret select {
  padding-right: 25px;
}

.settings-card .reminder-row {
  width: min(100%, 204px);
  min-width: 0;
  margin: 6px auto 0;
}

.settings-reminder-toggle {
  position: relative;
  cursor: pointer;
}

.settings-reminder-toggle input {
  width: 1px;
  min-height: 1px;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.settings-reminder-toggle b {
  width: 30px;
  height: 17px;
  border-radius: 999px;
  background: #c8d1c5;
  position: relative;
  flex: 0 0 30px;
  box-shadow: inset 0 1px 3px rgba(40, 55, 43, 0.18);
  transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.settings-reminder-toggle b::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(34, 46, 36, 0.16);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.settings-reminder-toggle input:checked + b {
  background: #59733f;
  box-shadow: inset 0 1px 3px rgba(21, 45, 26, 0.22), 0 5px 12px rgba(89, 115, 63, 0.15);
}

.settings-reminder-toggle input:checked + b::after {
  transform: translateX(13px);
}

.settings-reminder-toggle:hover b {
  transform: translateY(-1px);
}

.settings-reminder-toggle input:focus-visible + b {
  box-shadow: 0 0 0 2px rgba(89, 115, 63, 0.18);
}

.settings-card .modal-actions {
  border-top: 0;
  width: min(100%, 204px);
  margin: 11px auto 0;
  padding: 0 0 20px;
  justify-content: stretch;
}

.settings-save-btn {
  width: 100%;
  min-height: 33px;
  border: 0;
  border-radius: 8px;
  background: #59733f;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  font-size: 12.5px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(89, 115, 63, 0.22);
  transition: background-color 180ms ease, color 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.settings-save-btn:hover {
  background: #111318;
  color: #fff;
  filter: none;
  box-shadow: 0 12px 24px rgba(17, 19, 24, 0.24);
}

.settings-save-btn:active {
  background: #050608;
  color: #fff;
  filter: none;
}

[data-theme="dark"] .settings-card {
  background: rgba(246, 250, 241, 0.96);
  color: #0d1b14;
}

[data-theme="dark"] .settings-head h2,
[data-theme="dark"] .settings-card input,
[data-theme="dark"] .settings-card select,
[data-theme="dark"] .settings-card .form-grid label > span,
[data-theme="dark"] .settings-card .toggle-line span {
  color: #0d1b14;
}

.time-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(12, 22, 16, 0.08);
  backdrop-filter: blur(4px);
}

.time-picker-overlay[hidden] {
  display: none;
}

.time-picker-card {
  width: min(92vw, 246px);
  border: 1px solid rgba(89, 115, 63, 0.24);
  border-radius: 16px;
  background:
    radial-gradient(ellipse at 85% 5%, rgba(104, 138, 76, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 241, 0.96));
  box-shadow: 0 18px 44px rgba(23, 37, 29, 0.22);
  padding: 12px;
}

.time-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.time-picker-head strong {
  display: block;
  color: #173024;
  font-family: var(--display-font);
  font-size: 22px;
  line-height: 1;
  font-weight: 700;
}

.time-picker-head span {
  display: block;
  max-width: 176px;
  margin-top: 4px;
  color: #647282;
  font-size: 10px;
  line-height: 1.25;
  font-weight: 500;
}

#closeTimePickerBtn {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #263d35;
  font-size: 24px;
  line-height: 1;
  transition: color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

#closeTimePickerBtn:hover,
#closeTimePickerBtn:focus-visible {
  background: rgba(89, 115, 63, 0.1);
  color: #111318;
  transform: scale(1.05);
}

.time-picker-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-bottom: 8px;
  border: 1px solid rgba(89, 115, 63, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: #173024;
  font-size: 20px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.time-picker-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.time-picker-unit {
  position: relative;
  display: grid;
  gap: 6px;
}

.time-picker-unit > span {
  color: #4d5966;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.time-select-trigger {
  width: 100%;
  min-height: 26px;
  border: 1px solid rgba(89, 115, 63, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: #17251d;
  padding: 0 7px;
  display: grid;
  grid-template-columns: 12px 1fr 12px;
  align-items: center;
  justify-items: center;
  box-shadow: 0 8px 18px rgba(48, 72, 49, 0.06);
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.time-select-trigger::before {
  content: "";
  width: 12px;
  height: 1px;
}

.time-select-trigger:hover,
.time-select-trigger:focus-visible {
  border-color: #111318;
  background: rgba(255, 255, 255, 0.92);
  color: #17251d;
  outline: 0;
}

.time-select-trigger output {
  color: #17251d;
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.time-select-trigger b {
  width: 6px;
  height: 6px;
  border-right: 2px solid #6f7a90;
  border-bottom: 2px solid #6f7a90;
  transform: rotate(45deg) translateY(-2px);
}

.time-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 4;
  display: none;
  max-height: 116px;
  overflow-y: auto;
  border: 1px solid rgba(89, 115, 63, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 16px 28px rgba(23, 37, 29, 0.16);
  padding: 4px;
}

.time-select-menu.is-open {
  display: grid;
  gap: 2px;
}

.time-select-menu button {
  min-height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #17251d;
  font-size: 11px;
  font-weight: 700;
}

.time-select-menu button:hover,
.time-select-menu button:focus-visible {
  background: rgba(89, 115, 63, 0.14);
  color: #3f6233;
  outline: 0;
}

.time-period-group {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.time-period-group button,
.time-picker-actions button {
  min-height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(89, 115, 63, 0.28);
  background: rgba(255, 255, 255, 0.74);
  color: #17251d;
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.time-period-group button:hover,
.time-period-group button:focus-visible {
  border-color: #111318;
  background: #111318;
  color: #fff;
}

.time-period-group button.is-active {
  border-color: #59733f;
  background: #59733f;
  color: #fff;
  box-shadow: 0 10px 20px rgba(89, 115, 63, 0.18);
}

.time-picker-actions {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
}

.time-picker-overlay.no-clear .time-picker-actions {
  justify-content: flex-end;
}

.time-picker-clear {
  border-color: #111318 !important;
  background: rgba(255, 255, 255, 0.76) !important;
  color: #111318 !important;
}

.time-picker-clear:hover,
.time-picker-clear:focus-visible {
  background: #111318 !important;
  color: #fff !important;
}

.time-picker-apply {
  border-color: #59733f !important;
  background: #59733f !important;
  color: #fff !important;
  box-shadow: 0 10px 22px rgba(89, 115, 63, 0.2);
}

.time-picker-apply:hover,
.time-picker-apply:focus-visible {
  border-color: #111318 !important;
  background: #111318 !important;
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(17, 19, 24, 0.22);
}

[data-theme="dark"] .time-picker-card {
  background:
    radial-gradient(ellipse at 85% 5%, rgba(122, 151, 95, 0.17), transparent 30%),
    linear-gradient(135deg, #f8fbf3, #edf4e7);
  color: #0d1b14;
}

.toast {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 30, 24, 0.12);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  color: #19231d;
  pointer-events: none;
}

.toast > span {
  max-width: min(100%, 540px);
  color: inherit;
  font: 700 clamp(16px, 2.5vw, 20px)/1.5 var(--font);
  text-align: center;
  text-shadow: 0 1px 8px rgba(255, 255, 255, 0.9);
  overflow-wrap: anywhere;
}

.toast[hidden] {
  display: none;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .brand,
  .top-actions {
    justify-content: center;
  }

  .summary-card {
    grid-template-columns: repeat(2, 1fr);
    padding: 0;
  }

  .summary-card article {
    padding: 18px 20px;
  }

  .summary-card article:nth-child(3) {
    border-left: 0;
  }

  .summary-card article:nth-child(n + 3) {
    border-top: 1px solid var(--line);
    padding-top: 26px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    justify-self: center;
    width: min(100%, 610px);
  }

  .reset-btn {
    grid-column: 1 / -1;
    justify-self: center;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px 10px 24px;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 12px;
  }

  .brand-mark {
    width: 44px;
    height: 42px;
    flex-basis: 44px;
  }

  .brand h1 {
    font-size: 22px;
  }

  .brand-copy {
    flex-wrap: wrap;
    gap: 6px 8px;
    justify-content: center;
  }

  .profile-note {
    padding-left: 8px;
  }

  .profile-note span,
  .profile-note small {
    max-width: 150px;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
    font-size: 28px;
  }

  .top-actions {
    gap: 10px;
  }

  .summary-card {
    grid-template-columns: 1fr 1fr;
    padding: 0;
  }

  .summary-card article {
    padding: 14px 12px;
  }

  .summary-card article:nth-child(3) {
    border-left: 0;
  }

  .summary-card span {
    font-size: 12px;
  }

  .summary-card strong {
    font-size: 23px;
  }

  .summary-card small {
    font-size: 13px;
  }

  .calendar-card {
    padding: 14px 10px 16px;
  }

  .calendar-toolbar {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 8px;
    margin-bottom: 14px;
  }

  .calendar-heading {
    min-width: 0;
    gap: 9px;
  }

  .calendar-heading strong {
    font-size: clamp(22px, 8vw, 30px);
  }

  .today-btn {
    min-width: 0;
    height: auto;
    font-size: 13px;
  }

  .weekday-row,
  .calendar-grid {
    gap: 0;
  }

  .weekday-row span {
    font-size: 11px;
  }

  .calendar-grid {
    min-height: auto;
  }

  .day-cell {
    min-height: 38px;
    padding: 3px;
  }

  .day-num {
    font-size: 13px;
  }

  .day-meta {
    display: flex;
    min-height: 12px;
    gap: 3px;
    font-size: 9px;
    line-height: 1.2;
  }

  .side-panel {
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
  }

  .info-card {
    padding: 12px;
    border-radius: 13px;
  }

  .info-card h2 {
    margin-bottom: 8px;
    font-size: 11.5px;
  }

  .legend-list li,
  .status-grid li,
  .info-card p {
    font-size: 12px;
  }

  .status-grid {
    gap: 6px;
  }

  .reset-btn {
    width: min(100%, 226px);
    height: 33px;
    min-height: 33px;
    justify-self: center;
    font-size: 12.5px;
  }

  .overlay {
    align-items: flex-end;
    padding: 0;
  }

  #profileOverlay {
    align-items: center;
    padding: 10px;
  }

  .entry-modal,
  .settings-card,
  .confirm-card {
    width: 100%;
    max-height: 94vh;
    border-radius: 24px 24px 0 0;
    padding: 22px 18px max(22px, env(safe-area-inset-bottom));
  }

  #settingsOverlay {
    align-items: center;
    padding: 10px;
  }

  .settings-card {
    width: min(100%, 270px);
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
    padding: 0;
  }

  .settings-head {
    min-height: 80px;
    padding: 15px 14px 12px;
  }

  .settings-head h2 {
    font-size: 23px;
  }

  .settings-head p {
    font-size: 13.5px;
    margin-top: 5px;
  }

  .settings-card .round-close {
    width: 23px;
    height: 23px;
    font-size: 25px;
  }

  .settings-leaf {
    right: 30px;
    width: 50px;
    height: 38px;
  }

  .settings-leaf::before,
  .settings-leaf::after {
    width: 22px;
    height: 36px;
  }

  .settings-card .form-grid {
    grid-template-columns: 1fr;
    width: min(100%, 204px);
    margin: 12px auto 0;
    padding: 0;
    gap: 6px;
  }

  .settings-input-wrap {
    min-height: 31px;
  }

  .settings-input-wrap i {
    width: 13px;
    height: 13px;
    margin-left: 9px;
    flex-basis: 13px;
  }

  .settings-card input,
  .settings-card select {
    min-height: 0;
    padding: 5px 9px 5px 8px;
    font-size: 11.5px;
  }

  .settings-card .reminder-row {
    width: min(100%, 204px);
    min-width: 0;
    margin: 6px auto 0;
  }

  .settings-card .modal-actions {
    grid-template-columns: 1fr;
    width: min(100%, 204px);
    margin: 10px auto 0;
    padding: 0 0 16px;
  }

  .settings-card .settings-save-btn {
    min-height: 33px;
    font-size: 12.5px;
  }

  .profile-setup-card {
    width: min(100%, 300px);
    min-height: 0;
    max-height: calc(100dvh - 20px);
    overflow: hidden;
    border-radius: 16px;
    padding: 0;
    grid-template-columns: 1fr;
  }

  .profile-visual-panel {
    min-height: 94px;
    max-height: 94px;
  }

  .profile-visual-panel img {
    object-position: center 42%;
  }

  .profile-form-panel {
    padding: 14px 14px 16px;
  }

  .profile-clock {
    width: 34px;
    height: 34px;
    margin-bottom: 7px;
  }

  .profile-setup-intro {
    margin-bottom: 10px;
  }

  .profile-setup-intro h2 {
    font-size: clamp(16px, 5vw, 18px);
    line-height: 1.12;
    white-space: nowrap;
  }

  .profile-setup-intro i {
    width: 34px;
    height: 3px;
    margin: 7px 0 7px;
  }

  .profile-setup-intro p {
    width: min(100%, 250px);
    font-size: clamp(10px, 3vw, 11px);
    line-height: 1.28;
  }

  .profile-form-stack {
    width: 100%;
    gap: 6px;
  }

  .profile-form-stack label > span {
    font-size: 9.5px;
  }

  .profile-input-field {
    min-height: 31px;
  }

  .profile-input-icon {
    width: 12px;
    height: 12px;
    margin-left: 9px;
    flex-basis: 12px;
  }

  .profile-form-stack input,
  .profile-form-stack select {
    min-height: 29px;
    padding: 4px 9px 4px 8px;
    font-size: 11px;
  }

  .profile-actions {
    width: 100%;
    margin-top: 10px;
  }

  .profile-save-btn {
    min-height: 32px;
    gap: 7px;
    font-size: 12px;
    font-weight: 800;
  }

  .profile-save-icon {
    width: 14px;
    height: 14px;
    border-width: 2px;
  }

  .entry-modal {
    border-color: var(--line);
  }

  .modal-head h2 {
    font-size: 29px;
  }

  .modal-head p {
    font-size: 16px;
  }

  .round-close {
    width: 52px;
    height: 52px;
    font-size: 40px;
  }

  .time-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .hours-preview {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 18px;
  }

  .hours-preview article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .hours-preview span {
    font-size: 12px;
  }

  .hours-preview strong {
    font-size: 19px;
  }

  .time-grid label:first-child {
    border-right: 0;
    padding-right: 0;
  }

  .icon-field span,
  .option-block h3,
  .note-field > span {
    font-size: 13px;
    gap: 8px;
  }

  input,
  textarea {
    min-height: 54px;
    font-size: 16px;
    padding: 11px 12px;
  }

  .segmented,
  .segmented.two,
  .segmented.three,
  .quick-actions,
  .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .segmented button,
  .quick-actions button {
    min-height: 58px;
    font-size: 17px;
  }

  .segmented button small {
    font-size: 13px;
  }

  .pay-preview span,
  .pay-preview strong,
  .pay-preview output {
    font-size: 20px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .primary-btn,
  .ghost-btn,
  .save-btn,
  .danger-btn {
    min-height: 58px;
    width: 100%;
    padding: 0 12px;
    font-size: 17px;
  }
}

@media (max-width: 420px) {
  .summary-card {
    grid-template-columns: 1fr;
  }

  .summary-card article {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .summary-card article:first-child {
    border-top: 0;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

/* Responsive finishing rules: preserve the existing visual system while letting
   cards, forms and dialogs use the space available on each device. */
.app-shell,
.content-grid,
.calendar-card,
.calendar-grid,
.summary-card,
.overlay > * {
  min-width: 0;
}

.calendar-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.day-cell {
  min-width: 0;
  overflow-wrap: anywhere;
}

.overlay {
  padding: clamp(12px, 3vw, 28px);
}

.entry-modal,
.settings-card,
.confirm-card,
.profile-setup-card {
  max-height: min(94dvh, 900px);
  overscroll-behavior: contain;
}

@media (max-width: 760px) {
  .app-shell {
    padding-inline: clamp(8px, 2.5vw, 16px);
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand,
  .brand-copy {
    min-width: 0;
  }

  .profile-note span,
  .profile-note small {
    max-width: min(42vw, 220px);
  }

  .calendar-card {
    padding-inline: clamp(8px, 2.5vw, 16px);
  }

  .calendar-grid,
  .weekday-row {
    width: 100%;
  }

  .day-cell {
    min-height: clamp(38px, 10vw, 58px);
    padding: 3px 1px;
  }

  .day-num {
    font-size: clamp(11px, 3.5vw, 14px);
  }

  .overlay {
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
    overflow-y: auto;
    align-items: center;
  }

  .entry-modal,
  .settings-card,
  .confirm-card,
  .profile-setup-card {
    width: min(100%, 560px);
    max-height: calc(100dvh - 20px);
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 18px;
  }

  .entry-modal {
    padding: 24px clamp(16px, 5vw, 32px) max(20px, env(safe-area-inset-bottom));
  }

  .profile-setup-card {
    min-height: 0;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }

  .profile-visual-panel {
    min-height: 100%;
    max-height: none;
  }

  .profile-form-panel {
    min-width: 0;
    padding: 22px clamp(14px, 3vw, 24px);
  }

  .profile-setup-intro h2 {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .profile-form-stack,
  .profile-actions {
    width: 100%;
  }

  .profile-form-stack input,
  .profile-form-stack select,
  .settings-card input,
  .settings-card select {
    min-height: 44px;
    font-size: 15px;
  }

  .settings-card {
    padding: 0;
  }

  .settings-card .form-grid {
    width: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 16px;
  }

  .settings-card .form-grid label,
  .settings-card .reminder-row,
  .settings-card .modal-actions {
    min-width: 0;
  }

  .settings-card .reminder-row {
    width: auto;
    margin: 12px 16px;
  }

  .settings-card .modal-actions {
    width: auto;
    margin: 16px;
    padding: 0 0 16px;
  }

  .settings-card .settings-save-btn,
  .profile-save-btn {
    min-height: 44px;
    font-size: 14px;
  }

  .segmented,
  .segmented.two,
  .segmented.three,
  .quick-actions,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segmented button,
  .quick-actions button {
    min-width: 0;
    min-height: 48px;
    padding-inline: 8px;
    font-size: 14px;
  }

  .modal-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-btn,
  .ghost-btn,
  .save-btn,
  .danger-btn {
    min-height: 48px;
    font-size: 15px;
  }
}

@media (max-width: 520px) {
  .profile-setup-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-visual-panel {
    min-height: 108px;
    max-height: 108px;
  }

  .profile-form-panel {
    padding: 18px 18px 20px;
  }

  .settings-card .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-card {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-card article {
    padding: 14px 10px;
  }

  .summary-card strong {
    font-size: clamp(20px, 6vw, 26px);
    overflow-wrap: anywhere;
  }

  .calendar-toolbar {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 4px;
  }

  .calendar-heading {
    min-width: 0;
    flex-wrap: wrap;
    justify-content: center;
  }

  .calendar-heading strong {
    font-size: clamp(19px, 6vw, 26px);
  }

  .today-btn {
    padding-inline: 6px;
  }

  .weekday-row span {
    font-size: clamp(9px, 2.8vw, 11px);
  }

  .day-cell {
    min-height: clamp(36px, 10vw, 46px);
  }

  .modal-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 360px) {
  .summary-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .summary-card article {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .summary-card article:first-child {
    border-top: 0;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions .icon-btn {
    width: 40px;
    height: 40px;
  }
}

/* Keep the reminder switch anchored while its state changes. */
.settings-reminder-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  column-gap: 12px;
  width: 100%;
  min-height: 20px;
}

.settings-reminder-toggle > span {
  grid-column: 1;
  min-width: 0;
}

.settings-reminder-toggle b {
  grid-column: 2;
  justify-self: end;
  margin: 0;
  transition: none;
}

.settings-reminder-toggle b::after {
  transition: none;
}

.settings-reminder-toggle:hover b {
  transform: none;
}

.entry-modal .modal-head {
  width: 100%;
  max-width: 520px;
  gap: 10px;
}

.entry-modal .modal-head > div {
  flex: 1 1 auto;
  min-width: 0;
}

.entry-modal .modal-head .round-close {
  flex: 0 0 28px;
}

.entry-modal .modal-head h2 {
  font-size: clamp(13px, 4cqi, 22px);
  line-height: 1.2;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.entry-modal {
  container-type: inline-size;
}

.entry-modal .modal-head h2 {
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
}

.time-picker-head > div {
  min-width: 0;
  flex: 1 1 auto;
}

.time-picker-head strong {
  font-size: 16px;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.time-picker-head span {
  max-width: 100%;
}

.topbar {
  position: relative;
  z-index: 30;
}

.notification-anchor {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.notification-popover {
  position: absolute;
  display: flex;
  flex-direction: column;
  z-index: 90;
  top: calc(100% + 13px);
  right: -8px;
  width: min(276px, calc(100vw - 24px));
  max-height: var(--notification-available-height, calc(100dvh - 160px));
  transform: translateX(var(--notification-shift-x, 0px));
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

.notification-popover-head { flex-shrink: 0; }
.notification-popover-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }

.notification-popover[hidden] {
  display: none;
}

.notification-arrow {
  position: absolute;
  top: -7px;
  right: calc(18px + var(--notification-shift-x, 0px));
  width: 13px;
  height: 13px;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
  background: var(--card);
  transform: rotate(45deg);
}

.notification-popover-head {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 8px;
}

.notification-popover-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green-deep);
}

.notification-popover-icon .bell-icon {
  width: 16px;
  height: 16px;
}

.notification-popover-head h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 800;
}

.notification-popover-close {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
}

.notification-popover-close:hover {
  background: var(--card-soft);
  color: var(--text);
}

.notification-popover-message {
  margin: 10px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.notification-popover-time {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card-soft);
  font-size: 11px;
}

.notification-popover-time span {
  color: var(--muted);
}

.notification-popover-time strong {
  color: var(--green-deep);
  font-size: 11px;
}

.notification-popover-action {
  width: 100%;
  min-height: 34px;
  margin-top: 10px;
  border: 0;
  border-radius: 9px;
  background: var(--green-deep);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}

.notification-popover-action:hover {
  filter: brightness(0.92);
}

.notification-popover-action:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.settings-email {
  --settings-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E");
}

.settings-card .reminder-row {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 12px 17px;
}

.reminder-open-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 34px;
  min-height: 34px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.reminder-open-btn > span:first-child { display: grid; gap: 2px; min-width: 0; }
.reminder-open-btn strong { font-size: 11px; }
.reminder-open-btn small { color: var(--muted); font-size: 8px; line-height: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reminder-open-arrow { flex: 0 0 auto; color: var(--green-deep); font-size: 16px; line-height: 1; }
.reminder-open-btn:hover { border-color: var(--green-deep); }

.reminder-settings-overlay {
  z-index: 60;
  padding: 12px;
  background: rgba(231, 238, 235, 0.76);
}

.reminder-settings-card {
  display: grid;
  gap: 6px;
  width: min(92vw, 360px);
  height: min(360px, calc(100dvh - 24px));
  max-height: min(82dvh, 360px);
  overflow-y: auto;
  padding: clamp(14px, 2.5vw, 18px);
  border: 1px solid rgba(91, 105, 127, 0.2);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--text);
}

.reminder-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.reminder-settings-head > div { min-width: 0; }
.reminder-settings-head h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(22px, 3.8vw, 28px);
  line-height: 1.05;
}

.reminder-settings-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.3; }
.reminder-settings-head .round-close {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  min-width: 26px;
  flex: 0 0 26px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
}

.reminder-enable-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 30px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.reminder-enable-row input {
  position: absolute;
  right: 0;
  width: 36px;
  height: 22px;
  opacity: 0;
  cursor: pointer;
}

.reminder-enable-row b {
  position: relative;
  width: 36px;
  height: 22px;
  flex: 0 0 36px;
  border-radius: 99px;
  background: #bac6bb;
  transition: background .18s ease;
}

.reminder-enable-row b::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0002;
  transition: transform .18s ease;
}

.reminder-enable-row input:checked + b { background: var(--green-deep); }
.reminder-enable-row input:checked + b::after { transform: translateX(14px); }
.reminder-enable-row input:focus-visible + b { outline: 3px solid #527a3966; outline-offset: 3px; }

.reminder-field-group { display: grid; gap: 3px; min-width: 0; }
.reminder-field-group > label,
.reminder-code-group > label,
.reminder-days-fieldset legend { font-size: 11px; font-weight: 700; }

.reminder-email-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.reminder-email-row input {
  width: 100%;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid #d2d7d4;
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font: inherit;
}
.reminder-email-row input:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 1px; }
.reminder-verify-btn,
.reminder-cancel-btn,
.reminder-save-btn {
  height: 34px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--green-deep);
  border-radius: 9px;
  background: transparent;
  color: var(--green-deep);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.reminder-verify-btn:disabled { cursor: default; opacity: .7; }
.reminder-helper { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.25; }
.reminder-helper.is-verified { color: var(--green-deep); font-weight: 700; }
.reminder-code-group { display: grid; gap: 4px; }
.reminder-code-group[hidden] { display: none; }
.reminder-divider { height: 1px; margin: 1px 0; background: var(--line); }
.reminder-settings-card .settings-time { height: 34px; min-height: 34px; }
.reminder-settings-card .settings-time input {
  height: auto;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border: 0;
  outline: 0;
  box-shadow: none;
  font-size: 12px;
  caret-color: transparent;
}
.reminder-settings-card .settings-time.has-caret::after { top: 11px; }

.reminder-days-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.reminder-days-fieldset legend { margin-bottom: 5px; padding: 0; }
.reminder-day-options { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.reminder-day-options button {
  min-width: 0;
  height: 30px;
  min-height: 30px;
  padding: 0 4px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--card);
  color: var(--green-deep);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.reminder-day-options button.is-active { border-color: var(--green-deep); background: var(--green-deep); color: #fff; }
.reminder-day-options button:focus-visible { outline: 3px solid #527a3966; outline-offset: 2px; }
.reminder-skip-row { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: center; gap: 7px; font-size: 11px; font-weight: 600; line-height: 1.25; cursor: pointer; }
.reminder-skip-row input { grid-column: 1; grid-row: 1; width: 16px; height: 16px; margin: 0; accent-color: var(--green-deep); }
.reminder-skip-row span { grid-column: 2; grid-row: 1; }
.reminder-rest-note { margin: -2px 0 0 23px; }
.reminder-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.reminder-modal-actions > button { flex: 0 1 150px; max-width: calc((100% - 8px) / 2); margin: 0; width: 150px; }
.reminder-cancel-btn { background: var(--card); }
.reminder-save-btn { border-color: var(--green-deep); background: var(--green-deep); color: #fff; }
.reminder-save-btn:disabled { border-color: #c8d0c9; background: #c8d0c9; cursor: not-allowed; }

/* Keep primary actions and form controls aligned with the compact entry form. */
.entry-modal .ghost-btn,
.entry-modal .save-btn,
.reset-btn,
.settings-save-btn,
.notification-popover-action,
.reminder-open-btn,
.reminder-verify-btn,
.reminder-cancel-btn,
.reminder-save-btn {
  box-sizing: border-box;
  width: min(100%, 150px);
  height: 34px;
  min-height: 34px;
  margin-inline: auto;
}

.settings-card .reminder-open-btn {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.settings-card .settings-save-btn {
  width: 120px;
  margin-left: auto;
  margin-right: 0;
}

.reminder-settings-card .reminder-verify-btn {
  width: 70px;
  min-width: 70px;
  margin-inline: 0;
  padding-inline: 8px;
}

@media (max-width: 420px) {
  .reminder-settings-card { gap: 5px; padding: 14px; border-radius: 14px; }
  .reminder-settings-head p { font-size: 10px; }
  .reminder-day-options { gap: 4px; }
  .reminder-day-options button { height: 32px; min-height: 32px; padding-inline: 2px; font-size: 10px; }
  .reminder-email-row { gap: 6px; }
  .reminder-email-row input { height: 32px; min-height: 32px; }
  .reminder-verify-btn { width: 70px; min-width: 70px; padding-inline: 8px; }
  .reminder-settings-card .settings-time { height: 32px; min-height: 32px; }
}

/* Keep Settings compact and constrain the reminder dialog on short screens. */
@media (max-width: 760px) {
  .settings-card {
    width: min(100%, 560px);
    height: min(529px, calc(100dvh - 20px));
    max-height: calc(100dvh - 20px);
  }

  .reminder-settings-card {
    width: min(100%, 360px);
    height: min(360px, calc(100dvh - 20px));
    min-height: 0;
    max-height: calc(100dvh - 20px);
  }
}

/* Keep the save actions compact, right-aligned, and on one line. */
.profile-actions {
  display: flex;
  justify-content: flex-end;
}

.profile-save-btn,
.settings-card .settings-save-btn {
  width: min(100%, 150px);
  max-width: 150px;
  margin-left: auto;
  white-space: nowrap;
  flex: 0 0 auto;
}

.settings-card .settings-save-btn {
  margin-right: 0;
}

/* Match the reminder close control to the Settings close control. */
.reminder-settings-head .round-close {
  width: 24px;
  height: 24px;
  min-width: 24px;
  flex: 0 0 24px;
  border: 0;
  background: transparent;
  color: #263d35;
  font-size: 27px;
  box-shadow: none;
}

/* Fit the reminder schedule in a compact box without a desktop scrollbar. */
.reminder-settings-card {
  width: min(92vw, 320px);
  height: min(529px, calc(100dvh - 24px));
  min-height: 0;
  max-height: min(94dvh, 529px);
  overflow-x: hidden;
  overflow-y: hidden;
}

.reminder-settings-card > *,
.reminder-settings-card .reminder-email-row,
.reminder-settings-card .reminder-modal-actions {
  min-width: 0;
}

.reminder-day-options {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.reminder-modal-actions > button {
  width: 120px;
  flex: 0 1 120px;
  max-width: calc((100% - 8px) / 2);
}

@media (max-width: 760px) {
  .reminder-settings-card {
    width: min(100%, 320px);
    height: min(529px, calc(100dvh - 20px));
    max-height: calc(100dvh - 20px);
  }
}

@media (max-height: 540px) {
  .reminder-settings-card {
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }
}

/* Weekly hours and on-demand dashboard export menu. */
.weekly-hours-card { min-width: 0; }
.weekly-hours-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.weekly-hours-head h2 { margin: 0; }
.weekly-hours-head > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.weekly-hours-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  height: 82px;
  margin-top: 7px;
  align-items: end;
}
.weekly-bar-item {
  display: grid;
  grid-template-rows: 12px minmax(0, 1fr) 13px;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  height: 100%;
}
.weekly-bar-value,
.weekly-bar-day { color: var(--muted); font-size: 8px; line-height: 1; white-space: nowrap; }
.weekly-bar-track {
  display: flex;
  align-items: end;
  justify-content: center;
  width: 100%;
  max-width: 22px;
  height: 100%;
  overflow: hidden;
  border-radius: 5px 5px 2px 2px;
  background: rgba(82, 122, 57, 0.08);
}
.weekly-bar-fill {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #5cc98b, #35aa68);
}
.weekly-hours-summary { margin-top: 5px !important; font-size: 10px !important; }
.dashboard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}
.dashboard-actions .reset-btn {
  width: 100%;
  max-width: none;
  min-width: 0;
  height: 33px;
  min-height: 33px;
  font-size: 10px;
  gap: 5px;
  padding-inline: 5px;
}
.dashboard-actions .trash-icon { position: relative; flex: 0 0 12px; width: 12px; height: 14px; }
.export-dropdown { position: relative; min-width: 0; }
.export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  height: 33px;
  min-height: 33px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--green-deep);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.export-btn:hover { background: #41632e; }
.export-icon { font-size: 17px; line-height: 1; }
.export-caret { margin-left: auto; font-size: 14px; line-height: 1; }
.export-menu {
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: calc(100% + 7px);
  width: max-content;
  min-width: 158px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.export-menu[hidden] { display: none; }
.export-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 34px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 11px;
  white-space: nowrap;
}
.export-menu button:hover,
.export-menu button:focus-visible { background: var(--green-soft); }
.export-menu button > span { width: 16px; text-align: center; font-size: 16px; }

@media (max-width: 760px) {
  .weekly-hours-chart { height: 92px; }
  .weekly-bar-value,
  .weekly-bar-day { font-size: 10px; }
  .dashboard-actions .reset-btn,
  .export-btn { height: 38px; min-height: 38px; font-size: 12px; }
}

@media print {
  body { background: #fff !important; color: #111 !important; }
  .app-shell { width: 100%; max-width: none; padding: 0; }
  .top-actions,
  .calendar-toolbar > .icon-btn,
  .today-btn,
  .dashboard-actions,
  .notification-popover,
  .toast { display: none !important; }
  .content-grid { grid-template-columns: minmax(0, 1fr) 250px; gap: 10px; }
  .calendar-card,
  .info-card,
  .summary-card { box-shadow: none; backdrop-filter: none; break-inside: avoid; }
  .calendar-grid { min-height: 360px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .day-cell { min-height: 58px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* Settings stays fully visible; its compact controls fit without an inner scrollbar. */
.settings-card {
  height: auto;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.settings-head {
  min-height: 74px;
  padding: 12px 14px 10px;
}

.settings-card .form-grid {
  margin-top: 8px;
  gap: 4px;
}

.settings-card .form-grid label {
  gap: 2px;
}

.settings-input-wrap {
  height: 28px;
  min-height: 28px;
}

.settings-card .reminder-row {
  padding: 8px 14px;
}

.settings-card .reminder-open-btn {
  height: 32px;
  min-height: 32px;
}

.settings-card .modal-actions {
  margin-top: 7px;
  padding-bottom: 12px;
}

.settings-card .settings-save-btn {
  height: 32px;
  min-height: 32px;
}

/* Match the reference Daily Reminder field sizes and right-aligned actions. */
.reminder-settings-card {
  width: min(92vw, 340px);
  height: min(640px, calc(100dvh - 24px));
  max-height: min(94dvh, 640px);
  padding: 24px;
  gap: 6px;
  align-content: space-between;
  overflow-x: hidden;
  overflow-y: hidden;
}

.reminder-settings-head h2 {
  font-size: 28px;
  line-height: 1.05;
}

.reminder-settings-head p {
  max-width: 230px;
  font-size: 12px;
  line-height: 1.35;
}

.reminder-enable-row {
  min-height: 32px;
  font-size: 13px;
}

.reminder-email-row input {
  height: 40px;
  min-height: 40px;
  padding-inline: 12px;
  font-size: 13px;
}

.reminder-verify-btn {
  height: 40px;
  min-height: 40px;
  font-size: 12px;
}

.reminder-settings-card .settings-time,
.reminder-repeat-select-wrap {
  height: 42px;
  min-height: 42px;
  border: 1px solid #d8dee3;
  border-radius: 9px;
  background: #fff;
  box-shadow: none;
}

.reminder-settings-card .settings-time input {
  font-size: 14px;
}

.reminder-repeat-select-wrap {
  --settings-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 11h18'/%3E%3C/svg%3E");
}

.reminder-repeat-select-wrap select {
  width: 100%;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  padding: 0 30px 0 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.reminder-days-fieldset {
  display: grid;
  gap: 5px;
}

.reminder-days-fieldset legend {
  margin-bottom: 0;
}

.reminder-days-fieldset > .reminder-helper {
  font-size: 11px;
  line-height: 1.3;
}

.reminder-day-options[hidden] {
  display: none;
}

.reminder-modal-actions {
  gap: 8px;
  margin-top: 0;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.reminder-settings-card .reminder-modal-actions .reminder-cancel-btn {
  width: 76px;
  min-width: 76px;
  flex: 0 0 76px;
  margin: 0;
}

.reminder-settings-card .reminder-modal-actions .reminder-save-btn {
  width: 116px;
  min-width: 116px;
  flex: 0 0 116px;
  margin: 0;
}

@media (max-width: 760px) {
  .settings-card {
    width: min(100%, 560px);
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .reminder-settings-card {
    width: min(100%, 340px);
    height: min(640px, calc(100dvh - 20px));
    max-height: min(94dvh, 640px);
  }
}

@media (max-width: 420px) {
  .reminder-settings-card {
    padding: 18px;
  }
}

@media (max-height: 540px) {
  .reminder-settings-card {
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }
}

/* Final reminder sizing overrides: compact like Settings and avoid visible scrollbars. */
.reminder-settings-card {
  width: min(92vw, 270px);
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 24px);
  align-content: start;
  gap: 5px;
  padding: 14px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.reminder-settings-card::-webkit-scrollbar { display: none; }
.reminder-settings-head { min-height: 45px; }
.reminder-settings-head h2 { font-size: 24px; }
.reminder-settings-head p { font-size: 10px; line-height: 1.25; }
.reminder-enable-row { min-height: 28px; font-size: 11px; }
.reminder-email-row input,
.reminder-verify-btn { height: 28px; min-height: 28px; font-size: 11px; }
.reminder-email-row input { min-width: 0; padding-inline: 8px; }
.reminder-settings-card .reminder-verify-btn { width: 64px; min-width: 64px; padding-inline: 5px; }
.reminder-helper { font-size: 9px; line-height: 1.25; }
.reminder-divider { margin-block: 1px; }
.reminder-settings-card .settings-time,
.reminder-repeat-select-wrap { height: 28px; min-height: 28px; border-radius: 8px; }
.reminder-settings-card .settings-time input,
.reminder-repeat-select-wrap select { height: 26px; min-height: 26px; font-size: 11px; }
.reminder-settings-card .settings-time input { padding-inline: 8px; }
.reminder-repeat-select-wrap select { padding-left: 8px; }
.reminder-days-fieldset { gap: 3px; }
.reminder-days-fieldset > .reminder-helper { font-size: 9px; }
.reminder-day-options { gap: 4px; }
.reminder-day-options button { height: 28px; min-height: 28px; padding-inline: 2px; font-size: 9px; }
.reminder-skip-row { min-height: 24px; font-size: 10px; }
.reminder-skip-row input { width: 14px; height: 14px; }
.reminder-rest-note { margin-top: -2px; font-size: 9px; line-height: 1.25; }
.reminder-modal-actions { gap: 6px; padding-top: 7px; }
.reminder-settings-card .reminder-modal-actions .reminder-cancel-btn {
  width: 68px; min-width: 68px; flex-basis: 68px; height: 31px; min-height: 31px; font-size: 10px;
}
.reminder-settings-card .reminder-modal-actions .reminder-save-btn {
  width: 108px; min-width: 108px; flex-basis: 108px; height: 31px; min-height: 31px; font-size: 10px;
}
@media (max-width: 420px) {
  .reminder-settings-card { width: min(92vw, 270px); padding: 14px; }
}
@media (max-height: 540px) {
  .reminder-settings-card { height: auto; max-height: calc(100dvh - 16px); overflow-y: auto; }
}

.reminder-settings-head,
.reminder-enable-row,
.reminder-field-group,
.reminder-code-group,
.reminder-divider,
.reminder-days-fieldset,
.reminder-skip-row,
.reminder-rest-note,
.reminder-modal-actions {
  width: 100%;
  margin-inline: 0;
}
.reminder-modal-actions { margin-left: auto; margin-right: 0; justify-content: flex-end; }
.reminder-field-group { gap: 2px; }
.reminder-days-fieldset { gap: 2px; }
.reminder-days-fieldset > .reminder-helper { line-height: 1.2; }
.reminder-skip-row { margin-top: -1px; }
.reminder-rest-note { margin-top: -3px; }
.reminder-repeat-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
}
.reminder-enable-row b,
.reminder-enable-row input { width: 34px; height: 20px; flex-basis: 34px; }
.reminder-enable-row b::after { width: 16px; height: 16px; }
.reminder-enable-row input:checked + b::after { transform: translateX(14px); }

/* Reminder actions share a black hover state; keep the close control near the card corner. */
.reminder-settings-card .reminder-modal-actions .reminder-cancel-btn,
.reminder-settings-card .reminder-modal-actions .reminder-save-btn {
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.reminder-settings-card .reminder-modal-actions .reminder-cancel-btn:hover,
.reminder-settings-card .reminder-modal-actions .reminder-save-btn:not(:disabled):hover {
  border-color: #111;
  background: #111;
  color: #fff;
}
.reminder-settings-head { position: relative; }
.reminder-settings-head .round-close {
  position: absolute;
  top: -6px;
  right: -6px;
}

/* Keep the schedule guidance compact without changing the input dimensions. */
.reminder-schedule-options {
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 0;
}
.reminder-schedule-options .reminder-days-fieldset {
  gap: 2px;
}
.reminder-schedule-options .reminder-days-fieldset > .reminder-helper,
.reminder-schedule-options .reminder-skip-row,
.reminder-schedule-options .reminder-rest-note {
  margin: 0;
}
.reminder-schedule-options .reminder-days-fieldset > .reminder-helper {
  line-height: 1.2;
}
.reminder-repeat-select-wrap:focus-within {
  border-color: #6b7f4c;
  box-shadow: 0 0 0 1px rgba(104, 124, 76, 0.16);
}
.reminder-repeat-select-wrap select,
.reminder-repeat-select-wrap select:focus,
.reminder-repeat-select-wrap select:focus-visible {
  appearance: none;
  -webkit-appearance: none;
  outline: 0;
  box-shadow: none;
  background-image: none;
}
.reminder-repeat-select-wrap.has-caret::after {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

/* Keep both settings panels on the same frame and use the Settings header treatment. */
.settings-card,
.reminder-settings-card {
  box-sizing: border-box;
  width: min(92vw, 270px);
  height: min(470px, calc(100dvh - 24px));
  min-height: 0;
  max-height: min(94dvh, 470px);
}
.settings-card {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}
.settings-card::-webkit-scrollbar { display: none; }
.reminder-settings-card {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  border: 1px solid rgba(91, 105, 127, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 20px 54px rgba(42, 59, 82, 0.17);
}
.reminder-settings-card::-webkit-scrollbar { display: none; }
.reminder-settings-head {
  position: relative;
  width: calc(100% + 28px);
  min-height: 74px;
  margin: -14px -14px 0;
  padding: 12px 14px 10px;
  overflow: hidden;
  align-items: center;
  background:
    radial-gradient(ellipse at 88% 10%, rgba(111, 149, 93, 0.13), transparent 28%),
    linear-gradient(168deg, transparent 0 60%, rgba(214, 224, 193, 0.62) 60% 76%, transparent 76%),
    linear-gradient(135deg, #fffdf6 0%, #faf8ed 56%, #eef3e3 100%);
  border-bottom: 1px solid rgba(82, 122, 57, 0.12);
}
.reminder-settings-head > div { max-width: calc(100% - 38px); }
.reminder-settings-head h2 {
  font-size: 26px;
  line-height: 0.95;
}
.reminder-settings-head p {
  max-width: 204px;
  margin: 6px 0 0;
  font-size: 10px;
  line-height: 1.2;
}
.reminder-settings-card .reminder-field-group > label,
.reminder-settings-card .reminder-code-group > label,
.reminder-settings-card .reminder-days-fieldset legend {
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.1;
}
.reminder-settings-card .reminder-enable-row,
.reminder-settings-card .reminder-skip-row { font-size: 9.5px; }
.reminder-settings-head .settings-leaf {
  right: 23px;
  bottom: 4px;
}
.reminder-settings-head .round-close {
  z-index: 2;
  top: 7px;
  right: 7px;
}

/* Match Settings field width while keeping Reminder fields plain until interaction. */
.reminder-settings-card > .reminder-enable-row,
.reminder-settings-card > .reminder-field-group,
.reminder-settings-card > .reminder-code-group,
.reminder-settings-card > .reminder-divider,
.reminder-settings-card > .reminder-schedule-options,
.reminder-settings-card > .reminder-modal-actions {
  width: min(100%, 204px);
  margin-inline: auto;
}
.reminder-settings-card > .reminder-modal-actions { margin-top: auto; }
.reminder-settings-card .reminder-field-group,
.reminder-settings-card .reminder-code-group { gap: 2px; }
.reminder-email-row input,
.reminder-settings-card .settings-time input,
.reminder-repeat-select-wrap select { font-size: 11.5px; }
.reminder-email-row input,
.reminder-settings-card .settings-time,
.reminder-repeat-select-wrap {
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}
.reminder-email-row input {
  outline: 0;
}
.reminder-email-row input:hover,
.reminder-email-row input:focus,
.reminder-settings-card .settings-time:hover,
.reminder-settings-card .settings-time:focus-within,
.reminder-repeat-select-wrap:hover,
.reminder-repeat-select-wrap:focus-within {
  border-color: #4a4d4b;
  background: #4a4d4b;
  color: #fff;
  box-shadow: none;
}
.reminder-email-row input:hover::placeholder,
.reminder-email-row input:focus::placeholder { color: #e1e2e1; }
.reminder-settings-card .settings-time:hover input,
.reminder-settings-card .settings-time:focus-within input,
.reminder-repeat-select-wrap:hover select,
.reminder-repeat-select-wrap:focus-within select { color: #fff; }
.reminder-settings-card .settings-time:hover i,
.reminder-settings-card .settings-time:focus-within i,
.reminder-repeat-select-wrap:hover i,
.reminder-repeat-select-wrap:focus-within i { filter: brightness(0) invert(1); }
.reminder-settings-card .settings-time:hover::after,
.reminder-settings-card .settings-time:focus-within::after,
.reminder-repeat-select-wrap:hover::after,
.reminder-repeat-select-wrap:focus-within::after {
  border-color: #fff;
}
.settings-card .settings-save-btn {
  width: 108px;
  min-width: 108px;
  max-width: 108px;
  height: 31px;
  min-height: 31px;
  flex: 0 0 108px;
  margin: 0 0 0 auto;
  padding: 0 8px;
  gap: 0;
  white-space: nowrap;
  font-size: 10px;
}
.settings-card .reminder-open-btn {
  border-color: transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding-inline: 0;
  color: var(--text);
}
.settings-card .reminder-open-btn:hover,
.settings-card .reminder-open-btn:focus-visible {
  border-color: transparent;
  background: transparent;
  color: #737874;
  box-shadow: none;
}
.settings-card .reminder-open-btn:hover strong,
.settings-card .reminder-open-btn:focus-visible strong,
.settings-card .reminder-open-btn:hover small,
.settings-card .reminder-open-btn:focus-visible small,
.settings-card .reminder-open-btn:hover .reminder-open-arrow,
.settings-card .reminder-open-btn:focus-visible .reminder-open-arrow {
  color: #737874;
}
.settings-card .reminder-open-btn small { transition: color 140ms ease; }
.settings-card .reminder-row { padding: 8px 35px; }
.settings-card .reminder-open-arrow { display: none; }
.reminder-settings-card { gap: 6px; }
.reminder-settings-card .reminder-field-group,
.reminder-settings-card .reminder-code-group { gap: 3px; }
.reminder-schedule-options { gap: 5px; align-content: start; }
.reminder-schedule-options .reminder-days-fieldset { gap: 3px; align-content: start; }
.reminder-schedule-options .reminder-helper { line-height: 1.1; }
.reminder-settings-head { padding-left: 34px; }
.reminder-email-row input:hover,
.reminder-email-row input:focus,
.reminder-settings-card .settings-time:hover,
.reminder-settings-card .settings-time:focus-within,
.reminder-repeat-select-wrap:hover,
.reminder-repeat-select-wrap:focus-within {
  border-color: #4a4d4b;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}
.reminder-email-row input:hover::placeholder,
.reminder-email-row input:focus::placeholder { color: var(--muted); }
.reminder-settings-card .settings-time:hover input,
.reminder-settings-card .settings-time:focus-within input,
.reminder-repeat-select-wrap:hover select,
.reminder-repeat-select-wrap:focus-within select { color: var(--text); }
.reminder-settings-card .settings-time:hover i,
.reminder-settings-card .settings-time:focus-within i,
.reminder-repeat-select-wrap:hover i,
.reminder-repeat-select-wrap:focus-within i { filter: none; }
.reminder-settings-card .settings-time:hover::after,
.reminder-settings-card .settings-time:focus-within::after,
.reminder-repeat-select-wrap:hover::after,
.reminder-repeat-select-wrap:focus-within::after { border-color: #4a4d4b; }
.reminder-settings-card .reminder-verify-btn:hover {
  border-color: #111;
  background: #111;
  color: #fff;
  box-shadow: 0 12px 24px rgba(17, 19, 24, 0.24);
}
@media (max-width: 420px) {
  .settings-card,
  .reminder-settings-card {
    width: min(92vw, 270px);
    height: min(470px, calc(100dvh - 16px));
    max-height: calc(100dvh - 16px);
  }
}

/* Keep reminder sections evenly spaced and the schedule guidance compact. */
.reminder-settings-card { gap: 4px; }
.reminder-settings-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.reminder-settings-card > .reminder-enable-row,
.reminder-settings-card > .reminder-divider,
.reminder-settings-card > .reminder-schedule-options { margin-block: 0; }
.reminder-settings-card > .reminder-schedule-options { gap: 2px; }
.reminder-settings-card .reminder-schedule-options .reminder-days-fieldset { gap: 2px; }
.reminder-settings-head { padding-left: 28px; }
.reminder-settings-card > .reminder-modal-actions { margin-top: auto; }

/* Final shared action sizing and alignment. */
.settings-card .settings-save-btn,
.profile-save-btn,
.reminder-settings-card .reminder-modal-actions .reminder-cancel-btn,
.reminder-settings-card .reminder-modal-actions .reminder-save-btn,
.notification-popover .notification-popover-action,
.dashboard-actions .reset-btn,
.dashboard-actions .export-btn {
  box-sizing: border-box;
  width: 108px;
  min-width: 108px;
  max-width: 108px;
  height: 31px;
  min-height: 31px;
  flex: 0 0 108px;
  padding: 0 7px;
  font-size: 10px;
  white-space: nowrap;
}

.profile-actions,
.settings-card .modal-actions { display: flex; justify-content: flex-end; }
.settings-card .settings-save-btn,
.profile-save-btn { margin-left: auto; margin-right: 0; }
.reminder-settings-card > .reminder-modal-actions {
  width: min(100%, 240px);
  max-width: none;
  margin: auto 0 0 auto;
  justify-content: flex-end;
  gap: 6px;
}
.reminder-settings-card .reminder-modal-actions .reminder-cancel-btn,
.reminder-settings-card .reminder-modal-actions .reminder-save-btn { margin: 0; }
.notification-popover { padding-bottom: 17px; }
.notification-popover .notification-popover-action { display: block; margin: 10px 0 0 auto; }

/* Keep the notification bell plain while preserving its space in the header. */
.notification-popover-icon {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* One clean email input border with a smooth, single-line focus state. */
.reminder-settings-card .reminder-email-row input {
  outline: 0;
  outline-offset: 0;
  box-shadow: none;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}
.reminder-settings-card .reminder-email-row input:focus,
.reminder-settings-card .reminder-email-row input:focus-visible,
.reminder-settings-card .reminder-email-row input:hover {
  border-color: #4a4d4b;
  outline: 0;
  outline-offset: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

/* Center Export's icon and label independently of its right-aligned caret. */
.dashboard-actions .export-dropdown { width: 108px; margin: 0; }
.dashboard-actions .export-btn { position: relative; display: inline-flex; justify-content: center; gap: 5px; margin: 0; }
.dashboard-actions .export-icon { display: inline-flex; width: 14px; height: 14px; font-size: 0; line-height: 1; }
.dashboard-actions .export-icon svg,
.export-menu-icon svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dashboard-actions .export-caret {
  position: absolute;
  top: 11px;
  right: 8px;
  width: 6px;
  height: 6px;
  margin: 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  font-size: 0;
  transform: rotate(45deg);
}
.dashboard-actions .reset-btn { margin: 0; justify-content: center; gap: 5px; padding-inline: 6px; }
.export-menu button > .export-menu-icon { display: inline-flex; width: 16px; height: 16px; flex: 0 0 16px; }

.settings-card.is-readonly .settings-input-wrap input:read-only,
.settings-card.is-readonly .settings-input-wrap select:disabled {
  color: var(--text);
  opacity: 1;
  -webkit-text-fill-color: var(--text);
}

/* Dark mode: keep modal backdrops soft and modal content readable. */
[data-theme="dark"] .overlay,
[data-theme="dark"] .reminder-settings-overlay {
  background: rgba(7, 13, 10, 0.38);
  backdrop-filter: blur(7px) saturate(0.94);
  -webkit-backdrop-filter: blur(7px) saturate(0.94);
}

[data-theme="dark"] .settings-card,
[data-theme="dark"] .reminder-settings-card,
[data-theme="dark"] .entry-modal {
  --card: #fbfcf9;
  --card-soft: #f1f5ef;
  --line: #d9e1d8;
  --line-strong: #b9c8b8;
  --text: #17251d;
  --muted: #536457;
  --faint: #78877c;
  color-scheme: light;
  color: #17251d;
}

[data-theme="dark"] .settings-card {
  background: rgba(248, 250, 245, 0.98);
  border-color: rgba(255, 255, 255, 0.88);
}

[data-theme="dark"] .settings-card .settings-head h2,
[data-theme="dark"] .settings-card .settings-head p,
[data-theme="dark"] .settings-card .form-grid label > span,
[data-theme="dark"] .settings-card .toggle-line span,
[data-theme="dark"] .settings-card .reminder-open-btn,
[data-theme="dark"] .settings-card .reminder-open-btn strong,
[data-theme="dark"] .settings-card .reminder-open-btn small,
[data-theme="dark"] .settings-card input,
[data-theme="dark"] .settings-card select,
[data-theme="dark"] .settings-card.is-readonly .settings-input-wrap input:read-only,
[data-theme="dark"] .settings-card.is-readonly .settings-input-wrap select:disabled {
  color: #17251d;
  -webkit-text-fill-color: #17251d;
  opacity: 1;
}

[data-theme="dark"] .settings-card .settings-input-wrap {
  border-color: #d6dfd5;
  background: rgba(255, 255, 255, 0.78);
}

[data-theme="dark"] .settings-card .settings-input-wrap:focus-within {
  border-color: #647a58;
  background: #fff;
}

[data-theme="dark"] .reminder-settings-card {
  background: rgba(248, 250, 246, 0.98);
  border-color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .reminder-settings-card .settings-time,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap {
  border-color: #cbd7ca;
  background: #fbfcf9;
  color: #17251d;
}

[data-theme="dark"] .reminder-settings-card .settings-time input,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap select,
[data-theme="dark"] .reminder-settings-card .reminder-email-row input,
[data-theme="dark"] .reminder-settings-card .reminder-code-group input {
  color: #17251d;
  -webkit-text-fill-color: #17251d;
  color-scheme: light;
}

[data-theme="dark"] .reminder-settings-card .reminder-email-row input,
[data-theme="dark"] .reminder-settings-card .reminder-code-group input {
  border-color: #cbd7ca;
  background: #fbfcf9;
}

[data-theme="dark"] .reminder-settings-card .settings-time:hover,
[data-theme="dark"] .reminder-settings-card .settings-time:focus-within,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap:hover,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap:focus-within,
[data-theme="dark"] .reminder-settings-card .reminder-email-row input:hover,
[data-theme="dark"] .reminder-settings-card .reminder-email-row input:focus,
[data-theme="dark"] .reminder-settings-card .reminder-email-row input:focus-visible {
  border-color: #59645b;
  background: #f7f9f5;
  color: #17251d;
}

[data-theme="dark"] .reminder-settings-card .settings-time:hover input,
[data-theme="dark"] .reminder-settings-card .settings-time:focus-within input,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap:hover select,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap:focus-within select {
  color: #17251d;
  -webkit-text-fill-color: #17251d;
}

[data-theme="dark"] .entry-modal {
  background: linear-gradient(135deg, #fbfcf8 0%, #f4f7f0 100%);
  border-color: rgba(255, 255, 255, 0.86);
}

/* Entry actions match the compact Settings actions and stay at the right edge. */
.entry-modal .modal-actions {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  justify-content: flex-end;
  gap: 6px;
}

.entry-modal .modal-actions > .ghost-btn,
.entry-modal .modal-actions > .save-btn {
  box-sizing: border-box;
  flex: 0 0 108px;
  width: 108px;
  min-width: 108px;
  max-width: 108px;
  height: 31px;
  min-height: 31px;
  padding: 0 7px;
  font-size: 10px;
  white-space: nowrap;
}

/* All green primary actions share the black hover used by Save. */
.profile-save-btn:hover,
.settings-card .settings-save-btn:hover,
.entry-modal .save-btn:hover,
.reminder-settings-card .reminder-modal-actions .reminder-save-btn:not(:disabled):hover,
.notification-popover .notification-popover-action:not(:disabled):hover,
.dashboard-actions .export-btn:hover {
  border-color: #111318;
  background: #111318;
  color: #fff;
  filter: none;
  box-shadow: 0 12px 24px rgba(17, 19, 24, 0.24);
}

.reminder-settings-card .reminder-modal-actions .reminder-save-btn:disabled:hover {
  border-color: #c8d0c9;
  background: #c8d0c9;
  color: #fff;
  box-shadow: none;
}

/* Dark palette only: retain the existing layout and geometry. */
[data-theme="dark"] {
  --page: #252b2f;
  --card: #2e3439;
  --card-soft: #373e44;
  --line: #5a636a;
  --line-strong: #788188;
  --text: #f3f5f6;
  --muted: #c2c9ce;
  --faint: #9ca5ab;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 12% 12%, rgba(127, 160, 107, 0.1), transparent 34%),
    radial-gradient(ellipse at 86% 82%, rgba(96, 139, 83, 0.1), transparent 35%),
    linear-gradient(160deg, transparent 0 68%, rgba(109, 145, 91, 0.1) 68% 75%, transparent 75%),
    var(--page);
}

[data-theme="dark"] .summary-card,
[data-theme="dark"] .calendar-card,
[data-theme="dark"] .info-card,
[data-theme="dark"] .setup-card,
[data-theme="dark"] .confirm-card {
  background: rgba(46, 52, 57, 0.96);
  border-color: #636d74;
  color: var(--text);
}

[data-theme="dark"] .calendar-card {
  background: linear-gradient(145deg, #30363b, #292f34);
}

[data-theme="dark"] .info-card {
  background: #2e3439;
}

[data-theme="dark"] .summary-card article {
  border-left-color: #586168;
}

[data-theme="dark"] .summary-card span,
[data-theme="dark"] .summary-card strong,
[data-theme="dark"] .summary-card small,
[data-theme="dark"] .calendar-heading strong,
[data-theme="dark"] .weekday-row span,
[data-theme="dark"] .day-cell,
[data-theme="dark"] .day-meta,
[data-theme="dark"] .info-card h2,
[data-theme="dark"] .info-card p,
[data-theme="dark"] .legend-list li,
[data-theme="dark"] .legend-list strong,
[data-theme="dark"] .status-grid li,
[data-theme="dark"] .weekly-hours-summary,
[data-theme="dark"] .weekly-hours-title,
[data-theme="dark"] .weekly-hours-range {
  color: var(--text);
}

[data-theme="dark"] .summary-card article::after {
  background:
    linear-gradient(145deg, transparent 0 40%, rgba(125, 167, 121, 0.17) 40% 53%, transparent 53%),
    linear-gradient(152deg, transparent 0 50%, rgba(82, 122, 57, 0.2) 50% 67%, transparent 67%);
}

[data-theme="dark"] .weekly-bar-track {
  border: 1px solid #5e676e;
  background: #454c52;
}

[data-theme="dark"] .weekday-row,
[data-theme="dark"] .legend-list li,
[data-theme="dark"] .calendar-grid,
[data-theme="dark"] .day-cell {
  border-color: #59636a;
}

[data-theme="dark"] .calendar-grid {
  background: rgba(31, 37, 41, 0.35);
}

[data-theme="dark"] .day-cell.is-muted {
  color: #929ba1;
}

/* Dialogs and fields follow the charcoal reference while preserving colored icons. */
[data-theme="dark"] .settings-card,
[data-theme="dark"] .reminder-settings-card,
[data-theme="dark"] .entry-modal {
  --card: #343a40;
  --card-soft: #3c4349;
  --line: #687179;
  --line-strong: #899299;
  --text: #f3f5f6;
  --muted: #c1c8cd;
  --faint: #a2abb0;
  color-scheme: dark;
  color: #f3f5f6;
}

[data-theme="dark"] .settings-card {
  background: #2e3439;
  border-color: #687178;
}

[data-theme="dark"] .settings-card .settings-head {
  background:
    radial-gradient(ellipse at 88% 10%, rgba(111, 149, 93, 0.16), transparent 28%),
    linear-gradient(168deg, transparent 0 60%, rgba(130, 153, 108, 0.16) 60% 76%, transparent 76%),
    linear-gradient(135deg, #30373b 0%, #30363a 56%, #2b3335 100%);
}

[data-theme="dark"] .settings-card .settings-head h2,
[data-theme="dark"] .settings-card .settings-head p,
[data-theme="dark"] .settings-card .form-grid label > span,
[data-theme="dark"] .settings-card .toggle-line span,
[data-theme="dark"] .settings-card .reminder-open-btn,
[data-theme="dark"] .settings-card .reminder-open-btn strong,
[data-theme="dark"] .settings-card .reminder-open-btn small,
[data-theme="dark"] .settings-card input,
[data-theme="dark"] .settings-card select,
[data-theme="dark"] .settings-card.is-readonly .settings-input-wrap input:read-only,
[data-theme="dark"] .settings-card.is-readonly .settings-input-wrap select:disabled {
  color: #f3f5f6;
  -webkit-text-fill-color: #f3f5f6;
  opacity: 1;
}

[data-theme="dark"] .settings-card .settings-input-wrap {
  border-color: #727b82;
  background: #3b4248;
  box-shadow: none;
}

[data-theme="dark"] .settings-card .settings-input-wrap:focus-within {
  border-color: #e1e6e8;
  background: #41484e;
  box-shadow: 0 0 0 1px rgba(225, 230, 232, 0.18);
}

[data-theme="dark"] .settings-reminder-toggle b,
[data-theme="dark"] .reminder-enable-row b {
  background: #555d63;
}

[data-theme="dark"] .settings-card .settings-input-wrap > i,
[data-theme="dark"] .reminder-settings-card .settings-input-wrap > i {
  background-color: #e0e5e8;
}

[data-theme="dark"] .settings-card .settings-input-wrap.has-caret::after,
[data-theme="dark"] .reminder-settings-card .settings-input-wrap.has-caret::after {
  border-color: #e0e5e8;
}

[data-theme="dark"] .settings-card .reminder-open-btn:hover,
[data-theme="dark"] .settings-card .reminder-open-btn:focus-visible,
[data-theme="dark"] .settings-card .reminder-open-btn:hover strong,
[data-theme="dark"] .settings-card .reminder-open-btn:focus-visible strong,
[data-theme="dark"] .settings-card .reminder-open-btn:hover small,
[data-theme="dark"] .settings-card .reminder-open-btn:focus-visible small {
  color: #c2c9ce;
}

[data-theme="dark"] .reminder-settings-card {
  background: #2e3439;
  border-color: #687178;
}

[data-theme="dark"] .reminder-settings-head {
  background:
    radial-gradient(ellipse at 88% 10%, rgba(111, 149, 93, 0.18), transparent 28%),
    linear-gradient(168deg, transparent 0 60%, rgba(130, 153, 108, 0.16) 60% 76%, transparent 76%),
    linear-gradient(135deg, #30373b 0%, #30363a 56%, #2b3335 100%);
  border-bottom-color: #566067;
}

[data-theme="dark"] .reminder-settings-card .reminder-settings-head h2,
[data-theme="dark"] .reminder-settings-card .reminder-settings-head p,
[data-theme="dark"] .reminder-settings-card .reminder-enable-row,
[data-theme="dark"] .reminder-settings-card .reminder-field-group > label,
[data-theme="dark"] .reminder-settings-card .reminder-code-group > label,
[data-theme="dark"] .reminder-settings-card .reminder-days-fieldset legend,
[data-theme="dark"] .reminder-settings-card .reminder-skip-row,
[data-theme="dark"] .reminder-settings-card .reminder-helper,
[data-theme="dark"] .reminder-settings-card .reminder-rest-note {
  color: #f0f3f4;
}

[data-theme="dark"] .reminder-settings-card .reminder-settings-head p,
[data-theme="dark"] .reminder-settings-card .reminder-helper,
[data-theme="dark"] .reminder-settings-card .reminder-rest-note {
  color: #bdc5ca;
}

[data-theme="dark"] .reminder-settings-card .reminder-helper.is-verified,
[data-theme="dark"] .notification-popover-time strong {
  color: #9cdb77;
}

[data-theme="dark"] .reminder-settings-card .round-close {
  color: #eef1f3;
}

[data-theme="dark"] .reminder-settings-card .reminder-email-row input,
[data-theme="dark"] .reminder-settings-card .reminder-code-group input,
[data-theme="dark"] .reminder-settings-card .settings-time,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap {
  border-color: #737c83;
  background: #3b4248;
  color: #f2f4f5;
}

[data-theme="dark"] .reminder-settings-card .reminder-email-row input,
[data-theme="dark"] .reminder-settings-card .reminder-code-group input,
[data-theme="dark"] .reminder-settings-card .settings-time input,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap select {
  color: #f2f4f5;
  -webkit-text-fill-color: #f2f4f5;
  color-scheme: dark;
}

[data-theme="dark"] .reminder-settings-card .reminder-email-row input::placeholder,
[data-theme="dark"] .reminder-settings-card .reminder-code-group input::placeholder {
  color: #c0c7cc;
  opacity: 1;
}

[data-theme="dark"] .reminder-settings-card .settings-time i,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap i {
  background-color: #e0e5e8;
}

[data-theme="dark"] .reminder-settings-card .settings-time.has-caret::after,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap.has-caret::after {
  border-color: #e0e5e8;
}

[data-theme="dark"] .reminder-settings-card .reminder-email-row input:hover,
[data-theme="dark"] .reminder-settings-card .reminder-email-row input:focus,
[data-theme="dark"] .reminder-settings-card .reminder-email-row input:focus-visible,
[data-theme="dark"] .reminder-settings-card .settings-time:hover,
[data-theme="dark"] .reminder-settings-card .settings-time:focus-within,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap:hover,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap:focus-within {
  border-color: #e0e5e8;
  background: #41484e;
  color: #f2f4f5;
}

[data-theme="dark"] .reminder-settings-card .settings-time:hover::after,
[data-theme="dark"] .reminder-settings-card .settings-time:focus-within::after,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap:hover::after,
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap:focus-within::after {
  border-color: #e0e5e8;
}

[data-theme="dark"] .entry-modal {
  background: #2e3439;
  border-color: #687178;
  color: #f3f5f6;
}

[data-theme="dark"] .entry-modal .modal-head h2,
[data-theme="dark"] .entry-modal .modal-head p,
[data-theme="dark"] .entry-modal .icon-field span,
[data-theme="dark"] .entry-modal .option-block h3,
[data-theme="dark"] .entry-modal .note-field > span,
[data-theme="dark"] .entry-modal .hours-preview span,
[data-theme="dark"] .entry-modal .hours-preview strong,
[data-theme="dark"] .entry-modal .hours-input-card label,
[data-theme="dark"] .entry-modal .pay-preview span,
[data-theme="dark"] .entry-modal .pay-preview strong,
[data-theme="dark"] .entry-modal .pay-preview output,
[data-theme="dark"] .entry-modal .note-field > small {
  color: #f0f3f4;
}

[data-theme="dark"] .entry-modal .modal-head p,
[data-theme="dark"] .entry-modal .note-field > small {
  color: #bdc5ca;
}

[data-theme="dark"] .entry-modal .pay-preview output {
  color: #a6e77d;
}

[data-theme="dark"] .entry-modal .round-close {
  color: #eef1f3;
}

[data-theme="dark"] .entry-modal .icon-field i {
  color: #e0e5e8;
}

[data-theme="dark"] .entry-modal input:focus,
[data-theme="dark"] .entry-modal textarea:focus {
  border-color: #e0e5e8;
  background: #41484e;
  box-shadow: 0 0 0 1px rgba(225, 230, 232, 0.16);
}

[data-theme="dark"] .entry-modal input,
[data-theme="dark"] .entry-modal textarea,
[data-theme="dark"] .entry-modal .hours-preview article,
[data-theme="dark"] .entry-modal .pay-preview,
[data-theme="dark"] .entry-modal .segmented button,
[data-theme="dark"] .entry-modal .quick-actions button {
  border-color: #727b82;
  background: #3b4248;
  color: #f0f3f4;
  box-shadow: none;
}

[data-theme="dark"] .entry-modal .segmented button.is-active,
[data-theme="dark"] .entry-modal .quick-actions button.is-active {
  border-color: #83c95e;
  background: rgba(90, 143, 56, 0.3);
  color: #a7e77e;
}

[data-theme="dark"] .entry-modal #modifierGroup [data-modifier="none"]:hover,
[data-theme="dark"] .entry-modal #modifierGroup [data-modifier="none"]:focus-visible,
[data-theme="dark"] .entry-modal #modifierGroup [data-modifier="none"].is-active,
[data-theme="dark"] .entry-modal #restDayBtn:hover,
[data-theme="dark"] .entry-modal #restDayBtn:focus-visible,
[data-theme="dark"] .entry-modal #restDayBtn.is-active {
  border-color: #38bf70;
  color: #7ae3a2;
  background: rgba(47, 173, 91, 0.18);
}

[data-theme="dark"] .entry-modal #modifierGroup [data-modifier="holiday"],
[data-theme="dark"] .entry-modal #modifierGroup [data-modifier="holiday"].is-active {
  border-color: #e7ba45;
  color: #ffd868;
  background: rgba(245, 184, 35, 0.12);
}

[data-theme="dark"] .entry-modal #modifierGroup [data-modifier="double"],
[data-theme="dark"] .entry-modal #modifierGroup [data-modifier="double"].is-active {
  border-color: #e66b74;
  color: #ff8990;
  background: rgba(255, 88, 100, 0.12);
}

[data-theme="dark"] .entry-modal #excusedBtn,
[data-theme="dark"] .entry-modal #excusedBtn.is-active {
  border-color: #89939a;
  color: #c4ccd1;
  background: rgba(141, 153, 170, 0.12);
}

[data-theme="dark"] .entry-modal #clearDayBtn {
  border-color: #e66b74;
  color: #ff8990;
  background: rgba(255, 88, 100, 0.12);
}

[data-theme="dark"] .entry-modal input::placeholder,
[data-theme="dark"] .entry-modal textarea::placeholder,
[data-theme="dark"] .entry-modal .hours-input-card input::placeholder {
  color: #bac2c7;
}

[data-theme="dark"] .entry-modal .hours-input-card input {
  border: 0;
  background: transparent;
  color: #f3f5f6;
  -webkit-text-fill-color: #f3f5f6;
  box-shadow: none;
}

[data-theme="dark"] .entry-modal .modal-actions > .ghost-btn {
  border-color: #e0e5e8;
  background: transparent;
  color: #f3f5f6;
}

[data-theme="dark"] .entry-modal .modal-actions > .save-btn {
  border-color: var(--green-deep);
  background: var(--green-deep);
  color: #fff;
}

[data-theme="dark"] .time-picker-card {
  background: #3a4147;
  border-color: #778087;
  color: #f3f5f6;
  color-scheme: dark;
}

[data-theme="dark"] .time-picker-overlay {
  background: rgba(15, 19, 22, 0.52);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

[data-theme="dark"] .time-picker-head strong,
[data-theme="dark"] .time-picker-head span,
[data-theme="dark"] .time-picker-unit > span,
[data-theme="dark"] .time-picker-preview,
[data-theme="dark"] .time-select-trigger,
[data-theme="dark"] .time-select-trigger output,
[data-theme="dark"] .time-select-menu button {
  color: #f3f5f6;
}

[data-theme="dark"] .time-picker-preview,
[data-theme="dark"] .time-select-trigger,
[data-theme="dark"] .time-select-menu,
[data-theme="dark"] .time-period-group button,
[data-theme="dark"] .time-picker-actions button {
  border-color: #788188;
  background: #30373d;
}

[data-theme="dark"] .time-select-menu button:hover,
[data-theme="dark"] .time-select-menu button:focus-visible {
  background: #4a5258;
  color: #fff;
}

[data-theme="dark"] .time-select-trigger:hover,
[data-theme="dark"] .time-select-trigger:focus-visible {
  border-color: #e0e5e8;
  background: #41484e;
  color: #f3f5f6;
}

[data-theme="dark"] #closeTimePickerBtn {
  color: #f3f5f6;
}

[data-theme="dark"] .time-select-trigger b {
  border-color: #e0e5e8;
}

[data-theme="dark"] .time-period-group button.is-active {
  border-color: var(--green-deep);
  background: var(--green-deep);
  color: #fff;
}

[data-theme="dark"] .time-picker-clear {
  border-color: #e0e5e8 !important;
  background: transparent !important;
  color: #f3f5f6 !important;
}

[data-theme="dark"] #closeTimePickerBtn:hover,
[data-theme="dark"] #closeTimePickerBtn:focus-visible {
  background: #4a5258;
  color: #fff;
}

/* A black hover in light mode becomes a white, dark-text hover in dark mode. */
[data-theme="dark"] .profile-save-btn:hover,
[data-theme="dark"] .profile-save-btn:active,
[data-theme="dark"] .settings-card .settings-save-btn:hover,
[data-theme="dark"] .settings-card .settings-save-btn:active,
[data-theme="dark"] .entry-modal .ghost-btn:hover,
[data-theme="dark"] .entry-modal .save-btn:hover,
[data-theme="dark"] .entry-modal .segmented button:hover,
[data-theme="dark"] .entry-modal .segmented button:focus-visible,
[data-theme="dark"] .reminder-settings-card .reminder-verify-btn:hover,
[data-theme="dark"] .reminder-settings-card .reminder-modal-actions .reminder-cancel-btn:hover,
[data-theme="dark"] .reminder-settings-card .reminder-modal-actions .reminder-save-btn:not(:disabled):hover,
[data-theme="dark"] .notification-popover .notification-popover-action:not(:disabled):hover,
[data-theme="dark"] .dashboard-actions .export-btn:hover,
[data-theme="dark"] .time-period-group button:hover,
[data-theme="dark"] .time-period-group button:focus-visible,
[data-theme="dark"] .time-picker-clear:hover,
[data-theme="dark"] .time-picker-clear:focus-visible,
[data-theme="dark"] .time-picker-apply:hover,
[data-theme="dark"] .time-picker-apply:focus-visible {
  background: #fff !important;
  color: #15191c !important;
  -webkit-text-fill-color: #15191c;
  box-shadow: none !important;
}

[data-theme="dark"] .reminder-settings-card .reminder-save-btn:disabled:hover {
  border-color: #697177 !important;
  background: #697177 !important;
  color: #d6dadd !important;
  box-shadow: none;
}

/* Dark-mode focus uses a clear border without a glow or a bright fill. */
[data-theme="dark"] .settings-card .settings-input-wrap:focus-within {
  border-color: #d3dade;
  background: #3b4248;
  box-shadow: none;
}

[data-theme="dark"] .reminder-settings-card .reminder-email-row input:hover,
[data-theme="dark"] .reminder-settings-card .reminder-email-row input:focus,
[data-theme="dark"] .reminder-settings-card .reminder-email-row input:focus-visible,
[data-theme="dark"] .reminder-settings-card .settings-time:hover,
[data-theme="dark"] .reminder-settings-card .settings-time:focus-within {
  border-color: #d3dade;
  background: #3b4248;
  color: #f2f4f5;
  -webkit-text-fill-color: #f2f4f5;
  box-shadow: none;
}

[data-theme="dark"] .reminder-settings-card .settings-time:hover input,
[data-theme="dark"] .reminder-settings-card .settings-time:focus-within input {
  color: #f2f4f5;
  -webkit-text-fill-color: #f2f4f5;
}

/* Keep the opened repeat selector light and readable; the closed control stays slate. */
[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap:focus-within {
  border-color: #687783;
  background: #fbfcf9;
  color: #17251d;
  box-shadow: none;
}

[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap:focus-within select {
  color: #17251d;
  -webkit-text-fill-color: #17251d;
  color-scheme: light;
  outline: 0;
}

[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap:focus-within i {
  background-color: #687783;
}

[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap:focus-within::after {
  border-color: #687783;
}

[data-theme="dark"] .reminder-settings-card .reminder-repeat-select-wrap select option {
  background: #fbfcf9;
  color: #17251d;
}

[data-theme="dark"] .entry-modal input:focus,
[data-theme="dark"] .entry-modal textarea:focus {
  border-color: #d3dade;
  background: #3b4248;
  box-shadow: none;
  outline: 0;
}

/* Keep the Settings close mark visible on the dark header. */
[data-theme="dark"] .settings-card .round-close,
[data-theme="dark"] .settings-card .round-close:hover,
[data-theme="dark"] .settings-card .round-close:focus-visible {
  color: #f3f5f6;
}

/* Dark-mode hover keeps the green outline and uses white with dark text. */
[data-theme="dark"] .reminder-settings-card .reminder-modal-actions .reminder-cancel-btn {
  border-color: #78b857;
  background: transparent;
  color: #f3f5f6;
  -webkit-text-fill-color: #f3f5f6;
}

[data-theme="dark"] .reminder-settings-card .reminder-modal-actions .reminder-cancel-btn:hover,
[data-theme="dark"] .reminder-settings-card .reminder-modal-actions .reminder-cancel-btn:focus-visible {
  border-color: #78b857;
  background: #fff !important;
  color: #15191c !important;
  -webkit-text-fill-color: #15191c !important;
  box-shadow: none !important;
}

/* Keep the entry dialog dark even though its compact layout rule uses an ID selector. */
[data-theme="dark"] #entryOverlay .entry-modal {
  background: #2e3439;
  border-color: #687178;
  color: #f3f5f6;
}

/* Three-step Daily Reminder flow: share the Settings card footprint and leaf header. */
.reminder-step {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 340px;
  align-content: start;
  gap: 10px;
  animation: reminder-step-in 180ms ease-out both;
}
.reminder-step[hidden] { display: none; }
.reminder-step-title { margin: 0; font: 600 21px/1.1 var(--display-font); }
.reminder-step-copy { margin: -4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.reminder-step-copy strong { display: block; margin-top: 5px; color: var(--text); font-weight: 600; }
.reminder-email-step input[type="email"] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 11px;
}
.reminder-email-step input[type="email"]:focus-visible { outline: 2px solid #527a3940; outline-offset: 1px; border-color: var(--green-deep); }
.reminder-primary-action {
  width: 100%;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--green-deep);
  border-radius: 9px;
  background: var(--green-deep);
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}
.reminder-primary-action:hover,
.reminder-primary-action:focus-visible {
  border-color: #111;
  background: #111;
  color: #fff;
}
.reminder-step .reminder-modal-actions { width: 100%; margin-top: auto; }
.reminder-step .reminder-modal-actions > button { width: auto; min-width: 0; flex: 1 1 0; max-width: none; }
.reminder-settings-card .reminder-modal-actions .reminder-save-btn { min-height: 32px; }
.reminder-step .reminder-cancel-btn,
.reminder-step .reminder-save-btn {
  min-height: 32px;
  font-size: 10px;
}
.reminder-otp-inputs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.reminder-otp-inputs input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: 600 18px/1 var(--font);
  text-align: center;
}
.reminder-otp-inputs input:focus-visible { border-color: var(--green-deep); outline: 2px solid #527a3940; outline-offset: 1px; }
.visually-hidden-input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); border: 0; }
.reminder-countdown { text-align: center; }
.reminder-error { min-height: 13px; color: #c93333; text-align: center; }
.reminder-text-action {
  justify-self: end;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--green-deep);
  font: inherit;
  font-size: 10px;
  text-decoration: underline;
  cursor: pointer;
}
.reminder-verified-email-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.reminder-verified-email-row input,
.reminder-main-step input[type="date"],
.reminder-main-step textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 10px;
}
.reminder-verified-email-row input { height: 30px; }
.reminder-verified-badge { color: var(--green-deep); font-size: 9px; font-weight: 700; white-space: nowrap; }
.reminder-verified-email-row .reminder-text-action { font-size: 9px; }
.reminder-main-step { min-height: 0; gap: 5px; }
.reminder-main-step .reminder-field-group { gap: 2px; }
.reminder-main-step .reminder-field-group > label,
.reminder-main-step .reminder-days-fieldset legend { font-size: 9px; }
.reminder-main-step textarea { min-height: 40px; height: 40px; resize: vertical; line-height: 1.3; }
.reminder-date-time-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; min-width: 0; }
.reminder-main-step input[type="date"] { height: 30px; padding: 4px 6px; }
.reminder-main-step .settings-time,
.reminder-main-step .settings-time input { height: 30px; min-height: 30px; }
.reminder-main-step .settings-time input { font-size: 10px; }
.reminder-main-step > .reminder-helper { margin-top: -3px; font-size: 9px; }
.reminder-main-step .reminder-schedule-options { display: grid; gap: 3px; }
.reminder-main-step .reminder-days-fieldset { gap: 3px; }
.reminder-main-step .reminder-days-fieldset > .reminder-helper { display: none; }
.reminder-main-step .reminder-skip-row { min-height: 20px; font-size: 9px; }
.reminder-main-step .reminder-rest-note { display: none; }
.reminder-main-step .reminder-modal-actions { margin-top: 2px; padding-top: 6px; }
.reminder-main-step .reminder-modal-actions > button { flex: 0 1 108px; }
.reminder-main-step .reminder-repeat-select-wrap { height: 30px; min-height: 30px; }
.reminder-main-step .reminder-repeat-select-wrap select { height: 28px; min-height: 28px; font-size: 10px; }
.reminder-main-step .reminder-day-options button { height: 24px; min-height: 24px; font-size: 8px; }
.reminder-settings-card .reminder-step .reminder-cancel-btn:hover,
.reminder-settings-card .reminder-step .reminder-cancel-btn:focus-visible {
  border-color: #111;
  background: #fff;
  color: #111;
  -webkit-text-fill-color: #111;
}
[data-theme="dark"] .reminder-otp-inputs input,
[data-theme="dark"] .reminder-email-step input[type="email"],
[data-theme="dark"] .reminder-verified-email-row input,
[data-theme="dark"] .reminder-main-step input[type="date"],
[data-theme="dark"] .reminder-main-step textarea {
  border-color: #737c83;
  background: #3b4248;
  color: #f2f4f5;
  color-scheme: dark;
}
[data-theme="dark"] .reminder-step-copy strong { color: #f2f4f5; }
[data-theme="dark"] .reminder-step .reminder-cancel-btn:hover,
[data-theme="dark"] .reminder-step .reminder-cancel-btn:focus-visible {
  border-color: #78b857;
  background: #fff;
  color: #15191c;
  -webkit-text-fill-color: #15191c;
}
@keyframes reminder-step-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 420px) {
  .reminder-settings-card { width: min(92vw, 270px); }
  .reminder-step { gap: 8px; }
  .reminder-main-step { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .reminder-step { animation: none; }
}

[data-theme="dark"] #entryOverlay .entry-modal .modal-head h2,
[data-theme="dark"] #entryOverlay .entry-modal .modal-head p,
[data-theme="dark"] #entryOverlay .entry-modal .icon-field span,
[data-theme="dark"] #entryOverlay .entry-modal .option-block h3,
[data-theme="dark"] #entryOverlay .entry-modal .note-field > span,
[data-theme="dark"] #entryOverlay .entry-modal .hours-preview span,
[data-theme="dark"] #entryOverlay .entry-modal .hours-preview strong,
[data-theme="dark"] #entryOverlay .entry-modal .hours-input-card label,
[data-theme="dark"] #entryOverlay .entry-modal .pay-preview span,
[data-theme="dark"] #entryOverlay .entry-modal .note-field > small {
  color: #f0f3f4;
}

[data-theme="dark"] #entryOverlay .entry-modal .modal-head p,
[data-theme="dark"] #entryOverlay .entry-modal .note-field > small {
  color: #bdc5ca;
}

[data-theme="dark"] #entryOverlay .entry-modal input,
[data-theme="dark"] #entryOverlay .entry-modal textarea {
  border-color: #727b82;
  background: #3b4248;
  color: #f0f3f4;
  -webkit-text-fill-color: #f0f3f4;
  box-shadow: none;
}

[data-theme="dark"] #entryOverlay .entry-modal .hours-preview article,
[data-theme="dark"] #entryOverlay .entry-modal .pay-preview {
  border-color: #727b82;
  background: #3b4248;
  color: #f0f3f4;
  box-shadow: none;
}

[data-theme="dark"] #entryOverlay .entry-modal .pay-preview output {
  color: #a6e77d;
  -webkit-text-fill-color: #a6e77d;
}

[data-theme="dark"] #entryOverlay .entry-modal .hours-input-card input {
  border: 0;
  background: transparent;
  color: #f3f5f6;
  -webkit-text-fill-color: #f3f5f6;
}

/* Colored choices keep their semantic outline; the label stays readable on slate. */
[data-theme="dark"] #entryOverlay .entry-modal #rateTypeGroup button,
[data-theme="dark"] #entryOverlay .entry-modal #modifierGroup button,
[data-theme="dark"] #entryOverlay .entry-modal .quick-actions button {
  background: #3b4248;
  color: #f0f3f4;
  -webkit-text-fill-color: #f0f3f4;
}

[data-theme="dark"] #entryOverlay .entry-modal #modifierGroup [data-modifier="none"],
[data-theme="dark"] #entryOverlay .entry-modal #restDayBtn {
  border-color: #38bf70;
}

[data-theme="dark"] #entryOverlay .entry-modal #modifierGroup [data-modifier="holiday"] {
  border-color: #e7ba45;
}

[data-theme="dark"] #entryOverlay .entry-modal #modifierGroup [data-modifier="double"],
[data-theme="dark"] #entryOverlay .entry-modal #clearDayBtn {
  border-color: #e66b74;
}

[data-theme="dark"] #entryOverlay .entry-modal #excusedBtn {
  border-color: #89939a;
}

[data-theme="dark"] #entryOverlay .entry-modal #modifierGroup [data-modifier="none"]:hover,
[data-theme="dark"] #entryOverlay .entry-modal #modifierGroup [data-modifier="none"]:focus-visible,
[data-theme="dark"] #entryOverlay .entry-modal #modifierGroup [data-modifier="holiday"]:hover,
[data-theme="dark"] #entryOverlay .entry-modal #modifierGroup [data-modifier="holiday"]:focus-visible,
[data-theme="dark"] #entryOverlay .entry-modal #modifierGroup [data-modifier="double"]:hover,
[data-theme="dark"] #entryOverlay .entry-modal #modifierGroup [data-modifier="double"]:focus-visible,
[data-theme="dark"] #entryOverlay .entry-modal #restDayBtn:hover,
[data-theme="dark"] #entryOverlay .entry-modal #restDayBtn:focus-visible,
[data-theme="dark"] #entryOverlay .entry-modal #excusedBtn:hover,
[data-theme="dark"] #entryOverlay .entry-modal #excusedBtn:focus-visible,
[data-theme="dark"] #entryOverlay .entry-modal #clearDayBtn:hover,
[data-theme="dark"] #entryOverlay .entry-modal #clearDayBtn:focus-visible {
  background: #fff !important;
  color: #15191c !important;
  -webkit-text-fill-color: #15191c !important;
}

[data-theme="dark"] .time-period-group button {
  color: #f3f5f6;
  -webkit-text-fill-color: #f3f5f6;
}

/* White hover states need dark labels; preserve each control's existing fill and border. */
[data-theme="dark"] #entryOverlay .entry-modal #rateTypeGroup button:hover,
[data-theme="dark"] #entryOverlay .entry-modal #rateTypeGroup button:focus-visible,
[data-theme="dark"] #entryOverlay .entry-modal #modifierGroup button:hover,
[data-theme="dark"] #entryOverlay .entry-modal #modifierGroup button:focus-visible,
[data-theme="dark"] #entryOverlay .entry-modal #restDayBtn:hover,
[data-theme="dark"] #entryOverlay .entry-modal #restDayBtn:focus-visible,
[data-theme="dark"] #entryOverlay .entry-modal #excusedBtn:hover,
[data-theme="dark"] #entryOverlay .entry-modal #excusedBtn:focus-visible,
[data-theme="dark"] #entryOverlay .entry-modal #clearDayBtn:hover,
[data-theme="dark"] #entryOverlay .entry-modal #clearDayBtn:focus-visible {
  color: #15191c !important;
  -webkit-text-fill-color: #15191c !important;
}

/* Keep the entry footer actions together and aligned to the modal's right edge. */
.entry-modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.entry-modal .modal-actions > .ghost-btn,
.entry-modal .modal-actions > .save-btn {
  margin: 0;
}

/* Smooth dashboard motion; the reduced-motion rule above remains in control. */
.calendar-grid.is-month-entering-next {
  animation: calendar-enter-from-right 300ms cubic-bezier(0.2, 0.7, 0.25, 1) both;
}

.calendar-grid.is-month-entering-previous {
  animation: calendar-enter-from-left 300ms cubic-bezier(0.2, 0.7, 0.25, 1) both;
}

/* Saved date entries open as a review first, with destructive and edit actions grouped on the right. */
.entry-modal [hidden] { display: none !important; }
.entry-modal .modal-actions { justify-content: space-between; align-items: center; }
.entry-actions-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.entry-modal .modal-actions > .ghost-btn,
.entry-modal .entry-actions-right > .danger-btn,
.entry-modal .entry-actions-right > .save-btn {
  box-sizing: border-box;
  flex: 0 1 108px;
  width: 108px;
  min-width: 0;
  max-width: 108px;
  height: 31px;
  min-height: 31px;
  margin: 0;
  padding: 0 7px;
  font-size: 10px;
  white-space: nowrap;
}
.entry-modal .entry-actions-right > .danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #dc2626;
  background: transparent;
  color: #dc2626;
  font-weight: 800;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}
.entry-modal .entry-actions-right > .danger-btn:hover,
.entry-modal .entry-actions-right > .danger-btn:focus-visible {
  border-color: #111318;
  background: #111318;
  color: #fff;
}
.delete-icon,
.edit-icon {
  display: inline-block;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  background: currentColor;
  mask: center / contain no-repeat;
  -webkit-mask: center / contain no-repeat;
}
.delete-icon {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2m3 0-.9 14H5.9L5 6m4 4v6m6-6v6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18M8 6V4h8v2m3 0-.9 14H5.9L5 6m4 4v6m6-6v6'/%3E%3C/svg%3E");
}
.edit-icon {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 4 4 4M4 20l4-.8L19.5 7.7a2.1 2.1 0 0 0-3-3L5 16.2 4 20Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 4 4 4M4 20l4-.8L19.5 7.7a2.1 2.1 0 0 0-3-3L5 16.2 4 20Z'/%3E%3C/svg%3E");
}
.entry-modal .entry-view-mode .segmented button:disabled,
.entry-modal .entry-view-mode .quick-actions button:disabled {
  opacity: 1;
  filter: none;
  cursor: default;
}
[data-theme="dark"] .entry-modal .entry-actions-right > .danger-btn {
  border-color: #fb7185;
  background: transparent;
  color: #fff;
}
[data-theme="dark"] .entry-modal .entry-actions-right > .danger-btn:hover,
[data-theme="dark"] .entry-modal .entry-actions-right > .danger-btn:focus-visible {
  border-color: #fff;
  background: #fff;
  color: #111318;
}
@media (max-width: 480px) {
  .entry-modal .modal-actions { gap: 5px; }
  .entry-actions-right { flex: 1 1 auto; min-width: 0; gap: 4px; }
  .entry-modal .modal-actions > .ghost-btn { flex: 1 1 0; width: auto; max-width: none; }
  .entry-modal .entry-actions-right > .danger-btn,
  .entry-modal .entry-actions-right > .save-btn { flex: 1 1 0; width: auto; max-width: none; }
}

.entry-modal.entry-saved-mode .modal-actions {
  justify-content: flex-end;
}

.entry-modal.entry-saved-mode .entry-actions-right > .danger-btn,
.entry-modal.entry-saved-mode .entry-actions-right > .save-btn {
  flex: 0 0 108px;
  width: 108px;
  min-width: 108px;
  max-width: 108px;
  height: 31px;
  min-height: 31px;
}

@keyframes calendar-enter-from-right {
  from { opacity: 0.65; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes calendar-enter-from-left {
  from { opacity: 0.65; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.weekly-bar-fill {
  transform-origin: center bottom;
  animation: weekly-bar-rise 520ms cubic-bezier(0.2, 0.7, 0.25, 1) both;
  animation-delay: var(--bar-delay, 0ms);
}

@keyframes weekly-bar-rise {
  from { opacity: 0.55; transform: scaleY(0.08); }
  to { opacity: 1; transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  .weekly-bar-fill { animation-delay: 0ms !important; }
}

/* Daily Records popup */
.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;
}

.daily-records-trigger {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--green-deep);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 150ms ease, text-decoration-color 150ms ease;
}

.daily-records-trigger svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.daily-records-trigger:hover {
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}

[data-theme="dark"] .daily-records-trigger {
  color: #b9d89f;
}

[data-theme="dark"] .daily-records-trigger:hover {
  background: transparent;
}

.daily-records-overlay {
  z-index: 95;
  padding: clamp(10px, 3vw, 28px);
  background: rgba(232, 239, 233, 0.56);
  backdrop-filter: blur(14px) saturate(0.9);
  animation: daily-records-backdrop-in 160ms ease-out both;
}

[data-theme="dark"] .daily-records-overlay {
  background: rgba(18, 23, 22, 0.58);
}

.daily-records-card {
  box-sizing: border-box;
  width: min(92vw, 400px);
  height: min(460px, calc(100dvh - 24px));
  min-height: min(460px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  padding: 0 22px 14px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
  animation: daily-records-drop 240ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.daily-records-head {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 -22px;
  padding: 16px 22px 10px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 88% 10%, rgba(111, 149, 93, 0.13), transparent 28%),
    linear-gradient(168deg, transparent 0 60%, rgba(214, 224, 193, 0.62) 60% 76%, transparent 76%),
    linear-gradient(135deg, #fffdf6 0%, #faf8ed 56%, #eef3e3 100%);
}

.daily-records-head > div { position: relative; z-index: 1; min-width: 0; }
.daily-records-head .daily-records-close { position: relative; z-index: 2; }
.daily-records-head .daily-records-leaf { z-index: 0; }

.daily-records-head h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--display-font);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.05;
}

.daily-records-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14.5px;
}

.daily-records-close {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 27px;
  line-height: 1;
  transition: color 160ms ease, transform 160ms ease;
}

.daily-records-close:hover {
  background: transparent;
  color: #59733f;
  transform: scale(1.08);
}

[data-theme="dark"] .daily-records-close,
[data-theme="dark"] .daily-records-close:hover,
[data-theme="dark"] .daily-records-close:focus-visible {
  color: #f3f5f6;
}

.daily-records-controls {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}

.daily-records-month-wrap {
  min-width: 0;
  flex: 0 1 185px;
}

.daily-records-month-wrap select {
  width: 100%;
  min-height: 38px;
  padding: 4px 28px 4px 0;
  border: 0;
  border-radius: 0;
  appearance: auto;
  background: transparent;
  color: var(--text);
  font-family: var(--display-font);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

[data-theme="dark"] .daily-records-month-wrap select {
  color-scheme: dark;
}

.daily-records-periods {
  min-height: 38px;
  flex: 1 1 auto;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: clamp(6px, 1vw, 12px);
  border-left: 1px solid var(--line-strong);
  padding-left: 14px;
}

.daily-records-periods button {
  position: relative;
  min-width: 56px;
  padding: 5px 4px 9px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  transition: color 140ms ease;
}

.daily-records-periods button::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: transparent;
  content: "";
}

.daily-records-periods button:hover,
.daily-records-periods button.is-active {
  color: var(--green-deep);
}

.daily-records-periods button.is-active::after {
  background: var(--green-deep);
}

[data-theme="dark"] .daily-records-periods button.is-active,
[data-theme="dark"] .daily-records-periods button:hover {
  color: #b9d89f;
}

[data-theme="dark"] .daily-records-periods button.is-active::after {
  background: #9abd76;
}

.daily-records-list {
  min-height: 60px;
  max-height: none;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: auto;
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 6px 2px;
}

.daily-record-row {
  width: 100%;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background-color 150ms ease;
}

.daily-record-row:hover,
.daily-record-row:focus-visible,
.daily-record-row:active {
  background: #f0f2f0;
}

[data-theme="dark"] .daily-record-row:hover,
[data-theme="dark"] .daily-record-row:focus-visible,
[data-theme="dark"] .daily-record-row:active {
  background: #343b38;
}

.daily-record-row-copy,
.daily-record-row-metrics {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.daily-record-row-copy > strong {
  overflow: hidden;
  color: var(--text);
  font-family: var(--display-font);
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.daily-record-row-time,
.daily-record-row-note {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-record-row-metrics {
  justify-items: end;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.daily-record-row-metrics strong {
  color: var(--green-deep);
  font-family: var(--display-font);
  font-size: 18px;
}

[data-theme="dark"] .daily-record-row-metrics strong {
  color: #b9d89f;
}

.daily-record-chevron {
  color: var(--text);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
}

.daily-records-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.daily-records-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.daily-records-total {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px;
}

.daily-records-total > strong:first-child {
  color: var(--text);
  font-family: var(--display-font);
  font-size: 16px;
}

.daily-records-total > span {
  color: var(--muted);
  font-size: 13px;
}

.daily-records-total > .daily-records-total-amount {
  grid-column: 2;
  grid-row: 1 / span 2;
  padding-left: 12px;
  color: var(--green-deep);
  font-family: var(--display-font);
  font-size: 18px;
  white-space: nowrap;
}

[data-theme="dark"] .daily-records-total > .daily-records-total-amount {
  color: #b9d89f;
}

.daily-records-close-footer {
  box-sizing: border-box;
  flex: 0 0 108px;
  width: 108px;
  min-width: 108px;
  max-width: 108px;
  height: 31px;
  min-height: 31px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: #59733f;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(89, 115, 63, 0.22);
  transition: background-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.daily-records-close-footer:hover {
  background: #111318;
  color: #fff;
  box-shadow: 0 12px 24px rgba(17, 19, 24, 0.24);
}

@keyframes daily-records-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes daily-records-drop {
  from { opacity: 0; transform: translateY(-14px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 760px) {
  .daily-records-overlay { padding: 10px; }
  .daily-records-card {
    width: min(100%, 400px);
    height: min(460px, calc(100dvh - 20px));
    min-height: min(460px, calc(100dvh - 20px));
    max-height: calc(100dvh - 20px);
    padding: 0 14px 14px;
    overflow-x: hidden;
    overflow-y: hidden;
    border-radius: 18px;
  }
  .daily-records-head { margin-inline: -14px; padding: 14px 14px 10px; }
  .daily-records-head .settings-leaf { right: 26px; bottom: 5px; transform: scale(.88); transform-origin: bottom right; }
  .daily-records-close { width: 23px; height: 23px; flex-basis: 23px; font-size: 25px; }
  .daily-records-controls { flex-wrap: wrap; gap: 4px 10px; }
  .daily-records-month-wrap { flex: 1 1 100%; }
  .daily-records-month-wrap select { min-height: 36px; }
  .daily-records-periods {
    min-height: 40px;
    width: 100%;
    justify-content: space-between;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 5px 0 0;
    gap: 8px;
  }
  .daily-records-periods button { flex: 1 1 0; min-width: 0; font-size: 14px; }
  .daily-records-list { max-height: 48vh; padding: 6px 0; }
  .daily-record-row { min-height: 82px; grid-template-columns: minmax(0, 1fr) auto 14px; gap: 8px; padding: 12px 8px; }
  .daily-record-row-time, .daily-record-row-note { font-size: 13px; }
  .daily-record-row-metrics { font-size: 13px; }
  .daily-records-footer { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 10px; }
  .daily-records-close-footer { justify-self: end; }
}

@media (max-width: 420px) {
  .daily-records-trigger { gap: 5px; padding: 0; font-size: 12px; }
  .daily-records-trigger svg { width: 17px; height: 17px; }
  .daily-records-head h2 { font-size: 26px; }
  .daily-record-row { grid-template-columns: minmax(0, 1fr) auto; }
  .daily-record-chevron { display: none; }
  .daily-record-row-copy > strong { font-size: 16px; }
  .daily-record-row-metrics strong { font-size: 17px; }
  .daily-records-total > strong:first-child { font-size: 16px; }
  .daily-records-total > span { font-size: 13px; }
  .daily-records-close-footer { flex-basis: 108px; width: 108px; min-width: 108px; max-width: 108px; height: 31px; min-height: 31px; }
}

[data-theme="dark"] .daily-records-head {
  background:
    radial-gradient(ellipse at 88% 10%, rgba(111, 149, 93, 0.16), transparent 28%),
    linear-gradient(168deg, transparent 0 60%, rgba(130, 153, 108, 0.16) 60% 76%, transparent 76%),
    linear-gradient(135deg, #30373b 0%, #30363a 56%, #2b3335 100%);
}

@media (max-height: 560px) {
  .daily-records-overlay { padding-top: 8px; padding-bottom: 8px; }
  .daily-records-card { max-height: 96vh; padding-top: 12px; padding-bottom: 12px; }
  .daily-records-head { padding-bottom: 8px; }
  .daily-records-head h2 { font-size: 26px; }
  .daily-records-controls { min-height: 48px; }
  .daily-records-list { min-height: 60px; max-height: none; }
  .daily-record-row { min-height: 70px; padding-top: 8px; padding-bottom: 8px; }
  .daily-records-footer { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .daily-records-overlay,
  .daily-records-card,
  .daily-record-row,
  .daily-records-trigger,
  .daily-records-close,
  .daily-records-close-footer { animation: none !important; transition: none !important; }
}

/* Keep the dashboard identity and actions aligned to opposite edges on compact screens. */
@media (min-width: 761px) and (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    justify-items: stretch;
  }

  .topbar .brand {
    justify-self: start;
    justify-content: flex-start;
    min-width: 0;
  }

  .topbar .top-actions {
    justify-self: end;
    justify-content: flex-end;
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
  }

  .topbar .brand {
    justify-self: start;
    justify-content: flex-start;
    width: max-content;
    max-width: 100%;
  }

  .topbar .brand-copy {
    justify-content: flex-start;
    flex-wrap: nowrap;
    text-align: left;
  }

  .topbar .top-actions {
    justify-self: stretch;
    justify-content: flex-end;
    width: 100%;
    min-width: 0;
  }

  /* Settings fits its compact form without an unnecessary inner scrollbar. */
  #settingsOverlay .settings-card {
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - 24px);
    overflow: hidden;
  }

  /* Keep entry summaries and colored choices in their intended side-by-side rows. */
  #entryOverlay .entry-modal .hours-preview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  #entryOverlay .entry-modal #rateTypeGroup {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #entryOverlay .entry-modal #modifierGroup,
  #entryOverlay .entry-modal .quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  #entryOverlay .entry-modal .hours-preview article {
    min-width: 0;
    padding-inline: 3px;
  }

  #entryOverlay .entry-modal .hours-preview span,
  #entryOverlay .entry-modal .hours-input-card label {
    font-size: 7px;
    line-height: 1.15;
    text-align: center;
  }

  #entryOverlay .entry-modal #modifierGroup button,
  #entryOverlay .entry-modal .quick-actions button {
    min-width: 0;
    padding-inline: 3px;
    font-size: 10px;
    white-space: normal;
  }
}

@media (max-height: 560px) {
  #settingsOverlay .settings-card {
    max-height: calc(100dvh - 16px);
    overflow-y: auto;
  }
}

@media (max-width: 360px) {
  .topbar .brand-copy {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .topbar .brand h1 {
    font-size: 20px;
  }

  .topbar .profile-note {
    flex-basis: 100%;
    padding-left: 0;
    border-left: 0;
  }
}

/* Match the reminder email field to the compact Settings form controls. */
.reminder-settings-card {
  --verification-content-gap: 26px;
}

.reminder-settings-card.is-email-step,
.reminder-settings-card.reminder-verify-card {
  display: grid;
  height: 280px;
  min-height: 0;
  max-height: calc(100dvh - 24px);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
}

#reminderEmailStep {
  min-height: 0;
  padding-top: var(--verification-content-gap);
}

#reminderEmailStep:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

#reminderEmailStep .reminder-modal-actions {
  margin-top: 0;
  flex-shrink: 0;
}

#reminderEmailStep .reminder-field-group,
#reminderEmailStep .reminder-primary-action {
  width: min(100%, 204px);
  margin-inline: auto;
}

#reminderEmailStep .reminder-field-group { gap: 6px; }

#reminderEmailStep input[type="email"] {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  height: 26px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: 500 11.5px/1 var(--font);
  appearance: none;
  box-shadow: 0 8px 20px rgba(48, 72, 49, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

#reminderEmailStep input[type="email"]:focus-visible {
  outline: 0;
  border-color: #6b7f4c;
  box-shadow: 0 0 0 1px rgba(104, 124, 76, 0.16);
}

#reminderEmailStep .reminder-primary-action {
  margin-top: auto;
  min-height: 32px;
  height: 32px;
  flex-shrink: 0;
  font-size: 11px;
}

#reminderEmailStep .reminder-primary-action:disabled {
  cursor: wait;
}

.reminder-verify-overlay {
  z-index: 70;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(4px);
}

.reminder-verify-card {
  grid-template-rows: auto auto;
  width: min(92vw, 270px);
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 24px);
  padding: 0 14px 14px;
  gap: 0;
  overflow: hidden;
}

.reminder-verify-card .reminder-settings-head {
  min-height: 74px;
  margin: 0 -14px;
  padding: 15px 17px 12px;
}

.reminder-verify-card .reminder-settings-head h2 {
  font-size: 26px;
  line-height: 0.98;
}

.reminder-verify-card .reminder-settings-head p {
  max-width: 190px;
  margin-top: 5px;
  font-size: 10px;
}

.reminder-verify-card .round-close {
  width: 24px;
  height: 24px;
  min-width: 24px;
  flex: 0 0 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #263d35;
  font-size: 27px;
  box-shadow: none;
}

.reminder-verify-card .round-close:hover,
.reminder-verify-card .round-close:focus-visible {
  background: transparent;
  color: #59733f;
  transform: scale(1.08);
}

.reminder-verify-step {
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 9px;
  padding-top: var(--verification-content-gap);
}

.reminder-verify-card .reminder-step-copy { margin: 0; font-size: 11px; }
.reminder-verify-card .reminder-otp-inputs { gap: 5px; }
.reminder-verify-card .reminder-otp-inputs input { height: 36px; min-height: 36px; font-size: 16px; }
.reminder-code-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.reminder-code-meta .reminder-helper,
.reminder-code-meta .reminder-text-action { margin: 0; font-size: 9px; line-height: 1.4; }
.reminder-code-meta [hidden] { display: none; }
.reminder-verify-card .reminder-error:empty { display: none; }
.reminder-verify-card .reminder-modal-actions { margin-top: auto; padding-top: 8px; flex-shrink: 0; }
.reminder-verify-card .reminder-modal-actions > button {
  width: 108px;
  min-width: 0;
  min-height: 32px;
  height: 32px;
  flex: 0 1 108px;
  font-size: 10px;
}

[data-theme="dark"] #reminderEmailStep input[type="email"] {
  border-color: #727b82;
  background: #3b4248;
  color: #f2f4f5;
  -webkit-text-fill-color: #f2f4f5;
  box-shadow: none;
  color-scheme: dark;
}

[data-theme="dark"] .reminder-verify-overlay { background: rgba(0, 0, 0, 0.08); }
[data-theme="dark"] .reminder-verify-card .round-close { color: #f3f5f6; }

@media (max-width: 360px) {
  .reminder-verify-card { width: min(92vw, 270px); }
  .reminder-verify-card .reminder-otp-inputs { gap: 4px; }
}

/* Reminder delivery status stays inside the existing notification popover. */
.notification-popover-time { align-items: flex-start; }
.notification-popover-time strong { max-width: 165px; text-align: right; line-height: 1.4; }
.notification-schedule, .notification-status-help { margin: 8px 0; color: var(--muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.notification-history { max-height: 180px; overflow-y: auto; margin: 8px 0 0; padding: 0; list-style: none; }
.notification-history-row { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 10px; }
.notification-history-row strong { color: var(--green-deep); }
.notification-history-row.is-failed strong { color: #c93333; }
.notification-history-row span { overflow-wrap: anywhere; white-space: pre-wrap; }
.notification-history-row small { grid-column: 2; color: var(--muted); line-height: 1.4; }
[data-theme="dark"] .notification-history-row strong { color: #b8e398; }
[data-theme="dark"] .notification-history-row.is-failed strong { color: #ffb2b2; }

/* Passwordless profile access reuses the compact reminder fields and OTP frame. */
.profile-input-email {
  --profile-input-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E");
}
.profile-access-link {
  display: block;
  width: min(100%, 226px);
  margin-top: 10px;
  margin-inline: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-deep);
  font: 500 10px/1.5 var(--font);
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.profile-access-link:hover,
.profile-access-link:focus-visible,
.settings-account-row .reminder-text-action:hover { color: var(--text); }
.settings-account-row {
  display: grid;
  gap: 3px;
  width: min(100%, 204px);
  margin: 9px auto 0;
  font-size: 9px;
  line-height: 1.4;
}
.settings-account-row > span { overflow-wrap: anywhere; color: var(--muted); }
.settings-account-row .reminder-text-action { justify-self: start; font-size: 9px; text-align: left; }
.settings-card .settings-profile-actions { justify-content: space-between; align-items: center; gap: 8px; }
.settings-logout-btn { flex: 0 0 auto; margin-right: auto; font-size: 10px; }
.settings-logout-btn[hidden] { display: none; }

/* Keep Clear and Set Time aligned like the AM/PM buttons. */
.time-picker-actions button {
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: 1 1 0 !important;
  height: 26px !important;
  min-height: 26px !important;
}

.time-picker-overlay.no-clear .time-picker-actions {
  justify-content: flex-end;
}

.time-picker-overlay.no-clear .time-picker-actions .time-picker-apply {
  flex: 0 1 50% !important;
}

/* Give every Change email / Link email text action a clear hover and focus state. */
.reminder-text-action:hover,
.reminder-text-action:focus-visible {
  background: transparent !important;
  color: #111b14 !important;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

[data-theme="dark"] .reminder-text-action:hover,
[data-theme="dark"] .reminder-text-action:focus-visible {
  background: transparent !important;
  color: #f2f4f5 !important;
}

#settingsOverlay .settings-account-row .reminder-text-action:hover,
#settingsOverlay .settings-account-row .reminder-text-action:focus-visible,
#reminderForm .reminder-verified-email-row .reminder-text-action:hover,
#reminderForm .reminder-verified-email-row .reminder-text-action:focus-visible {
  background: transparent !important;
  color: #111b14 !important;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

[data-theme="dark"] #settingsOverlay .settings-account-row .reminder-text-action:hover,
[data-theme="dark"] #settingsOverlay .settings-account-row .reminder-text-action:focus-visible,
[data-theme="dark"] #reminderForm .reminder-verified-email-row .reminder-text-action:hover,
[data-theme="dark"] #reminderForm .reminder-verified-email-row .reminder-text-action:focus-visible {
  background: transparent !important;
  color: #f2f4f5 !important;
}
.profile-access-card.is-email-step {
  display: grid;
  width: min(92vw, 270px);
  height: 280px;
  max-height: calc(100dvh - 24px);
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0 14px 14px;
  gap: 0;
  overflow: hidden;
}
.profile-access-card .reminder-settings-head { min-height: 74px; margin: 0 -14px; padding: 15px 17px 12px; }
.profile-access-card .reminder-settings-head h2 { font-size: 26px; line-height: 0.98; }
.profile-access-card .reminder-settings-head p {
  color: #465862;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
}
[data-theme="dark"] .profile-access-card .reminder-settings-head p { color: #d1d9df; }
.profile-access-step {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: var(--verification-content-gap);
  gap: 9px;
}
.profile-access-step .reminder-field-group,
.profile-access-step .reminder-primary-action { width: min(100%, 204px); margin-inline: auto; }
.profile-access-step .reminder-field-group { gap: 6px; }
.profile-access-step input[type="email"] {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  height: 26px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font: 500 11.5px/1 var(--font);
  box-shadow: 0 8px 20px rgba(48, 72, 49, 0.08);
}
.profile-access-step input[type="email"]:focus-visible { outline: 0; border-color: #6b7f4c; box-shadow: 0 0 0 1px #687c4c29; }
.profile-access-step .reminder-primary-action { margin-top: auto; height: 32px; min-height: 32px; flex-shrink: 0; font-size: 11px; }
.profile-access-step .reminder-modal-actions { margin-top: 0; flex-shrink: 0; }
.profile-access-step .reminder-error:empty { display: none; }
.profile-access-step .reminder-error { width: min(100%, 204px); margin: 0 auto; }
.profile-access-card:has(.reminder-error:not(:empty)),
.reminder-verify-card:has(.reminder-error:not(:empty)) { height: 306px; }
.reminder-verify-card .reminder-settings-head h2 { max-width: 190px; }
.reminder-verify-card .reminder-code-meta { flex-wrap: wrap; gap: 2px 6px; }
[data-theme="dark"] .profile-access-step input[type="email"] { border-color: #727b82; background: #3b4248; color: #f2f4f5; -webkit-text-fill-color: #f2f4f5; color-scheme: dark; box-shadow: none; }
[data-theme="dark"] .profile-access-link,
[data-theme="dark"] .settings-account-row .reminder-text-action,
[data-theme="dark"] .settings-logout-btn { color: #a9ca86; }
@media (max-width: 640px) {
  .profile-access-link { width: 100%; }
}
@media (max-height: 380px) {
  .profile-access-card.is-email-step,
  .reminder-verify-card { overflow-y: auto; }
}

/* Grow Settings with its account controls; scroll only on a genuinely short viewport. */
#settingsOverlay .settings-card {
  width: min(92vw, 270px);
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#settingsOverlay .settings-profile-actions { padding-bottom: 14px; }

/* Fields remain outlined before focus in both themes. */
:root {
  --field-border: #a9b69f;
  --form-field-width: 226px;
  --form-field-height: 31px;
  --form-action-width: 108px;
  --form-action-height: 31px;
}
[data-theme="dark"] { --field-border: #88959d; }

#profileForm .profile-input-field:not(:focus-within),
#settingsOverlay .settings-input-wrap:not(:focus-within),
.reminder-settings-card .settings-input-wrap:not(:focus-within),
#profileAccessForm input[type="email"]:not(:focus),
#reminderEmailStep input[type="email"]:not(:focus),
.reminder-settings-card .reminder-verified-email-row input:not(:focus),
.reminder-settings-card input[type="date"]:not(:focus),
.reminder-settings-card textarea:not(:focus),
.reminder-verify-card .reminder-otp-inputs input:not(:focus),
#entryOverlay .time-input:not(:focus),
#entryOverlay .hours-input-card:not(:focus-within),
#entryOverlay #noteInput:not(:focus),
.time-select-trigger:not(:focus-visible),
.daily-records-month-wrap {
  border: 1px solid var(--field-border);
}

.daily-records-month-wrap { border-radius: 8px; }

/* Keep compact Settings controls consistent at every breakpoint. */
#settingsOverlay .form-grid {
  grid-template-columns: minmax(0, 1fr);
  width: min(100%, var(--form-field-width));
  margin-inline: auto;
}

#settingsOverlay .settings-input-wrap input,
#settingsOverlay .settings-input-wrap select {
  height: 100%;
  min-height: 0;
  font-size: 11.5px;
}

@media (max-height: 560px) {
  #profileOverlay .profile-setup-card {
    min-height: 0;
    overflow-y: auto;
    grid-auto-rows: max-content;
  }
}

/* Profile Setup defines the shared field and action sizes across compact forms. */
.profile-form-stack,
.profile-actions,
.profile-access-step,
#reminderEmailStep,
.reminder-verify-step,
.reminder-main-step {
  width: min(100%, var(--form-field-width));
}

.profile-access-step,
#reminderEmailStep,
.reminder-verify-step,
.reminder-main-step { margin-inline: auto; }

.profile-access-step .reminder-field-group,
#reminderEmailStep .reminder-field-group { width: 100%; }

#profileAccessForm input[type="email"],
#reminderEmailStep input[type="email"] {
  width: var(--form-field-width);
  max-width: 100%;
}

#profileForm .profile-input-field,
#settingsOverlay .settings-input-wrap,
.reminder-settings-card .settings-input-wrap,
#profileAccessForm input[type="email"],
#reminderEmailStep input[type="email"],
.reminder-settings-card .reminder-verified-email-row input,
.reminder-settings-card input[type="date"],
.reminder-verify-card .reminder-otp-inputs input,
#entryOverlay .time-input,
.time-select-trigger,
.daily-records-month-wrap {
  box-sizing: border-box;
  height: var(--form-field-height);
  min-height: var(--form-field-height);
}

#profileForm .profile-input-field input,
#profileForm .profile-input-field select,
#settingsOverlay .settings-input-wrap input,
#settingsOverlay .settings-input-wrap select,
.reminder-settings-card .settings-input-wrap input,
.reminder-settings-card .settings-input-wrap select {
  height: 100%;
  min-height: 0;
  font-size: 11.5px;
}

.daily-records-month-wrap select {
  height: 100%;
  min-height: 0;
  font-size: 11.5px;
}

#profileAccessForm input[type="email"],
#reminderEmailStep input[type="email"],
.reminder-settings-card .reminder-verified-email-row input,
.reminder-settings-card input[type="date"] { font-size: 11.5px; }

.profile-save-btn,
#settingsOverlay .settings-save-btn,
#profileAccessForm .reminder-primary-action,
#reminderEmailStep .reminder-primary-action,
.reminder-settings-card .reminder-modal-actions > button,
#reminderForm .reminder-modal-actions > button,
#reminderVerifyForm .reminder-modal-actions > button,
#profileAccessForm .reminder-modal-actions > button,
#entryOverlay .modal-actions button,
.time-picker-actions button,
.daily-records-close-footer,
.notification-popover .notification-popover-action,
.dashboard-actions .reset-btn,
.dashboard-actions .export-btn {
  box-sizing: border-box;
  width: var(--form-action-width);
  min-width: 0;
  max-width: var(--form-action-width);
  height: var(--form-action-height);
  min-height: var(--form-action-height);
  flex: 0 1 var(--form-action-width);
  padding: 0 7px;
  font-size: 10px;
  white-space: nowrap;
}

#profileAccessForm .reminder-primary-action,
#reminderEmailStep .reminder-primary-action {
  width: 100%;
  max-width: none;
  height: 32px;
  min-height: 32px;
  flex: 0 0 32px;
  margin-left: 0;
  margin-right: 0;
  font-size: 11px;
}

.reminder-settings-card .reminder-helper:not(.reminder-error) {
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  font-size: 9px;
}

.reminder-verify-card .reminder-step-copy strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Compact Settings account section: the verified email follows the same field scale. */
#settingsOverlay .settings-card {
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
}

#settingsOverlay .settings-card .form-grid {
  width: min(100%, var(--form-field-width));
  margin-top: 8px;
  gap: 4px;
}

#settingsOverlay .settings-card .form-grid label > span,
#settingsOverlay .settings-account-label {
  font-size: 9px;
  line-height: 1.15;
}

#settingsOverlay .settings-section-divider {
  width: var(--form-field-width);
  max-width: calc(100% - 28px);
  height: 1px;
  margin: 8px auto;
  background: var(--line);
}

#settingsOverlay .settings-account-row {
  display: grid;
  width: min(100%, var(--form-field-width));
  margin: 0 auto;
  gap: 3px;
  color: var(--text);
}

#settingsOverlay .settings-account-label {
  color: var(--muted);
  font-weight: 800;
}

#settingsOverlay .settings-email-display {
  --settings-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E");
  width: 100%;
  color: var(--text);
}

#settingsOverlay .settings-email-display > span {
  min-width: 0;
  overflow: hidden;
  padding: 0 9px 0 8px;
  color: inherit;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#settingsOverlay .settings-email-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 13px;
  gap: 8px;
  font-size: 9px;
  line-height: 1.1;
}

#settingsOverlay .settings-email-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green-deep);
  font-weight: 700;
}

#settingsOverlay .settings-email-verified i {
  display: inline-grid;
  width: 12px;
  height: 12px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-deep);
  color: #fff;
  font: 800 8px/1 var(--font);
  font-style: normal;
}

#settingsOverlay .settings-account-row .reminder-text-action {
  justify-self: end;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green-deep);
  font: 700 9px/1.1 var(--font);
  text-decoration: underline;
  text-underline-offset: 2px;
}

#settingsOverlay .settings-card .reminder-row {
  width: min(100%, var(--form-field-width));
  margin: 0 auto;
  padding: 0;
}

#settingsOverlay .settings-card .reminder-open-btn {
  position: relative;
  height: var(--form-field-height);
  min-height: var(--form-field-height);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
}

#settingsOverlay .settings-card .reminder-open-btn::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-right: 10px;
  flex: 0 0 14px;
  background: var(--green-deep);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4'/%3E%3C/svg%3E") center / contain no-repeat;
}

#settingsOverlay .settings-card .reminder-open-btn > span:first-child { flex: 1 1 auto; }
#settingsOverlay .settings-card .reminder-open-btn strong { font-size: 10px; }
#settingsOverlay .settings-card .reminder-open-btn small { font-size: 8px; }
#settingsOverlay .settings-card .reminder-open-arrow {
  display: block;
  color: var(--muted);
  font-size: 18px;
}

#settingsOverlay .settings-card .settings-profile-actions {
  width: min(100%, var(--form-field-width));
  margin: 8px auto 0;
  padding: 0 0 12px;
  justify-content: space-between;
}

#settingsOverlay .settings-card .settings-logout-btn {
  min-width: 0;
  padding: 0;
  color: var(--green-deep);
  font-size: 10px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#settingsOverlay .settings-card .settings-logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: var(--form-action-height);
  transition: color 120ms ease;
}

#settingsOverlay .settings-logout-btn svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#settingsOverlay .settings-card .reminder-open-btn { transition: background-color 120ms ease, color 120ms ease; }

#settingsOverlay .settings-card .reminder-open-btn:hover,
#settingsOverlay .settings-card .reminder-open-btn:focus-visible,
#settingsOverlay .settings-card .reminder-open-btn:active {
  border-radius: 5px;
  background: #e0e3df;
  color: #3f4542;
}

#settingsOverlay .settings-card .reminder-open-btn:hover *,
#settingsOverlay .settings-card .reminder-open-btn:focus-visible *,
#settingsOverlay .settings-card .reminder-open-btn:active * { color: inherit; }

#settingsOverlay .settings-card .reminder-open-btn:hover::before,
#settingsOverlay .settings-card .reminder-open-btn:focus-visible::before,
#settingsOverlay .settings-card .reminder-open-btn:active::before { background: currentColor; }

#settingsOverlay .settings-card .settings-logout-btn:hover,
#settingsOverlay .settings-card .settings-logout-btn:focus-visible,
#settingsOverlay .settings-card .settings-logout-btn:active { color: #3f4542; }

[data-theme="dark"] #settingsOverlay .settings-card .reminder-open-btn:hover,
[data-theme="dark"] #settingsOverlay .settings-card .reminder-open-btn:focus-visible,
[data-theme="dark"] #settingsOverlay .settings-card .reminder-open-btn:active { background: #454d49; color: #fff; }

[data-theme="dark"] #settingsOverlay .settings-card .settings-logout-btn:hover,
[data-theme="dark"] #settingsOverlay .settings-card .settings-logout-btn:focus-visible,
[data-theme="dark"] #settingsOverlay .settings-card .settings-logout-btn:active { color: #e1e5e2; }

[data-theme="dark"] #settingsOverlay .settings-email-display,
[data-theme="dark"] #settingsOverlay .settings-email-display > span { color: #f3f5f6; }
[data-theme="dark"] #settingsOverlay .settings-account-label { color: #bdc5ca; }
[data-theme="dark"] #settingsOverlay .settings-section-divider { background: #566067; }

/* General in-app updates stay short so the notification panel remains compact. */
.notification-system-list {
  display: grid;
  gap: 4px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.notification-system-row {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 8px;
  border: 1px solid rgba(89, 115, 63, 0.2);
  border-radius: 8px;
  background: rgba(235, 243, 228, 0.7);
  color: var(--text);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.3;
}

.notification-system-row::before {
  content: "✓";
  display: inline-grid;
  width: 13px;
  height: 13px;
  margin-right: 6px;
  flex: 0 0 13px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-deep);
  color: #fff;
  font: 800 8px/1 var(--font);
}

.notification-btn.has-system-update .bell-icon { color: var(--green-deep); }
[data-theme="dark"] .notification-system-row { border-color: #687178; background: #3b4248; color: #f3f5f6; }

/* Let the schedule fit its fields instead of reserving empty space below the actions. */
#reminderForm:not(.is-email-step) {
  display: flex;
  flex-direction: column;
  width: min(92vw, 270px);
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 24px);
  padding: 0 14px 12px;
  gap: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

#reminderForm:not(.is-email-step) .reminder-settings-head {
  min-height: 74px;
  margin: 0 -14px;
  padding: 15px 17px 12px;
  flex-shrink: 0;
}

#reminderForm .reminder-main-step {
  padding-top: 10px;
  flex: 0 0 auto;
  gap: 8px;
}

#reminderForm .reminder-main-step .reminder-field-group { gap: 3px; }
#reminderForm .reminder-verified-email-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; }
#reminderForm .reminder-profile-email { width: 100%; border: 1px solid var(--field-border); }
#reminderForm .reminder-profile-email {
  background: var(--card);
  box-shadow: none;
}
#reminderForm .reminder-profile-email input {
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0 8px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 11.5px;
  opacity: 1;
  -webkit-text-fill-color: var(--text);
}

#reminderForm .reminder-verified-email-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#reminderForm .reminder-verified-badge { display: inline-flex; align-items: center; gap: 4px; }
#reminderForm .reminder-verified-badge::before {
  content: "✓";
  display: inline-grid;
  width: 11px;
  height: 11px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-deep);
  color: #fff;
  font: 800 8px/1 var(--font);
}

#reminderForm .reminder-main-step .reminder-modal-actions { margin-top: 0; padding-top: 7px; }
#reminderForm .reminder-main-step .reminder-divider { margin: 0; }
#reminderForm .reminder-main-step textarea:focus,
#reminderForm .reminder-main-step textarea:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: #4a4d4b;
}

#reminderForm .reminder-date-time-row input,
#reminderForm .reminder-main-step .settings-time input,
#reminderForm .reminder-main-step .reminder-repeat-select-wrap select {
  font-size: 10px !important;
  letter-spacing: 0;
}

#reminderForm .reminder-main-step .settings-time.has-caret::after,
#reminderForm .reminder-main-step .reminder-repeat-select-wrap.has-caret::after {
  width: 7px;
  height: 7px;
  right: 9px;
  border-width: 0 1px 1px 0;
}

#reminderForm .reminder-main-step .settings-time:hover,
#reminderForm .reminder-main-step .reminder-repeat-select-wrap:hover {
  border-color: #aeb8b0;
  background: #f4f6f3;
  color: var(--text);
}

#reminderForm .reminder-main-step .settings-time:focus-within,
#reminderForm .reminder-main-step .reminder-repeat-select-wrap:focus-within {
  border-color: var(--green-deep);
  background: var(--card);
  color: var(--text);
  box-shadow: 0 0 0 2px rgba(82, 122, 57, 0.12);
}

#reminderForm .reminder-main-step .settings-time:hover input,
#reminderForm .reminder-main-step .settings-time:focus-within input,
#reminderForm .reminder-main-step .reminder-repeat-select-wrap:hover select,
#reminderForm .reminder-main-step .reminder-repeat-select-wrap:focus-within select {
  color: var(--text);
  -webkit-text-fill-color: var(--text);
}

#reminderForm .reminder-main-step .settings-time:hover i,
#reminderForm .reminder-main-step .settings-time:focus-within i,
#reminderForm .reminder-main-step .reminder-repeat-select-wrap:hover i,
#reminderForm .reminder-main-step .reminder-repeat-select-wrap:focus-within i {
  filter: none;
}

#reminderForm .reminder-main-step .settings-time:hover::after,
#reminderForm .reminder-main-step .settings-time:focus-within::after,
#reminderForm .reminder-main-step .reminder-repeat-select-wrap:hover::after,
#reminderForm .reminder-main-step .reminder-repeat-select-wrap:focus-within::after {
  border-color: var(--muted);
}

#reminderRepeatPreset option {
  background: #fff;
  color: #17251d;
}

[data-theme="dark"] #reminderRepeatPreset option {
  background: #29312d;
  color: #f2f4f5;
}

[data-theme="dark"] #reminderForm .reminder-main-step .settings-time:hover,
[data-theme="dark"] #reminderForm .reminder-main-step .reminder-repeat-select-wrap:hover {
  border-color: #737c83;
  background: #41484e;
  color: #f2f4f5;
}

[data-theme="dark"] #reminderForm .reminder-main-step .settings-time:focus-within,
[data-theme="dark"] #reminderForm .reminder-main-step .reminder-repeat-select-wrap:focus-within {
  border-color: #a2b1a6;
  background: #3b4248;
  color: #f2f4f5;
}

[data-theme="dark"] #reminderForm .reminder-main-step .settings-time:hover input,
[data-theme="dark"] #reminderForm .reminder-main-step .settings-time:focus-within input,
[data-theme="dark"] #reminderForm .reminder-main-step .reminder-repeat-select-wrap:hover select,
[data-theme="dark"] #reminderForm .reminder-main-step .reminder-repeat-select-wrap:focus-within select {
  color: #f2f4f5;
  -webkit-text-fill-color: #f2f4f5;
}

[data-theme="dark"] #reminderForm .reminder-main-step .settings-time:hover i,
[data-theme="dark"] #reminderForm .reminder-main-step .settings-time:focus-within i,
[data-theme="dark"] #reminderForm .reminder-main-step .reminder-repeat-select-wrap:hover i,
[data-theme="dark"] #reminderForm .reminder-main-step .reminder-repeat-select-wrap:focus-within i {
  filter: brightness(0) invert(1);
}

[data-theme="dark"] #reminderForm .reminder-main-step .settings-time:hover::after,
[data-theme="dark"] #reminderForm .reminder-main-step .settings-time:focus-within::after,
[data-theme="dark"] #reminderForm .reminder-main-step .reminder-repeat-select-wrap:hover::after,
[data-theme="dark"] #reminderForm .reminder-main-step .reminder-repeat-select-wrap:focus-within::after {
  border-color: #dce3df;
}

#reminderForm .reminder-enable-row,
#reminderForm .reminder-enable-row b,
#reminderForm .reminder-enable-row input {
  cursor: pointer;
}

[data-theme="dark"] #reminderForm .reminder-profile-email {
  border-color: #737c83;
  background: #3b4248;
}

[data-theme="dark"] #reminderForm .reminder-profile-email input {
  background: transparent;
  color: #f2f4f5;
  -webkit-text-fill-color: #f2f4f5;
  color-scheme: dark;
}

[data-theme="dark"] #reminderForm .reminder-profile-email:focus-within {
  border-color: #e0e5e8;
  background: #41484e;
}

/* Feedback is centered plain text over the dimmed page, never a pill or panel. */
#toast {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

[data-theme="dark"] #toast {
  background: rgba(8, 12, 10, 0.2);
  color: #f3f5f6;
}
[data-theme="dark"] #toast > span {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

/* Notification content stays compact; only the list scrolls. */
.notification-anchor::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 13px;
}

.notification-popover {
  box-sizing: border-box;
  height: min(320px, var(--notification-available-height, calc(100dvh - 160px)));
  min-height: 0;
  padding: 12px 10px 8px;
}

.notification-popover-head {
  grid-template-columns: 16px minmax(0, 1fr) 18px;
  gap: 7px;
  padding: 0 3px;
}

.notification-popover-icon,
.notification-popover-icon .bell-icon {
  width: 15px;
  height: 15px;
}

.notification-popover-head h2 { font-size: 12px; font-weight: 700; }
.notification-popover-close {
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 3px;
  font-size: 18px;
}

.notification-mark-all,
.notification-view-all,
.notification-popover .notification-popover-action {
  width: auto;
  min-width: 0;
  max-width: none;
  min-height: 0;
  height: auto;
  flex: 0 1 auto;
  margin: 0;
  padding: 4px 5px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
  color: var(--green-deep);
  font: 500 9px/1.3 var(--font);
  text-align: right;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background-color 180ms ease, color 180ms ease;
}

.notification-mark-all { align-self: flex-end; margin: 4px 0 5px; }
.notification-mark-all:disabled { opacity: .48; cursor: default; }
.notification-popover-body {
  flex: 1 1 auto;
  min-height: 0;
  border-block: 1px solid var(--line);
  scrollbar-width: thin;
}

.notification-items { margin: 0; padding: 0; list-style: none; }
.notification-items > li + li { border-top: 1px solid var(--line); }
.notification-row {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  width: 100%;
  padding: 9px 4px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  text-align: left;
  text-decoration: none !important;
  transition: background-color 180ms ease;
}

.notification-row-icon {
  display: block;
  width: 15px;
  height: 15px;
  margin-top: 1px;
  background: var(--green-deep);
  mask: center / contain no-repeat;
  -webkit-mask: center / contain no-repeat;
}
.notification-row-icon.is-bell {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 8a6 6 0 0 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9M10 21h4'/%3E%3C/svg%3E");
}
.notification-row-icon.is-send {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4Z M22 2 11 13'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 2-7 20-4-9-9-4Z M22 2 11 13'/%3E%3C/svg%3E");
}
.notification-row-icon.is-user {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M4 21v-2a8 8 0 0 1 16 0v2Z'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3Cpath d='M4 21v-2a8 8 0 0 1 16 0v2Z'/%3E%3C/svg%3E");
}
.notification-row-copy { display: grid; min-width: 0; gap: 3px; }
.notification-row-copy strong {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}
.notification-unread-dot {
  display: block;
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: #1eaa5b;
}
.notification-row-copy > span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}
.notification-row-copy small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
  text-align: right;
}
.notification-empty { padding: 16px 5px; color: var(--muted); font-size: 10px; }
.notification-popover-footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding-top: 6px;
}
.notification-popover .notification-popover-action { display: block; }
.notification-view-all[hidden] { display: none; }
.notification-row:hover,
.notification-mark-all:not(:disabled):hover,
.notification-view-all:hover,
.notification-popover .notification-popover-action:hover,
.notification-popover .notification-popover-action:not(:disabled):hover {
  background: rgba(82, 119, 83, .09) !important;
  color: var(--green-deep) !important;
  box-shadow: none;
  filter: none;
  text-decoration: none !important;
}
.notification-row:focus-visible,
.notification-mark-all:focus-visible,
.notification-view-all:focus-visible,
.notification-popover .notification-popover-action:focus-visible,
.notification-popover-close:focus-visible {
  outline: 1px solid var(--green-deep);
  outline-offset: -1px;
  text-decoration: none !important;
}
.notification-popover button::after { content: none !important; }
[data-theme="dark"] .notification-row:hover,
[data-theme="dark"] .notification-mark-all:not(:disabled):hover,
[data-theme="dark"] .notification-view-all:hover,
[data-theme="dark"] .notification-popover .notification-popover-action:not(:disabled):hover {
  background: rgba(185, 209, 185, .12) !important;
  color: var(--text) !important;
}

/* Match the existing entry dialog width on mobile and tablet only. */
@media (max-width: 900px) {
  #profileOverlay .profile-setup-card,
  .daily-records-card {
    box-sizing: border-box;
    width: min(92vw, 360px);
    max-width: min(92vw, 360px);
  }
  #profileOverlay .profile-setup-card { grid-template-columns: minmax(0, 1fr); }
  #profileOverlay .profile-visual-panel { min-height: 108px; max-height: 108px; }
  #profileOverlay .profile-form-panel { padding: 18px 18px 20px; }
}

/* Reset confirmation follows the compact Settings footprint on every device. */
#confirmOverlay {
  padding: 12px;
}

#confirmOverlay .confirm-card {
  box-sizing: border-box;
  width: min(92vw, 270px);
  min-height: 0;
  max-height: min(94dvh, 300px);
  overflow: hidden;
  padding: 22px 14px 14px;
  border-radius: 16px;
}

#confirmOverlay .confirm-card h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.05;
}

#confirmOverlay .confirm-card p {
  margin: 9px 0 14px;
  font-size: 12px;
  line-height: 1.45;
}

#confirmOverlay .confirm-card .modal-actions {
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

#confirmOverlay .confirm-card .ghost-btn,
#confirmOverlay .confirm-card .danger-btn {
  box-sizing: border-box;
  width: var(--form-action-width);
  min-width: var(--form-action-width);
  max-width: var(--form-action-width);
  height: var(--form-action-height);
  min-height: var(--form-action-height);
  padding: 0 7px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

#confirmOverlay .confirm-card .ghost-btn {
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

#confirmOverlay .confirm-card .ghost-btn:hover,
#confirmOverlay .confirm-card .ghost-btn:focus-visible {
  border-color: #111;
  background: #111;
  color: #fff;
}

#confirmOverlay .confirm-card p strong {
  color: var(--ink);
  font-weight: 800;
}

@media (max-width: 360px) {
  #confirmOverlay .confirm-card {
    width: min(92vw, 270px);
    padding-inline: 12px;
  }
}

/* Calendar period controls keep the existing grid unchanged while providing
   a direct month/year picker for the calendar heading. */
.calendar-heading {
  position: relative;
}

.calendar-period-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
  gap: 9px;
  padding: 4px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
}

.calendar-period-btn:hover {
  background: rgba(82, 122, 57, 0.08);
}

.calendar-period-btn:focus-visible {
  outline: 3px solid rgba(245, 184, 35, 0.3);
  outline-offset: 2px;
}

.calendar-period-chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-right: 2px solid var(--green-deep);
  border-bottom: 2px solid var(--green-deep);
  transform: translateY(-3px) rotate(45deg);
}

.calendar-period-picker[hidden] {
  display: none;
}

.calendar-period-picker {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 30;
  width: min(286px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
}

.calendar-period-picker-head,
.calendar-period-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calendar-period-picker-head {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.calendar-period-picker-head strong {
  display: block;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.2;
  font-weight: 800;
}

.calendar-period-close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #263d35;
  font-size: 27px;
  line-height: 1;
  box-shadow: none;
  transition: color 160ms ease, transform 160ms ease;
}

.calendar-period-close:hover,
.calendar-period-close:focus-visible {
  border-color: transparent;
  background: transparent;
  color: #59733f;
  transform: scale(1.08);
}

.calendar-period-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 8px;
}

.calendar-period-field {
  position: relative;
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.calendar-period-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card-soft);
  color: var(--text);
  font-size: 12px;
  text-align: left;
}

.calendar-period-select:hover,
.calendar-period-select[aria-expanded="true"] {
  border-color: var(--green-deep);
}

.calendar-period-select-chevron {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
}

.calendar-period-menu[hidden] {
  display: none;
}

.calendar-period-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.calendar-period-option {
  min-height: 30px;
  padding: 4px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-align: left;
}

.calendar-period-option:hover,
.calendar-period-option.is-selected {
  background: var(--green-soft);
  color: var(--green-deep);
  font-weight: 800;
}

.calendar-period-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.calendar-period-today {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
}

.calendar-period-today {
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--green-deep);
}

[data-theme="dark"] .calendar-period-btn:hover {
  background: rgba(151, 185, 145, 0.12);
}

[data-theme="dark"] .calendar-period-chevron {
  border-color: #9bbd74;
}

/* Keep reset actions side-by-side even on narrow phones. */
#confirmOverlay .confirm-card .modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  justify-content: stretch;
}

#confirmOverlay .confirm-card .ghost-btn,
#confirmOverlay .confirm-card .danger-btn {
  width: 100%;
  min-width: 0;
  max-width: none;
}

/* Center the profile fields on mobile and tablet without changing desktop. */
@media (max-width: 900px) {
  #profileOverlay .profile-form-panel {
    justify-items: center;
  }

  #profileOverlay .profile-form-panel > *,
  #profileOverlay .profile-form-stack,
  #profileOverlay .profile-actions {
    width: min(100%, 300px);
    margin-inline: auto;
  }

  #profileOverlay .profile-setup-intro {
    justify-items: center;
    text-align: center;
  }

  #profileOverlay .profile-setup-intro p {
    width: 100%;
  }
}

/* Desktop-only spacing adjustment. Mobile and tablet calendar layout stays as-is. */
@media (min-width: 1181px) {
  .app-shell {
    padding-top: 26px;
    padding-bottom: 14px;
  }

  .topbar {
    margin-bottom: 20px;
  }

  .summary-card {
    margin-bottom: 20px;
  }

  .calendar-card {
    padding-top: 24px;
  }
}

/* Give the compact header identity enough breathing room on phones. */
@media (max-width: 760px) {
  .topbar .brand-copy {
    align-items: flex-start;
    gap: 10px;
  }

  .topbar .profile-note {
    max-width: min(44vw, 176px);
    gap: 5px;
    padding-left: 10px;
  }

  .topbar .profile-note span,
  .topbar .profile-note small {
    max-width: 100%;
  }

  .topbar .profile-note span {
    font-size: 11px;
    line-height: 1.2;
  }

  .topbar .profile-note small {
    font-size: 8.5px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Keep mobile/tablet overlays aligned with the Entry Logs modal. */
@media (max-width: 900px) {
  #entryOverlay .entry-modal,
  #settingsOverlay .settings-card,
  #reminderSettingsOverlay .reminder-settings-card {
    width: min(92vw, 360px);
    max-width: min(92vw, 360px);
    box-sizing: border-box;
  }

  /* Center form fields while keeping each panel's action row edge-aligned. */
  #settingsOverlay .form-grid,
  #settingsOverlay .settings-account-row {
    width: min(100%, 226px);
    margin-inline: auto;
  }

  #settingsOverlay .settings-profile-actions,
  #reminderSettingsOverlay .reminder-modal-actions {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    justify-content: space-between;
  }

  #reminderSettingsOverlay #reminderEmailStep .reminder-modal-actions {
    justify-content: flex-end;
  }

  /* Keep Settings and Email Reminder on the same compact frame. */
  #settingsOverlay .settings-card,
  #reminderSettingsOverlay .reminder-settings-card {
    width: min(92vw, 320px);
    max-width: min(92vw, 320px);
  }

  #reminderSettingsOverlay .reminder-settings-card {
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - 24px);
  }

  #reminderSettingsOverlay .reminder-modal-actions,
  #reminderSettingsOverlay #reminderEmailStep .reminder-modal-actions {
    width: min(100%, 240px);
    margin-left: auto;
    margin-right: 0;
    justify-content: flex-end;
  }

  #reminderSettingsOverlay #reminderEmailStep,
  #reminderSettingsOverlay #reminderMainStep {
    width: 100%;
    margin-inline: 0;
  }

  #reminderSettingsOverlay #reminderEmailStep .reminder-field-group,
  #reminderSettingsOverlay #reminderMainStep > .reminder-field-group,
  #reminderSettingsOverlay #reminderMainStep .reminder-date-time-row,
  #reminderSettingsOverlay #reminderMainStep .reminder-schedule-options {
    width: min(100%, 226px);
    margin-inline: auto;
  }

  #reminderForm .reminder-main-step .reminder-enable-row {
    display: flex;
    width: min(100%, 226px);
    min-width: 0;
    margin-inline: auto;
    padding-inline: 0;
    box-sizing: border-box;
    justify-content: space-between;
  }

  #reminderForm .reminder-main-step .reminder-enable-row input:focus-visible + b {
    outline: 0;
    outline-offset: 0;
  }

  #reminderSettingsOverlay #reminderMainStep > .reminder-helper {
    width: min(100%, 226px);
    margin: -1px auto 0;
    text-align: left;
  }
}

/* Keep the custom switch as a single pill on every viewport. */
#reminderForm .reminder-enable-row input:focus-visible {
  outline: 0;
  outline-offset: 0;
}

#reminderForm .reminder-enable-row input:focus-visible + b {
  outline: 0;
  outline-offset: 0;
}
