:root {
  --night: #12182a;
  --ink: #f4efe4;
  --muted: #b7c0d4;
  --gold: #e7c98a;
  --gold-deep: #c6a15a;
  --sky: #8fd6d2;
  --rose: #f0b4a8;
  --line: rgba(231, 201, 138, 0.38);
  --panel: rgba(22, 30, 52, 0.72);
  --panel-solid: #1a2340;
  --shadow: 0 24px 70px rgba(4, 8, 20, 0.45);
  --month-gap: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(143, 214, 210, 0.18), transparent 55%),
    radial-gradient(800px 480px at 100% 0%, rgba(231, 201, 138, 0.16), transparent 50%),
    radial-gradient(700px 500px at 70% 110%, rgba(92, 122, 214, 0.22), transparent 45%),
    var(--night);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 22%, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 68%, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 74% 18%, rgba(231, 201, 138, 0.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 86% 62%, rgba(255, 255, 255, 0.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 48% 40%, rgba(143, 214, 210, 0.7) 50%, transparent 51%);
  opacity: 0.7;
}

button,
input,
textarea {
  font: inherit;
  font-size: 16px;
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.app {
  position: relative;
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px 28px 16px;
  padding-top: calc(28px + env(safe-area-inset-top));
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(32, 42, 72, 0.86), rgba(18, 24, 42, 0.72));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.seal {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #2a2112;
  font-family: "Palatino Linotype", "Songti SC", serif;
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(160deg, #f3e2b4, var(--gold-deep));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: 0 0 18px rgba(231, 201, 138, 0.45);
}

.brand h1,
.year-nav h2,
.month-title,
.editor-head h3,
.cloud-panel h3 {
  font-family: "Palatino Linotype", "Songti SC", "Noto Serif SC", serif;
}

.brand h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0.32em;
  font-weight: 600;
  color: var(--gold);
}

.notebook-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  padding: 7px 14px 7px 10px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(160deg, #f3e2b4, var(--gold-deep));
  color: #2a2112;
  font-weight: 700;
  letter-spacing: 0.14em;
  box-shadow: 0 0 18px rgba(231, 201, 138, 0.5);
  cursor: pointer;
}

.notebook-btn svg {
  width: 18px;
  height: 18px;
}

.notebook-btn:hover {
  filter: brightness(1.08);
}

.notebook-panel h3 {
  margin: 0 36px 6px 0;
  font-size: 24px;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.notebook-hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.year-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.year-nav h2 {
  margin: 0;
  min-width: 6.2em;
  text-align: center;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: #fff8ea;
  text-shadow: 0 0 18px rgba(231, 201, 138, 0.35);
}

#zoom-out {
  border: 1px solid var(--line);
  padding: 6px 12px;
}

#zoom-out[hidden] {
  display: none;
}

.icon-btn,
.text-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  border-radius: 999px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  font-size: 22px;
  line-height: 1;
  color: var(--gold);
}

.icon-btn:hover,
.text-btn:hover {
  background: rgba(231, 201, 138, 0.14);
}

.actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search input,
.field input,
textarea#note,
textarea#notebook {
  border: 1px solid var(--line);
  background: rgba(8, 12, 24, 0.45);
  outline: none;
}

.search input {
  width: 180px;
  padding: 8px 14px;
  border-radius: 999px;
}

.search input:focus,
.field input:focus,
textarea#note:focus,
textarea#notebook:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(231, 201, 138, 0.15);
}

.text-btn,
.file-btn {
  padding: 7px 12px;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.file-btn {
  display: inline-flex;
  cursor: pointer;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.legend .off,
.legend .work {
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.legend .off {
  color: #2a2112;
  background: #e8c98a;
}

.legend .work {
  color: #062422;
  background: var(--sky);
}

.work-left-key,
.work-left {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #c9c3d6;
  background: rgba(201, 195, 214, 0.12);
  border: 0;
  border-radius: 2px;
  font-weight: 500;
}

.work-left-key {
  padding: 2px 8px 2px 6px;
}

.work-left {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 1;
  flex: none;
  padding: 2px 6px 2px 4px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.hourglass {
  width: 12px;
  height: 12px;
  flex: none;
}

.year-grid.month-focus .day:has(.work-left) {
  padding-bottom: 28px;
}

.year-grid.month-focus .work-left {
  font-size: 13px;
}

.year-grid.month-focus .hourglass {
  width: 13px;
  height: 13px;
}

.year-grid:not(.month-focus) .work-left {
  right: 2px;
  bottom: 2px;
  gap: 1px;
  padding: 0 3px 0 2px;
  font-size: 9px;
}

.year-grid:not(.month-focus) .hourglass {
  width: 8px;
  height: 8px;
}

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

.legend-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(231, 160, 184, 0.45);
  border-radius: 999px;
  background: transparent;
  color: #f3d7e2;
  cursor: pointer;
}

.legend-choice.on {
  background: rgba(231, 160, 184, 0.22);
  border-color: #e7a0b8;
  color: #fff;
}

.legend-choice.leave,
.legend-choice.leave.on {
  padding: 2px 8px;
  border: 0;
  border-radius: 999px;
  background: #f3c1d0;
  color: #4a2433;
  font-weight: 700;
}

.legend-choice.leave.on {
  box-shadow: inset 0 0 0 1px #4a2433;
}

.legend-choice.shot,
.marker-btn.shot {
  border-color: rgba(143, 214, 210, 0.55);
  color: #d7f4f2;
}

.legend-choice.shot.on,
.marker-btn.shot.on {
  background: rgba(143, 214, 210, 0.22);
  border-color: var(--sky);
  color: #fff;
}

.legend-choice.mars,
.marker-btn.mars {
  border-color: rgba(212, 83, 44, 0.55);
  color: #f8d7c8;
}

.legend-choice.mars.on,
.marker-btn.mars.on {
  background: rgba(212, 83, 44, 0.22);
  border-color: #e0704a;
  color: #fff;
}

.usage-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid rgba(231, 201, 138, 0.45);
  border-radius: 999px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.usage-live.warn {
  border-color: #e07a8a;
  color: #f0b7c2;
}

.usage-ring {
  width: 16px;
  height: 16px;
  flex: none;
}

.usage-mark {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 4px;
  color: var(--gold);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.year-grid.month-focus .usage-mark .usage-ring {
  width: 18px;
  height: 18px;
}

.year-grid:not(.month-focus) .usage-mark {
  margin: 0 0 0 auto;
}

.year-grid:not(.month-focus) .usage-mark .usage-pct {
  display: none;
}

.year-grid:not(.month-focus) .usage-ring {
  width: 12px;
  height: 12px;
}

.year-grid.stamping .day {
  cursor: copy;
}

.flower,
.syringe {
  width: 14px;
  height: 14px;
  flex: none;
  vertical-align: -2px;
}

svg.mars {
  width: 22px;
  height: 22px;
  flex: none;
  vertical-align: -4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.day-marks {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex: none;
}

.day-mark {
  display: inline-flex;
  margin: 0;
  padding: 2px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  line-height: 0;
  cursor: pointer;
}

.day-mark:hover,
.day-mark:focus-visible {
  background: rgba(231, 201, 138, 0.18);
}

.day-mark svg {
  width: 12px;
  height: 12px;
}

.year-grid.month-focus .day-mark svg {
  width: 20px;
  height: 20px;
}

.day-mark svg.mars {
  width: 18px;
  height: 18px;
}

.year-grid.month-focus .day-mark svg.mars {
  width: 36px;
  height: 36px;
}

.year-grid:not(.month-focus) .day-mark svg.mars {
  width: 15px;
  height: 15px;
}

.detail-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 4px;
  color: #f3d7e2;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
}

.detail-preview.shot {
  color: #d7f4f2;
}

.detail-preview.mars {
  color: #f8d7c8;
}

.orb {
  width: 16px;
  height: 16px;
  flex: none;
}

.omen-field[hidden] {
  display: none !important;
}

.omen-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  color: var(--gold);
  font-size: 13px;
}

.omen-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.omen-field textarea {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid rgba(231, 201, 138, 0.45);
  border-radius: 12px;
  background: rgba(8, 12, 24, 0.45);
  color: var(--ink);
  resize: vertical;
}

.omen-field textarea:focus {
  border-color: var(--gold);
  outline: none;
}

.omen-line {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.omen-line .orb {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.omen-line.is-empty {
  width: auto;
  opacity: 0.4;
}

.omen-line.is-empty .orb {
  width: 14px;
  height: 14px;
}

.omen-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-width: 0;
}

.year-grid:not(.month-focus) .omen-line {
  width: 100%;
  margin: 2px 0 0;
  font-size: 9px;
  line-height: 1.2;
}

.year-grid:not(.month-focus) .omen-line .orb {
  width: 10px;
  height: 10px;
  margin-top: 0;
}

.day.holiday .omen-line {
  color: #5a3414;
}

.day.leave .omen-line {
  color: #4a2433;
}

.day.holiday .omen-line.is-empty,
.day.leave .omen-line.is-empty {
  opacity: 0.72;
}

.day.holiday .detail-preview {
  color: #6a3148;
}

.day.holiday .detail-preview.shot {
  color: #0e4c49;
}

.day.holiday .detail-preview.mars {
  color: #7a2a14;
}

.marker-details:empty {
  display: none;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  color: #f3d7e2;
  font-size: 13px;
}

.detail-field textarea {
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid rgba(231, 160, 184, 0.45);
  border-radius: 12px;
  background: rgba(8, 12, 24, 0.45);
  resize: vertical;
}

.detail-field textarea:focus {
  border-color: #e7a0b8;
  outline: none;
}

.marker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.marker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(231, 160, 184, 0.45);
  border-radius: 999px;
  background: transparent;
  color: #f3d7e2;
  font: inherit;
  cursor: pointer;
}

.marker-btn.on {
  background: rgba(231, 160, 184, 0.22);
  border-color: #e7a0b8;
  color: #fff;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--month-gap);
}

.month {
  min-width: 0;
  padding: 14px 12px 10px;
  background: linear-gradient(180deg, rgba(36, 48, 82, 0.78), rgba(16, 22, 40, 0.82));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.month-title {
  display: block;
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-align: center;
  color: var(--gold);
}

button.month-title {
  cursor: pointer;
}

button.month-title:hover {
  color: #fff8ea;
}

.year-grid.month-focus {
  grid-template-columns: minmax(0, 1fr);
  justify-content: center;
}

.year-grid.month-focus .month-title {
  display: none;
}

.year-grid.month-focus .day {
  min-height: clamp(162px, calc((100dvh - 270px) / 5), 280px);
  aspect-ratio: auto;
}

.year-grid.month-focus .day .num {
  font-size: 22px;
}

.year-grid.month-focus .day .lunar-day {
  font-size: 13px;
}

.year-grid.month-focus .day .mark {
  min-width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 18px;
}

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

.weekdays span {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 4px;
}

.weekdays span:first-child,
.weekdays span:last-child {
  color: var(--rose);
}

.day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 6px 8px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border-radius: 10px;
  text-align: left;
  overflow: hidden;
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding-right: 16px;
}

.year-grid:not(.month-focus) .day-head .lunar-day {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 4px;
  color: #f7f1e4;
  font-size: 10px;
  line-height: 1.35;
  white-space: pre-wrap;
  text-align: left;
}

.year-grid.month-focus .note-preview {
  -webkit-line-clamp: 5;
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.day.holiday .note-preview {
  color: #3a2a16;
}

.day.empty {
  background: transparent;
  cursor: default;
}

.day .num {
  display: block;
  font-size: 14px;
  line-height: 1.15;
}

.day .lunar-day {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.day.weekend .num {
  color: var(--rose);
}

.day .mark {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 14px;
  height: 14px;
  padding: 0 2px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 14px;
  font-weight: 700;
}

.day.holiday {
  background: #e8c98a;
  border-color: #f6e7c0;
}

.day.holiday .num,
.day.holiday .lunar-day {
  color: #2a2112;
  font-weight: 700;
}

.day.holiday .lunar-day {
  font-size: 11px;
}

.day.holiday .mark {
  background: #2a2112;
  color: #ffe7b8;
}

.day.workday {
  background: rgba(143, 214, 210, 0.2);
  border-color: var(--sky);
  box-shadow: inset 0 0 0 1px var(--sky);
}

.day.workday .num {
  color: #f3fffe;
}

.day.workday .mark {
  background: var(--sky);
  color: #062422;
}

.day.today.holiday {
  background: #e8c98a;
  box-shadow: inset 0 0 0 2px var(--sky), 0 0 14px rgba(143, 214, 210, 0.35);
}

.day.today.workday {
  box-shadow: inset 0 0 0 2px #fff, 0 0 14px rgba(143, 214, 210, 0.45);
}

.day.today {
  background: rgba(143, 214, 210, 0.18);
  box-shadow: inset 0 0 0 1px var(--sky), 0 0 16px rgba(143, 214, 210, 0.28);
}

.day.selected {
  background: rgba(231, 201, 138, 0.34);
  border-color: var(--gold);
}

.day.leave {
  background: #f3c1d0;
  border-color: #f7d5e0;
}

.day.leave .num,
.day.leave .lunar-day,
.day.leave .note-preview,
.day.leave .detail-preview,
.day.leave .work-left,
.day.leave .day-todo {
  color: #4a2433;
}

.day.leave .mark {
  background: #4a2433;
  color: #ffe4ee;
}

.day.today.leave,
.day.selected.leave {
  background: #f3c1d0;
  border-color: #e7a0b8;
  box-shadow: inset 0 0 0 2px #fff, 0 0 14px rgba(231, 160, 184, 0.4);
}

.day.has-note::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 6px var(--sky);
}

.day:not(.empty):hover {
  background: rgba(231, 201, 138, 0.16);
}

.search-results {
  display: grid;
  gap: 10px;
}

.search-results.hidden {
  display: none;
}

.result {
  text-align: left;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 14px 16px;
  border-radius: 14px;
  cursor: pointer;
}

.result strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
}

.result span {
  color: var(--muted);
  font-size: 14px;
}

.editor {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 20, 0.62);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 10;
}

.editor[hidden] {
  display: none;
}

.editor-panel {
  position: relative;
  width: min(520px, 100%);
  background:
    linear-gradient(180deg, rgba(42, 54, 90, 0.96), rgba(16, 22, 40, 0.96));
  box-shadow: var(--shadow), 0 0 0 1px rgba(231, 201, 138, 0.25);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px 28px 20px;
}

.editor-panel .close {
  position: absolute;
  top: 10px;
  right: 10px;
}

.editor-head {
  margin-bottom: 14px;
}

.lunar {
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.16em;
  font-size: 13px;
}

.editor-head h3 {
  margin: 4px 0 0;
  font-size: 28px;
  letter-spacing: 0.08em;
}

.weekday {
  margin: 4px 0 0;
  color: var(--muted);
}

textarea#note,
textarea#notebook {
  width: 100%;
  resize: vertical;
  min-height: 220px;
  border-radius: 14px;
  padding: 14px;
  line-height: 1.7;
}

.editor-foot,
.editor-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.danger {
  color: var(--rose);
}

.todo-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.todo-form input {
  border: 1px solid var(--line);
  background: rgba(8, 12, 24, 0.45);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 12px;
  outline: none;
  color-scheme: dark;
}

.todo-form input:focus {
  border-color: var(--gold);
}

.todo-form button {
  border: 1px solid var(--line);
}

.todo-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.todo-list:empty {
  display: none;
}

.todo-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.todo-item span,
.todo-edit {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.todo-text {
  cursor: text;
}

.todo-edit {
  width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--gold);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 0 0 1px;
  outline: none;
}

.todo-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  cursor: pointer;
}

.todo-icon {
  display: grid;
  width: 14px;
  height: 14px;
}

.todo-icon svg {
  width: 14px;
  height: 14px;
}

.todo-item.done span,
.day-todo.done span {
  color: var(--muted);
  text-decoration: line-through;
}

.todo-item.done .todo-mark,
.day-todo.done {
  color: #9a9178;
}

.day.leave .day-todo.done,
.day.leave .day-todo.done span {
  color: #4a2433;
}

.todo-remove {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.day-todo {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-top: 4px;
  color: #f7f1e4;
  font-size: 12px;
  line-height: 1.35;
}

.day-todo-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.day-todo span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}

.day-todo .todo-icon,
.day-todo .todo-icon svg {
  width: 11px;
  height: 11px;
}

.cloud-panel h3 {
  margin: 0 36px 8px 0;
  font-size: 24px;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.cloud-copy,
.cloud-user {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.cloud-user:empty {
  display: none;
}

.field {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  font-size: 13px;
  color: var(--muted);
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
}

.cloud-error {
  color: var(--rose);
  font-size: 14px;
}

.cloud-error[hidden] {
  display: none;
}

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

  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .actions {
    justify-content: flex-start;
  }
}

@media (max-width: 700px) {
  .app {
    padding: 14px 12px calc(36px + env(safe-area-inset-bottom));
  }

  .brand h1 {
    font-size: 22px;
    letter-spacing: 0.18em;
  }

  .year-nav h2 {
    font-size: 22px;
    min-width: 0;
  }

  .year-grid.month-focus .day {
    min-height: 96px;
  }

  .year-grid.month-focus .note-preview {
    -webkit-line-clamp: 3;
    font-size: 12px;
  }

  .year-grid.month-focus .day .num {
    font-size: 16px;
  }

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

  .search {
    flex: 1;
    min-width: 0;
  }

  .search input {
    width: 100%;
  }

  .icon-btn,
  .day {
    min-height: 44px;
  }

  .editor {
    padding: 0;
    align-items: end;
  }

  .editor-panel {
    width: 100%;
    min-height: min(92dvh, 100%);
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }

  textarea#note,
  textarea#notebook {
    min-height: 42dvh;
  }

  .editor-nav {
    gap: 8px;
    flex-wrap: wrap;
  }
}
