:root {
  color-scheme: dark;
  --page: #11131a;
  --surface: #1b1e28;
  --surface-soft: #242835;
  --ink: #edf0fa;
  --muted: #9ba3b8;
  --line: #303545;
  --accent: #9a90ff;
  --accent-dark: #8175f5;
  --accent-soft: #302d50;
  --danger: #ff788d;
  --success: #63cda5;
  --shadow: 0 18px 50px rgba(0, 0, 0, .22);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 90% 0%, rgba(116, 105, 244, .10), transparent 34rem),
    var(--page);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(100% - 32px, 620px); margin: 0 auto; padding: 22px 0 28px; }
.topbar { display: flex; align-items: center; gap: 10px; min-height: 34px; }
.brand-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 11px;
  color: #fff; background: linear-gradient(145deg, #8175ff, #5c50dc); font-size: 24px; font-weight: 800;
  box-shadow: 0 5px 14px rgba(101, 88, 232, .25);
}
.topbar-caption { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.topbar-spacer { flex: 1; }
.connection-indicator { display: flex; align-items: center; gap: 7px; color: #788195; font-size: 11px; font-weight: 700; }
.connection-indicator span, .footer-dot { width: 7px; height: 7px; border-radius: 50%; background: #35b889; box-shadow: 0 0 0 3px rgba(53, 184, 137, .12); }
.intro { padding: 38px 2px 25px; }
.eyebrow { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .17em; }
.intro h1 { margin: 10px 0 11px; font-size: clamp(36px, 10vw, 49px); line-height: 1.07; letter-spacing: -.065em; font-weight: 800; }
.intro h1 span { color: var(--accent); }
.intro p { max-width: 360px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.panel { border: 1px solid rgba(232, 235, 244, .9); border-radius: 23px; background: var(--surface); box-shadow: var(--shadow); }
.composer { padding: 23px 21px 18px; }
.panel-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.panel-heading h2, .section-heading h2 { margin: 5px 0 0; font-size: 19px; line-height: 1.3; letter-spacing: -.04em; }
.heading-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 13px; color: var(--accent); background: var(--accent-soft); font-size: 21px; }
.field-label { display: block; margin: 22px 0 9px; color: var(--ink); font-size: 11px; font-weight: 800; }
textarea, .input-wrap input {
  display: block; width: 100%; border: 1px solid var(--line); outline: none; border-radius: 13px;
  color: var(--ink); background: var(--surface-soft); transition: border-color .18s, box-shadow .18s, background .18s;
}
textarea { min-height: 92px; padding: 13px 14px; resize: vertical; font-size: 13px; line-height: 1.6; }
textarea::placeholder { color: #aeb4c2; }
textarea:focus, .input-wrap input:focus { border-color: #aaa3ff; background: var(--surface-soft); box-shadow: 0 0 0 3px rgba(101, 88, 232, .09); }
.field-meta { display: flex; justify-content: space-between; margin-top: 7px; color: #a0a7b6; font-size: 10px; }
.date-label { margin-top: 20px; }
.datetime-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 10px; }
.input-wrap { display: block; min-width: 0; padding: 10px 12px 9px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.input-caption { display: block; margin-bottom: 5px; color: #9aa1b1; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.input-wrap input { padding: 0; border: 0; border-radius: 0; background: transparent; font-size: 13px; font-weight: 700; }
.input-wrap input:focus { border: 0; box-shadow: none; background: transparent; }
.timezone-hint { margin-top: 9px; color: #9aa1b1; font-size: 10px; }
.primary-button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 51px;
  margin-top: 19px; padding: 0 16px 0 18px; border: 0; border-radius: 14px; color: #fff;
  background: linear-gradient(105deg, #7064f0, #5d51dc); box-shadow: 0 8px 18px rgba(101, 88, 232, .22);
  cursor: pointer; font-size: 12px; font-weight: 800; transition: transform .15s, box-shadow .15s, opacity .15s;
}
.primary-button:active { transform: translateY(1px); box-shadow: 0 4px 10px rgba(101, 88, 232, .2); }
.primary-button:disabled { opacity: .58; cursor: wait; }
.button-arrow { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; background: rgba(255,255,255,.17); font-size: 17px; }
.form-status { min-height: 15px; margin: 9px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.form-status.error { color: var(--danger); }
.form-status.success { color: var(--success); }
.reminders-section { margin-top: 32px; }
.section-heading { padding: 0 2px 13px; }
.count-pill { display: grid; place-items: center; min-width: 29px; height: 27px; padding: 0 8px; border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-size: 11px; font-weight: 800; }
.reminder-list { display: grid; gap: 9px; }
.reminder-card { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 5px 20px rgba(34, 42, 75, .035); animation: appear .22s ease both; }
.reminder-date-icon { display: grid; flex: 0 0 37px; place-items: center; width: 37px; height: 37px; border-radius: 12px; color: var(--accent); background: var(--accent-soft); font-size: 17px; }
.reminder-content { flex: 1; min-width: 0; }
.reminder-date { margin: 1px 0 5px; color: var(--accent); font-size: 10px; font-weight: 800; }
.reminder-text { color: var(--ink); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.delete-button { flex: 0 0 auto; padding: 7px 9px; border: 0; border-radius: 9px; color: #a0a6b4; background: transparent; cursor: pointer; font-size: 10px; font-weight: 700; }
.delete-button:active { color: var(--danger); background: #422631; }
.list-placeholder, .empty-state { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 86px; padding: 18px; border: 1px dashed var(--line); border-radius: 16px; color: #9aa1b1; background: rgba(255,255,255,.025); text-align: center; font-size: 11px; line-height: 1.6; }
.empty-icon { display: block; margin-bottom: 4px; color: #aaa4f5; font-size: 21px; }
.loader { width: 13px; height: 13px; border: 2px solid #e6e3ff; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.notice { display: flex; gap: 13px; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-soft); box-shadow: var(--shadow); }
.notice-icon { display: grid; flex: 0 0 35px; place-items: center; width: 35px; height: 35px; border-radius: 11px; color: var(--accent); background: var(--accent-soft); font-size: 19px; }
.notice h2 { margin: 1px 0 5px; font-size: 13px; }
.notice p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.footer { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 29px; color: #a1a8b6; font-size: 9px; }
.footer-dot { width: 5px; height: 5px; box-shadow: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 560px) { .app-shell { padding-top: 30px; } .intro { padding-top: 48px; } .composer { padding: 27px 27px 20px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Быстрые варианты и собственные пикеры даты/времени */
.quick-presets { display: flex; flex-wrap: wrap; gap: 7px; margin: -1px 0 13px; }
.preset-button {
  min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--muted); background: var(--surface-soft); cursor: pointer; font-size: 10px; font-weight: 700;
  transition: color .15s, border-color .15s, background .15s, transform .15s;
}
.preset-button:active { transform: translateY(1px); }
.preset-button.is-active { color: var(--accent); border-color: rgba(101, 88, 232, .35); background: var(--accent-soft); }
.picker-field { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); transition: border-color .18s, box-shadow .18s; }
.picker-field:focus-within { border-color: #aaa3ff; box-shadow: 0 0 0 3px rgba(101, 88, 232, .09); }
.picker-trigger { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; width: 100%; min-height: 66px; padding: 9px 12px; border: 0; color: var(--muted); background: transparent; cursor: pointer; text-align: left; font-size: 13px; font-weight: 700; }
.picker-trigger.has-value { color: var(--ink); }
.picker-value-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.picker-value-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-chevron { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.picker-popover { position: relative; z-index: 5; margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 14px 38px rgba(25, 31, 55, .14); animation: appear .16s ease both; }
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.calendar-header strong { color: var(--ink); font-size: 13px; font-weight: 800; text-transform: capitalize; }
.picker-nav { display: grid; place-items: center; width: 31px; height: 31px; border: 0; border-radius: 9px; color: var(--ink); background: var(--surface-soft); cursor: pointer; font-size: 21px; line-height: 1; }
.calendar-weekdays, .calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.calendar-weekdays { margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 800; }
.calendar-weekdays span { padding: 5px 0; }
.calendar-blank { min-height: 36px; }
.calendar-day { min-height: 36px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; cursor: pointer; font-size: 11px; font-weight: 600; }
.calendar-day:active { background: var(--accent-soft); }
.calendar-day.is-today { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
.calendar-day.is-selected { color: #fff; background: var(--accent); box-shadow: none; }
.picker-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); }
.picker-text-button { padding: 7px 4px; border: 0; color: var(--accent); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.picker-done { min-width: 78px; min-height: 34px; padding: 0 13px; border: 0; border-radius: 10px; color: #fff; background: var(--accent); cursor: pointer; font-size: 11px; font-weight: 800; }
.time-picker-heading { margin-bottom: 11px; color: var(--ink); font-size: 13px; font-weight: 800; }
.time-columns { display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr); align-items: center; gap: 8px; }
.time-column-wrap { min-width: 0; }
.column-caption { display: block; margin-bottom: 8px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .12em; text-align: center; }
.time-wheel { height: 184px; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none; padding: 68px 4px; border-radius: 11px; background: var(--surface-soft); }
.time-wheel::-webkit-scrollbar { display: none; }
.time-option { display: block; width: 100%; height: 48px; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 16px; font-weight: 700; scroll-snap-align: center; }
.time-option.is-selected { color: #fff; background: var(--accent); font-size: 20px; font-weight: 800; }
.time-separator { color: var(--ink); font-size: 23px; font-weight: 800; text-align: center; }


@media (max-width: 380px) {
  .quick-presets { gap: 6px; }
  .preset-button { padding: 0 8px; font-size: 9px; }
  .datetime-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .picker-trigger { padding-right: 9px; padding-left: 9px; font-size: 11px; }
}
.calendar-day:disabled { color: var(--muted); opacity: .32; cursor: not-allowed; }

/* Всплывающие пикеры и подтверждение удаления */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 7, 12, .72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.picker-popover {
  position: fixed;
  z-index: 51;
  top: 50%;
  left: 50%;
  width: min(350px, calc(100vw - 32px));
  max-height: min(82vh, 680px);
  overflow: auto;
  margin: 0;
  padding: 17px;
  border: 1px solid #3a4053;
  border-radius: 20px;
  background: #1b1e28;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
  transform: translate(-50%, -50%);
  animation: popup-appear .16s ease both;
}
@keyframes popup-appear {
  from { opacity: 0; scale: .97; }
  to { opacity: 1; scale: 1; }
}
.time-popover { width: min(300px, calc(100vw - 32px)); }
.time-options-single {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: min(52vh, 390px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border-radius: 13px;
  background: var(--surface-soft);
  scrollbar-width: thin;
  scrollbar-color: #555b72 transparent;
}
.time-options-single .time-option {
  flex: 0 0 37px;
  width: 100%;
  min-height: 37px;
  text-align: center;
  font-size: 13px;
}
.time-options-single .time-option.is-selected {
  color: #fff;
  background: var(--accent);
}
.confirm-dialog {
  position: fixed;
  z-index: 61;
  top: 50%;
  left: 50%;
  width: min(360px, calc(100vw - 32px));
  padding: 23px;
  border: 1px solid #3a4053;
  border-radius: 21px;
  background: #1b1e28;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
  text-align: center;
  transform: translate(-50%, -50%);
  animation: popup-appear .16s ease both;
}
#delete-backdrop { z-index: 60; }
.confirm-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 13px;
  border-radius: 14px;
  color: var(--danger);
  background: rgba(255, 120, 141, .12);
  font-size: 22px;
  font-weight: 800;
}
.confirm-dialog h2 { margin: 0 0 8px; color: var(--ink); font-size: 16px; }
.confirm-dialog p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 21px; }
.secondary-button, .danger-button {
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.secondary-button { color: var(--ink); background: var(--surface-soft); }
.danger-button { color: #fff; background: #c94e67; }
.danger-button:disabled { opacity: .55; cursor: wait; }
@media (max-width: 380px) {
  .picker-popover { padding: 14px; }
  .confirm-dialog { padding: 20px; }
}
