/* Список Задач — «strict technical + rewarding» design layer (2026-10).
 * Loaded after app.css. Re-maps the old neumorphic tokens to hairline
 * borders so every component goes flat at once, then tightens type,
 * radii and spacing. Reward moments: green check, day progress, finish line.
 */
@import url("/static/fonts/technical.css");

:root {
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --neu-bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --ink: #0e1116;
  --ink-soft: #3b4351;
  --muted: #6b7280;
  --line: #e2e5ea;
  --line-strong: #cdd3db;
  --grid: rgba(14, 17, 22, 0.035);
  --accent: #c24a36;
  --accent-soft: #e0705c;
  --accent-wash: rgba(194, 74, 54, 0.1);
  --ok: #12a150;
  --ok-wash: rgba(18, 161, 80, 0.12);
  --warn: #c27a12;

  --neu: 0 0 0 1px var(--line), 0 1px 2px rgba(14, 17, 22, 0.04);
  --neu-sm: 0 0 0 1px var(--line);
  --neu-lg: 0 0 0 1px var(--line), 0 12px 32px rgba(14, 17, 22, 0.1);
  --neu-in: inset 0 0 0 1px var(--line-strong);
  --neu-press: inset 0 0 0 1px var(--line-strong), inset 0 1px 2px rgba(14, 17, 22, 0.08);
  --neu-accent: 0 1px 0 rgba(14, 17, 22, 0.12), inset 0 -1px 0 rgba(0, 0, 0, 0.12);
  --rail-shadow: var(--neu-sm);
  --rail-shadow-in: inset 0 0 0 1px var(--line-strong);
  --radius: 10px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
}

html.dark,
body.dark {
  --neu-bg: #0c0e11;
  --surface: #14171c;
  --surface-2: #1a1e24;
  --ink: #e8ebef;
  --ink-soft: #b7bec8;
  --muted: #8a93a0;
  --line: #252a32;
  --line-strong: #323944;
  --grid: rgba(232, 235, 239, 0.03);
  --accent: #e0644d;
  --accent-soft: #f08a75;
  --accent-wash: rgba(224, 100, 77, 0.14);
  --ok: #2fc46f;
  --ok-wash: rgba(47, 196, 111, 0.14);
  --neu: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, 0.3);
  --neu-sm: 0 0 0 1px var(--line);
  --neu-lg: 0 0 0 1px var(--line), 0 16px 40px rgba(0, 0, 0, 0.5);
  --neu-in: inset 0 0 0 1px var(--line-strong);
  --neu-press: inset 0 0 0 1px var(--line-strong), inset 0 1px 2px rgba(0, 0, 0, 0.4);
  --neu-accent: inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

/* ---- base ---- */
html,
body {
  font-family: var(--font);
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}
body {
  background-color: var(--neu-bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
button,
input,
select,
textarea {
  font-family: var(--font);
}
::selection { background: var(--accent-wash); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- top bar ---- */
.top-nav {
  background: color-mix(in srgb, var(--surface) 88%, transparent) !important;
  backdrop-filter: saturate(1.4) blur(10px);
  border-radius: var(--r-lg) !important;
  box-shadow: var(--neu) !important;
}
html.fx-lite .top-nav { backdrop-filter: none; background: var(--surface) !important; }
.top-nav .toggle-nav .wrapper,
.top-nav .profile-pill,
.top-nav .search-clear {
  border-radius: var(--r-md) !important;
  box-shadow: var(--neu-sm) !important;
  background: var(--surface) !important;
}
.top-nav .search input,
#searchInput {
  border-radius: var(--r-md) !important;
  box-shadow: var(--neu-in) !important;
  background: var(--surface-2) !important;
  font-family: var(--font);
}
.theme-toggle .toggle-slot { border-radius: var(--r-md) !important; box-shadow: var(--neu-in) !important; }
.theme-toggle .toggle-button { border-radius: 5px !important; }

.pro-pill,
.sfx-toggle {
  height: 34px;
  border-radius: var(--r-md);
  box-shadow: var(--neu-sm);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
body.is-pro .pro-pill { background: var(--ink); color: var(--surface); box-shadow: none; }
.sfx-toggle {
  appearance: none;
  border: 0;
  width: 34px;
  display: inline-grid;
  place-items: center;
  margin-right: 10px;
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
}
.sfx-toggle svg { width: 17px; height: 17px; }
.sfx-toggle .sfx-off { display: none; }
.sfx-toggle.is-muted .sfx-on { display: none; }
.sfx-toggle.is-muted .sfx-off { display: block; }
.sfx-toggle.is-muted { color: var(--muted); }

/* ---- side rail ---- */
.nav-item,
.nav-link,
.nav-create-folder,
.nav-search-btn {
  border-radius: var(--r-md) !important;
  background: var(--surface) !important;
  font-weight: 500;
}
.nav-item.active {
  box-shadow: inset 0 0 0 1px var(--ink), inset 3px 0 0 var(--accent) !important;
}
.nav-item.active .nav-item-label { color: var(--ink); font-weight: 600; }
.nav-item-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.nav-item.danger .nav-item-count { color: var(--accent); }
.nav-action {
  border-radius: var(--r-md) !important;
  background: var(--ink) !important;
  color: var(--surface) !important;
}
.nav-action .nav-ico,
.nav-action .nav-link-label { color: var(--surface) !important; }
.sidenav { border-radius: var(--r-lg) !important; }
.sidenav.open { background: var(--surface) !important; box-shadow: var(--neu-lg) !important; }
.sidenav-title { font-weight: 600; letter-spacing: -0.01em; }
.sidenav-sub, .nav-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---- composer ---- */
.composer {
  border-radius: var(--r-lg) !important;
  background: var(--surface) !important;
  box-shadow: var(--neu) !important;
  padding: 10px !important;
}
.composer #titleInput,
#titleInput {
  border-radius: var(--r-md) !important;
  box-shadow: var(--neu-in) !important;
  background: var(--surface-2) !important;
  font-family: var(--font);
  font-size: 1rem;
}
#addBtn,
.btn.accent {
  border-radius: var(--r-md) !important;
  background: var(--ink) !important;
  color: var(--surface) !important;
  box-shadow: none !important;
  font-family: var(--mono);
  font-weight: 600;
}
.first-hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* ---- day progress (reward) ---- */
.day-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin: 10px 2px 2px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.day-progress[hidden] { display: none !important; }
.day-progress .dp-bar {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.day-progress .dp-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--ok), color-mix(in srgb, var(--ok) 70%, #9be7b8));
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.day-progress .dp-n { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.day-progress.is-done .dp-n { color: var(--ok); }
.day-progress.is-done .dp-bar i { animation: dp-shine 1.2s ease-out 1; }
@keyframes dp-shine {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.35); }
  100% { filter: brightness(1); }
}

/* ---- panels & tasks ---- */
.panel,
.panel.neu {
  border-radius: var(--r-lg) !important;
  background: var(--surface) !important;
  box-shadow: var(--neu) !important;
}
.panel-head h2,
#openHeading,
#doneHeading {
  font-family: var(--mono);
  font-size: 0.74rem !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.task-list { gap: 0 !important; }
.task {
  border-radius: var(--r-md) !important;
  background: transparent !important;
  box-shadow: none !important;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s ease;
}
.task:last-child { border-bottom: 0; }
.task:hover { background: var(--surface-2) !important; }
.task.prio-high { box-shadow: inset 3px 0 0 var(--accent) !important; }
.task.overdue .task-title { color: var(--ink); }
.task-title { font-weight: 500; letter-spacing: -0.01em; }
.task-preview { color: var(--muted); font-size: 0.85rem; }
.task.done-item .task-title { color: var(--muted); text-decoration-color: var(--line-strong); }
.task .btn.icon,
.task .pin-btn,
.task .delete {
  border-radius: var(--r-sm) !important;
  box-shadow: none !important;
  background: transparent !important;
  opacity: 0.55;
}
.task:hover .btn.icon { opacity: 1; }
.task .btn.icon:hover { background: var(--surface) !important; box-shadow: var(--neu-sm) !important; }

/* check = the reward moment */
.check {
  width: 20px !important;
  height: 20px !important;
  border-radius: 5px !important;
  box-shadow: inset 0 0 0 1.5px var(--line-strong) !important;
  background: var(--surface) !important;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.check:hover { box-shadow: inset 0 0 0 1.5px var(--ok) !important; background: var(--ok-wash) !important; }
.check:checked {
  background: var(--ok) !important;
  box-shadow: inset 0 0 0 1.5px var(--ok) !important;
}
.task.completing .check { transform: scale(1.18); }
.check-burst i { background: var(--ok) !important; border-radius: 1px !important; }

.meta-bit {
  font-family: var(--mono);
  font-size: 0.68rem !important;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 4px !important;
  padding: 2px 6px !important;
  background: var(--surface-2) !important;
  box-shadow: inset 0 0 0 1px var(--line) !important;
  color: var(--ink-soft) !important;
}
.meta-bit.due.overdue,
.meta-bit.remind.due-now { color: var(--accent) !important; box-shadow: inset 0 0 0 1px var(--accent-wash) !important; background: var(--accent-wash) !important; }
.meta-bit.prio.p3 { color: var(--accent) !important; }
.meta-bit.repeat { color: var(--ok) !important; }
.empty {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* ---- buttons ---- */
.btn {
  border-radius: var(--r-md) !important;
  font-family: var(--font);
  font-weight: 600;
  letter-spacing: -0.005em;
}
.btn.ghost {
  background: var(--surface) !important;
  box-shadow: var(--neu-sm) !important;
}
.btn.save,
.btn.welcome-go {
  background: var(--ink) !important;
  color: var(--surface) !important;
  box-shadow: none !important;
}
.btn.icon {
  border-radius: var(--r-md) !important;
}
.chip {
  border-radius: var(--r-sm) !important;
  box-shadow: inset 0 0 0 1px var(--line-strong) !important;
  background: var(--surface) !important;
  font-family: var(--mono);
  font-size: 0.74rem !important;
  font-weight: 500;
}
.chip[aria-pressed="true"] {
  background: var(--ink) !important;
  color: var(--surface) !important;
  box-shadow: none !important;
}
.toggle {
  border-radius: var(--r-md) !important;
  box-shadow: var(--neu-sm) !important;
  background: var(--surface) !important;
}
.toggle input { accent-color: var(--ok); }

/* ---- detail sheet ---- */
.detail-sheet {
  border-radius: var(--r-lg) 0 0 var(--r-lg) !important;
  background: var(--surface) !important;
  box-shadow: var(--neu-lg) !important;
}
.sheet-head h2 {
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
#detailTitle,
.field textarea,
.field input,
.field select,
.smart-when input[type="text"],
.smart-when input[type="time"],
.repeat-n input {
  border-radius: var(--r-md) !important;
  box-shadow: var(--neu-in) !important;
  background: var(--surface-2) !important;
  font-family: var(--font);
}
#detailTitle { font-size: 1.15rem; font-weight: 600; }
.field > span,
.chip-label {
  font-family: var(--mono);
  font-size: 0.66rem !important;
  letter-spacing: 0.1em !important;
}
.icon-pick,
.emoji-panel,
.emoji-btn {
  border-radius: var(--r-md) !important;
}
.smart-hint { font-family: var(--mono); font-size: 0.72rem; }
.detail-meta { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.push-hint { border-radius: var(--r-md); box-shadow: var(--neu-in); }

/* ---- modals, sheets, toast ---- */
.pro-modal,
.bot-sheet,
.stats-modal {
  border-radius: var(--r-lg) !important;
  background: var(--surface) !important;
  box-shadow: var(--neu-lg) !important;
}
.pro-right { border-radius: 0 var(--r-lg) var(--r-lg) 0 !important; background: var(--surface-2) !important; }
.pro-art { border-radius: var(--r-lg) !important; box-shadow: var(--neu) !important; }
.pro-features li::before { background: var(--ok) !important; border-radius: 4px !important; }
.pro-label { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.ics-row input { border-radius: var(--r-md); box-shadow: var(--neu-in); font-family: var(--mono); }
.stats-tile { border-radius: var(--r-md) !important; box-shadow: var(--neu-sm) !important; }
.stats-tile strong { font-family: var(--mono); color: var(--ink) !important; font-weight: 600; }
.stats-bar i { background: var(--ok) !important; border-radius: 2px 2px 0 0 !important; }
.stats-bar span,
.stats-day span,
.stats-h { font-family: var(--mono); }
.stats-day { border-radius: var(--r-md) !important; box-shadow: var(--neu-sm) !important; }
.stats-day strong { font-family: var(--mono); }
.stats-day.is-top { box-shadow: inset 0 0 0 1.5px var(--ok) !important; }
.pro-backdrop,
.sheet-backdrop,
.bot-backdrop,
.nav-backdrop {
  background: rgba(8, 10, 13, 0.42) !important;
  backdrop-filter: blur(2px);
}
.toast {
  border-radius: var(--r-md) !important;
  background: var(--ink) !important;
  color: var(--surface) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2) !important;
  font-family: var(--mono);
  font-size: 0.8rem !important;
  letter-spacing: 0.01em;
}
.fab-new-task {
  border-radius: 14px !important;
  background: var(--ink) !important;
  color: var(--surface) !important;
  box-shadow: 0 8px 20px rgba(14, 17, 22, 0.22) !important;
}
.logo,
.logo.sm { border-radius: var(--r-md) !important; }

/* finish line: everything due today is done */
.finish-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 2px 0;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--ok-wash);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 35%, transparent);
  color: var(--ink);
  font-size: 0.88rem;
  animation: finish-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.finish-line[hidden] { display: none !important; }
.finish-line b { font-family: var(--mono); color: var(--ok); font-weight: 600; }
@keyframes finish-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .day-progress .dp-bar i,
  .finish-line { transition: none; animation: none; }
}

/* theme switch: monochrome, matches the rest of the chrome */
.theme-toggle .toggle-slot {
  background: var(--surface-2) !important;
  border: 0 !important;
}
.theme-toggle .toggle-button {
  background: var(--ink) !important;
  box-shadow: none !important;
}
.theme-toggle .sun-icon-wrapper,
.theme-toggle .moon-icon-wrapper { color: var(--muted) !important; }
.theme-toggle .sun-icon { stroke: var(--ink-soft) !important; }
.theme-toggle .sun-core { fill: transparent !important; }
.top-nav .profile-avatar { border-radius: 6px !important; }

/* ===================================================================
 * QA pass 2026-10-09: layout + chrome fixes found on review.
 * =================================================================== */

/* Header was shifted with position:relative + top:30px but only 12px of
 * flow space was reserved, so it covered the first 18px of the composer
 * and the page scrolled by a nav height. Keep it in normal flow. */
.top-nav {
  top: 0 !important;
  margin-top: calc(16px + var(--safe-t)) !important;
  margin-bottom: 16px !important;
}
.app { min-height: 0; }
/* Keep the header's top margin inside <body> (it collapsed through and
 * added a phantom 16px of scroll). */
body { display: flow-root; }
@media (min-width: 980px) {
  .sidenav { top: calc(92px + var(--safe-t)) !important; }
}

/* Base rule `html.dark, body.dark .top-nav … ::placeholder` matched <html>,
 * not the placeholder: it was dark grey on the dark field. */
.top-nav .search input::placeholder,
#searchInput::placeholder,
#titleInput::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted) !important;
  opacity: 1;
}

/* Theme switch → a square icon button like the sound toggle: the old
 * sliding knob rendered as a solid white/black square in this palette.
 * Shows the mode you switch to (moon in light, sun in dark). */
.theme-toggle {
  width: 34px !important;
  height: 34px !important;
  border-radius: var(--r-md) !important;
  background: var(--surface) !important;
  box-shadow: var(--neu-sm) !important;
  color: var(--ink-soft) !important;
}
.theme-toggle:hover { color: var(--ink) !important; }
.theme-toggle .toggle-slot {
  width: 100% !important;
  height: 100% !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}
.theme-toggle .toggle-button { display: none !important; }
.theme-toggle .sun-icon-wrapper,
.theme-toggle .moon-icon-wrapper {
  inset: 0 !important;
  width: auto !important;
  color: inherit !important;
  transform: none !important;
  transition: opacity 0.15s ease !important;
}
.theme-toggle .sun-icon-wrapper { opacity: 0 !important; }
.theme-toggle .moon-icon-wrapper { opacity: 1 !important; }
.theme-toggle[aria-pressed="true"] .sun-icon-wrapper { opacity: 1 !important; }
.theme-toggle[aria-pressed="true"] .moon-icon-wrapper { opacity: 0 !important; }
.theme-toggle .sun-icon { width: 17px; height: 17px; filter: none !important; stroke: currentColor !important; }
.theme-toggle .sun-rays,
.theme-toggle .sun-rays path,
.theme-toggle .sun-core,
.theme-toggle .moon-stars path { animation: none !important; }
.theme-toggle .moon-icon { width: 17px !important; height: 15px !important; filter: none !important; }
.theme-toggle .moon-stars { fill: currentColor !important; opacity: 0.6; }
.top-nav .mode { transform: none !important; }

/* Priority row: base adds a 3px left border on top of our inset bar,
 * pushing the row's content out of line with its neighbours. */
.task.prio-high { border-left: 0 !important; }

/* Line icons instead of colour emoji (pin, calendar, alarm). */
.btn.icon.pin-btn,
#duePickBtn,
#remindPickBtn {
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  font-size: 0;
}
.btn.icon.pin-btn svg,
#duePickBtn svg,
#remindPickBtn svg { width: 16px; height: 16px; }
.task .btn.icon.pin-btn { opacity: 0; }
.task:hover .btn.icon.pin-btn,
.task .btn.icon.pin-btn:focus-visible { opacity: 1; }
.task.is-pinned .btn.icon.pin-btn { opacity: 1; color: var(--ink); }
@media (hover: none) {
  .task .btn.icon.pin-btn { opacity: 0.6; }
}

/* Rail: uniform 10px rhythm (base used 18px, and 0 before the folder
 * group), so all 13 items fit a laptop-height screen. */
@media (min-width: 980px) {
  .nav-item,
  .nav-link,
  .nav-action,
  .nav-create-folder { margin-bottom: 10px !important; }
  .nav-section > .nav-item:last-child,
  .nav-folder-panel-inner > .nav-item:last-child { margin-bottom: 10px !important; }
  .nav-footer { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
}
.nav-item .nav-ico svg,
.nav-link .nav-ico svg { width: 18px; height: 18px; }

/* One add button per screen: the composer is always on screen from
 * tablet width up, so the floating one is phone-only. */
@media (min-width: 761px) {
  .fab-new-task { display: none !important; }
}

/* Neutral scrollbars (the base tinted them with the accent). */
* { scrollbar-color: var(--line-strong) transparent; }

/* Phones: give the search field and task titles the width back. */
@media (max-width: 560px) {
  .top-nav .toggle-nav { margin-left: 6px !important; }
  .top-nav .search { margin-left: 6px !important; margin-right: 6px !important; min-width: 0; }
  .top-nav .search input,
  #searchInput { padding-left: 12px !important; padding-right: 8px !important; }
  .top-nav .search .si { display: none !important; }
  .nav-end { gap: 6px !important; margin-right: 6px !important; }
  .sfx-toggle,
  .pro-pill { margin-right: 0 !important; }
  .sfx-toggle,
  .theme-toggle { width: 32px !important; height: 32px !important; }
  .pro-pill { height: 32px; padding: 0 8px !important; }
  .top-nav .profile-pill { width: 38px !important; height: 38px !important; }

  .shell { padding-left: 12px !important; padding-right: 12px !important; }
  .panel,
  .panel.neu { padding-left: 6px !important; padding-right: 6px !important; }
  .task { gap: 8px !important; padding: 12px 4px 12px 10px !important; }
  .task .btn.icon { width: 32px !important; min-width: 32px !important; height: 32px !important; }
}
