/* Список Задач — newmood-inspired neumorphism */
:root {
  --accent: #c24a36;
  --accent-soft: #df7b6a;
  --accent-wash: rgba(194, 74, 54, 0.12);
  --accent-rgb: 194, 74, 54;
  --white: #ffffff;
  --ink: #0a0a0a;
  --ink-soft: #3d3d3d;
  --muted: #6b6b6b;
  --neu-bg: #ebe8e6;
  --surface-2: #e4e0dd;
  --glass-edge: rgba(255, 255, 255, 0.55);
  --line: rgba(10, 10, 10, 0.06);
  --neu:
    3px 3px 5px rgba(10, 10, 10, 0.14),
    -3px -3px 5px rgba(255, 255, 255, 0.95);
  --neu-sm:
    2px 2px 3px rgba(10, 10, 10, 0.12),
    -2px -2px 3px rgba(255, 255, 255, 0.92);
  --neu-lg:
    4px 4px 7px rgba(10, 10, 10, 0.15),
    -4px -4px 7px rgba(255, 255, 255, 0.96);
  --neu-in:
    inset 2px 2px 4px rgba(10, 10, 10, 0.12),
    inset -2px -2px 4px rgba(255, 255, 255, 0.9);
  --neu-press:
    inset 3px 3px 5px rgba(10, 10, 10, 0.15),
    inset -2px -2px 4px rgba(255, 255, 255, 0.85);
  --neu-accent:
    3px 3px 5px rgba(160, 50, 35, 0.35),
    -2px -2px 4px rgba(255, 200, 180, 0.45);
  --radius: 28px;
  --font: "Comfortaa", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

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

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

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--neu-bg);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.45) transparent;
}

.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;
}

.app {
  min-height: 100dvh;
}

.shell {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: calc(28px + var(--safe-t)) 20px calc(48px + var(--safe-b));
}

.sidenav {
  position: fixed;
  z-index: 70;
  top: 0;
  left: 0;
  width: min(300px, 88vw);
  height: 100dvh;
  padding: calc(18px + var(--safe-t)) 14px calc(18px + var(--safe-b));
  border-radius: 0 28px 28px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: translateX(-105%);
  transition: transform 0.28s ease;
  overflow: hidden;
}

body.nav-open .sidenav {
  transform: none;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 65;
  background: rgba(20, 16, 14, 0.28);
  backdrop-filter: blur(2px);
}

.sidenav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 2px;
}

.logo.sm {
  width: 44px;
  height: 44px;
  font-size: 1.15rem;
  animation: none;
  box-shadow: var(--neu-sm);
}

.sidenav-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sidenav-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-close {
  margin-left: auto;
}

.nav-search-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--neu-bg);
  box-shadow: var(--neu-sm);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: left;
}

.nav-search-btn:hover {
  color: var(--accent);
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.nav-section.grow {
  flex: 1;
  overflow: hidden;
}

.nav-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px;
}

.nav-label {
  margin: 0;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn.icon.tiny {
  width: 32px;
  height: 32px;
  font-size: 1.1rem;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: auto;
  padding: 2px 2px 6px;
}

.nav-item {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px 0 10px;
  border-radius: 16px;
  background: var(--neu-bg);
  box-shadow: var(--neu-sm);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: left;
  transition:
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.nav-item:hover {
  color: var(--accent);
}

.nav-item.active {
  color: var(--accent);
  box-shadow:
    var(--neu-sm),
    0 0 0 3px var(--accent-wash);
}

.nav-item.danger {
  color: #8a3a32;
}

.nav-item.danger.active,
.nav-item.danger:hover {
  color: var(--accent);
}

.nav-item-icon {
  font-size: 1.05rem;
  line-height: 1;
  text-align: center;
}

.nav-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item-count {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.nav-item.active .nav-item-count {
  color: var(--accent);
}

.nav-empty {
  margin: 4px 8px 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.nav-footer {
  padding-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-link {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  border-radius: 999px;
  background: var(--neu-bg);
  box-shadow: var(--neu-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-action {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--neu-accent);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
}

.nav-action:hover {
  background: #b3412f;
}

.btn.icon.menu-btn {
  display: grid;
  width: 44px;
  height: 44px;
  font-size: 1.15rem;
}

.folder-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn.ghost.sm.danger {
  color: #8a3a32;
}

.btn.ghost.sm.danger:hover {
  color: var(--accent);
}

.meta-bit.folder {
  color: var(--ink-soft);
}

@media (min-width: 980px) {
  .sidenav {
    transform: none;
    box-shadow: var(--neu-lg);
  }

  .nav-backdrop,
  .nav-close,
  .btn.icon.menu-btn,
  .nav-search-btn {
    display: none !important;
  }

  .app {
    margin-left: 300px;
  }

  .shell {
    width: min(760px, calc(100% - 24px));
  }
}

@media (max-width: 979px) {
  .nav-search-btn {
    display: inline-flex;
  }
}

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

.top-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  margin-bottom: 14px;
}

.view-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  margin-bottom: 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.view-tab {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px 0 12px;
  border-radius: 999px;
  background: var(--neu-bg);
  box-shadow: var(--neu-sm);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  scroll-snap-align: start;
  transition:
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.view-tab:hover {
  color: var(--accent);
}

.view-tab.active {
  color: var(--accent);
  box-shadow:
    var(--neu-sm),
    0 0 0 3px var(--accent-wash);
}

.view-tab.today.active {
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--neu-accent);
}

.view-tab.today.active .view-tab-count {
  color: rgba(255, 255, 255, 0.9);
}

.view-tab.danger {
  color: #8a3a32;
}

.view-tab-icon {
  font-size: 1rem;
  line-height: 1;
}

.view-tab-count {
  min-width: 1.2em;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.view-tab.active .view-tab-count {
  color: var(--accent);
}

.top-search input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--neu-bg);
  box-shadow: var(--neu-in);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  outline: none;
}

.top-search input::placeholder {
  color: var(--muted);
}

.top-search input:focus {
  box-shadow:
    var(--neu-in),
    0 0 0 3px var(--accent-wash);
}

.top-search input[type="search"]::-webkit-search-cancel-button,
.top-search input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.btn.icon.search-clear {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.btn.accent.search-go {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1;
}

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

.logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--neu-bg);
  box-shadow: var(--neu-lg);
  color: var(--accent);
  font-size: 1.55rem;
  font-weight: 700;
  flex-shrink: 0;
  animation: pulse 2.8s ease-in-out infinite;
}

.logo-glyph {
  display: block;
  width: 82%;
  height: 82%;
  background-color: currentColor;
  -webkit-mask: url("/static/img/logo.svg") center / contain no-repeat;
  mask: url("/static/img/logo.svg") center / contain no-repeat;
}

.logo img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  display: block;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: var(--neu-lg);
  }
  50% {
    box-shadow:
      5px 5px 10px rgba(10, 10, 10, 0.16),
      -5px -5px 10px rgba(255, 255, 255, 1),
      0 0 0 6px var(--accent-wash);
  }
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.tagline {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 400;
  line-height: 1.35;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--neu-bg);
  box-shadow: var(--neu-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

.chip.muted {
  color: var(--muted);
  font-weight: 500;
}

.neu {
  background: var(--neu-bg);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  box-shadow: var(--neu-lg);
}

.composer {
  padding: 14px;
  margin-bottom: 22px;
  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    padding 0.28s ease;
}

.first-hint {
  margin: 0 0 12px;
  padding: 0 6px;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

body.first-visit .composer {
  padding: 22px 18px;
  box-shadow:
    var(--neu-lg),
    0 0 0 6px var(--accent-wash);
}

body.first-visit .panels {
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

body.first-visit #titleInput {
  height: 58px;
  font-size: 1.05rem;
}

body.first-visit #titleInput::placeholder {
  color: var(--ink-soft);
}

#createForm {
  display: flex;
  gap: 12px;
  align-items: center;
}

#titleInput {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--neu-bg);
  box-shadow: var(--neu-in);
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  outline: none;
}

#titleInput::placeholder {
  color: var(--muted);
}

#titleInput:focus {
  box-shadow:
    var(--neu-in),
    0 0 0 3px var(--accent-wash);
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn.accent {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--neu-accent);
  font-size: 1.65rem;
  line-height: 1;
}

.btn.accent:hover {
  background: #b3412f;
}

.btn.ghost {
  background: var(--neu-bg);
  color: var(--ink-soft);
  box-shadow: var(--neu-sm);
  padding: 0 16px;
  min-height: 40px;
}

.btn.ghost:hover {
  color: var(--accent);
}

.btn.ghost.sm {
  min-height: 34px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0 14px;
}

.btn.icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--neu-bg);
  box-shadow: var(--neu-sm);
  color: var(--muted);
  font-size: 1.05rem;
  flex-shrink: 0;
}

.btn.icon:hover {
  color: var(--accent);
}

.panels {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel {
  padding: 8px 10px 12px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 8px;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.task-list {
  list-style: none;
  margin: 0;
  padding: 4px 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 10px 12px 14px;
  border-radius: 22px;
  background: var(--neu-bg);
  box-shadow: var(--neu-sm);
  animation: rise 0.28s ease;
  cursor: pointer;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.task:hover {
  box-shadow: var(--neu);
}

.task.pinned {
  box-shadow:
    var(--neu-sm),
    0 0 0 2px var(--accent-wash);
}

.task.prio-high {
  border-left: 3px solid var(--accent);
}

.task.overdue .meta-bit.due {
  color: var(--accent);
  font-weight: 700;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.task.done-item {
  opacity: 0.72;
}

.task.done-item .task-title {
  text-decoration: line-through;
  color: var(--muted);
}

.check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  appearance: none;
  margin: 0;
  cursor: pointer;
  background: var(--neu-bg);
  box-shadow: var(--neu-in);
  border: 0;
  display: grid;
  place-items: center;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.check::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.18s ease, transform 0.18s ease;
  transform: scale(0.4);
}

.check:checked {
  background: var(--accent);
  box-shadow: var(--neu-accent);
}

.check:checked::after {
  background: var(--white);
  transform: scale(1);
}

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

.task-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-icon {
  flex-shrink: 0;
  font-size: 1.15rem;
  line-height: 1;
}

.task-title {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}

.pin-mark {
  flex-shrink: 0;
  font-size: 0.85rem;
  opacity: 0.85;
}

.task-preview {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.meta-bit {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  box-shadow: var(--neu-in);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}

.meta-bit.prio.p1 {
  color: #5a7a4a;
}

.meta-bit.prio.p2 {
  color: #9a6b2a;
}

.meta-bit.prio.p3 {
  color: var(--accent);
}

.meta-bit.tag {
  color: var(--accent);
}

.btn.icon.pin-btn {
  font-size: 0.95rem;
  opacity: 0.72;
}

.btn.icon.pin-btn:hover {
  opacity: 1;
}

.empty {
  margin: 8px 16px 18px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(20, 16, 14, 0.28);
  backdrop-filter: blur(2px);
  animation: fade 0.2s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.detail-sheet {
  position: fixed;
  z-index: 60;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100dvh;
  padding: calc(18px + var(--safe-t)) 18px calc(22px + var(--safe-b));
  border-radius: 28px 0 0 28px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slideIn 0.28s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(18px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

body.sheet-open {
  overflow: hidden;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 2px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

.detail-row.icon-title {
  display: flex;
  gap: 10px;
  align-items: center;
}

.icon-pick {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border: 0;
  border-radius: 18px;
  background: var(--neu-bg);
  box-shadow: var(--neu-sm);
  font-size: 1.45rem;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.icon-pick:hover {
  box-shadow: var(--neu);
}

.icon-pick:active {
  transform: scale(0.96);
  box-shadow: var(--neu-press);
}

#detailTitle {
  flex: 1;
  min-width: 0;
  height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  background: var(--neu-bg);
  box-shadow: var(--neu-in);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  outline: none;
}

#detailTitle:focus,
.field textarea:focus,
.field input:focus,
.field select:focus {
  box-shadow:
    var(--neu-in),
    0 0 0 3px var(--accent-wash);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field > span {
  padding-left: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.smart-when {
  display: flex;
  align-items: center;
  gap: 8px;
}

.smart-when input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  background: var(--neu-bg);
  box-shadow: var(--neu-in);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  outline: none;
}

.smart-when input[type="text"]:focus {
  box-shadow:
    var(--neu-in),
    0 0 0 3px var(--accent-wash);
}

.smart-hint {
  margin: 6px 0 0;
  padding-left: 4px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
}

.smart-hint.bad {
  color: #8a3a32;
}

.meta-bit.remind {
  color: #9a6b2a;
}

.meta-bit.remind.due-now {
  color: var(--accent);
  font-weight: 700;
}

/* Date/time popover */
.dt-popover {
  position: fixed;
  z-index: 120;
  width: min(320px, calc(100vw - 24px));
  padding: 14px;
  border-radius: 22px;
}

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

.dt-head strong {
  font-size: 0.95rem;
}

.dt-dow {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 6px;
  text-align: center;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.dt-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.dt-day {
  appearance: none;
  border: 0;
  height: 36px;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.dt-day.empty {
  pointer-events: none;
}

.dt-day:hover {
  background: var(--accent-wash);
  color: var(--accent);
}

.dt-day.today {
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}

.dt-day.selected {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--neu-accent);
}

.dt-time {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.dt-time label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.dt-time input {
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--neu-bg);
  box-shadow: var(--neu-in);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  outline: none;
}

.dt-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.dt-quick button {
  appearance: none;
  border: 0;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--neu-bg);
  box-shadow: var(--neu-sm);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
}

.dt-quick button:hover {
  color: var(--accent);
}

.dt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.btn.save.sm,
.btn.ghost.sm {
  min-height: 36px;
  padding: 0 14px;
}

.field textarea,
.field input,
.field select {
  width: 100%;
  border: 0;
  border-radius: 18px;
  background: var(--neu-bg);
  box-shadow: var(--neu-in);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
  outline: none;
  padding: 14px 16px;
}

.field textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.45;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

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

.detail-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--neu-bg);
  box-shadow: var(--neu-sm);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.emoji-panel {
  padding: 12px;
  border-radius: 20px;
  background: var(--neu-bg);
  box-shadow: var(--neu-in);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.emoji-btn {
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--neu-bg);
  box-shadow: var(--neu-sm);
  font-size: 1.2rem;
  cursor: pointer;
}

.emoji-btn:hover {
  color: var(--accent);
}

.emoji-btn.clear {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}

#emojiCustom {
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: var(--neu-bg);
  box-shadow: var(--neu-in);
  font: inherit;
  outline: none;
}

.detail-meta {
  margin: 0;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn.save {
  flex: 1;
  min-height: 48px;
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--neu-accent);
  font-size: 0.95rem;
}

.btn.save:hover {
  background: #b3412f;
}

.btn.ghost.danger {
  color: #8a3a32;
}

.btn.ghost.danger:hover {
  color: var(--accent);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 80;
  max-width: min(90vw, 360px);
  padding: 12px 18px;
  border-radius: 999px;
  background: #2a2428;
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  animation: rise 0.25s ease;
}

@media (max-width: 560px) {
  .top {
    flex-direction: column;
  }

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

  .logo {
    width: 56px;
    height: 56px;
  }

  .detail-sheet {
    width: 100%;
    border-radius: 28px 28px 0 0;
    top: auto;
    bottom: 0;
    height: min(92dvh, 100%);
    animation: riseSheet 0.28s ease;
  }

  @keyframes riseSheet {
    from {
      transform: translateY(24px);
      opacity: 0.7;
    }
    to {
      transform: none;
      opacity: 1;
    }
  }

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

  .emoji-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

.btn.welcome-go {
  width: 100%;
  min-height: 52px;
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--neu-accent);
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 999px;
}

.btn.welcome-go:hover {
  background: #b3412f;
}

.pro-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 16, 14, 0.4);
  backdrop-filter: blur(3px);
  animation: fade 0.22s ease;
}

.pro-modal {
  position: fixed;
  z-index: 96;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(860px, calc(100vw - 24px));
  max-height: min(92dvh, 720px);
  overflow: auto;
  padding: 0;
  border-radius: 28px;
  animation: rise 0.28s ease;
}

.pro-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
}

.pro-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 520px;
}

.pro-left {
  padding: 32px 28px 28px;
}

.pro-right {
  padding: 36px 28px 28px;
  background: linear-gradient(165deg, #f7efe6 0%, #f3e7db 55%, #efe0d2 100%);
  border-radius: 0 28px 28px 0;
}

.pro-left h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.pro-lead {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.pro-label {
  margin: 22px 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}

.pro-plan {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  border-radius: 16px;
  background: var(--neu-bg);
  box-shadow: var(--neu-in);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.pro-plan.selected {
  box-shadow:
    var(--neu-in),
    0 0 0 2px var(--accent);
}

.pro-plan-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pro-plan-main strong {
  font-size: 0.98rem;
}

.pro-plan-main em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.86rem;
}

.pro-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(194, 74, 54, 0.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.pro-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

.pro-more {
  margin: 10px 0 0;
  font-size: 0.88rem;
}

.pro-more a,
.pro-learn a {
  color: var(--accent);
  font-weight: 600;
}

.pro-select {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--neu-bg);
  box-shadow: var(--neu-in);
  font-weight: 600;
  color: var(--ink-soft);
}

.pro-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.pro-due {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.pro-due strong {
  font-size: 0.98rem;
}

.pro-due p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.pro-free-tag {
  color: #2f9e5b;
  font-weight: 700;
}

.pro-due-sum {
  text-align: right;
}

.pro-due-sum strong {
  display: block;
  font-size: 1.15rem;
}

.pro-due-sum span {
  color: var(--muted);
  font-size: 0.8rem;
}

.pro-left .welcome-go {
  margin-top: 18px;
}

.pro-foot {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  text-align: center;
}

.pro-art {
  width: 96px;
  height: 96px;
  margin: 8px auto 18px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background: var(--neu-bg);
  box-shadow: var(--neu-lg);
  color: var(--accent);
  font-size: 2.6rem;
}

.pro-art .logo-glyph {
  width: 72%;
  height: 72%;
}

.pro-right h3 {
  margin: 0 0 14px;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-align: center;
}

.pro-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pro-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink-soft);
  line-height: 1.35;
}

.pro-features li::before {
  content: "✓";
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2f9e5b;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.pro-learn {
  margin: 16px 0 0;
  text-align: center;
  font-size: 0.9rem;
}

.pro-reviews {
  margin: 22px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

body.pro-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .pro-grid {
    grid-template-columns: 1fr;
  }

  .pro-right {
    border-radius: 0 0 28px 28px;
  }

  .pro-due {
    flex-direction: column;
  }

  .pro-due-sum {
    text-align: left;
  }
}
