/* =========================================================
   Focus — Apple-style UI (iOS / macOS system look)
   ========================================================= */
:root {
  --bg: #f2f2f7;            /* systemGroupedBackground */
  --bg-2: #ffffff;          /* secondarySystemGroupedBackground */
  --bg-3: #f2f2f7;
  --fill: rgba(120,120,128,.12);
  --fill-2: rgba(120,120,128,.08);
  --label: #000000;
  --label-2: rgba(60,60,67,.6);
  --label-3: rgba(60,60,67,.3);
  --sep: rgba(60,60,67,.18);
  --blue: #007aff;
  --green: #34c759;
  --red: #ff3b30;
  --orange: #ff9500;
  --yellow: #ffcc00;
  --purple: #af52de;
  --indigo: #5856d6;
  --teal: #30b0c7;
  --gray: #8e8e93;
  --material: rgba(249,249,249,.78);
  --sidebar: rgba(236,236,241,.82);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --shadow-pop: 0 10px 40px rgba(0,0,0,.18), 0 0 0 .5px rgba(0,0,0,.08);
  --r: 12px;
  --r-lg: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 50px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-2: #1c1c1e;
    --bg-3: #2c2c2e;
    --fill: rgba(120,120,128,.24);
    --fill-2: rgba(120,120,128,.16);
    --label: #ffffff;
    --label-2: rgba(235,235,245,.6);
    --label-3: rgba(235,235,245,.3);
    --sep: rgba(84,84,88,.6);
    --blue: #0a84ff;
    --green: #30d158;
    --red: #ff453a;
    --orange: #ff9f0a;
    --yellow: #ffd60a;
    --purple: #bf5af2;
    --indigo: #5e5ce6;
    --teal: #40c8e0;
    --material: rgba(22,22,24,.78);
    --sidebar: rgba(28,28,30,.86);
    --shadow: none;
    --shadow-pop: 0 10px 40px rgba(0,0,0,.6), 0 0 0 .5px rgba(255,255,255,.1);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.29;
  letter-spacing: -0.41px;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
svg { width: 22px; height: 22px; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

/* ---------------------------------------------------- layout */
.app { display: grid; grid-template-columns: 1fr; min-height: 100%; }
.sidebar { display: none; }
.main { min-width: 0; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); }
.content { max-width: 860px; margin: 0 auto; padding: 0 16px; }

@media (min-width: 900px) {
  .app { grid-template-columns: 272px 1fr; height: 100vh; }
  .sidebar {
    display: flex; flex-direction: column;
    background: var(--sidebar);
    -webkit-backdrop-filter: saturate(180%) blur(30px);
    backdrop-filter: saturate(180%) blur(30px);
    border-right: .5px solid var(--sep);
    padding: 18px 12px 14px;
    overflow-y: auto;
  }
  .main { height: 100vh; overflow-y: auto; padding-bottom: 48px; }
  .content { padding: 0 40px; }
  .tabbar { display: none !important; }
}

/* ---------------------------------------------------- sidebar */
.side-head { padding: 0 4px 14px; }
.search {
  display: flex; align-items: center; gap: 6px;
  background: var(--fill); border-radius: 10px; height: 36px; padding: 0 10px;
  color: var(--label-2);
}
.search svg { width: 17px; height: 17px; }
.search input { flex: 1; border: 0; outline: 0; background: none; font-size: 17px; min-width: 0; color: var(--label); }
.search input::placeholder { color: var(--label-2); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

.side-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 4px; }
.smart {
  background: var(--bg-2); border-radius: var(--r); padding: 10px 12px 10px;
  text-align: left; display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow); transition: transform .15s;
}
.smart:active { transform: scale(.97); }
.smart-top { display: flex; justify-content: space-between; align-items: flex-start; }
.smart-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.smart-ico svg { width: 18px; height: 18px; }
.smart-count { font-family: var(--round); font-size: 26px; font-weight: 700; line-height: 1; }
.smart-label { font-size: 15px; font-weight: 600; color: var(--label-2); }
.smart.active { background: var(--blue); color: #fff; }
.smart.active .smart-label { color: rgba(255,255,255,.85); }
.smart.active .smart-ico { background: #fff !important; color: var(--blue); }

.side-section { font-size: 13px; font-weight: 600; color: var(--label-2); padding: 22px 12px 6px; }
.side-tags { display: flex; flex-direction: column; gap: 1px; }
.side-tag {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px;
  font-size: 15px; text-align: left; color: var(--label);
}
.side-tag svg { width: 16px; height: 16px; color: var(--label-2); }
.side-tag .n { margin-left: auto; color: var(--label-2); font-size: 14px; }
.side-tag:hover { background: var(--fill-2); }
.side-tag.active { background: var(--fill); }
.side-empty { padding: 4px 12px; color: var(--label-3); font-size: 14px; }
.side-foot { margin-top: auto; padding: 18px 8px 0; display: flex; justify-content: space-between; }
.link-btn { color: var(--blue); font-size: 15px; padding: 6px 4px; }
.link-btn.danger { color: var(--red); }

/* ---------------------------------------------------- nav bar */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: flex-end;
  height: calc(44px + var(--safe-t)); padding: var(--safe-t) 10px 0;
  background: transparent; transition: background .2s, border-color .2s;
  border-bottom: .5px solid transparent;
}
.nav.scrolled {
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: var(--sep);
}
.nav-compact {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 11px; font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s;
  white-space: nowrap; pointer-events: none;
}
.nav.scrolled .nav-compact { opacity: 1; }
.nav-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  color: var(--blue); background: var(--fill-2);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.accent { background: var(--blue); color: #fff; }
.icon-btn:active { opacity: .6; }
@media (min-width: 900px) {
  .nav { padding: 0 24px; height: 52px; }
}

/* ---------------------------------------------------- titles */
.large-title { padding: 2px 4px 14px; }
.large-title h1 { margin: 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .37px; }
.large-title .sub { color: var(--label-2); font-size: 15px; margin-top: 2px; letter-spacing: -.24px; }
.large-title .sub::first-letter { text-transform: uppercase; }
.section-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 26px 4px 8px;
}
.section-h h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: .35px; }
.section-h button { color: var(--blue); font-size: 15px; }
.footnote { font-size: 13px; color: var(--label-2); padding: 6px 16px 0; letter-spacing: -.08px; }

/* ---------------------------------------------------- stat tiles (обзор) */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  background: var(--bg-2); border-radius: var(--r); padding: 11px 12px 10px;
  display: flex; flex-direction: column; gap: 8px; text-align: left; box-shadow: var(--shadow);
  transition: transform .15s;
}
.tile:active { transform: scale(.97); }
.tile-top { display: flex; justify-content: space-between; align-items: center; }
.tile-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.tile-ico svg { width: 18px; height: 18px; }
.tile-n { font-family: var(--round); font-size: 28px; font-weight: 700; line-height: 1; }
.tile-l { font-size: 15px; font-weight: 600; color: var(--label-2); }

.bg-blue { background: var(--blue); } .bg-red { background: var(--red); }
.bg-green { background: var(--green); } .bg-orange { background: var(--orange); }
.bg-yellow { background: var(--yellow); } .bg-purple { background: var(--purple); }
.bg-indigo { background: var(--indigo); } .bg-gray { background: var(--gray); }
.bg-teal { background: var(--teal); }

/* ---------------------------------------------------- inset grouped list */
.group {
  background: var(--bg-2); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow);
}
.group + .group { margin-top: 14px; }
.group.mb { margin-bottom: 14px; }
.group-h { font-size: 13px; color: var(--label-2); text-transform: uppercase; padding: 18px 16px 6px; letter-spacing: -.08px; }
.group-h.today { color: var(--blue); }
.group-h.overdue { color: var(--red); }

.row {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 16px 11px 16px; min-height: 44px; width: 100%; text-align: left;
  transition: background .12s;
}
.row::after {
  content: ""; position: absolute; bottom: 0; right: 0; left: 50px;
  border-bottom: .5px solid var(--sep);
}
.row:last-child::after { display: none; }
.row.plain::after { left: 16px; }
.row:active, .row.pressed { background: var(--fill-2); }
@media (hover: hover) { .row:hover { background: var(--fill-2); } }

.row-body { flex: 1; min-width: 0; cursor: pointer; }
.row-title { word-wrap: break-word; }
.row-notes { color: var(--label-2); font-size: 15px; margin-top: 2px; letter-spacing: -.24px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; font-size: 13px; color: var(--label-2); letter-spacing: -.08px; }
.row-meta span { display: inline-flex; align-items: center; gap: 3px; }
.row-meta svg { width: 13px; height: 13px; }
.row-meta .overdue { color: var(--red); }
.row-meta .today { color: var(--blue); }
.row-meta .m-goal { color: var(--indigo); }
.prio { color: var(--orange); font-weight: 700; letter-spacing: 0; margin-right: 4px; }
.prio.p3 { color: var(--red); }
.prio.p1 { color: var(--blue); }

.chev { width: 14px; height: 14px; color: var(--label-3); align-self: center; }

/* checkbox (Напоминания) */
.check {
  flex: none; width: 24px; height: 24px; margin-top: -1px; border-radius: 50%;
  border: 1.6px solid var(--label-3); display: grid; place-items: center;
  transition: background .2s, border-color .2s, transform .15s;
}
.check svg { width: 14px; height: 14px; color: #fff; opacity: 0; transform: scale(.4); transition: all .2s; }
.check.p1 { border-color: var(--blue); }
.check.p2 { border-color: var(--orange); }
.check.p3 { border-color: var(--red); }
.check:active { transform: scale(.85); }
.check.on { background: var(--blue); border-color: var(--blue); }
.check.on svg { opacity: 1; transform: scale(1); }
.row.done .row-title { color: var(--label-2); }
.row.leaving { animation: leave .45s ease forwards; }
@keyframes leave { 0%{opacity:1} 60%{opacity:1} 100%{opacity:0; transform: translateX(8px)} }

/* quick add */
.quick {
  display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 46px;
}
.quick .plus { width: 24px; height: 24px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; }
.quick .plus svg { width: 15px; height: 15px; }
.quick input { flex: 1; border: 0; outline: 0; background: none; font-size: 17px; padding: 12px 0; min-width: 0; }
.quick input::placeholder { color: var(--label-3); }

/* ---------------------------------------------------- segmented control */
.seg {
  display: flex; background: var(--fill); border-radius: 9px; padding: 2px; margin: 0 0 14px;
  position: relative; overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1; height: 30px; border-radius: 7px; font-size: 13px; font-weight: 500; letter-spacing: -.08px;
  white-space: nowrap; padding: 0 10px; transition: background .2s, box-shadow .2s;
}
.seg button.on { background: var(--bg-2); font-weight: 600; box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); }
@media (prefers-color-scheme: dark) { .seg button.on { background: #636366; } }

/* chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 32px; padding: 0 14px; border-radius: 16px; background: var(--bg-2);
  font-size: 15px; font-weight: 500; box-shadow: var(--shadow); white-space: nowrap;
}
.chip.on { background: var(--label); color: var(--bg-2); }
.tag-pill {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 12px; font-weight: 600; letter-spacing: 0; background: var(--fill-2); color: var(--label-2);
}

/* ---------------------------------------------------- goals */
.goals { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .goals { grid-template-columns: 1fr 1fr; } }
.goal {
  background: var(--bg-2); border-radius: var(--r-lg); padding: 16px; display: flex; gap: 14px;
  text-align: left; box-shadow: var(--shadow); align-items: center; transition: transform .15s;
  width: 100%;
}
.goal:active { transform: scale(.98); }
.ring { position: relative; width: 58px; height: 58px; flex: none; }
.ring svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.ring .track { stroke: var(--fill); }
.ring .bar { stroke: var(--green); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
.ring.mid .bar { stroke: var(--blue); }
.ring.low .bar { stroke: var(--orange); }
.ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--round); font-weight: 700; font-size: 14px; letter-spacing: -.4px; }
.goal-body { flex: 1; min-width: 0; }
.goal-title { font-weight: 600; font-size: 17px; }
.goal-meta { font-size: 13px; color: var(--label-2); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.goal-meta .overdue { color: var(--red); }
.goal.achieved .goal-title { color: var(--label-2); }
.status-pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; letter-spacing: 0; }
.st-paused { background: rgba(142,142,147,.18); color: var(--gray); }
.st-achieved { background: rgba(52,199,89,.16); color: var(--green); }
.st-new { background: rgba(0,122,255,.12); color: var(--blue); }
.st-active { background: rgba(255,149,0,.15); color: var(--orange); }
.st-done { background: rgba(52,199,89,.16); color: var(--green); }
.st-archived { background: rgba(142,142,147,.18); color: var(--gray); }

/* ---------------------------------------------------- ideas (Заметки) */
.ideas { columns: 2 220px; column-gap: 12px; }
.idea {
  break-inside: avoid; display: block; width: 100%; margin: 0 0 12px; text-align: left;
  background: var(--bg-2); border-radius: var(--r); padding: 14px 14px 12px; box-shadow: var(--shadow);
  transition: transform .15s;
}
.idea:active { transform: scale(.98); }
.idea-top { display: flex; align-items: flex-start; gap: 6px; }
.idea-title { font-weight: 600; flex: 1; }
.idea-pin { width: 15px; height: 15px; color: var(--orange); margin-top: 2px; }
.idea-text { font-size: 15px; color: var(--label-2); margin-top: 6px; white-space: pre-wrap; letter-spacing: -.24px;
  display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.idea-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.idea-date { font-size: 12px; color: var(--label-3); margin-left: auto; letter-spacing: 0; }
@media (max-width: 480px) { .ideas { columns: 1; } }

/* ---------------------------------------------------- empty state */
.empty { text-align: center; padding: 48px 24px; color: var(--label-2); }
.empty svg { width: 44px; height: 44px; color: var(--label-3); margin-bottom: 10px; }
.empty b { display: block; color: var(--label); font-size: 20px; margin-bottom: 4px; }
.empty-inline { padding: 14px 16px; color: var(--label-2); font-size: 15px; }

/* ---------------------------------------------------- tab bar (iPhone) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--gray); font-size: 10px; font-weight: 500; letter-spacing: .1px; position: relative;
}
.tab svg { width: 25px; height: 25px; }
.tab.on { color: var(--blue); }
.tab .badge {
  position: absolute; top: 3px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 12px; font-weight: 600;
  display: grid; place-items: center; letter-spacing: 0;
}

/* ---------------------------------------------------- sheet (editor) */
.scrim {
  position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.32);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
  max-height: calc(100% - var(--safe-t) - 12px);
  background: var(--bg); border-radius: 12px 12px 0 0;
  transform: translateY(calc(100% + 60px)); visibility: hidden;
  transition: transform .42s cubic-bezier(.32,.72,0,1), visibility 0s linear .42s;
  display: flex; flex-direction: column; box-shadow: var(--shadow-pop);
}
.sheet.on { transform: translateY(0); visibility: visible; transition: transform .42s cubic-bezier(.32,.72,0,1); }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--label-3); margin: 6px auto 0; flex: none; }
.sheet-inner { overflow-y: auto; padding: 0 16px calc(24px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
@media (min-width: 700px) {
  .sheet {
    left: 50%; top: 50%; bottom: auto; width: 560px; max-height: 86vh; border-radius: 14px;
    transform: translate(-50%, -46%) scale(.96); opacity: 0; pointer-events: none;
    transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s, visibility 0s linear .28s;
  }
  .sheet.on { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .2s; }
  .grabber { display: none; }
  .sheet-inner { padding-bottom: 20px; }
}
.sheet-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  height: 52px; margin: 0 -16px 8px; padding: 0 16px; background: var(--bg);
}
.sheet-bar h3 { margin: 0; font-size: 17px; font-weight: 600; }
.sheet-bar button { color: var(--blue); font-size: 17px; min-width: 70px; text-align: left; }
.sheet-bar button.done { font-weight: 600; text-align: right; }
.sheet-bar button:disabled { color: var(--label-3); }

.form .group { margin-bottom: 22px; }
.f-title, .f-notes {
  width: 100%; border: 0; outline: 0; background: none; padding: 12px 16px; display: block; resize: none;
}
.f-title { font-size: 17px; font-weight: 600; }
.f-notes { min-height: 92px; font-size: 16px; color: var(--label); border-top: .5px solid var(--sep); }
.f-notes::placeholder, .f-title::placeholder { color: var(--label-3); }
.f-row {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 6px 16px;
}
.f-row::after { content: ""; position: absolute; left: 58px; right: 0; bottom: 0; border-bottom: .5px solid var(--sep); }
.f-row:last-child::after { display: none; }
.f-ico { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; }
.f-ico svg { width: 18px; height: 18px; }
.f-label { flex: 1; }
.f-row input[type=date], .f-row select, .f-row input[type=text] {
  border: 0; outline: 0; background: var(--fill-2); border-radius: 7px; padding: 6px 10px;
  font-size: 16px; color: var(--blue); max-width: 60%; text-align: right; min-height: 34px;
  -webkit-appearance: none; appearance: none;
}
.f-row input[type=text] { color: var(--label); text-align: left; flex: 1; max-width: none; background: none; padding-left: 0; }
.f-row input[type=date]:invalid, .f-row input[type=date][value=""] { color: var(--label-3); }
.f-row select { padding-right: 10px; }
.mini-seg { display: flex; background: var(--fill); border-radius: 8px; padding: 2px; }
.mini-seg button { height: 28px; min-width: 38px; padding: 0 9px; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--label-2); }
.mini-seg button.on { background: var(--bg-2); color: var(--label); box-shadow: 0 2px 6px rgba(0,0,0,.12); }
@media (prefers-color-scheme: dark) { .mini-seg button.on { background: #636366; } }

/* toggle */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--fill); transition: background .25s; }
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 3px 1px rgba(0,0,0,.06); transition: transform .25s;
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

/* slider */
.f-slider { padding: 10px 16px 14px; }
.f-slider-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.f-slider-top b { font-family: var(--round); }
input[type=range] { width: 100%; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: var(--fill); outline: 0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.18), 0 0 0 .5px rgba(0,0,0,.06); }
input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 3px 8px rgba(0,0,0,.18); }
input[type=range]:disabled { opacity: .45; }

.btn-danger {
  width: 100%; background: var(--bg-2); color: var(--red); border-radius: var(--r); min-height: 46px;
  font-size: 17px; box-shadow: var(--shadow);
}
.sheet-tasks .row::after { left: 50px; }

/* ---------------------------------------------------- popover menu */
.popover {
  position: fixed; z-index: 60; min-width: 230px; border-radius: 13px; overflow: hidden;
  background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow-pop); opacity: 0; transform: scale(.9); transform-origin: top right;
  pointer-events: none; transition: opacity .18s, transform .22s cubic-bezier(.2,.8,.2,1);
}
.popover.on { opacity: 1; transform: scale(1); pointer-events: auto; }
.popover button {
  display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 16px;
  font-size: 17px; text-align: left; border-bottom: .5px solid var(--sep);
}
.popover button:last-child { border-bottom: 0; }
.popover button:active { background: var(--fill); }
.popover button.danger { color: var(--red); }
.popover button svg { width: 19px; height: 19px; }

/* ---------------------------------------------------- toast */
.toast {
  position: fixed; left: 50%; z-index: 70; bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; border-radius: 22px;
  background: rgba(30,30,32,.92); color: #fff; font-size: 15px; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  transition: opacity .25s, transform .3s cubic-bezier(.2,.8,.2,1); white-space: nowrap;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: #64b5ff; font-weight: 600; padding: 4px 6px; }
@media (min-width: 900px) { .toast { bottom: 28px; left: calc(50% + 136px); } }

/* ---------------------------------------------------- mobile search */
.m-search { margin: 0 0 14px; }
@media (min-width: 900px) { .m-search { display: none; } }

/* ---------------------------------------------------- login */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login { width: 100%; max-width: 340px; text-align: center; margin-top: -6vh; }
.login-icon { border-radius: 19px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.login h1 { font-size: 34px; margin: 18px 0 4px; font-weight: 700; letter-spacing: .37px; }
.login-sub { color: var(--label-2); margin: 0 0 30px; font-size: 15px; }
.login-field {
  display: flex; align-items: center; background: var(--bg-2); border-radius: 14px; padding: 5px 5px 5px 16px;
  box-shadow: var(--shadow), 0 0 0 .5px var(--sep);
}
.login-field input { flex: 1; border: 0; outline: 0; background: none; font-size: 17px; height: 44px; min-width: 0; }
.login-go {
  width: 40px; height: 40px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center;
  transition: opacity .2s;
}
.login-go svg { width: 20px; height: 20px; }
.busy .login-go { opacity: .5; }
.login-err { color: var(--red); font-size: 14px; min-height: 20px; margin: 12px 0 0; }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:none} 20%{transform:translateX(-9px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(3px)} }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
