:root {
  color-scheme: dark;
  --glass: rgba(30, 19, 28, 0.58);
  --glass-strong: rgba(27, 17, 25, 0.72);
  --line: rgba(255, 255, 255, 0.15);
  --line-strong: rgba(255, 255, 255, 0.24);
  --text: #fff9fb;
  --muted: rgba(255, 246, 249, 0.68);
  --soft: rgba(255, 240, 245, 0.10);
  --accent: #ffc1d3;
  --accent-strong: #ff91b3;
  --accent-shadow: rgba(255, 128, 170, 0.34);
  --danger: #ffb5b5;
  --shadow: 0 30px 80px rgba(14, 7, 12, 0.38);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 15px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body { width: 100%; min-height: 100%; margin: 0; }

body {
  min-height: 100vh;
  overflow: hidden;
  color: var(--text);
  background: #24191e url("assets/background.png") center center / cover no-repeat fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(18, 11, 16, 0.36) 0%, rgba(18, 11, 16, 0.06) 43%, rgba(18, 11, 16, 0.28) 100%),
    linear-gradient(180deg, rgba(13, 8, 11, 0.09) 0%, rgba(13, 8, 11, 0.16) 100%);
}

button, input, textarea { font: inherit; }
button { color: inherit; }
button, input[type="checkbox"] { cursor: pointer; }

.desktop-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: clamp(28px, 4vw, 68px);
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(520px, 620px);
  gap: clamp(28px, 4vw, 76px);
  align-items: start;
}

.hero-clock {
  align-self: start;
  padding-top: 2vh;
  max-width: 560px;
  text-shadow: 0 4px 30px rgba(35, 15, 22, 0.45);
}

.clock {
  font-size: clamp(72px, 9vw, 146px);
  font-weight: 230;
  letter-spacing: -0.075em;
  line-height: 0.9;
}

.today-label {
  margin-top: 18px;
  font-size: clamp(20px, 2vw, 31px);
  font-weight: 520;
}

.hero-tasks {
  --drag-x: 0px;
  --drag-y: 0px;
  width: min(560px, calc(100vw - 48px));
  margin-top: 16px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.19);
  border-radius: 22px;
  color: rgba(255,255,255,.93);
  background: linear-gradient(145deg, rgba(34, 19, 30, .46), rgba(24, 15, 22, .34));
  backdrop-filter: blur(20px) saturate(125%);
  -webkit-backdrop-filter: blur(20px) saturate(125%);
  box-shadow: 0 18px 45px rgba(22, 10, 17, .22), inset 0 1px 0 rgba(255,255,255,.06);
  text-shadow: none;
  transform: translate3d(var(--drag-x), var(--drag-y), 0);
  will-change: transform;
}

.hero-tasks.is-dragging {
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 26px 70px rgba(22, 10, 17, .36), inset 0 1px 0 rgba(255,255,255,.09);
}

.hero-tasks-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px 9px;
  font-size: 13px;
  font-weight: 720;
  letter-spacing: .01em;
  cursor: grab;
  touch-action: none;
}

.hero-tasks.is-dragging .hero-tasks-heading { cursor: grabbing; }

.hero-task-heading-title,
.hero-task-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drag-grip {
  color: rgba(255,255,255,.48);
  font-size: 17px;
  line-height: 1;
  letter-spacing: -4px;
}

.hero-task-reset {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 999px;
  color: rgba(255,255,255,.68);
  background: rgba(255,255,255,.06);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.hero-task-reset:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}

.hero-task-counter {
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #3e1d29;
  background: var(--accent);
  font-size: 11px;
  font-weight: 850;
}

.hero-task-form {
  display: grid;
  grid-template-columns: 82px 1fr 38px;
  gap: 8px;
}

.hero-task-form input {
  height: 39px;
  border-color: rgba(255,255,255,.16);
  background: rgba(8, 5, 7, .24);
}

.hero-task-form button {
  border: 0;
  border-radius: 12px;
  color: #3a1b27;
  background: linear-gradient(135deg, #ffe5ec, #ffabc4);
  font-size: 21px;
  box-shadow: 0 8px 18px rgba(255, 128, 169, .17);
}

.hero-task-list {
  max-height: 154px;
  margin-top: 7px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) transparent;
}

.hero-task-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: auto 61px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 3px;
  border-bottom: 1px solid rgba(255,255,255,.085);
}

.hero-task-row:last-child { border-bottom: 0; }
.hero-task-row.completed .hero-task-title {
  color: rgba(255,255,255,.45);
  text-decoration: line-through;
}

.hero-task-time,
.task-time {
  color: var(--accent);
  font-size: 11px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hero-task-time.no-time,
.task-time.no-time {
  color: rgba(255,255,255,.40);
  font-size: 9px;
  font-weight: 600;
}

.hero-task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}

.hero-empty-state {
  padding: 11px 4px 5px;
  color: rgba(255,255,255,.62);
  font-size: 12px;
  line-height: 1.4;
}

.hero-task-row .delete-button { opacity: .55; }
.hero-task-row:hover .delete-button { opacity: 1; }

.dashboard {
  width: 100%;
  max-height: calc(100vh - clamp(56px, 8vw, 136px));
  overflow: auto;
  scrollbar-width: none;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background: linear-gradient(155deg, rgba(48, 28, 42, 0.62), rgba(24, 15, 22, 0.70));
  backdrop-filter: blur(28px) saturate(125%);
  -webkit-backdrop-filter: blur(28px) saturate(125%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.08);
}

.dashboard::-webkit-scrollbar { display: none; }

.dashboard-header,
.panel-heading,
.calendar-toolbar,
.dashboard-footer,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-header { margin-bottom: 18px; }

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.17em;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 27px; letter-spacing: -0.02em; }
h2 { margin-bottom: 0; font-size: 19px; letter-spacing: -0.015em; }

.header-actions { display: flex; align-items: center; gap: 9px; }

.ghost-button,
.icon-button,
.nav-button,
.text-button,
.danger-button {
  border: 0;
  outline: none;
}

.ghost-button,
.icon-button,
.nav-button {
  min-height: 38px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.075);
  transition: .18s ease;
}

.ghost-button { padding: 0 15px; border-radius: 999px; font-size: 13px; }
.icon-button, .nav-button { width: 38px; border-radius: 12px; font-size: 19px; }
.ghost-button:hover, .icon-button:hover, .nav-button:hover { background: rgba(255,255,255,.14); transform: translateY(-1px); }

.calendar-card,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.055);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
}

.calendar-card { padding: 16px; }
.calendar-toolbar { margin-bottom: 12px; }
.calendar-toolbar h2 { text-transform: capitalize; }

.weekdays, .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.weekdays span {
  padding: 4px 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
}

.calendar-day {
  position: relative;
  aspect-ratio: 1.38 / 1;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  transition: .16s ease;
}

.calendar-day:hover { background: rgba(255,255,255,.09); }
.calendar-day.other-month { color: rgba(255,255,255,.33); }
.calendar-day.today { border-color: rgba(255,193,211,.58); }
.calendar-day.selected {
  color: #3b1c28;
  font-weight: 760;
  background: linear-gradient(135deg, #ffe0e8, #ffacc5);
  box-shadow: 0 7px 20px var(--accent-shadow);
}

.calendar-day.has-data::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}
.calendar-day.selected.has-data::after { background: #6a2d42; }

.planner-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.panel { padding: 16px; min-width: 0; }
.counter {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #3e1d29;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.quick-form,
.meeting-form {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}
.quick-form { grid-template-columns: 82px 1fr 38px; }
.meeting-form { grid-template-columns: 86px 1fr 38px; }

input, textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,.13);
  outline: none;
  color: var(--text);
  background: rgba(8, 5, 7, .18);
  transition: border-color .17s ease, background .17s ease, box-shadow .17s ease;
}

input {
  height: 39px;
  padding: 0 12px;
  border-radius: 12px;
  font-size: 13px;
}

input::placeholder, textarea::placeholder { color: rgba(255,255,255,.42); }
input:focus, textarea:focus {
  border-color: rgba(255,193,211,.72);
  background: rgba(8,5,7,.27);
  box-shadow: 0 0 0 3px rgba(255,145,179,.12);
}

.quick-form button, .meeting-form button {
  border: 0;
  border-radius: 12px;
  color: #3a1b27;
  background: linear-gradient(135deg, #ffe5ec, #ffabc4);
  font-size: 21px;
  font-weight: 500;
  box-shadow: 0 8px 18px rgba(255, 128, 169, .17);
}

.item-list {
  margin-top: 12px;
  max-height: 188px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) transparent;
}

.empty-state {
  padding: 16px 4px 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.list-item {
  min-height: 40px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 7px 3px;
  border-bottom: 1px solid rgba(255,255,255,.075);
}
.list-item:last-child { border-bottom: 0; }
.task-row { grid-template-columns: auto 61px 1fr auto; }

.task-check {
  appearance: none;
  width: 19px;
  height: 19px;
  margin: 0;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 6px;
  background: rgba(255,255,255,.035);
  display: grid;
  place-content: center;
}
.task-check::before {
  content: "✓";
  color: #41202c;
  font-size: 13px;
  font-weight: 900;
  transform: scale(0);
  transition: transform .12s ease;
}
.task-check:checked { border-color: var(--accent); background: var(--accent); }
.task-check:checked::before { transform: scale(1); }

.item-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}
.completed .item-title { color: rgba(255,255,255,.43); text-decoration: line-through; }

.delete-button {
  width: 27px;
  height: 27px;
  opacity: 0;
  border: 0;
  border-radius: 9px;
  color: rgba(255,255,255,.72);
  background: transparent;
  font-size: 16px;
  transition: .15s ease;
}
.list-item:hover .delete-button { opacity: 1; }
.delete-button:hover { color: #fff; background: rgba(255,122,142,.18); }

.meeting-time {
  min-width: 45px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 730;
}
.meeting-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(255,145,179,.10), 0 0 12px rgba(255,145,179,.45);
}
.meeting-row { grid-template-columns: auto auto 1fr auto; }

.notes-panel { margin-top: 14px; }
.notes-heading { align-items: flex-end; }
.save-status { color: var(--muted); font-size: 11px; transition: opacity .2s ease; }
.notes-panel textarea {
  min-height: 92px;
  margin-top: 12px;
  padding: 12px 13px;
  resize: vertical;
  border-radius: 14px;
  line-height: 1.45;
}

.dashboard-footer {
  margin-top: 14px;
  padding: 0 3px;
  color: rgba(255,255,255,.48);
  font-size: 10.5px;
}
.text-button { padding: 4px 0; color: rgba(255,255,255,.6); background: none; font-size: 10.5px; }
.text-button:hover { color: var(--danger); }

.confirm-dialog {
  width: min(430px, calc(100vw - 36px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  color: var(--text);
  background: rgba(34, 21, 31, .90);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: 0 30px 90px rgba(0,0,0,.45);
}
.confirm-dialog::backdrop { background: rgba(12,7,10,.42); backdrop-filter: blur(4px); }
.confirm-dialog form { padding: 24px; }
.confirm-dialog h2 { margin-bottom: 9px; }
.confirm-dialog p { color: var(--muted); line-height: 1.5; }
.dialog-actions { justify-content: flex-end; margin-top: 22px; }
.danger-button { min-height: 38px; padding: 0 15px; border-radius: 999px; color: #3a111d; background: #ffb0bd; }

@media (max-width: 1180px) {
  .desktop-shell { grid-template-columns: minmax(250px, .7fr) minmax(500px, 570px); }
  .clock { font-size: clamp(68px, 8vw, 112px); }
  .planner-grid { grid-template-columns: 1fr; }
  .item-list { max-height: 136px; }
}

@media (max-width: 880px) {
  body { overflow: auto; }
  .desktop-shell { grid-template-columns: 1fr; align-items: start; padding: 24px; }
  .hero-clock { padding-top: 0; }
  .dashboard { max-height: none; }
  .hero-tasks { width: min(560px, calc(100vw - 48px)); }
}

@media (max-width: 520px) {
  .desktop-shell { padding: 18px; }
  .clock { font-size: 70px; }
  .today-label { margin-top: 12px; font-size: 20px; }
  .hero-tasks { width: calc(100vw - 36px); margin-top: 12px; padding: 11px; border-radius: 18px; }
  .hero-task-form { grid-template-columns: 74px minmax(0, 1fr) 36px; gap: 6px; }
  .hero-task-row { grid-template-columns: auto 55px minmax(0, 1fr) auto; gap: 6px; }
  .hero-task-list { max-height: 132px; }
  .dashboard { padding: 18px; }
  .quick-form { grid-template-columns: 74px minmax(0, 1fr) 36px; }
  .meeting-form { grid-template-columns: 74px minmax(0, 1fr) 36px; }
}

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

/* V4: убраны дублирующие блоки задач, встреч и заметок. */
.dashboard {
  overflow: visible;
  max-height: none;
}
