:root {
  --bg: #f4f2ed;
  --bg-deep: #ece8e0;
  --surface: #fffefa;
  --surface-2: #faf8f3;
  --ink: #17181c;
  --ink-soft: #3d3f46;
  --muted: #7c7b78;
  --muted-soft: #a6a39b;
  --line: #e6e2d9;
  --line-strong: #d7d1c5;
  --accent: #e2563f;
  --accent-strong: #c9452f;
  --accent-soft: #fcece7;
  --gold: #b78833;
  --gold-soft: #f8f0de;
  --positive: #5f8069;
  --positive-soft: #eef4ef;
  --danger: #ac3a29;
  --font-ui: "Manrope", "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;
  --shadow-sm: 0 1px 2px rgba(23, 24, 28, 0.03), 0 12px 28px rgba(23, 24, 28, 0.04);
  --shadow-lg: 0 28px 80px rgba(23, 24, 28, 0.2);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #f7c9be;
  color: var(--ink);
}

.no-scroll {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-star {
  fill: currentColor;
  stroke: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.page-wash {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 96% -8%, rgba(226, 86, 63, 0.1), transparent 62%),
    radial-gradient(760px 480px at -8% 12%, rgba(183, 136, 51, 0.07), transparent 64%),
    radial-gradient(600px 420px at 55% 108%, rgba(95, 128, 105, 0.05), transparent 65%);
}

/* Category palette */
.cat-trabajo {
  --cat: #526b8e;
  --cat-soft: #edf1f7;
  --cat-ink: #3b506d;
}

.cat-personal {
  --cat: #d56049;
  --cat-soft: #fbece7;
  --cat-ink: #97402f;
}

.cat-celebracion {
  --cat: #b48533;
  --cat-soft: #f8f0dd;
  --cat-ink: #79591e;
}

.cat-bienestar {
  --cat: #5b806c;
  --cat-soft: #eaf1ec;
  --cat-ink: #3f5d4d;
}

/* Shared atoms */
.eyebrow {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    transform 0.18s ease, box-shadow 0.18s ease;
}

.btn .icon {
  font-size: 16px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 7px 18px rgba(23, 24, 28, 0.14);
}

.btn-primary:hover {
  background: #2a2b32;
  border-color: #2a2b32;
  box-shadow: 0 9px 22px rgba(23, 24, 28, 0.18);
}

.btn-dark {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn-dark:hover {
  background: #2a2b32;
  border-color: #2a2b32;
}

.btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--line-strong);
}

.btn-quiet {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.btn-quiet:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.btn-soft {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.btn-soft:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.btn-danger {
  background: transparent;
  border-color: transparent;
  color: var(--danger);
  padding-left: 9px;
  padding-right: 9px;
}

.btn-danger:hover {
  background: #fbefec;
  border-color: #f1ddd6;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--line);
}

.icon-btn.mini {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 13px;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.stepper .icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 15px;
}

.stepper .icon-btn:hover {
  background: var(--surface-2);
  border-color: transparent;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--accent-strong);
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.4;
}

.text-link .icon {
  font-size: 12px;
  transition: transform 0.18s ease;
}

.text-link:hover .icon {
  transform: translateX(2px);
}

.count-pill {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 20px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.panel {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.panel-head h2 {
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.4;
  text-transform: uppercase;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
}

.panel-copy {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.empty-mini {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 45;
  height: 70px;
  border-bottom: 1px solid rgba(214, 208, 197, 0.7);
  background: rgba(244, 242, 237, 0.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  width: 100%;
  max-width: 1680px;
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ink);
  text-align: left;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: none;
  filter: drop-shadow(0 5px 10px rgba(23, 24, 28, 0.16));
  transition: transform 0.22s ease;
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand:hover .brand-mark {
  transform: rotate(-4deg) scale(1.04);
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1;
}

.brand-sub {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.2em;
  line-height: 1.4;
  text-transform: uppercase;
}

.topbar-date {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.topbar-date::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.topbar-actions .btn {
  min-height: 38px;
  border-radius: 10px;
  font-size: 11.5px;
}

.topbar-year {
  background: transparent;
}

/* Main layout */
.app-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr) 328px;
  align-items: start;
  gap: 22px;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px 28px 56px;
}

/* Year rail */
.year-rail {
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 112px);
  padding: 22px 18px 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.rail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  padding: 0 2px;
}

.rail-title .eyebrow {
  margin-bottom: 7px;
}

.rail-year-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.rail-year-line h2 {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.9;
}

.rail-count {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.year-map {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.year-map-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 17px;
  align-items: center;
  gap: 7px;
  padding: 3px 3px;
  border-radius: 7px;
  transition: background 0.16s ease;
}

.year-map-row:hover {
  background: var(--surface-2);
}

.year-map-row.is-current {
  background: #f7f3eb;
}

.map-month {
  padding: 3px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.4;
  text-align: left;
  text-transform: uppercase;
  transition: color 0.16s ease;
}

.map-month:hover {
  color: var(--ink);
}

.year-map-row.is-current .map-month {
  color: var(--ink);
}

.year-map-row.is-important .map-month {
  color: var(--gold);
}

.map-days {
  display: grid;
  grid-template-columns: repeat(31, minmax(0, 1fr));
  gap: 2px;
  min-width: 0;
}

.map-day {
  display: block;
  height: 7px;
  border-radius: 2px;
  background: #eeebe4;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease;
}

.map-day:hover {
  background: var(--line-strong);
  transform: scaleY(1.45);
}

.map-day.has-events {
  background: var(--cat);
}

.map-day.is-important {
  background: var(--gold);
}

.map-day.is-today {
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--surface), 0 0 0 2px var(--ink);
}

.map-count {
  color: var(--muted-soft);
  font-size: 8px;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 15px 3px 16px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1.5;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.legend-map-event,
.legend-map-today,
.legend-map-important {
  display: inline-block;
  width: 9px;
  height: 5px;
  border-radius: 2px;
}

.legend-map-event {
  background: var(--accent);
}

.legend-map-today {
  background: var(--ink);
}

.legend-map-important {
  background: var(--gold);
}

.rail-year-btn {
  width: 100%;
  min-height: 40px;
  border-radius: 10px;
  font-size: 10.5px;
}

/* Mobile year strip */
.mobile-year {
  display: none;
}

/* Month */
.calendar-stage {
  min-width: 0;
}

.month-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 2px 2px 18px;
}

.month-title-block {
  min-width: 0;
}

.month-title-block .eyebrow {
  margin-bottom: 8px;
}

.month-title-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 9px;
}

.month-title-line h1 {
  font-family: var(--font-display);
  font-size: clamp(48px, 4.8vw, 68px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.9;
}

.month-year {
  align-self: center;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.title-star {
  display: inline-flex;
  align-self: center;
  color: var(--gold);
  font-size: 17px;
}

.title-star .icon {
  fill: currentColor;
  stroke: none;
}

.month-summary {
  margin-top: 8px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.month-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 7px;
  padding-bottom: 2px;
}

.star-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.star-pill .icon {
  color: var(--gold);
  font-size: 12px;
}

.star-pill:hover,
.star-pill.is-active {
  border-color: #eadcbe;
  background: var(--gold-soft);
  color: #6f531b;
}

.star-pill.is-active .icon {
  fill: currentColor;
  stroke: none;
}

.month-controls #monthTodayBtn {
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 10.5px;
}

.month-controls .stepper {
  height: 36px;
  border-radius: 999px;
}

.month-controls .stepper .icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.calendar-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.weekdays {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #fbfaf6;
}

.weekdays span {
  padding: 12px 11px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

.weekdays span:nth-child(6),
.weekdays span:nth-child(7) {
  color: #a39f96;
}

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

.day-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  min-height: 96px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.17s ease;
}

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

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

.day-cell:hover {
  background: #faf8f2;
}

.day-cell:focus-visible {
  z-index: 2;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.day-cell.is-weekend {
  background: #fcfbf7;
}

.day-cell.is-weekend:hover {
  background: #f8f5ee;
}

.day-cell.is-other {
  background: #f9f7f3;
}

.day-cell.is-other:hover {
  background: #f5f1e9;
}

.day-cell.is-other .day-number {
  color: var(--muted-soft);
}

.day-cell.is-today {
  background: #fff8f3;
}

.day-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-height: 25px;
}

.day-number {
  display: inline-grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.day-cell.is-today .day-number {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 3px 9px rgba(226, 86, 63, 0.3);
}

.day-star {
  display: inline-flex;
  color: var(--gold);
  font-size: 10px;
}

.day-star .icon {
  fill: currentColor;
  stroke: none;
}

.cell-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  margin-top: auto;
}

.event-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 20px;
  padding: 3px 6px;
  overflow: hidden;
  border: 0;
  border-radius: 6px;
  background: var(--cat-soft);
  color: var(--cat-ink);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.15;
  text-align: left;
  transition: filter 0.16s ease, transform 0.16s ease;
}

.event-chip:hover {
  filter: saturate(1.14);
  transform: translateX(1px);
}

.chip-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--cat);
}

.chip-time {
  flex: none;
  font-size: 8.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.chip-title {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.more-events {
  padding-left: 3px;
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
}

.calendar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 14px 3px 0;
}

.hint {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}

.hint .icon {
  color: var(--accent);
  font-size: 11px;
}

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 11px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cat);
}

/* Insights column */
.insights {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.today-card {
  position: relative;
  overflow: hidden;
  padding: 19px;
  border-radius: var(--radius-xl);
  background: linear-gradient(148deg, #25262d 0%, #131418 100%);
  box-shadow: 0 18px 38px rgba(19, 20, 24, 0.16);
  color: #fff;
}

.today-card::after {
  content: "";
  position: absolute;
  top: -92px;
  right: -86px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 86, 63, 0.62), rgba(226, 86, 63, 0) 68%);
  pointer-events: none;
}

.today-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.today-label {
  color: rgba(255, 255, 255, 0.55);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.icon-btn.on-dark {
  width: 29px;
  height: 29px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
}

.icon-btn.on-dark:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.16);
}

.today-date {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 15px;
}

.today-num {
  font-family: var(--font-display);
  font-size: 62px;
  letter-spacing: -0.035em;
  line-height: 0.82;
}

.today-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 6px;
}

.today-weekday {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
}

.today-month {
  color: rgba(255, 255, 255, 0.5);
  font-size: 9.5px;
  line-height: 1.4;
}

.today-divider {
  position: relative;
  z-index: 1;
  height: 1px;
  margin: 15px 0 12px;
  background: rgba(255, 255, 255, 0.12);
}

.today-agenda-label {
  position: relative;
  z-index: 1;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.today-agenda {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.today-event {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 10px;
  text-align: left;
  transition: background 0.16s ease;
}

.today-event:hover {
  background: rgba(255, 255, 255, 0.11);
}

.today-event-time {
  color: rgba(255, 255, 255, 0.52);
  font-size: 8.5px;
  font-weight: 700;
  white-space: nowrap;
}

.today-event-title {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-more {
  padding-left: 2px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 8.5px;
}

.today-empty {
  padding: 4px 0;
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
  line-height: 1.55;
}

.up-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--cat);
}

/* Reminder card */
.notification-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.state-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--muted-soft);
}

.notification-state.is-on {
  border-color: #dce8de;
  background: var(--positive-soft);
  color: #476c53;
}

.notification-state.is-on .state-dot {
  background: var(--positive);
  box-shadow: 0 0 0 2.5px rgba(95, 128, 105, 0.16);
}

.notification-state.is-blocked {
  border-color: #f0ddd7;
  background: #fbf1ee;
  color: #8c4a3d;
}

.notification-state.is-blocked .state-dot {
  background: var(--danger);
}

.reminder-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 1px 0 10px;
}

.reminder-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: background 0.16s ease;
}

.reminder-item:hover {
  background: var(--surface-2);
}

.reminder-bullet {
  width: 5px;
  height: 5px;
  margin-top: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.reminder-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.reminder-title {
  overflow: hidden;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reminder-meta {
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.45;
}

.reminder-panel .btn-block {
  min-height: 36px;
  border-radius: 9px;
  font-size: 10px;
}

.reminder-empty {
  margin: 0 6px 10px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}

/* Upcoming */
.upcoming-list {
  display: flex;
  flex-direction: column;
}

.upcoming-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.upcoming-item:first-child {
  padding-top: 1px;
  border-top: 0;
}

.upcoming-item:last-child {
  padding-bottom: 1px;
}

.upcoming-item:hover .up-title {
  color: var(--accent-strong);
}

.up-date {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 39px;
  height: 39px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  line-height: 1;
}

.upcoming-item.is-today .up-date {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.up-day {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 0.85;
}

.up-month {
  margin-top: 2px;
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.upcoming-item.is-today .up-month {
  color: rgba(255, 255, 255, 0.56);
}

.up-star {
  position: absolute;
  top: -5px;
  right: -4px;
  color: var(--gold);
  font-size: 9px;
}

.up-star .icon {
  fill: currentColor;
  stroke: none;
}

.up-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.up-title {
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  transition: color 0.16s ease;
}

.up-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.up-meta-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.up-reminder {
  display: inline-flex;
  align-items: center;
  margin-left: 1px;
  flex: none;
  color: var(--accent);
  font-size: 9px;
}

.empty-state {
  padding: 7px 0 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

/* Important dates */
.important-block {
  min-width: 0;
}

.side-subhead {
  margin-bottom: 6px;
  color: var(--muted-soft);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.important-months,
.important-days {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.important-month {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 8.5px;
  font-weight: 600;
  line-height: 1.4;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.important-month:hover {
  border-color: #eadcbe;
  background: var(--gold-soft);
}

.imp-star {
  color: var(--gold);
  font-size: 9px;
  fill: currentColor;
  stroke: none;
}

.imp-year {
  color: var(--muted);
  font-size: 7.5px;
}

.imp-arrow {
  display: none;
}

.imp-day {
  padding: 4px 8px;
  border: 1px solid #ece0c8;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #75561a;
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.4;
  transition: background 0.16s ease;
}

.imp-day:hover {
  background: #f4e9d1;
}

.imp-day .icon {
  width: 8px;
  height: 8px;
  margin-right: 3px;
  fill: currentColor;
  stroke: none;
}

.important-divider {
  height: 1px;
  margin: 11px 0;
  background: var(--line);
}

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(19, 20, 24, 0.44);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#eventOverlay {
  z-index: 160;
}

.day-overlay {
  z-index: 120;
}

.year-overlay {
  z-index: 90;
}

/* Annual full view */
.year-sheet {
  width: min(1280px, 100%);
  max-height: calc(100dvh - 44px);
  padding: 26px;
  overflow: auto;
  border-radius: 28px;
  background: var(--bg);
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  transform: translateY(10px) scale(0.99);
  transition: transform 0.26s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.overlay.is-open .year-sheet {
  transform: none;
}

.year-sheet-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
}

.year-sheet-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 3px;
}

.year-sheet-title h2 {
  font-family: var(--font-display);
  font-size: 54px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 0.9;
}

.year-summary {
  color: var(--muted);
  font-size: 10px;
}

.year-sheet-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.year-sheet-actions .btn {
  min-height: 36px;
  border-radius: 10px;
  font-size: 10.5px;
}

.year-help {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 18px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.year-help .icon {
  color: var(--gold);
  font-size: 12px;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.year-month {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.year-month.is-important {
  border-color: #e8dab9;
  background: linear-gradient(180deg, #fffdf7, var(--surface));
}

.year-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  margin-bottom: 8px;
}

.year-open {
  padding: 0 0 0 1px;
  border: 0;
  background: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1;
  text-align: left;
  text-transform: capitalize;
  transition: color 0.16s ease;
}

.year-open:hover {
  color: var(--accent-strong);
}

.year-star {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #cbc6bb;
  font-size: 10px;
  transition: background 0.16s ease, color 0.16s ease;
}

.year-star:hover {
  background: var(--gold-soft);
  color: var(--gold);
}

.year-star.is-active {
  color: var(--gold);
}

.year-star .icon {
  fill: currentColor;
  stroke: none;
}

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

.mini-weekdays span {
  color: var(--muted-soft);
  font-size: 7.5px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  text-transform: uppercase;
}

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

.mini-day {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 500;
  line-height: 1;
  transition: background 0.14s ease, color 0.14s ease;
}

.mini-day:hover {
  background: var(--surface-2);
}

.mini-day.is-empty {
  pointer-events: none;
}

.mini-day.is-today {
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.mini-day.has-events::after {
  content: "";
  position: absolute;
  bottom: 1px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--cat);
}

.mini-day.is-today.has-events::after {
  background: var(--accent);
}

.mini-day.is-important {
  box-shadow: inset 0 0 0 1px var(--gold);
}

.mini-day.is-important.is-today {
  box-shadow: none;
}

/* Event modal */
.event-modal {
  width: min(620px, 100%);
  max-height: calc(100dvh - 32px);
  padding: 26px 28px;
  overflow: auto;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  transform: translateY(10px) scale(0.99);
  transition: transform 0.26s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.overlay.is-open .event-modal {
  transform: none;
}

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

.modal-head h2 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
}

.modal-close {
  flex: none;
}

#eventForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.field > label,
.field-label,
.field legend {
  padding: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.optional {
  color: var(--muted-soft);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.text-input {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffdfa;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.4;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  appearance: none;
}

.text-input::placeholder {
  color: #aaa69d;
}

.text-input:hover {
  border-color: var(--line-strong);
}

.text-input:focus {
  border-color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 24, 28, 0.06);
}

.text-input.is-invalid {
  border-color: #cd6b5a;
  box-shadow: 0 0 0 3px rgba(205, 107, 90, 0.1);
}

textarea.text-input {
  min-height: 68px;
  resize: vertical;
  line-height: 1.5;
}

input[type="date"].text-input,
input[type="time"].text-input {
  color-scheme: light;
}

input[type="date"].text-input::-webkit-calendar-picker-indicator,
input[type="time"].text-input::-webkit-calendar-picker-indicator {
  opacity: 0.5;
}

.field-error {
  display: none;
  color: #aa4230;
  font-size: 9.5px;
  line-height: 1.4;
}

.field-error:not(:empty) {
  display: block;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.category-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.cat-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdfa;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.cat-option:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.cat-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cat-option:has(input:checked) {
  border-color: var(--cat);
  background: var(--cat-soft);
  color: var(--cat-ink);
  font-weight: 700;
}

.cat-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cat-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--cat);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.date-row-grid {
  align-items: end;
}

.switch-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffdfa;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.switch {
  position: relative;
  display: block;
  width: 34px;
  height: 20px;
  flex: none;
}

.switch input {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #ddd8ce;
  transition: background 0.18s ease;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}

.switch input:checked + .switch-track {
  background: var(--ink);
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(14px);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.time-error {
  margin-top: -7px;
}

.reminder-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.reminder-option {
  position: relative;
  cursor: pointer;
}

.reminder-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.reminder-option span {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdfa;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.reminder-option:hover span {
  border-color: var(--line-strong);
}

.reminder-option input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.reminder-option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 2px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.action-spacer {
  flex: 1;
}

.modal-actions .btn {
  min-height: 39px;
  border-radius: 10px;
  font-size: 11px;
}

/* Day drawer */
.day-overlay {
  align-items: stretch;
  justify-content: flex-end;
  padding: 14px;
}

.day-drawer {
  position: relative;
  width: min(420px, 100%);
  height: 100%;
  padding: 27px 25px;
  overflow: auto;
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  transform: translateX(16px);
  transition: transform 0.26s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.overlay.is-open .day-drawer {
  transform: none;
}

.drawer-close {
  position: absolute;
  top: 17px;
  right: 17px;
}

.drawer-top {
  padding-right: 34px;
}

.drawer-top h2 {
  margin: 6px 0 5px;
  font-family: var(--font-display);
  font-size: 47px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
}

.drawer-month {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.day-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.day-flag .icon {
  color: var(--gold);
  font-size: 10px;
}

.day-flag:hover {
  border-color: #e8dab9;
  color: var(--ink-soft);
}

.day-flag.is-active {
  border-color: #eadcbe;
  background: var(--gold-soft);
  color: #785a1d;
}

.day-flag.is-active .icon {
  fill: currentColor;
  stroke: none;
}

.drawer-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 24px 0 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.drawer-section-head h3 {
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.drawer-section-head span {
  color: var(--muted);
  font-size: 9px;
}

.day-events {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.day-event {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 12px;
  align-items: start;
  gap: 9px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cat);
  border-radius: 11px;
  background: #fffdfa;
  color: var(--ink);
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.day-event:hover {
  border-color: var(--line-strong);
  border-left-color: var(--cat);
  background: var(--surface-2);
  transform: translateY(-1px);
}

.day-event-time {
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.event-time-sub {
  display: block;
  color: var(--muted-soft);
  font-size: 8px;
}

.day-event-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.day-event-title {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.day-event-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.up-meta-sep {
  color: var(--muted-soft);
}

.day-event-reminder {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent-strong);
  font-size: 8px;
  font-weight: 600;
}

.day-event-reminder .icon {
  font-size: 9px;
}

.day-note {
  display: block;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.day-event-chevron {
  margin-top: 2px;
  color: #bbb6ac;
  font-size: 12px;
}

.empty-day {
  padding: 32px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface-2);
  text-align: center;
}

.empty-day-icon {
  color: var(--gold);
  font-size: 20px;
}

.empty-day h4 {
  margin: 7px 0 4px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 400;
  line-height: 1.1;
}

.empty-day p {
  max-width: 240px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.drawer-add {
  width: 100%;
  margin-top: 17px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 32px);
  padding: 9px 12px 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: var(--ink);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.toast-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffab9c;
  font-size: 13px;
}

.toast-message {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.45;
}

.toast-action {
  flex: none;
  padding: 4px;
  border: 0;
  background: none;
  color: #ffb3a6;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Tablet */
@media (max-width: 1240px) {
  .app-layout {
    grid-template-columns: 258px minmax(0, 1fr);
    gap: 20px;
    padding: 22px 24px 48px;
  }

  .insights {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .today-card {
    min-height: 100%;
  }

  .day-cell {
    min-height: 94px;
  }

  .topbar-inner {
    padding: 0 24px;
  }
}

@media (max-width: 1100px) {
  .topbar-date {
    display: none;
  }

  .topbar-actions {
    margin-left: auto;
  }
}

/* Compact navigation */
@media (max-width: 980px) {
  .app-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 20px 22px 46px;
  }

  .year-rail {
    display: none;
  }

  .mobile-year {
    position: sticky;
    top: 70px;
    z-index: 35;
    display: block;
    margin: 0 -22px 14px;
    padding: 9px 22px 8px;
    border-bottom: 1px solid rgba(214, 208, 197, 0.7);
    background: rgba(244, 242, 237, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .mobile-year-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
  }

  .mobile-year-head .eyebrow span {
    color: var(--ink);
  }

  .mobile-year-actions {
    display: flex;
    align-items: center;
    gap: 3px;
  }

  .month-strip {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .month-strip::-webkit-scrollbar {
    display: none;
  }

  .strip-month {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 58px;
    padding: 7px 9px 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  }

  .strip-month:hover {
    border-color: var(--line-strong);
    color: var(--ink);
  }

  .strip-month.is-active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
  }

  .strip-name {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.03em;
    line-height: 1.3;
    text-transform: uppercase;
  }

  .strip-meta {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 8px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
  }

  .strip-month.is-active .strip-meta {
    color: rgba(255, 255, 255, 0.58);
  }

  .strip-event-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
  }

  .strip-star {
    position: absolute;
    top: 5px;
    right: 5px;
    color: var(--gold);
    font-size: 8px;
    fill: currentColor;
    stroke: none;
  }

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

  .month-head {
    margin-top: 0;
  }
}

/* Mobile */
@media (max-width: 720px) {
  html {
    scroll-padding-top: 80px;
  }

  .topbar {
    height: 62px;
  }

  .topbar-inner {
    gap: 12px;
    padding: 0 16px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 25px;
  }

  .brand-sub {
    font-size: 7.5px;
  }

  .topbar-actions {
    gap: 5px;
    padding-left: 0;
    border-left: 0;
  }

  .app-layout {
    padding: 15px 16px 38px;
  }

  .mobile-year {
    top: 62px;
    margin: 0 -16px 13px;
    padding: 8px 16px 7px;
  }

  .month-head {
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
    margin: 0 1px 14px;
  }

  .month-title-line h1 {
    font-size: 52px;
  }

  .month-summary {
    margin-top: 6px;
    font-size: 10px;
  }

  .month-controls {
    justify-content: flex-start;
    padding-bottom: 0;
  }

  .calendar-card {
    border-radius: 18px;
  }

  .weekdays span {
    padding: 10px 6px;
    font-size: 7.5px;
    letter-spacing: 0.07em;
  }

  .day-cell {
    gap: 3px;
    min-height: 81px;
    padding: 6px;
  }

  .day-top {
    min-height: 22px;
  }

  .day-number {
    width: 22px;
    height: 22px;
    font-size: 10.5px;
  }

  .day-star {
    font-size: 9px;
  }

  .event-chip {
    gap: 3px;
    min-height: 18px;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 8.5px;
  }

  .chip-dot {
    width: 4px;
    height: 4px;
  }

  .chip-time {
    font-size: 7.5px;
  }

  .more-events {
    font-size: 7.5px;
  }

  .calendar-foot {
    gap: 8px;
    padding-top: 11px;
  }

  .hint {
    display: none;
  }

  .legend {
    gap: 4px 9px;
    font-size: 8.5px;
  }

  .insights {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 2px;
  }

  .today-card {
    min-height: 0;
  }

  .today-num {
    font-size: 58px;
  }

  .panel {
    padding: 16px;
  }

  .event-modal {
    padding: 21px 18px;
    border-radius: 22px;
  }

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

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

  .date-row-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }

  .day-overlay {
    padding: 0;
  }

  .day-drawer {
    width: 100%;
    height: 100%;
    border-radius: 0;
    padding: 24px 20px 32px;
  }

  .drawer-top h2 {
    font-size: 42px;
  }

  .drawer-close {
    top: 15px;
    right: 15px;
  }

  .year-overlay {
    padding: 0;
  }

  .year-sheet {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: 19px 14px 30px;
    border-radius: 0;
  }

  .year-sheet-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .year-sheet-title h2 {
    font-size: 46px;
  }

  .year-sheet-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .year-help {
    margin-bottom: 14px;
  }

  .year-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .year-month {
    padding: 10px;
    border-radius: 14px;
  }

  .year-open {
    font-size: 21px;
  }

  .mini-weekdays span {
    font-size: 7px;
  }

  .mini-day {
    font-size: 8.5px;
  }

  .toast {
    bottom: 15px;
  }
}

/* En pantallas estrechas el año y el compartir ya están en la franja de meses y en
   la cabecera del mes; quitarlos del encabezado evita que las acciones desborden. */
@media (max-width: 600px) {
  .topbar-year,
  .topbar-share {
    display: none;
  }

  .icon-btn.mini {
    width: 30px;
    height: 30px;
  }

  .icon-btn.on-dark {
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 560px) {
  .topbar .btn .btn-label {
    display: none;
  }

  .topbar .btn {
    width: 38px;
    min-height: 38px;
    padding: 0;
    flex: none;
  }

  .brand-copy {
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .topbar-inner {
    padding: 0 13px;
  }

  .app-layout {
    padding: 12px 12px 32px;
  }

  .mobile-year {
    margin: 0 -12px 12px;
    padding: 8px 12px 6px;
  }

  .mobile-year-actions .text-link {
    font-size: 9.5px;
  }

  .month-title-line h1 {
    font-size: 46px;
  }

  .month-year {
    padding: 4px 8px;
    font-size: 8.5px;
  }

  .month-controls {
    gap: 5px;
  }

  .star-pill {
    height: 33px;
    padding: 0 9px;
    font-size: 9px;
  }

  .month-controls #monthTodayBtn {
    height: 33px;
    min-height: 33px;
    padding: 0 11px;
    font-size: 9.5px;
  }

  .month-controls .stepper {
    height: 33px;
  }

  .month-controls .stepper .icon-btn {
    width: 31px;
    height: 31px;
  }

  .calendar-card {
    border-radius: 16px;
  }

  .weekdays span {
    padding: 9px 4px;
    font-size: 7px;
    letter-spacing: 0.04em;
  }

  .day-cell {
    min-height: 73px;
    padding: 5px 5px 6px;
  }

  .day-number {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }

  .day-star {
    font-size: 8px;
  }

  .event-chip {
    width: 6px;
    height: 6px;
    min-height: 0;
    padding: 0;
    border-radius: 50%;
    background: var(--cat);
  }

  .event-chip .chip-dot,
  .event-chip .chip-time,
  .event-chip .chip-title {
    display: none;
  }

  .cell-events {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
  }

  .more-events {
    padding-left: 0;
    font-size: 7px;
  }

  .legend {
    gap: 4px 8px;
    font-size: 8px;
  }

  .brand-sub {
    display: none;
  }

  .brand-name {
    font-size: 24px;
  }

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

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

  .reminder-options {
    gap: 4px;
  }

  .reminder-option span {
    min-height: 29px;
    padding: 0 8px;
    font-size: 9px;
  }

  .event-modal {
    max-height: calc(100dvh - 16px);
    padding: 19px 15px;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

  .modal-actions .btn {
    font-size: 10px;
  }

  .action-spacer {
    display: none;
  }

  #deleteEventBtn {
    margin-right: auto;
  }

  .year-grid {
    gap: 7px;
  }

  .year-month {
    padding: 8px;
  }

  .mini-calendar,
  .mini-weekdays {
    gap: 1px;
  }

  .mini-day {
    font-size: 8px;
  }

  .mini-day.has-events::after {
    bottom: 0;
    width: 2px;
    height: 2px;
  }

  .toast {
    width: calc(100vw - 24px);
    max-width: 380px;
    padding: 9px 10px;
  }
}

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Account controls in the topbar */
.topbar-actions .theme-toggle {
  width: 38px;
  height: 38px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 15px;
}

.topbar-actions .theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 10px 0 4px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.profile-trigger:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.avatar-badge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #f17b65, #ca4530);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.profile-name {
  max-width: 92px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Welcome and access */
.auth-screen {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 30px;
}

.auth-brand {
  pointer-events: none;
}

.auth-theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 16px;
}

.auth-theme-toggle:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.auth-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 22px 28px 56px;
}

.welcome-panel {
  position: relative;
  width: min(680px, 100%);
  padding: 52px 54px 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: authRise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.welcome-panel::before {
  content: "";
  position: absolute;
  top: -210px;
  left: 50%;
  width: 520px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 86, 63, 0.13), rgba(226, 86, 63, 0) 70%);
  transform: translateX(-50%);
  pointer-events: none;
}

.welcome-panel::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -140px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(183, 136, 51, 0.1), rgba(183, 136, 51, 0) 70%);
  pointer-events: none;
}

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

.welcome-jelly {
  display: inline-grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin-bottom: 16px;
  border: 1px solid rgba(226, 86, 63, 0.14);
  border-radius: 22px;
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: 0 12px 28px rgba(226, 86, 63, 0.12);
  transform: rotate(-4deg);
}

.welcome-jelly svg {
  display: block;
  width: 44px;
  height: 44px;
}

.welcome-panel .eyebrow {
  margin-bottom: 14px;
  color: var(--muted);
}

.welcome-panel h1 {
  max-width: 570px;
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: clamp(46px, 6vw, 68px);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.98;
}

.welcome-panel h1 em {
  color: var(--accent);
  font-weight: 400;
}

.welcome-copy {
  max-width: 470px;
  margin: 17px auto 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: min(350px, 100%);
  margin: 29px auto 0;
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid #d8d4cb;
  border-radius: 14px;
  background: #fff;
  color: #1f1f22;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(23, 24, 28, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-google:hover {
  background: #fbfaf7;
  box-shadow: 0 11px 28px rgba(23, 24, 28, 0.12);
  transform: translateY(-1px);
}

.btn-google:active {
  transform: translateY(0);
}

.btn-google:disabled,
.welcome-register:disabled {
  opacity: 0.7;
  cursor: progress;
  transform: none;
  box-shadow: none;
}

.btn-google:disabled:hover {
  background: #fff;
  transform: none;
}

.google-g {
  width: 18px;
  height: 18px;
  flex: none;
}

.welcome-login {
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  font-size: 13px;
}

.welcome-login .icon {
  font-size: 14px;
}

.welcome-register {
  width: 100%;
  min-height: 45px;
  border-radius: 13px;
  font-size: 12px;
}

.welcome-register .icon {
  font-size: 13px;
  transition: transform 0.18s ease;
}

.welcome-register:hover .icon {
  transform: translateX(2px);
}

.welcome-restore {
  margin-top: 14px;
  color: var(--muted);
  font-size: 9.5px;
}

.welcome-restore:hover {
  color: var(--ink);
}

.welcome-restore .icon {
  color: var(--accent);
}

.welcome-restore:hover .icon {
  transform: translateY(-1px);
}

.welcome-feedback {
  max-width: 350px;
  margin: 13px auto 0;
  padding: 9px 12px;
  border: 1px solid rgba(226, 86, 63, 0.2);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--danger);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.55;
  text-align: left;
}

.welcome-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 430px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.55;
}

.welcome-mode-tag {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.4;
  text-transform: uppercase;
}

.welcome-mode:not([hidden]) + .welcome-foot {
  margin-top: 12px;
}

.welcome-foot {
  margin-top: 25px;
  color: var(--muted-soft);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.6;
}

.auth-flow-card {
  position: relative;
  width: min(466px, 100%);
  padding: 28px 32px 32px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: authRise 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.auth-back {
  margin: -2px 0 19px -3px;
  color: var(--muted);
  font-size: 10px;
}

.auth-back:hover {
  color: var(--ink);
}

.auth-back .icon {
  font-size: 12px;
}

.auth-step-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 17px;
  border: 1px solid rgba(226, 86, 63, 0.15);
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 21px;
}

.auth-step-icon.auth-step-google {
  border-color: var(--line);
  background: var(--surface-2);
}

.auth-step-google svg {
  display: block;
  width: 21px;
  height: 21px;
}

.auth-step h2 {
  margin: 5px 0 9px;
  font-family: var(--font-display);
  font-size: 41px;
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1;
}

.auth-step-copy {
  margin-bottom: 21px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.auth-step-copy strong {
  color: var(--ink-soft);
  font-weight: 700;
  overflow-wrap: anywhere;
}

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

.auth-form .field {
  gap: 6px;
}

.auth-form .text-input,
.profile-edit .text-input {
  min-height: 46px;
  background: var(--surface-2);
  font-size: 13px;
}

.auth-form .field-hint {
  font-size: 8.5px;
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 2px;
  border-radius: 13px;
  font-size: 12px;
}

.auth-demo-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.auth-demo-note .icon {
  margin-top: 1px;
  flex: none;
  color: var(--gold);
  font-size: 12px;
}

.auth-inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 17px;
}

.auth-inline-actions .text-link {
  font-size: 9.5px;
}

.auth-switch {
  margin-top: 17px;
  color: var(--muted);
  font-size: 9.5px;
  text-align: center;
}

.auth-switch .text-link {
  padding: 0;
  font-size: 9.5px;
}

.auth-switch.auth-forgot {
  margin-top: 8px;
}

.auth-code-input {
  padding-left: 0.35em;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.35em;
  text-align: center;
}

.auth-reset-send {
  width: 100%;
  min-height: 40px;
}

.auth-center-link {
  display: flex;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 9.5px;
}

.auth-center-link:hover {
  color: var(--accent-strong);
}

.auth-account-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.auth-avatar {
  width: 34px;
  height: 34px;
  font-size: 11px;
}

.auth-account-chip > span:not(.avatar-badge) {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.auth-account-chip strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-account-chip small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-chip-check {
  margin-left: auto;
  flex: none;
  color: var(--positive);
  font-size: 13px;
}

.password-wrap {
  position: relative;
}

.password-wrap .text-input {
  padding-right: 45px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  transform: translateY(-50%);
  transition: background 0.16s ease, color 0.16s ease;
}

.password-toggle:hover {
  background: var(--bg-deep);
  color: var(--ink);
}

.auth-code-input {
  min-height: 52px !important;
  padding-left: 0.36em;
  font-size: 22px !important;
  font-weight: 800 !important;
  letter-spacing: 0.36em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.demo-mail {
  margin-bottom: 16px;
  padding: 13px 14px;
  border: 1px dashed #dfcda2;
  border-radius: 14px;
  background: var(--gold-soft);
}

.demo-mail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 5px;
}

.demo-mail-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #7e6123;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.demo-mail-badge .icon {
  font-size: 11px;
}

.demo-mail-mode {
  padding: 2px 6px;
  border: 1px solid rgba(126, 97, 35, 0.2);
  border-radius: 999px;
  color: #7e6123;
  font-size: 7.5px;
  font-weight: 700;
  line-height: 1.4;
}

.demo-mail-subject {
  margin: 8px 0 9px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.4;
}

.demo-code-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.demo-code {
  color: #5f4714;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.demo-code-line .text-link {
  flex: none;
  padding: 3px 5px;
  color: #7e6123;
  font-size: 8.5px;
}

.demo-mail-foot {
  margin-top: 8px;
  color: #8a7440;
  font-size: 8px;
  line-height: 1.5;
}

.field-hint.username-status.is-ok,
.field-hint.is-ok {
  color: var(--positive);
}

.field-hint.username-status.is-error,
.field-hint.is-error {
  color: var(--danger);
}

.password-strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
}

.password-meter {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  flex: 1;
}

.password-meter span {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  transition: background 0.18s ease;
}

.password-meter[data-level="1"] span:nth-child(-n + 1) {
  background: var(--danger);
}

.password-meter[data-level="2"] span:nth-child(-n + 2) {
  background: var(--gold);
}

.password-meter[data-level="3"] span:nth-child(-n + 3) {
  background: var(--gold);
}

.password-meter[data-level="4"] span {
  background: var(--positive);
}

.password-strength-label {
  min-width: 72px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 600;
  line-height: 1.4;
  text-align: right;
}

.auth-requirements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.auth-requirements li {
  position: relative;
  padding-left: 12px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
  transition: color 0.16s ease;
}

.auth-requirements li::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.16s ease;
}

.auth-requirements li.is-met {
  color: var(--positive);
}

.auth-requirements li.is-met::before {
  background: var(--positive);
}

.auth-fine-print {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.55;
}

.auth-fine-print .icon {
  margin-top: 1px;
  flex: none;
  color: var(--positive);
  font-size: 11px;
}

.auth-fine-print.auth-warning {
  margin-top: 8px;
}

.auth-fine-print.auth-warning .icon {
  color: var(--gold);
}

.auth-error.is-success {
  color: var(--positive);
}

/* Profile */
.profile-overlay {
  z-index: 200;
}

.profile-modal {
  width: min(590px, 100%);
  max-height: calc(100dvh - 32px);
  padding: 26px 28px 28px;
  overflow: auto;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  transform: translateY(10px) scale(0.99);
  transition: transform 0.26s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.overlay.is-open .profile-modal {
  transform: none;
}

.profile-modal-head {
  margin-bottom: 16px;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-2);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 18px;
  background: linear-gradient(135deg, #f17b65, #ca4530);
  box-shadow: 0 10px 24px rgba(202, 69, 48, 0.24);
  color: #fff;
  font-family: var(--font-display);
  font-size: 27px;
  font-style: italic;
  line-height: 1;
}

.profile-identity-copy {
  min-width: 0;
}

.profile-identity-copy h3 {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-identity-copy p {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-badge {
  margin-left: auto;
  padding: 4px 8px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

.profile-facts {
  margin: 16px 0 0;
  padding: 0 3px;
}

.profile-fact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.profile-fact:last-child {
  border-bottom: 0;
}

.profile-fact dt {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.profile-fact dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.45;
  text-align: right;
  overflow-wrap: anywhere;
}

.profile-password-fact {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.password-mask {
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.14em;
  line-height: 1;
}

.profile-secure-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--positive-soft);
  color: var(--positive);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.4;
  text-transform: uppercase;
}

.profile-secure-tag .icon {
  font-size: 8px;
}

.profile-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 14px 2px 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
}

.profile-note .icon {
  margin-top: 1px;
  flex: none;
  color: var(--positive);
  font-size: 10px;
}

.profile-section {
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.profile-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.profile-section-head h3 {
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.profile-section-head span {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
  text-align: right;
}

.theme-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.theme-choices.render-choices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 560px) {
  .theme-choices.render-choices {
    grid-template-columns: 1fr;
  }
}

.theme-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.theme-choice .icon {
  font-size: 13px;
}

.theme-choice:hover {
  color: var(--ink);
}

.theme-choice[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-actions .btn {
  min-height: 38px;
  border-radius: 10px;
  font-size: 10px;
}

.profile-actions .btn .icon {
  font-size: 13px;
}

.profile-logout {
  margin-left: auto;
}

.profile-edit {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  animation: authRise 0.22s ease both;
}

.profile-edit .field {
  gap: 6px;
}

.profile-edit .field > label {
  font-size: 8px;
}

.profile-edit .text-input {
  min-height: 42px;
  font-size: 12px;
}

.profile-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.profile-edit-actions .btn {
  min-height: 37px;
  border-radius: 9px;
  font-size: 10px;
}

.profile-feedback {
  margin-top: 13px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--positive-soft);
  color: var(--positive);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
}

/* Encrypted backup */
.backup-overlay {
  z-index: 280;
}

.backup-modal {
  width: min(540px, 100%);
}

.backup-intro {
  margin: 0 2px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.6;
}

.backup-section {
  margin-top: 17px;
}

.backup-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.backup-modal .profile-edit {
  margin-top: 0;
}

.backup-file {
  padding: 8px 10px;
  font-size: 10.5px;
  cursor: pointer;
}

.backup-file::file-selector-button {
  margin-right: 10px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
}

.backup-file::file-selector-button:hover {
  border-color: var(--line-strong);
}

.backup-modal .profile-edit-actions .btn .icon {
  font-size: 12px;
}

@keyframes authRise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Responsive access and profile */
@media (max-width: 1100px) {
  .profile-name {
    display: none;
  }

  .profile-trigger {
    width: 38px;
    padding: 3px;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .auth-topbar {
    padding: 17px 18px;
  }

  .auth-stage {
    align-items: flex-start;
    padding: 14px 16px 38px;
  }

  .welcome-panel {
    padding: 39px 24px 30px;
    border-radius: 27px;
  }

  .welcome-jelly {
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    border-radius: 18px;
  }

  .welcome-jelly svg {
    width: 38px;
    height: 38px;
  }

  .welcome-panel h1 {
    font-size: clamp(40px, 11vw, 56px);
  }

  .welcome-copy {
    margin-top: 13px;
    font-size: 12.5px;
  }

  .welcome-actions {
    margin-top: 23px;
  }

  .welcome-foot {
    margin-top: 20px;
    font-size: 8.5px;
  }

  .auth-flow-card {
    padding: 24px 21px 26px;
    border-radius: 25px;
  }

  .auth-step h2 {
    font-size: 36px;
  }

  .auth-step-icon {
    width: 43px;
    height: 43px;
    border-radius: 13px;
    font-size: 18px;
  }

  .profile-overlay {
    padding: 0;
  }

  .backup-overlay {
    padding: 0;
  }

  .profile-modal {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: 22px 18px 30px;
    border-radius: 0;
  }

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

  .profile-identity {
    gap: 10px;
    padding: 12px;
  }

  .profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 15px;
    font-size: 23px;
  }

  .profile-identity-copy h3 {
    font-size: 23px;
  }

  .profile-badge {
    display: none;
  }

  .profile-fact {
    gap: 12px;
  }

  .profile-actions .btn {
    flex: 1 1 calc(50% - 3px);
  }

  .profile-logout {
    flex-basis: 100% !important;
    margin-left: 0;
  }

  .profile-actions .profile-logout {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .topbar-actions .theme-toggle {
    width: 38px;
    height: 38px;
  }

  .topbar .profile-trigger {
    width: 38px;
    height: 38px;
    padding: 4px;
  }

  .profile-trigger .avatar-badge {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 380px) {
  .auth-topbar {
    padding: 14px 13px;
  }

  .auth-stage {
    padding: 10px 11px 30px;
  }

  .welcome-panel {
    padding: 32px 17px 26px;
    border-radius: 23px;
  }

  .welcome-panel h1 {
    font-size: 39px;
  }

  .auth-flow-card {
    padding: 21px 17px 23px;
    border-radius: 22px;
  }

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

  .demo-code {
    font-size: 24px;
  }

  .welcome-foot {
    font-size: 8px;
  }
}

/* Dark theme */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131417;
  --bg-deep: #0e0f12;
  --surface: #1a1b20;
  --surface-2: #202127;
  --ink: #f3efe7;
  --ink-soft: #d4d0c6;
  --muted: #9a978f;
  --muted-soft: #6f6d67;
  --line: #2b2c33;
  --line-strong: #3b3c45;
  --accent: #f17963;
  --accent-strong: #ff9d89;
  --accent-soft: #35221f;
  --gold: #d2a44e;
  --gold-soft: #2e2718;
  --positive: #90b89c;
  --positive-soft: #1e2b23;
  --danger: #ff9785;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28), 0 16px 34px rgba(0, 0, 0, 0.26);
  --shadow-lg: 0 32px 90px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] ::selection {
  background: #6e392f;
  color: var(--ink);
}

[data-theme="dark"] .page-wash {
  background:
    radial-gradient(900px 520px at 96% -8%, rgba(226, 86, 63, 0.14), transparent 62%),
    radial-gradient(760px 480px at -8% 12%, rgba(183, 136, 51, 0.08), transparent 64%),
    radial-gradient(600px 420px at 55% 108%, rgba(95, 128, 105, 0.06), transparent 65%);
}

[data-theme="dark"] .cat-trabajo {
  --cat: #8fa9cf;
  --cat-soft: #202a39;
  --cat-ink: #c6d8ef;
}

[data-theme="dark"] .cat-personal {
  --cat: #ef8b75;
  --cat-soft: #36221e;
  --cat-ink: #ffc0b1;
}

[data-theme="dark"] .cat-celebracion {
  --cat: #d6ad5e;
  --cat-soft: #302819;
  --cat-ink: #ecd296;
}

[data-theme="dark"] .cat-bienestar {
  --cat: #87ae94;
  --cat-soft: #1f2d24;
  --cat-ink: #c0ddc9;
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-dark {
  border-color: #f1ece2;
  background: #f1ece2;
  color: #191a1f;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-dark:hover {
  border-color: #fffdf8;
  background: #fffdf8;
  color: #191a1f;
}

[data-theme="dark"] .btn-danger:hover {
  border-color: #4b2b26;
  background: rgba(255, 151, 133, 0.09);
}

[data-theme="dark"] .btn-google {
  border-color: #e8e4dc;
  background: #f8f7f4;
  color: #1f1f22;
}

[data-theme="dark"] .btn-google:hover {
  background: #ffffff;
}

[data-theme="dark"] .topbar {
  border-bottom-color: rgba(49, 50, 58, 0.8);
  background: rgba(19, 20, 23, 0.84);
}

[data-theme="dark"] .panel {
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.035) inset;
}

[data-theme="dark"] .year-map-row.is-current {
  background: #24252b;
}

[data-theme="dark"] .map-day {
  background: #27282e;
}

[data-theme="dark"] .map-day:hover {
  background: var(--line-strong);
}

[data-theme="dark"] .weekdays {
  background: #18191d;
}

[data-theme="dark"] .weekdays span:nth-child(6),
[data-theme="dark"] .weekdays span:nth-child(7) {
  color: #716e68;
}

[data-theme="dark"] .day-cell:hover {
  background: #1f2025;
}

[data-theme="dark"] .day-cell.is-weekend {
  background: #17181d;
}

[data-theme="dark"] .day-cell.is-weekend:hover {
  background: #1e1f24;
}

[data-theme="dark"] .day-cell.is-other {
  background: #15161a;
}

[data-theme="dark"] .day-cell.is-other:hover {
  background: #1b1c21;
}

[data-theme="dark"] .day-cell.is-today {
  background: #241e1b;
}

[data-theme="dark"] .star-pill:hover,
[data-theme="dark"] .star-pill.is-active {
  border-color: #4e3f25;
  background: var(--gold-soft);
  color: #e7cb91;
}

[data-theme="dark"] .today-card {
  border: 1px solid #2e2f37;
  background: linear-gradient(148deg, #27282f 0%, #101115 100%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .notification-state.is-on {
  border-color: #2f4436;
  background: var(--positive-soft);
  color: #add2b8;
}

[data-theme="dark"] .notification-state.is-blocked {
  border-color: #4d2d28;
  background: #2a1614;
  color: #ffb5a6;
}

[data-theme="dark"] .upcoming-item.is-today .up-date {
  border-color: var(--ink);
  background: var(--ink);
  color: #191a1f;
}

[data-theme="dark"] .upcoming-item.is-today .up-month {
  color: rgba(25, 26, 31, 0.6);
}

[data-theme="dark"] .important-month:hover {
  border-color: #4e3f25;
  background: var(--gold-soft);
}

[data-theme="dark"] .imp-day {
  border-color: #4b3d24;
  background: var(--gold-soft);
  color: #e5c98f;
}

[data-theme="dark"] .imp-day:hover {
  background: #3a311e;
}

[data-theme="dark"] .overlay {
  background: rgba(5, 6, 8, 0.64);
}

[data-theme="dark"] .year-month.is-important {
  border-color: #4a3c22;
  background: linear-gradient(180deg, #221f17, var(--surface));
}

[data-theme="dark"] .year-star {
  color: #5d5a53;
}

[data-theme="dark"] .mini-day.is-today {
  background: var(--ink);
  color: #191a1f;
}

[data-theme="dark"] .text-input {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

[data-theme="dark"] .text-input::placeholder {
  color: var(--muted-soft);
}

[data-theme="dark"] .text-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(243, 239, 231, 0.08);
}

[data-theme="dark"] input[type="date"].text-input,
[data-theme="dark"] input[type="time"].text-input {
  color-scheme: dark;
}

[data-theme="dark"] .field-error {
  color: #ff9d8b;
}

[data-theme="dark"] .cat-option {
  border-color: var(--line);
  background: var(--surface-2);
}

[data-theme="dark"] .switch-line {
  border-color: var(--line);
  background: var(--surface-2);
}

[data-theme="dark"] .switch-track {
  background: #3b3c44;
}

[data-theme="dark"] .switch-thumb {
  background: #e8e4da;
}

[data-theme="dark"] .switch input:checked + .switch-track {
  background: var(--ink);
}

[data-theme="dark"] .switch input:checked + .switch-track .switch-thumb {
  background: #191a1f;
}

[data-theme="dark"] .reminder-option span {
  border-color: var(--line);
  background: var(--surface-2);
}

[data-theme="dark"] .reminder-option input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: #191a1f;
}

[data-theme="dark"] .day-event {
  background: var(--surface-2);
}

[data-theme="dark"] .day-event-chevron {
  color: #6d6a63;
}

[data-theme="dark"] .day-flag:hover {
  border-color: #4e3f25;
}

[data-theme="dark"] .day-flag.is-active {
  border-color: #4e3f25;
  background: var(--gold-soft);
  color: #e5c98f;
}

[data-theme="dark"] .strip-month.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #191a1f;
}

[data-theme="dark"] .strip-month.is-active .strip-meta {
  color: rgba(25, 26, 31, 0.6);
}

[data-theme="dark"] .mobile-year {
  border-bottom-color: rgba(49, 50, 58, 0.8);
  background: rgba(19, 20, 23, 0.92);
}

[data-theme="dark"] .toast {
  border-color: #383941;
  background: #26272e;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  color: #f6f2e9;
}

[data-theme="dark"] .theme-choice[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #191a1f;
}

[data-theme="dark"] .profile-secure-tag {
  background: var(--positive-soft);
  color: #b1d1bb;
}

[data-theme="dark"] .welcome-panel::before {
  background: radial-gradient(circle, rgba(241, 121, 99, 0.16), rgba(241, 121, 99, 0) 70%);
}

[data-theme="dark"] .welcome-jelly {
  border-color: #4c2d27;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .demo-mail {
  border-color: #4b3d24;
}

[data-theme="dark"] .demo-mail-badge,
[data-theme="dark"] .demo-mail-mode,
[data-theme="dark"] .demo-code-line .text-link {
  color: #e1c181;
}

[data-theme="dark"] .demo-mail-mode {
  border-color: rgba(225, 193, 129, 0.24);
}

[data-theme="dark"] .demo-code {
  color: #f0d69e;
}

[data-theme="dark"] .demo-mail-foot {
  color: #b9a16d;
}

[data-theme="dark"] .password-toggle:hover {
  background: #2c2d34;
}

[data-theme="dark"] .profile-feedback {
  color: var(--positive);
}

/* ---------- History, recurrence and series ---------- */

.history-controls {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.history-btn {
  width: 29px;
  height: 29px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 14px;
}

.history-btn:not(:disabled):hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.history-btn:disabled {
  opacity: 0.38;
}

.history-btn .icon {
  stroke-width: 1.9;
}

.topbar-share {
  gap: 6px;
}

.month-share {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 14px;
}

.month-share:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
}

.recurrence-field {
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.recurrence-grid .field {
  gap: 5px;
}

select.text-input {
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none' stroke='%23827c72' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 11px 8px;
  cursor: pointer;
}

.weekday-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 3px;
}

.weekday-options {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.weekday-options label {
  position: relative;
  display: block;
}

.weekday-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-options span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.weekday-options span:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.weekday-options input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.weekday-options input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.series-scope {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--gold-soft);
}

.series-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.series-option {
  position: relative;
}

.series-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.series-option span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 58px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.series-option strong {
  color: var(--ink);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.3;
}

.series-option small {
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.series-option input:checked + span {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.series-option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#seriesScopeHint {
  color: var(--ink-soft);
}

.btn.btn-danger-quiet {
  padding: 0 10px;
  border-color: var(--line);
  background: transparent;
  color: var(--danger);
  font-size: 10px;
}

.btn.btn-danger-quiet:hover {
  border-color: #e5c0b6;
  background: #fbefec;
}

#deleteSeriesBtn {
  min-height: 36px;
}

.drawer-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-top: 17px;
}

.drawer-actions .btn {
  min-height: 42px;
}

.drawer-actions .drawer-add {
  width: auto;
  margin-top: 0;
}

/* ---------- Share panel ---------- */

.share-overlay {
  z-index: 260;
  padding: 16px;
}

.share-modal {
  width: min(1000px, 100%);
  max-height: calc(100dvh - 32px);
  padding: 22px 24px 24px;
  overflow: auto;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  transform: translateY(10px) scale(0.99);
  transition: transform 0.26s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.overlay.is-open .share-modal {
  transform: none;
}

.share-modal-head {
  margin-bottom: 16px;
}

.share-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 368px;
  align-items: start;
  gap: 20px;
}

.share-preview-frame {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-deep);
}

.share-preview {
  display: flex;
  justify-content: center;
  width: 100%;
}

.share-preview svg {
  display: block;
  width: auto;
  max-width: 100%;
  height: min(68vh, 760px);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.share-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 13px;
}

.share-scope {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.share-scope-btn {
  min-height: 34px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.share-scope-btn:hover {
  color: var(--ink);
}

.share-scope-btn.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.share-period {
  display: flex;
  align-items: center;
  gap: 6px;
}

.share-period .icon-btn {
  flex: none;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 14px;
}

.share-period-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.share-period-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-period-copy span {
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.4;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.share-actions .btn {
  min-height: 39px;
  border-radius: 10px;
  font-size: 10px;
}

.share-actions #shareCopyImage,
.share-actions #shareNative {
  grid-column: 1 / -1;
}

.share-text-details {
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.share-text-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.share-text-details summary::-webkit-details-marker {
  display: none;
}

.share-text-details summary::after {
  content: "+";
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.share-text-details[open] summary::after {
  content: "–";
}

.share-text-details pre {
  max-height: 180px;
  margin: 0 -3px 11px;
  padding: 10px;
  overflow: auto;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 9.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
}

.share-note {
  display: flex;
  gap: 7px;
  color: var(--muted);
  font-size: 8.5px;
  line-height: 1.5;
}

.share-note .icon {
  flex: none;
  margin-top: 1px;
  color: var(--positive);
  font-size: 11px;
}

/* ---------- Appearance designer ---------- */

.design-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 15px 0 8px;
}

.design-heading h4 {
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.design-heading span {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.4;
  text-align: right;
}

.design-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.design-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--ink-soft);
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.design-choice:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.design-choice[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.design-swatch {
  position: relative;
  width: 34px;
  height: 34px;
  flex: none;
  overflow: hidden;
  border: 1px solid rgba(23, 24, 28, 0.14);
  border-radius: 8px;
}

.design-swatch i,
.design-swatch b {
  position: absolute;
  display: block;
  font-style: normal;
}

.design-swatch-default {
  background: linear-gradient(135deg, #fffefa 44%, #efe9db 100%);
}

.design-swatch-default i {
  top: 8px;
  left: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #e2563f;
}

.design-swatch-default b {
  right: 6px;
  bottom: 6px;
  width: 12px;
  height: 2px;
  background: #17181c;
  box-shadow: 0 -4px 0 rgba(23, 24, 28, 0.35);
}

.design-swatch-victoriana {
  border-color: #b89354;
  background: linear-gradient(135deg, #5d2722, #2b1712);
}

.design-swatch-victoriana i {
  inset: 5px;
  border: 1px solid #c9a061;
}

.design-swatch-victoriana b {
  top: 14px;
  left: 14px;
  width: 6px;
  height: 6px;
  border: 1px solid #e2c489;
  transform: rotate(45deg);
}

.design-swatch-futurista {
  border-color: #1d4550;
  background: #071319;
}

.design-swatch-futurista i {
  inset: 0;
  background-image: linear-gradient(rgba(34, 211, 238, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.18) 1px, transparent 1px);
  background-size: 8px 8px;
}

.design-swatch-futurista b {
  right: 5px;
  bottom: 7px;
  width: 18px;
  height: 2px;
  background: #22d3ee;
  box-shadow: 0 0 8px #22d3ee;
}

.design-swatch-ajedrez {
  border-color: #1f4d3a;
  background: conic-gradient(#1f4d3a 0 25%, #f2ecdd 0 50%, #1f4d3a 0 75%, #f2ecdd 0) 0 0 / 14px 14px;
}

.design-swatch-ajedrez i {
  top: 9px;
  left: 9px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(240, 232, 214, 0.92);
}

.design-swatch-ajedrez b {
  top: 16px;
  left: 16px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #b08a3e;
}

.design-choice-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 1px;
}

.design-choice-copy strong {
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.3;
}

.design-choice-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Design: shared surfaces ---------- */

:root[data-design] .page-wash {
  overflow: hidden;
}

:root[data-design] .topbar {
  border-bottom-color: var(--line);
  background: var(--topbar-bg);
}

:root[data-design] .mobile-year {
  border-bottom-color: var(--line);
  background: var(--mobile-bg);
}

:root[data-design] .text-input,
:root[data-design] .switch-line,
:root[data-design] .cat-option,
:root[data-design] .reminder-option span,
:root[data-design] .day-event {
  background: var(--field-bg);
}

:root[data-design] .text-input::placeholder {
  color: var(--muted-soft);
}

:root[data-design] .weekdays {
  background: var(--surface-alt);
}

:root[data-design] .day-cell {
  background: var(--surface);
}

:root[data-design] .day-cell:hover {
  background: var(--hover-bg);
}

:root[data-design] .day-cell.is-weekend {
  background: var(--surface-alt);
}

:root[data-design] .day-cell.is-weekend:hover {
  background: var(--hover-bg);
}

:root[data-design] .day-cell.is-other {
  background: var(--surface-other);
}

:root[data-design] .day-cell.is-other:hover {
  background: var(--hover-bg);
}

:root[data-design] .day-cell.is-today {
  background: var(--today-bg);
}

:root[data-design] .year-map-row.is-current {
  background: var(--surface-2);
}

:root[data-design] .map-day {
  background: var(--line);
}

:root[data-design] .today-card {
  background: linear-gradient(150deg, var(--today-grad-a), var(--today-grad-b));
}

:root[data-design] .today-card::after {
  background: radial-gradient(circle, var(--accent) 0%, transparent 68%);
  opacity: 0.48;
}

:root[data-design] .star-pill:hover,
:root[data-design] .star-pill.is-active {
  border-color: var(--line-strong);
  background: var(--gold-soft);
  color: var(--ink);
}

:root[data-design] .day-flag:hover {
  border-color: var(--line-strong);
}

:root[data-design] .day-flag.is-active {
  border-color: var(--line-strong);
  background: var(--gold-soft);
  color: var(--ink);
}

:root[data-design] .year-map-row.is-current .map-month {
  color: var(--ink);
}

:root[data-design] .chip-dot,
:root[data-design] .legend-dot {
  border-radius: 1px;
}

:root[data-design] .brand-mark svg rect {
  fill: var(--brand-bg);
}

:root[data-design] .brand-mark svg path {
  fill: var(--brand-jelly);
}

:root[data-design] .brand-mark svg ellipse {
  fill: var(--brand-shine);
}

:root[data-design] .brand-name {
  font-style: normal;
}

:root[data-design] .btn,
:root[data-design] .icon-btn,
:root[data-design] .text-input,
:root[data-design] .stepper,
:root[data-design] .month-year,
:root[data-design] .star-pill,
:root[data-design] .day-flag,
:root[data-design] .empty-day,
:root[data-design] .day-event,
:root[data-design] .share-scope,
:root[data-design] .share-scope-btn,
:root[data-design] .share-period .icon-btn,
:root[data-design] .share-text-details,
:root[data-design] .series-scope,
:root[data-design] .series-option span,
:root[data-design] .recurrence-field,
:root[data-design] .weekday-options span,
:root[data-design] .design-choice {
  border-radius: 3px;
}

:root[data-design] .weekday-options span,
:root[data-design] .history-controls,
:root[data-design] .history-btn {
  border-radius: 2px;
}

/* ---------- Design: Victoriana ---------- */

:root[data-design="victoriana"] {
  --bg: #f1e9da;
  --bg-deep: #e7dbc5;
  --surface: #fcf7ec;
  --surface-2: #f6eee0;
  --surface-alt: #f7efe1;
  --surface-other: #ece2cf;
  --hover-bg: #f7eddd;
  --today-bg: #f8e9dc;
  --field-bg: #fdf9f1;
  --ink: #2e2319;
  --ink-soft: #4d3c2b;
  --muted: #7f6b55;
  --muted-soft: #ab987f;
  --line: #ddcfb8;
  --line-strong: #c8b28e;
  --accent: #7a2f29;
  --accent-strong: #5e211c;
  --accent-soft: #f1ded7;
  --gold: #9a7834;
  --gold-soft: #efe2c3;
  --positive: #596e57;
  --positive-soft: #edf0e3;
  --danger: #862f24;
  --font-ui: "Lora", Georgia, serif;
  --font-display: "Cinzel", Georgia, serif;
  --radius-xl: 5px;
  --radius-lg: 4px;
  --radius-md: 3px;
  --radius-sm: 2px;
  --shadow-sm: 0 1px 0 rgba(73, 52, 27, 0.08), 0 16px 32px rgba(73, 52, 27, 0.08);
  --shadow-lg: 0 32px 90px rgba(43, 28, 14, 0.4);
  --topbar-bg: rgba(241, 233, 218, 0.88);
  --mobile-bg: rgba(241, 233, 218, 0.95);
  --today-grad-a: #5e2a24;
  --today-grad-b: #281a11;
  --brand-bg: #2b1c13;
  --brand-jelly: #c9a061;
  --brand-shine: #f6e9d0;
}

:root[data-design="victoriana"] .page-wash {
  background: radial-gradient(900px 520px at 96% -8%, rgba(122, 47, 41, 0.1), transparent 62%),
    radial-gradient(760px 480px at -8% 12%, rgba(154, 120, 52, 0.12), transparent 64%),
    radial-gradient(600px 420px at 55% 108%, rgba(89, 110, 87, 0.06), transparent 65%),
    repeating-linear-gradient(114deg, rgba(91, 63, 31, 0.022) 0 1px, transparent 1px 8px);
}

:root[data-design="victoriana"] .page-wash::before,
:root[data-design="victoriana"] .page-wash::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background-color: var(--gold);
  -webkit-mask-image: url("assets/ornament-victoriana.svg");
  mask-image: url("assets/ornament-victoriana.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

:root[data-design="victoriana"] .page-wash::before {
  top: -64px;
  right: -46px;
  width: min(420px, 42vw);
  aspect-ratio: 1;
  opacity: 0.4;
  transform: scaleX(-1);
}

:root[data-design="victoriana"] .page-wash::after {
  bottom: -78px;
  left: -54px;
  width: min(350px, 34vw);
  aspect-ratio: 1;
  opacity: 0.26;
}

:root[data-design="victoriana"] .brand-name {
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

:root[data-design="victoriana"] .brand-sub {
  color: var(--gold);
  letter-spacing: 0.24em;
}

:root[data-design="victoriana"] .eyebrow {
  color: var(--gold);
  letter-spacing: 0.24em;
}

:root[data-design="victoriana"] .month-title-line h1 {
  font-size: clamp(42px, 4.2vw, 60px);
  font-weight: 500;
  letter-spacing: 0.012em;
}

:root[data-design="victoriana"] .month-year {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--gold);
  letter-spacing: 0.18em;
}

:root[data-design="victoriana"] .btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fdf6e8;
  box-shadow: 0 6px 16px rgba(94, 33, 28, 0.22);
}

:root[data-design="victoriana"] .btn-primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

:root[data-design="victoriana"] .btn:not(.btn-primary):not(.btn-danger):not(.btn-danger-quiet):hover {
  background: var(--surface-2);
}

:root[data-design="victoriana"] .icon-btn {
  border-radius: 2px;
}

:root[data-design="victoriana"] .calendar-card {
  border-color: var(--line-strong);
  border-radius: 3px;
  box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--line), var(--shadow-sm);
}

:root[data-design="victoriana"] .weekdays {
  border-bottom-color: var(--line-strong);
  background: var(--surface-alt);
}

:root[data-design="victoriana"] .weekdays span {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.18em;
}

:root[data-design="victoriana"] .weekdays span:nth-child(6),
:root[data-design="victoriana"] .weekdays span:nth-child(7) {
  color: var(--accent);
}

:root[data-design="victoriana"] .day-number {
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 500;
}

:root[data-design="victoriana"] .day-cell.is-today .day-number {
  background: var(--accent);
  box-shadow: 0 2px 0 var(--gold);
}

:root[data-design="victoriana"] .day-cell.is-today .day-number::after {
  content: "";
}

:root[data-design="victoriana"] .event-chip {
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--font-ui);
}

:root[data-design="victoriana"] .chip-dot {
  transform: rotate(45deg);
}

:root[data-design="victoriana"] .day-cell.is-today {
  background: var(--today-bg);
}

:root[data-design="victoriana"] .month-controls #monthTodayBtn,
:root[data-design="victoriana"] .month-controls .stepper,
:root[data-design="victoriana"] .month-share {
  border-radius: 2px;
}

:root[data-design="victoriana"] .today-card {
  border: 1px solid var(--gold);
  border-radius: 3px;
  box-shadow: inset 0 0 0 4px rgba(201, 160, 97, 0.16), 0 20px 44px rgba(43, 28, 14, 0.24);
}

:root[data-design="victoriana"] .today-card::before {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -38px;
  width: 170px;
  height: 170px;
  opacity: 0.32;
  background-color: var(--gold);
  -webkit-mask-image: url("assets/ornament-victoriana.svg");
  mask-image: url("assets/ornament-victoriana.svg");
  -webkit-mask-size: contain;
  mask-size: contain;
  transform: rotate(180deg);
  pointer-events: none;
}

:root[data-design="victoriana"] .panel,
:root[data-design="victoriana"] .year-rail {
  border-color: var(--line-strong);
  border-radius: 4px;
}

:root[data-design="victoriana"] .year-rail {
  box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--line), var(--shadow-sm);
}

:root[data-design="victoriana"] .event-modal,
:root[data-design="victoriana"] .profile-modal,
:root[data-design="victoriana"] .share-modal {
  border: 1px solid var(--gold);
  border-radius: 5px;
  box-shadow: inset 0 0 0 5px var(--surface), inset 0 0 0 6px var(--line), var(--shadow-lg);
}

:root[data-design="victoriana"] .share-modal {
  padding: 27px 28px 28px;
}

:root[data-design="victoriana"] .share-scope {
  border-color: var(--line-strong);
}

:root[data-design="victoriana"] .share-scope-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdf6e8;
}

:root[data-design="victoriana"] .share-preview-frame {
  border-color: var(--line-strong);
  border-radius: 3px;
}

:root[data-design="victoriana"] .share-preview svg {
  border-radius: 2px;
}

:root[data-design="victoriana"] .share-period-copy strong {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.01em;
}

:root[data-design="victoriana"] .history-controls {
  background: var(--surface);
}

:root[data-design="victoriana"] .recurrence-field,
:root[data-design="victoriana"] .series-scope {
  border-color: var(--line-strong);
}

:root[data-design="victoriana"] .toast {
  border-color: var(--gold);
  border-radius: 3px;
  background: #2a1c12;
}

:root[data-design="victoriana"] .design-choice[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ---------- Design: Futurista ---------- */

:root[data-design="futurista"] {
  --bg: #e9f1f4;
  --bg-deep: #dbe8ed;
  --surface: #faffff;
  --surface-2: #eff7f9;
  --surface-alt: #e5eff3;
  --surface-other: #dce8ec;
  --hover-bg: #ecf7fa;
  --today-bg: #dff5f9;
  --field-bg: #f4fbfc;
  --ink: #0a1c25;
  --ink-soft: #24414e;
  --muted: #617c88;
  --muted-soft: #93acb5;
  --line: #cddfe5;
  --line-strong: #a9c8d2;
  --accent: #07869c;
  --accent-strong: #046a7d;
  --accent-soft: #d9f3f8;
  --gold: #b17c16;
  --gold-soft: #f3e9cf;
  --positive: #467c6d;
  --positive-soft: #e2f1ec;
  --danger: #b0432e;
  --font-ui: "Rajdhani", "Segoe UI", sans-serif;
  --font-display: "Orbitron", "Segoe UI", sans-serif;
  --radius-xl: 2px;
  --radius-lg: 2px;
  --radius-md: 2px;
  --radius-sm: 2px;
  --shadow-sm: 0 0 0 1px rgba(7, 134, 156, 0.06), 0 18px 36px rgba(10, 28, 37, 0.1);
  --shadow-lg: 0 30px 90px rgba(4, 24, 32, 0.38);
  --topbar-bg: rgba(233, 241, 244, 0.86);
  --mobile-bg: rgba(233, 241, 244, 0.95);
  --today-grad-a: #0a3944;
  --today-grad-b: #04141b;
  --brand-bg: #061a22;
  --brand-jelly: #22d3ee;
  --brand-shine: #c9f8ff;
}

:root[data-design="futurista"] .page-wash {
  background: radial-gradient(880px 520px at 96% -8%, rgba(7, 134, 156, 0.15), transparent 62%),
    radial-gradient(700px 460px at -8% 18%, rgba(34, 211, 238, 0.1), transparent 64%),
    linear-gradient(rgba(10, 61, 72, 0.045) 1px, transparent 1px) 0 0 / 46px 46px,
    linear-gradient(90deg, rgba(10, 61, 72, 0.045) 1px, transparent 1px) 0 0 / 46px 46px;
}

:root[data-design="futurista"] .page-wash::before,
:root[data-design="futurista"] .page-wash::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background-color: var(--accent);
  -webkit-mask-image: url("assets/ornament-futurista.svg");
  mask-image: url("assets/ornament-futurista.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

:root[data-design="futurista"] .page-wash::before {
  top: -54px;
  right: -44px;
  width: min(400px, 40vw);
  aspect-ratio: 1;
  opacity: 0.38;
  transform: scaleX(-1);
}

:root[data-design="futurista"] .page-wash::after {
  bottom: -64px;
  left: -48px;
  width: min(330px, 33vw);
  aspect-ratio: 1;
  opacity: 0.24;
  transform: scaleY(-1);
}

:root[data-design="futurista"] .brand-name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

:root[data-design="futurista"] .brand-sub {
  color: var(--accent);
  letter-spacing: 0.3em;
}

:root[data-design="futurista"] .eyebrow {
  color: var(--accent-strong);
  letter-spacing: 0.3em;
}

:root[data-design="futurista"] .month-title-line h1 {
  font-size: clamp(33px, 3.4vw, 50px);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

:root[data-design="futurista"] .month-year {
  border-color: var(--line-strong);
  color: var(--accent-strong);
  font-family: var(--font-display);
  font-size: 8px;
  letter-spacing: 0.2em;
}

:root[data-design="futurista"] .btn {
  letter-spacing: 0.04em;
}

:root[data-design="futurista"] .btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #021418;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  box-shadow: 0 0 20px rgba(7, 134, 156, 0.28);
}

:root[data-design="futurista"] .btn-primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #f2ffff;
}

:root[data-design="futurista"] .icon-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

:root[data-design="futurista"] .calendar-card {
  position: relative;
  border-color: var(--line-strong);
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(7, 134, 156, 0.16), 0 22px 54px rgba(5, 24, 32, 0.16);
}

:root[data-design="futurista"] .calendar-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 4;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.9;
  pointer-events: none;
}

:root[data-design="futurista"] .weekdays {
  border-bottom-color: var(--line-strong);
}

:root[data-design="futurista"] .weekdays span {
  color: var(--accent-strong);
  font-family: var(--font-ui);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.26em;
}

:root[data-design="futurista"] .weekdays span:nth-child(6),
:root[data-design="futurista"] .weekdays span:nth-child(7) {
  color: var(--gold);
}

:root[data-design="futurista"] .day-number {
  border-radius: 1px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 500;
}

:root[data-design="futurista"] .day-cell.is-today .day-number {
  background: var(--accent);
  color: #021418;
  box-shadow: 0 0 14px rgba(7, 134, 156, 0.45);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
}

:root[data-design="futurista"] .day-star {
  color: var(--accent);
  filter: drop-shadow(0 0 4px rgba(7, 134, 156, 0.5));
}

:root[data-design="futurista"] .event-chip {
  border-left: 2px solid var(--cat);
  border-radius: 1px;
  font-family: var(--font-ui);
  font-weight: 600;
}

:root[data-design="futurista"] .star-pill .icon,
:root[data-design="futurista"] .title-star .icon,
:root[data-design="futurista"] .day-flag .icon {
  filter: drop-shadow(0 0 4px rgba(7, 134, 156, 0.45));
}

:root[data-design="futurista"] .month-controls .stepper,
:root[data-design="futurista"] .month-controls #monthTodayBtn,
:root[data-design="futurista"] .month-share,
:root[data-design="futurista"] .star-pill {
  border-radius: 2px;
}

:root[data-design="futurista"] .today-card {
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 2px;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
  box-shadow: 0 20px 48px rgba(5, 24, 32, 0.22);
}

:root[data-design="futurista"] .today-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(34, 211, 238, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

:root[data-design="futurista"] .panel {
  position: relative;
  border-color: var(--line-strong);
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px transparent, var(--shadow-sm);
}

:root[data-design="futurista"] .panel::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 22px;
  height: 2px;
  background: var(--accent);
}

:root[data-design="futurista"] .year-rail {
  border-color: var(--line-strong);
  border-radius: 2px;
}

:root[data-design="futurista"] .event-modal,
:root[data-design="futurista"] .profile-modal,
:root[data-design="futurista"] .share-modal {
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

:root[data-design="futurista"] .share-modal {
  padding: 25px 26px 27px;
}

:root[data-design="futurista"] .share-modal-head h2,
:root[data-design="futurista"] .modal-head h2 {
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

:root[data-design="futurista"] .share-scope {
  border-color: var(--line-strong);
}

:root[data-design="futurista"] .share-scope-btn.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #021418;
}

:root[data-design="futurista"] .share-period-copy strong {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

:root[data-design="futurista"] .share-period .icon-btn,
:root[data-design="futurista"] .share-preview-frame {
  border-color: var(--line-strong);
  border-radius: 2px;
}

:root[data-design="futurista"] .share-preview svg {
  border-radius: 1px;
}

:root[data-design="futurista"] .share-actions .btn,
:root[data-design="futurista"] .share-text-details {
  border-radius: 2px;
}

:root[data-design="futurista"] .recurrence-field,
:root[data-design="futurista"] .series-scope,
:root[data-design="futurista"] .series-option span,
:root[data-design="futurista"] .weekday-options span {
  border-radius: 1px;
}

:root[data-design="futurista"] .toast {
  border-color: var(--accent);
  border-radius: 2px;
  background: #04151c;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.2), 0 18px 40px rgba(0, 0, 0, 0.35);
}

/* ---------- Design: Ajedrez ---------- */

:root[data-design="ajedrez"] {
  --bg: #f1ece1;
  --bg-deep: #e7e0d1;
  --surface: #fbf8f0;
  --surface-2: #f5f0e4;
  --surface-alt: #f7f2e7;
  --surface-other: #eae3d2;
  --hover-bg: #f4eee0;
  --today-bg: #edf2e9;
  --field-bg: #faf6ec;
  --ink: #1c241f;
  --ink-soft: #38463c;
  --muted: #6e7a70;
  --muted-soft: #a3ab9f;
  --line: #dad3c2;
  --line-strong: #c2b99f;
  --accent: #1f4d3a;
  --accent-strong: #153a2b;
  --accent-soft: #e4ece2;
  --gold: #a67f36;
  --gold-soft: #f1e6ca;
  --positive: #4f7259;
  --positive-soft: #e8efe5;
  --danger: #99402c;
  --font-ui: "Lora", Georgia, serif;
  --font-display: "Playfair Display", "Instrument Serif", Georgia, serif;
  --radius-xl: 4px;
  --radius-lg: 3px;
  --radius-md: 3px;
  --radius-sm: 2px;
  --shadow-sm: 0 1px 0 rgba(28, 36, 31, 0.06), 0 16px 32px rgba(28, 36, 31, 0.07);
  --shadow-lg: 0 30px 86px rgba(14, 22, 17, 0.36);
  --topbar-bg: rgba(241, 236, 225, 0.88);
  --mobile-bg: rgba(241, 236, 225, 0.95);
  --today-grad-a: #24402f;
  --today-grad-b: #101b14;
  --brand-bg: #13251b;
  --brand-jelly: #d9bd84;
  --brand-shine: #f6eedb;
}

:root[data-design="ajedrez"] .page-wash {
  background: radial-gradient(900px 520px at 96% -8%, rgba(31, 77, 58, 0.08), transparent 62%),
    radial-gradient(720px 460px at -6% 16%, rgba(166, 127, 54, 0.1), transparent 64%),
    linear-gradient(45deg, rgba(31, 77, 58, 0.035) 25%, transparent 25%, transparent 75%, rgba(31, 77, 58, 0.035) 75%) 0 0 / 92px 92px,
    linear-gradient(45deg, rgba(31, 77, 58, 0.035) 25%, transparent 25%, transparent 75%, rgba(31, 77, 58, 0.035) 75%) 46px 46px / 92px 92px;
}

:root[data-design="ajedrez"] .page-wash::before,
:root[data-design="ajedrez"] .page-wash::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background-color: var(--gold);
  -webkit-mask-image: url("assets/ornament-ajedrez.svg");
  mask-image: url("assets/ornament-ajedrez.svg");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

:root[data-design="ajedrez"] .page-wash::before {
  top: -56px;
  right: -50px;
  width: min(390px, 39vw);
  aspect-ratio: 1;
  opacity: 0.34;
  transform: scaleX(-1);
}

:root[data-design="ajedrez"] .page-wash::after {
  bottom: -68px;
  left: -54px;
  width: min(330px, 33vw);
  aspect-ratio: 1;
  opacity: 0.22;
  transform: scaleY(-1);
}

:root[data-design="ajedrez"] .brand-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 29px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

:root[data-design="ajedrez"] .brand-sub {
  color: var(--gold);
  letter-spacing: 0.24em;
}

:root[data-design="ajedrez"] .eyebrow {
  color: var(--gold);
  letter-spacing: 0.2em;
}

:root[data-design="ajedrez"] .month-title-line h1 {
  font-size: clamp(44px, 4.5vw, 64px);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.015em;
}

:root[data-design="ajedrez"] .month-year {
  border-color: var(--line-strong);
  color: var(--gold);
  letter-spacing: 0.16em;
}

:root[data-design="ajedrez"] .btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #f7f2e6;
  box-shadow: 0 6px 16px rgba(21, 58, 43, 0.22);
}

:root[data-design="ajedrez"] .btn-primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

:root[data-design="ajedrez"] .calendar-card {
  position: relative;
  border-color: var(--line-strong);
  border-radius: 3px;
  box-shadow: 0 0 0 1px var(--line), 0 20px 44px rgba(28, 36, 31, 0.08);
}

:root[data-design="ajedrez"] .calendar-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 4;
  height: 5px;
  background: conic-gradient(var(--accent) 0 25%, var(--surface) 0 50%, var(--accent) 0 75%, var(--surface) 0) 0 0 / 12px 12px;
  opacity: 0.85;
  pointer-events: none;
}

:root[data-design="ajedrez"] .weekdays {
  border-bottom-color: var(--line-strong);
  background: var(--surface-alt);
}

:root[data-design="ajedrez"] .weekdays span {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 9px;
  font-style: italic;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: none;
}

:root[data-design="ajedrez"] .weekdays span:nth-child(6),
:root[data-design="ajedrez"] .weekdays span:nth-child(7) {
  color: var(--gold);
}

:root[data-design="ajedrez"] .day-number {
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
}

:root[data-design="ajedrez"] .day-cell.is-today .day-number {
  background: var(--accent);
  box-shadow: 0 2px 0 var(--gold);
}

:root[data-design="ajedrez"] .event-chip {
  border-radius: 2px;
  font-family: var(--font-ui);
}

:root[data-design="ajedrez"] .month-controls #monthTodayBtn,
:root[data-design="ajedrez"] .month-controls .stepper,
:root[data-design="ajedrez"] .month-share {
  border-radius: 2px;
}

:root[data-design="ajedrez"] .today-card {
  border: 1px solid rgba(217, 189, 132, 0.35);
  border-radius: 3px;
  background-color: var(--today-grad-b);
  background-image: linear-gradient(150deg, rgba(36, 64, 47, 0.92), rgba(16, 27, 20, 0.98)),
    linear-gradient(45deg, rgba(217, 189, 132, 0.09) 25%, transparent 25%, transparent 75%, rgba(217, 189, 132, 0.09) 75%),
    linear-gradient(45deg, rgba(217, 189, 132, 0.09) 25%, transparent 25%, transparent 75%, rgba(217, 189, 132, 0.09) 75%);
  background-position: 0 0, 0 0, 22px 22px;
  background-size: auto, 44px 44px, 44px 44px;
  box-shadow: inset 0 0 0 3px rgba(217, 189, 132, 0.14), 0 20px 44px rgba(14, 22, 17, 0.24);
}

:root[data-design="ajedrez"] .panel,
:root[data-design="ajedrez"] .year-rail,
:root[data-design="ajedrez"] .event-modal,
:root[data-design="ajedrez"] .profile-modal,
:root[data-design="ajedrez"] .share-modal {
  border-color: var(--line-strong);
  border-radius: 3px;
}

:root[data-design="ajedrez"] .share-modal {
  border-top: 5px solid transparent;
  border-image: repeating-linear-gradient(90deg, var(--accent) 0 12px, var(--surface) 12px 24px) 5;
  padding: 25px 27px 27px;
}

:root[data-design="ajedrez"] .share-scope {
  border-color: var(--line-strong);
}

:root[data-design="ajedrez"] .share-scope-btn.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #f7f2e6;
}

:root[data-design="ajedrez"] .share-period-copy strong {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
}

:root[data-design="ajedrez"] .share-preview-frame {
  border-color: var(--line-strong);
}

:root[data-design="ajedrez"] .history-controls {
  background: var(--surface);
}

:root[data-design="ajedrez"] .toast {
  border-color: var(--gold);
  border-radius: 2px;
  background: #13251b;
}

/* ---------- Design: dark variants ---------- */

:root[data-design="victoriana"][data-theme="dark"] {
  --bg: #1a1410;
  --bg-deep: #120d0a;
  --surface: #241c15;
  --surface-2: #2b2219;
  --surface-alt: #2a2118;
  --surface-other: #160f0b;
  --hover-bg: #30261b;
  --today-bg: #302419;
  --field-bg: #201811;
  --ink: #f1e7d4;
  --ink-soft: #d7c7ad;
  --muted: #a38f76;
  --muted-soft: #786653;
  --line: #3c3024;
  --line-strong: #574434;
  --accent: #cf9f61;
  --accent-strong: #e6bd84;
  --accent-soft: #3a2c1c;
  --gold: #cf9f61;
  --gold-soft: #332716;
  --positive: #9db28f;
  --positive-soft: #232b1f;
  --danger: #e59b83;
  --topbar-bg: rgba(26, 20, 16, 0.87);
  --mobile-bg: rgba(26, 20, 16, 0.95);
  --today-grad-a: #4a2b21;
  --today-grad-b: #160e09;
  --brand-bg: #0f0a07;
  --brand-jelly: #cf9f61;
  --brand-shine: #f3e2c2;
}

:root[data-design="victoriana"][data-theme="dark"] .page-wash {
  background: radial-gradient(900px 520px at 96% -8%, rgba(207, 159, 97, 0.1), transparent 62%),
    radial-gradient(760px 480px at -8% 12%, rgba(122, 47, 41, 0.16), transparent 64%),
    radial-gradient(600px 420px at 55% 108%, rgba(157, 178, 143, 0.05), transparent 65%),
    repeating-linear-gradient(114deg, rgba(231, 210, 178, 0.018) 0 1px, transparent 1px 8px);
}

:root[data-design="victoriana"][data-theme="dark"] .page-wash::before {
  opacity: 0.48;
}

:root[data-design="victoriana"][data-theme="dark"] .page-wash::after {
  opacity: 0.3;
}

:root[data-design="victoriana"][data-theme="dark"] .btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #22170d;
}

:root[data-design="victoriana"][data-theme="dark"] .btn-primary:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

:root[data-design="victoriana"][data-theme="dark"] .calendar-card {
  box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--line), var(--shadow-sm);
}

:root[data-design="victoriana"][data-theme="dark"] .share-scope-btn.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1410;
}

:root[data-design="victoriana"][data-theme="dark"] .toast {
  background: #2a1d12;
  color: #f4e9d5;
}

:root[data-design="futurista"][data-theme="dark"] {
  --bg: #060d12;
  --bg-deep: #03080b;
  --surface: #0c1720;
  --surface-2: #101f2a;
  --surface-alt: #0d2029;
  --surface-other: #050b0f;
  --hover-bg: #0f222c;
  --today-bg: #0c2932;
  --field-bg: #09151c;
  --ink: #e5f5f9;
  --ink-soft: #b5d2db;
  --muted: #7e9aa5;
  --muted-soft: #4f6c78;
  --line: #19313c;
  --line-strong: #2a4d5a;
  --accent: #22d3ee;
  --accent-strong: #7ce9f7;
  --accent-soft: #0b3039;
  --gold: #e6b24c;
  --gold-soft: #2c2517;
  --positive: #74c7b4;
  --positive-soft: #0d2b26;
  --danger: #ff9b82;
  --topbar-bg: rgba(6, 13, 18, 0.86);
  --mobile-bg: rgba(6, 13, 18, 0.95);
  --today-grad-a: #0b3e49;
  --today-grad-b: #030e13;
  --brand-bg: #02080b;
  --brand-jelly: #22d3ee;
  --brand-shine: #d7fbff;
}

:root[data-design="futurista"][data-theme="dark"] .page-wash {
  background: radial-gradient(880px 520px at 96% -8%, rgba(34, 211, 238, 0.16), transparent 62%),
    radial-gradient(700px 460px at -8% 18%, rgba(34, 211, 238, 0.07), transparent 64%),
    linear-gradient(rgba(34, 211, 238, 0.035) 1px, transparent 1px) 0 0 / 46px 46px,
    linear-gradient(90deg, rgba(34, 211, 238, 0.035) 1px, transparent 1px) 0 0 / 46px 46px;
}

:root[data-design="futurista"][data-theme="dark"] .page-wash::before {
  opacity: 0.55;
}

:root[data-design="futurista"][data-theme="dark"] .page-wash::after {
  opacity: 0.32;
}

:root[data-design="futurista"][data-theme="dark"] .btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #03161b;
}

:root[data-design="futurista"][data-theme="dark"] .btn-primary:hover {
  border-color: #a4f5ff;
  background: #a4f5ff;
  color: #03161b;
}

:root[data-design="futurista"][data-theme="dark"] .share-scope-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #03161b;
}

:root[data-design="futurista"][data-theme="dark"] .today-card {
  border-color: rgba(34, 211, 238, 0.32);
}

:root[data-design="futurista"][data-theme="dark"] .toast {
  background: #041319;
  color: #dffbff;
}

:root[data-design="ajedrez"][data-theme="dark"] {
  --bg: #111612;
  --bg-deep: #0a0e0b;
  --surface: #182019;
  --surface-2: #1f291f;
  --surface-alt: #1e2820;
  --surface-other: #0c110d;
  --hover-bg: #232e23;
  --today-bg: #1c2b21;
  --field-bg: #151d16;
  --ink: #edf0e7;
  --ink-soft: #cfd7c9;
  --muted: #93a095;
  --muted-soft: #647067;
  --line: #2c372e;
  --line-strong: #455445;
  --accent: #9bc7ab;
  --accent-strong: #c4e5cf;
  --accent-soft: #223529;
  --gold: #d0ae6b;
  --gold-soft: #2e2a1a;
  --positive: #9bc7ab;
  --positive-soft: #1e2d22;
  --danger: #f0a089;
  --topbar-bg: rgba(17, 22, 18, 0.87);
  --mobile-bg: rgba(17, 22, 18, 0.95);
  --today-grad-a: #2b4735;
  --today-grad-b: #0b130e;
  --brand-bg: #0a140d;
  --brand-jelly: #d0ae6b;
  --brand-shine: #f5ecd9;
}

:root[data-design="ajedrez"][data-theme="dark"] .page-wash {
  background: radial-gradient(900px 520px at 96% -8%, rgba(155, 199, 171, 0.1), transparent 62%),
    radial-gradient(720px 460px at -6% 16%, rgba(208, 174, 107, 0.09), transparent 64%),
    linear-gradient(45deg, rgba(237, 240, 231, 0.025) 25%, transparent 25%, transparent 75%, rgba(237, 240, 231, 0.025) 75%) 0 0 / 92px 92px,
    linear-gradient(45deg, rgba(237, 240, 231, 0.025) 25%, transparent 25%, transparent 75%, rgba(237, 240, 231, 0.025) 75%) 46px 46px / 92px 92px;
}

:root[data-design="ajedrez"][data-theme="dark"] .page-wash::before {
  opacity: 0.42;
}

:root[data-design="ajedrez"][data-theme="dark"] .page-wash::after {
  opacity: 0.28;
}

:root[data-design="ajedrez"][data-theme="dark"] .btn-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #121813;
}

:root[data-design="ajedrez"][data-theme="dark"] .btn-primary:hover {
  border-color: #ffffff;
  background: #ffffff;
  color: #121813;
}

:root[data-design="ajedrez"][data-theme="dark"] .calendar-card::before {
  opacity: 0.55;
}

:root[data-design="ajedrez"][data-theme="dark"] .share-scope-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #101710;
}

:root[data-design="ajedrez"][data-theme="dark"] .toast {
  background: #182019;
  color: #edf0e7;
}

/* ---------- Responsive additions ---------- */

@media (max-width: 1240px) {
  .topbar-year .btn-label,
  .topbar-share .btn-label {
    display: none;
  }

  .topbar-year,
  .topbar-share {
    width: 38px;
    min-height: 38px;
    padding: 0;
    flex: none;
  }
}

@media (max-width: 900px) {
  .share-overlay {
    padding: 10px;
  }

  .share-modal {
    width: 100%;
    max-height: calc(100dvh - 20px);
    padding: 20px;
  }

  .share-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .share-preview svg {
    height: min(44vh, 460px);
  }

  .share-side {
    gap: 11px;
  }
}

@media (max-width: 720px) {
  .topbar-actions .history-controls {
    padding: 1px;
  }

  .history-btn {
    width: 27px;
    height: 27px;
  }

  .history-controls {
    border-radius: 8px;
  }

  .month-share {
    width: 33px;
    height: 33px;
  }

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

  .series-option span {
    min-height: 46px;
  }

  .weekday-options span {
    width: 28px;
    height: 28px;
  }

  .modal-actions {
    flex-wrap: wrap;
  }

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

  :root[data-design] .page-wash::before {
    width: min(280px, 48vw);
    opacity: 0.24;
  }

  :root[data-design] .page-wash::after {
    display: none;
  }

  :root[data-design="victoriana"] .page-wash::before,
  :root[data-design="futurista"] .page-wash::before,
  :root[data-design="ajedrez"] .page-wash::before {
    opacity: 0.22;
  }

  :root[data-design="victoriana"] .calendar-card {
    box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 4px var(--line), var(--shadow-sm);
  }

  :root[data-design="victoriana"] .event-modal,
  :root[data-design="victoriana"] .profile-modal,
  :root[data-design="victoriana"] .share-modal {
    box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--line), var(--shadow-lg);
  }
}

@media (max-width: 560px) {
  .share-overlay {
    padding: 0;
  }

  .share-modal {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    padding: 16px 15px 26px;
    border-radius: 0;
  }

  :root[data-design="futurista"] .share-modal,
  :root[data-design="victoriana"] .share-modal,
  :root[data-design="ajedrez"] .share-modal {
    clip-path: none;
    border-top-width: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .share-modal-head {
    margin-bottom: 12px;
  }

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

  .share-preview-frame {
    padding: 9px;
    border-radius: 12px;
  }

  .share-preview svg {
    height: min(40vh, 400px);
  }

  .share-period-copy strong {
    font-size: 21px;
  }

  .share-actions .btn {
    min-height: 38px;
  }

  .history-controls {
    display: none;
  }

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

  :root[data-design] .month-title-line h1 {
    letter-spacing: 0;
  }

  .drawer-actions {
    position: sticky;
    bottom: -1px;
    z-index: 2;
    padding: 9px 0 1px;
    background: linear-gradient(180deg, transparent, var(--surface) 26%);
  }
}

@media (max-width: 380px) {
  .month-share {
    width: 31px;
    height: 31px;
  }

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

  .share-actions #shareCopyImage,
  .share-actions #shareNative {
    grid-column: auto;
  }
}
