/* Putdel's gentle interaction layer. Layout, data and native dialog motion
   remain in the Expert core; every effect respects motion preferences. */
:root {
  --diary-motion-ease: cubic-bezier(.22, 1, .36, 1);
  --diary-motion-fast: 180ms;
  --diary-motion-soft: 260ms;
}

.diary-stat,
.diary-collab-card,
.diary-task-row,
.diary-content-row,
.diary-followup-row,
.diary-day,
.job-row,
.diary-panel,
.diary-month-actions button,
.diary-panel-head > button,
.diary-calendar-legend button,
.btn,
.icon-btn,
.nav button,
.bottom-nav button,
.tab,
.more-btn,
.contact-btn,
.indi-companion-open,
.indi-companion-restore {
  transition:
    transform var(--diary-motion-soft) var(--diary-motion-ease),
    opacity var(--diary-motion-fast) ease,
    background-color var(--diary-motion-fast) ease,
    color var(--diary-motion-fast) ease,
    border-color var(--diary-motion-fast) ease,
    box-shadow var(--diary-motion-soft) var(--diary-motion-ease);
}

.diary-day > span:first-child,
.diary-task-check,
.diary-brand-avatar,
.diary-panel-head > button svg {
  transition:
    transform var(--diary-motion-soft) var(--diary-motion-ease),
    color var(--diary-motion-fast) ease,
    border-color var(--diary-motion-fast) ease,
    background-color var(--diary-motion-fast) ease;
}

/* The companion responds to interaction instead of floating continuously. */
.indi-companion-image, .indi-companion-shadow { animation: none; }

/* Hover motion is reserved for a precise pointer, keeping touch scrolling quiet. */
@media (hover: hover) and (pointer: fine) {
  .diary-stat:hover {
    transform: translateY(-2px);
    border-color: #c9def4;
    box-shadow: 0 5px 13px #80a8d018;
  }
  .diary-stat.pink:hover { border-color: #edc4d7; }
  .diary-stat.lilac:hover { border-color: #d7cdef; }
  .diary-stat.sand:hover { border-color: #ead7b1; }
  .diary-panel:hover { border-color: #d3e2f3; }
  .diary-collab-card:hover {
    transform: translateY(-2px);
    border-color: #c3d9ef;
    box-shadow: 0 4px 10px #7ea4ca16;
  }
  .diary-collab-card.pink:hover { border-color: #efc3d7; }
  .diary-collab-card.lilac:hover { border-color: #d8cbee; }
  .diary-collab-card.sand:hover { border-color: #eddbb9; }
  .diary-task-row:hover,
  .diary-content-row:hover,
  .diary-followup-row:hover {
    transform: translateX(2px);
    background-color: #f5faff;
  }
  .diary-task-row:hover .diary-task-check {
    background-color: #e9f4ff;
    color: #719bc8;
    border-color: #c8ddf2;
  }
  .diary-content-row:hover .diary-brand-avatar,
  .diary-followup-row:hover .diary-brand-avatar {
    transform: translateY(-1px);
  }
  .diary-day:hover {
    background-color: #eff7ff;
    color: #547a9f;
  }
  .diary-day:hover > span:first-child { transform: translateY(-1px); }
  .diary-day.has-content:hover { background-color: #fff0f6; }
  .diary-day.today:hover { background-color: #e7f2ff; }
  .job-row:hover {
    border-color: #c9dcf1 !important;
    box-shadow: 0 3px 12px #80a8d016;
  }
  .btn:not(:disabled):hover,
  .icon-btn:not(:disabled):hover,
  .diary-month-actions button:not(:disabled):hover {
    transform: translateY(-1px);
  }
  .btn-primary:not(:disabled):hover {
    border-color: #adcbee;
    box-shadow: 0 4px 9px #7296be1c;
  }
  .nav button:not(:disabled):hover { transform: translateX(2px); }
  .diary-panel-head > button:hover svg { transform: translateX(2px); }
  .indi-companion-open:hover .indi-companion-label {
    background-color: #fff2f8;
    border-color: #e8c4d7;
    box-shadow: 0 3px 10px #a97c9a1a;
  }
}

/* The press response is small and immediate; transforms never change layout. */
.diary-collab-card:active:not(:disabled),
.diary-task-row:active:not(:disabled),
.diary-content-row:active:not(:disabled),
.diary-followup-row:active:not(:disabled),
.diary-day:active:not(:disabled),
.diary-month-actions button:active:not(:disabled),
.diary-panel-head > button:active:not(:disabled),
.diary-calendar-legend button:active:not(:disabled),
.btn:active:not(:disabled),
.icon-btn:active:not(:disabled),
.nav button:active:not(:disabled),
.bottom-nav button:active:not(:disabled),
.tab:active:not(:disabled),
.more-btn:active:not(:disabled),
.contact-btn:active:not(:disabled),
.indi-companion-open:active:not(:disabled),
.indi-companion-restore:active:not(:disabled) {
  transform: scale(.985);
  transition-duration: 120ms;
}
.bottom-nav .bottom-add:active:not(:disabled) { transform: scale(.97); }
.diary-task-row:active:not(:disabled),
.diary-content-row:active:not(:disabled),
.diary-followup-row:active:not(:disabled) { background-color: #edf6ff; }

/* The desktop rail is stationary; only the mobile drawer slides. */
@media (min-width: 901px) {
  .sidebar { transition: none; }
}
@media (max-width: 900px) {
  .sidebar { transition: transform 320ms var(--diary-motion-ease); }
}

/* Disable feedback transforms explicitly, while keeping the diary's static
   ribbon/note rotations and the drawer's closed/open positions untouched. */
html[data-motion="false"] :is(
  .diary-stat, .diary-collab-card, .diary-task-row, .diary-content-row,
  .diary-followup-row, .diary-day, .job-row, .diary-panel,
  .diary-month-actions button, .diary-panel-head > button,
  .diary-calendar-legend button, .btn, .icon-btn, .nav button,
  .bottom-nav button, .tab, .more-btn, .contact-btn,
  .indi-companion-open, .indi-companion-restore
):is(:hover, :active),
html[data-motion="false"] .diary-day > span:first-child,
html[data-motion="false"] .diary-content-row .diary-brand-avatar,
html[data-motion="false"] .diary-followup-row .diary-brand-avatar,
html[data-motion="false"] .diary-panel-head > button svg {
  transform: none !important;
}

@media (prefers-reduced-motion: reduce) {
  :is(
    .diary-stat, .diary-collab-card, .diary-task-row, .diary-content-row,
    .diary-followup-row, .diary-day, .job-row, .diary-panel,
    .diary-month-actions button, .diary-panel-head > button,
    .diary-calendar-legend button, .btn, .icon-btn, .nav button,
    .bottom-nav button, .tab, .more-btn, .contact-btn,
    .indi-companion-open, .indi-companion-restore
  ):is(:hover, :active),
  .diary-day > span:first-child,
  .diary-content-row .diary-brand-avatar,
  .diary-followup-row .diary-brand-avatar,
  .diary-panel-head > button svg { transform: none !important; }
  .sidebar,
  .diary-stat, .diary-panel, .diary-collab-card,
  .diary-task-row, .diary-content-row, .diary-followup-row,
  .diary-day, .diary-day > span:first-child,
  .diary-brand-avatar, .diary-task-check,
  .diary-month-actions button, .diary-panel-head > button,
  .diary-panel-head > button svg { transition: none !important; }
}
/* Scale the completed portion without animating layout or changing the track width. */
.diary-stat-track > span { width: 100%; transform-origin: left center; }
