:root,
[data-theme="warm-yellow"] {
  --color-background: #fbf3da;
  --color-surface: #fffaf0;
  --color-surface-soft: #f8e9b9;
  --color-primary: #e7ad37;
  --color-primary-soft: #f7d979;
  --color-accent: #c77743;
  --color-text: #4d4033;
  --color-text-muted: #877562;
  --color-border: #c9a769;
  --color-birthday: #d47f62;
  --color-anniversary: #b76f73;
  --color-today: #f2c557;
  --color-shadow: rgba(101, 76, 44, 0.18);
  --color-input: #fffdf7;
  --color-grid-line: #dfcfaa;
  --color-empty: #f7edd5;
  --radius-card: 16px;
  --radius-button: 11px;
  --border-width-pixel: 2px;
  --shadow-card: 3px 3px 0 rgba(132, 97, 48, 0.18);
  --icon-calendar: "▦";
  --background-pattern: none;
}

[data-theme="cream"] {
  --color-background: #f3ecdf;
  --color-surface: #fffaf2;
  --color-surface-soft: #eadfca;
  --color-primary: #cda778;
  --color-primary-soft: #ead2aa;
  --color-accent: #9c7254;
  --color-text: #4b4037;
  --color-text-muted: #817267;
  --color-border: #bca183;
  --color-birthday: #c88471;
  --color-anniversary: #a87572;
  --color-today: #d8b47f;
  --color-shadow: rgba(91, 70, 50, 0.17);
  --color-input: #fffdf8;
  --color-grid-line: #d8c6ac;
  --color-empty: #eee4d4;
}

[data-theme="mint"] {
  --color-background: #e7f0e7;
  --color-surface: #f8fbf4;
  --color-surface-soft: #d6e7d6;
  --color-primary: #8fb99a;
  --color-primary-soft: #c2ddc7;
  --color-accent: #5e8973;
  --color-text: #384b42;
  --color-text-muted: #6e8177;
  --color-border: #96b39f;
  --color-birthday: #c88778;
  --color-anniversary: #a8757d;
  --color-today: #9dc6a5;
  --color-shadow: rgba(55, 86, 67, 0.16);
  --color-input: #fbfdf8;
  --color-grid-line: #c3d7c6;
  --color-empty: #dfeadf;
}

[data-theme="mist-blue"] {
  --color-background: #e9f0f3;
  --color-surface: #f9fcfc;
  --color-surface-soft: #d8e5ea;
  --color-primary: #8eb3c2;
  --color-primary-soft: #c8dee7;
  --color-accent: #658a9b;
  --color-text: #384a52;
  --color-text-muted: #71838b;
  --color-border: #9fb9c3;
  --color-birthday: #c7867c;
  --color-anniversary: #9e7886;
  --color-today: #9fc6d5;
  --color-shadow: rgba(53, 79, 91, 0.15);
  --color-input: #fcfefe;
  --color-grid-line: #c8d9df;
  --color-empty: #e1eaed;
}

[data-theme="soft-lilac"] {
  --color-background: #f0ebf2;
  --color-surface: #fdf9fc;
  --color-surface-soft: #e5d9e8;
  --color-primary: #b39abd;
  --color-primary-soft: #dbc9df;
  --color-accent: #876f92;
  --color-text: #4b414f;
  --color-text-muted: #807384;
  --color-border: #b9a4bf;
  --color-birthday: #c27f84;
  --color-anniversary: #9b7289;
  --color-today: #c4aace;
  --color-shadow: rgba(75, 58, 80, 0.15);
  --color-input: #fefbfe;
  --color-grid-line: #d9cce0;
  --color-empty: #eae1ec;
}

[data-theme="dusty-rose"] {
  --color-background: #e9e1e2;
  --color-surface: #f8f3f2;
  --color-surface-soft: #ddcbce;
  --color-primary: #aa858b;
  --color-primary-soft: #d8b9bc;
  --color-accent: #785d64;
  --color-text: #40383a;
  --color-text-muted: #776a6d;
  --color-border: #a98e93;
  --color-birthday: #b97576;
  --color-anniversary: #8e6974;
  --color-today: #bd969c;
  --color-shadow: rgba(61, 48, 51, 0.17);
  --color-input: #fbf7f6;
  --color-grid-line: #d2c1c4;
  --color-empty: #e2d7d8;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--color-background);
  color: var(--color-text);
  font-family: "Courier New", "Microsoft YaHei", monospace;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--color-background);
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(199, 119, 67, 0.35);
  outline-offset: 2px;
}

.app-shell {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 14px calc(92px + env(safe-area-inset-bottom));
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 2px 14px;
}

.app-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  margin: 0;
  place-items: center;
  border: var(--border-width-pixel) solid var(--color-border);
  border-radius: 10px;
  background: var(--color-primary-soft);
  box-shadow: 3px 3px 0 var(--color-shadow);
  color: var(--color-accent);
  font-size: 24px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 2px;
  color: var(--color-text-muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: 0.04em;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.icon-button,
.month-button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: var(--border-width-pixel) solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-surface);
  box-shadow: 2px 2px 0 var(--color-shadow);
  cursor: pointer;
  font-size: 24px;
}

.icon-button:active,
.month-button:active,
.button:active {
  box-shadow: none;
  transform: translate(2px, 2px);
}

.page {
  display: none;
}

.page.is-active {
  display: block;
}

.calendar-card,
.event-form,
.settings-card {
  border: var(--border-width-pixel) solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

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

.month-toolbar {
  display: grid;
  grid-template-columns: 36px 1fr 36px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.month-button {
  width: 36px;
  height: 36px;
  border-width: 1px;
  box-shadow: none;
  color: var(--color-accent);
}

.month-title-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.month-title-button strong {
  font-size: 18px;
}

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

.weekday-row {
  margin-bottom: 5px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.calendar-grid {
  overflow: hidden;
  border: 1px solid var(--color-grid-line);
  border-radius: 9px;
  background: var(--color-grid-line);
  gap: 1px;
}

.calendar-day {
  position: relative;
  min-width: 0;
  min-height: 70px;
  padding: 5px 3px 3px;
  overflow: hidden;
  border: 0;
  background: var(--color-surface);
  cursor: pointer;
  text-align: left;
}

.calendar-day.is-empty {
  cursor: default;
  background: var(--color-empty);
}

.calendar-day.is-today {
  background: var(--color-primary-soft);
  box-shadow: inset 0 0 0 2px var(--color-today);
}

.day-number {
  display: block;
  width: 20px;
  margin-bottom: 3px;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.is-today .day-number {
  border-radius: 5px;
  background: var(--color-primary);
  color: var(--color-surface);
}

.day-event {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 2px;
  margin-bottom: 2px;
  font-size: 9px;
  line-height: 1.25;
}

.day-event__icon {
  flex: 0 0 auto;
  font-family: sans-serif;
  font-size: 14px;
}

.day-event__avatar {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  object-fit: cover;
}

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

.day-event__mode {
  flex: 0 0 auto;
  padding: 1px 2px;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  background: var(--color-surface-soft);
  color: var(--color-accent);
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
}

.day-more {
  color: var(--color-accent);
  font-size: 9px;
  font-weight: 700;
}

.section-block {
  padding-top: 24px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
  padding: 0 2px;
}

.text-button {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.event-list {
  display: grid;
  gap: 10px;
}

.event-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: var(--border-width-pixel) solid var(--color-border);
  border-radius: 13px;
  background: var(--color-surface);
  box-shadow: 2px 2px 0 var(--color-shadow);
  cursor: pointer;
  text-align: left;
}

.event-item__date {
  color: var(--color-accent);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.event-item__date strong {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.event-item__content {
  min-width: 0;
}

.event-item__title {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  font-size: 13px;
  font-weight: 700;
}

.event-avatar {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  object-fit: cover;
}

.event-item__title span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-item__meta {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 10px;
}

.event-item__countdown {
  color: var(--color-accent);
  font-size: 10px;
  font-weight: 700;
  text-align: right;
}

.event-item__countdown strong {
  display: block;
  font-size: 14px;
}

.event-item--birthday {
  display: block;
  padding: 11px 12px;
}

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

.event-item__person .event-item__title {
  margin-bottom: 0;
}

.event-item__relationship {
  flex: 0 0 auto;
  color: var(--color-text-muted);
  font-size: 9px;
}

.event-schedules {
  display: grid;
  margin-top: 8px;
  border-top: 1px dashed var(--color-border);
}

.event-schedule {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding-top: 7px;
}

.event-schedule + .event-schedule {
  margin-top: 7px;
  border-top: 1px solid var(--color-border);
}

.event-schedule__kind {
  padding: 3px 2px;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  background: var(--color-primary-soft);
  color: var(--color-accent);
  font-size: 8px;
  font-weight: 700;
  text-align: center;
}

.event-schedule__date {
  min-width: 0;
  overflow: hidden;
  color: var(--color-text-muted);
  font-size: 9px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-schedule__countdown {
  color: var(--color-accent);
  font-size: 8px;
  font-weight: 700;
  text-align: right;
}

.event-schedule__countdown strong {
  display: block;
  font-size: 12px;
}

.page-heading {
  padding: 8px 2px 18px;
}

.page-heading h2 {
  margin-bottom: 7px;
  font-size: 24px;
}

.page-heading > p:last-child {
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 15px;
}

.filter-button {
  padding: 8px 11px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface);
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.filter-button.is-active {
  border-color: var(--color-accent);
  background: var(--color-primary-soft);
  color: var(--color-text);
}

.event-form {
  padding: 16px;
}

.form-fieldset {
  min-width: 0;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.form-fieldset legend,
.field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
}

.type-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.type-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.type-switch span {
  display: block;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.type-switch input:checked + span {
  border: 2px solid var(--color-accent);
  background: var(--color-primary-soft);
  padding: 9px;
}

.type-switch input:focus-visible + span {
  outline: 3px solid rgba(199, 119, 67, 0.35);
  outline-offset: 2px;
}

.form-grid {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 15px 10px;
}

.field {
  grid-column: 1 / -1;
}

.field--icon {
  grid-column: 1;
}

.field--grow {
  grid-column: 2;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-input);
  font-size: 13px;
}

.field .type-switch input {
  width: 1px;
  height: 1px;
  padding: 0;
}

.avatar-field {
  padding-bottom: 2px;
}

.avatar-picker {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px dashed var(--color-border);
  border-radius: 11px;
  background: var(--color-surface-soft);
}

.avatar-preview {
  display: grid;
  width: 66px;
  height: 66px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface);
  box-shadow: 2px 2px 0 var(--color-shadow);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-preview span {
  font-family: sans-serif;
  font-size: 30px;
}

.avatar-picker__actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.avatar-picker__actions small,
.field-help,
.field-heading-row small {
  width: 100%;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 9px;
  line-height: 1.5;
}

.avatar-upload-button,
.backup-upload-button {
  display: inline-grid;
  place-items: center;
}

.field-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.field-heading-row > span {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
}

.field-heading-row small {
  width: auto;
  text-align: right;
}

.lunar-field {
  padding: 12px;
  border: 1px dashed var(--color-border);
  border-radius: 11px;
  background: var(--color-surface-soft);
}

.lunar-input-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr;
  gap: 7px;
}

.lunar-input-grid label > span {
  display: block;
  margin-bottom: 4px;
  color: var(--color-text-muted);
  font-size: 9px;
}

.lunar-input-grid input,
.lunar-input-grid select {
  height: 38px;
  padding: 0 7px;
  font-family: inherit;
  font-size: 11px;
}

.lunar-input-grid .leap-checkbox {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 7px;
}

.lunar-input-grid .leap-checkbox input {
  width: 17px;
  height: 17px;
}

.lunar-input-grid .leap-checkbox span {
  margin: 0;
  color: var(--color-text);
  font-size: 10px;
}

.field-help {
  margin-top: 7px;
}

.celebration-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.celebration-field legend {
  margin-bottom: 7px;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
}

.type-switch--compact span {
  padding: 8px;
  font-size: 10px;
}

.type-switch--compact input:checked + span {
  padding: 7px;
}

.type-switch--reminders {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field input,
.field select {
  height: 42px;
  padding: 0 10px;
}

.field select {
  font-family: sans-serif;
  font-size: 18px;
}

.field textarea {
  min-height: 92px;
  padding: 10px;
  resize: vertical;
  line-height: 1.5;
}

.form-error {
  min-height: 18px;
  margin: 11px 0 4px;
  color: #a6473e;
  font-size: 11px;
}

.form-actions {
  display: flex;
  gap: 9px;
  justify-content: flex-end;
}

.button {
  min-height: 42px;
  padding: 0 16px;
  border: var(--border-width-pixel) solid var(--color-border);
  border-radius: var(--radius-button);
  box-shadow: 2px 2px 0 var(--color-shadow);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.button--primary {
  border-color: #b87d2d;
  background: var(--color-primary-soft);
}

.button--secondary {
  background: var(--color-surface);
}

.button--danger {
  border-color: #bd7770;
  background: #f6d7ce;
  color: #803e39;
}

.button--full {
  width: 100%;
  margin-top: 14px;
}

.settings-card {
  overflow: hidden;
}

.setting-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 15px;
}

.setting-row + .setting-row {
  border-top: 1px dashed var(--color-border);
}

.setting-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-soft);
}

.setting-row strong {
  font-size: 12px;
}

.setting-row p {
  margin: 3px 0 0;
  color: var(--color-text-muted);
  font-size: 10px;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border: 2px solid #fffaf0;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-border);
}

.notice-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.6;
}

.notice-card strong {
  color: var(--color-text);
}

.notice-card p {
  margin: 4px 0 0;
}

.settings-section {
  margin-top: 16px;
  padding: 15px;
  border: var(--border-width-pixel) solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}

.settings-section__heading {
  margin-bottom: 12px;
}

.settings-section__heading h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.settings-section__heading p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 9px;
}

.settings-help {
  margin: 10px 0 0;
  color: var(--color-text-muted);
  font-size: 9px;
  line-height: 1.6;
}

.calendar-time-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
}

.calendar-time-setting input {
  width: 116px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-input);
  color: var(--color-text);
  font: inherit;
}

.calendar-time-setting + .settings-help {
  margin: 0 0 12px;
}

.pwa-ios-help {
  padding: 10px 12px;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-button);
  background: var(--color-surface-soft);
  font-size: 9px;
  line-height: 1.6;
}

.pwa-ios-help p {
  margin: 4px 0 0;
  color: var(--color-text-muted);
}

#update-pwa {
  margin-top: 10px;
}

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

.theme-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-input);
  cursor: pointer;
  font-size: 10px;
  text-align: left;
}

.theme-option.is-active {
  border-width: 2px;
  padding: 8px;
  background: var(--color-surface-soft);
  font-weight: 700;
}

.theme-dot {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 1px solid rgba(70, 60, 50, 0.25);
  border-radius: 5px;
}

.theme-dot--cream { background: #cda778; }
.theme-dot--mint { background: #8fb99a; }
.theme-dot--blue { background: #8eb3c2; }
.theme-dot--lilac { background: #b39abd; }
.theme-dot--yellow { background: #e7ad37; }
.theme-dot--rose { background: #aa858b; }

.backup-actions,
.import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: var(--border-width-pixel) solid var(--color-border);
  background: rgba(255, 250, 240, 0.97);
}

.nav-button {
  display: grid;
  min-height: 53px;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
}

.nav-button > span {
  font-size: 19px;
  line-height: 1;
}

.nav-button small {
  font-size: 9px;
  font-weight: 700;
}

.nav-button.is-active {
  background: var(--color-surface-soft);
  color: var(--color-accent);
}

.nav-button--add > span {
  display: grid;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  place-items: center;
  border: 2px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-primary-soft);
  box-shadow: 2px 2px 0 var(--color-shadow);
  color: var(--color-text);
}

.day-dialog {
  width: min(calc(100% - 20px), 520px);
  max-height: min(72vh, 620px);
  margin: auto auto 10px;
  padding: 12px 16px 18px;
  overflow: auto;
  border: var(--border-width-pixel) solid var(--color-border);
  border-radius: 18px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 5px 5px 0 var(--color-shadow);
}

.import-dialog {
  width: min(calc(100% - 28px), 440px);
  padding: 18px;
  border: var(--border-width-pixel) solid var(--color-border);
  border-radius: 16px;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 4px 4px 0 var(--color-shadow);
}

.import-dialog::backdrop {
  background: rgba(62, 48, 35, 0.34);
}

.import-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 14px;
}

.import-summary div {
  padding: 10px 6px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-surface-soft);
  font-size: 9px;
  text-align: center;
}

.import-summary strong {
  display: block;
  margin-bottom: 2px;
  font-size: 17px;
}

.import-warning {
  color: var(--color-text-muted);
  font-size: 10px;
  line-height: 1.6;
}

.day-dialog::backdrop {
  background: rgba(62, 48, 35, 0.34);
}

.dialog-handle {
  width: 36px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: 4px;
  background: var(--color-border);
}

.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.icon-button--small {
  width: 34px;
  height: 34px;
  box-shadow: none;
  font-size: 20px;
}

.dialog-event {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 11px;
  background: var(--color-input);
}

.dialog-event__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.dialog-event h3 {
  margin: 0 0 5px;
  font-size: 14px;
}

.dialog-event p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 10px;
  line-height: 1.5;
}

.dialog-event__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.dialog-event__actions .button {
  min-height: 34px;
  padding: 0 11px;
  font-size: 10px;
}

.empty-state {
  padding: 26px 16px;
  border: 1px dashed var(--color-border);
  border-radius: 12px;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.empty-state span {
  display: block;
  margin-bottom: 7px;
  font-family: sans-serif;
  font-size: 26px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  max-width: calc(100% - 32px);
  padding: 9px 14px;
  border: 1px solid var(--color-border);
  border-radius: 9px;
  background: var(--color-text);
  color: var(--color-surface);
  box-shadow: 2px 2px 0 var(--color-shadow);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 8px);
  transition: opacity 120ms ease, transform 120ms ease;
}

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

@media (min-width: 480px) {
  .app-shell {
    padding-right: 20px;
    padding-left: 20px;
  }

  .calendar-card {
    padding: 17px 14px 15px;
  }

  .calendar-day {
    min-height: 79px;
    padding: 6px 5px;
  }

  .day-event {
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
