:root {
  --bg: #F4F0E8;
  --bg-2: #ECE6DB;
  --surface: #FCFAF6;
  --surface-2: #F6F2EB;
  --line: #E6DFD2;
  --line-2: #D6CDBD;
  --ink: #1C2030;
  --ink-2: #3A3F4F;
  --muted: #62646E;
  --faint: #8C8D95;
  --brand: #2F4A9E;
  --brand-2: #233A80;
  --brand-soft: #E5E9F5;
  --ok: #2F7F5A;
  --ok-soft: #DDEEE3;
  --warn: #A5621B;
  --warn-soft: #F6E7D2;
  --bad: #B83E33;
  --bad-soft: #F7E1DC;
  --shadow-sm: 0 1px 2px rgba(40, 34, 20, .06);
  --shadow: 0 1px 2px rgba(40, 34, 20, .04), 0 6px 20px -8px rgba(40, 34, 20, .14);
  --shadow-lg: 0 20px 50px -12px rgba(30, 26, 16, .30);
  --r: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --tabbar-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  font-synthesis: none;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 Manrope, system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg:not([width]) { width: 1.15em; height: 1.15em; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--muted); }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
body.locked { overflow: hidden; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  font-weight: 600; font-size: 14.5px; white-space: nowrap; text-decoration: none;
  transition: transform .15s var(--ease), background .2s, border-color .2s;
}
.btn:hover { border-color: var(--line-2); }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-2); }
.btn-danger { color: var(--bad); }
.btn-danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { min-height: 50px; font-size: 16px; border-radius: 14px; }
.btn-wide { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.loading { pointer-events: none; opacity: .8; }
.btn.loading::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: inline-grid; place-items: center; color: var(--muted); transition: background .2s, color .2s, transform .15s; flex: none; }
.icon-btn:hover { background: var(--bg-2); color: var(--ink); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; }

input[type=text], input[type=password], input[type=search], input[type=date], input[type=time], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); font-size: 16px;
  outline: none; transition: border-color .2s, box-shadow .2s; -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2362646E' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 36px; }
textarea { min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { font-weight: 400; color: var(--muted); font-size: 12.5px; }

/* ---------- Вход ---------- */
.login { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; justify-items: center; text-align: center; padding: 32px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); animation: rise .6s var(--ease) both; }
.login-card > * { width: 100%; }
.login-card .login-icon { width: 64px; height: 64px; border-radius: 18px; }
.login-card p { margin: 0; }
.login-error { color: var(--bad); min-height: 1.2em; font-size: 13.5px; }
.shake { animation: shake .4s; }

/* ---------- Шапка ---------- */
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-word { font-weight: 700; letter-spacing: .16em; color: var(--brand); font-size: 17px; }
.brand-sub { color: var(--muted); font-size: 13px; font-weight: 500; }
.brand-lg { justify-content: center; }
.brand-lg .brand-word { font-size: 26px; }
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(244, 240, 232, .94); border-bottom: 1px solid transparent; transition: border-color .3s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.sync { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; border-radius: 99px; font-size: 13px; font-weight: 500; color: var(--muted); transition: background .2s; }
.sync:hover { background: var(--bg-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; display: inline-block; }
.dot.on { background: var(--ok); }
.dot.pulse { animation: pulse 2.4s infinite; }
.dot.err { background: var(--bad); }
.dot.wait { background: var(--warn); animation: blink 1s infinite; }

.tabs { display: flex; gap: 2px; padding: 4px; border-radius: 14px; background: var(--bg-2); position: relative; }
.tabs button { position: relative; z-index: 1; min-height: 36px; padding: 0 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); transition: color .25s; white-space: nowrap; display: flex; align-items: center; gap: 7px; }
.tabs button svg { width: 17px; height: 17px; }
.tabs button.active { color: var(--ink); }
.tabs .ink { position: absolute; top: 4px; height: 36px; border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); transition: left .35s var(--spring), width .35s var(--spring); }
.tab-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }

.tabbar { display: none; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 12px 16px calc(80px + var(--tabbar-h) + var(--safe-b)); }
.view { animation: fadeUp .35s var(--ease) both; }

/* ---------- Скелетон ---------- */
.skeleton { display: grid; gap: 16px; padding-top: 12px; }
.sk { border-radius: var(--r); background: linear-gradient(90deg, var(--bg-2) 0%, #F1ECE3 50%, var(--bg-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
.sk-title { height: 30px; width: 55%; border-radius: 10px; }
.sk-card { height: 150px; }
.sk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sk-tile { height: 140px; }

/* ---------- Общие блоки ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; line-height: 1.2; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 22px 2px 10px; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.section-title .count { color: var(--ink-2); }
.section-title.bad { color: var(--bad); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.card + .card { margin-top: 12px; }
.card h3 { font-size: 16.5px; display: flex; align-items: center; gap: 10px; }
.card h3 svg { width: 20px; height: 20px; color: var(--muted); }
.card > p.muted { margin: 4px 0 14px; font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill svg { width: 13px; height: 13px; }
.stagger > * { animation: fadeUp .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
.calm .stagger > *, .calm .view { animation: none; }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--warn-soft); color: #5E3E14; margin-bottom: 12px; font-size: 14px; text-align: left; width: 100%; }
.notice.info { background: var(--brand-soft); color: var(--brand-2); }
.notice.bad { background: var(--bad-soft); color: #7A271F; }
.notice > svg { width: 20px; height: 20px; margin-top: 1px; }
.notice > div { flex: 1; min-width: 0; }
.notice b { font-weight: 600; }
.notice .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.notice select { width: auto; min-height: 40px; }
.notice.link { cursor: pointer; transition: transform .15s; }
.notice.link:active { transform: scale(.99); }

.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty .ico { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 18px; background: var(--bg-2); display: grid; place-items: center; color: var(--faint); animation: float 3s ease-in-out infinite; }
.empty .ico svg { width: 26px; height: 26px; }
.empty b { display: block; color: var(--ink-2); font-weight: 600; margin-bottom: 2px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { min-height: 36px; padding: 0 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; transition: background .2s, color .2s, border-color .2s, transform .15s; white-space: nowrap; }
.chip-btn:active { transform: scale(.95); }
.chip-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-btn .n { font-weight: 500; opacity: .7; }
.chip-btn svg { width: 15px; height: 15px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--bg-2); flex: none; }
.seg button { min-height: 36px; padding: 0 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s; display: inline-flex; align-items: center; gap: 6px; }
.seg button svg { width: 16px; height: 16px; }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Иконка зоны ---------- */
.zi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--c); flex: none; }
.zi svg { width: 21px; height: 21px; }
.zi.sm { width: 20px; height: 20px; border-radius: 6px; }
.zi.sm svg { width: 12px; height: 12px; stroke-width: 2.2; }
.zi.lg { width: 48px; height: 48px; border-radius: 14px; }
.zi.lg svg { width: 24px; height: 24px; }

/* ---------- Фокус ---------- */
.next-card { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: left; width: 100%; transition: transform .2s var(--ease); }
.next-card:active { transform: scale(.99); }
.next-card .date { width: 54px; height: 58px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.next-card .date b { font-size: 22px; font-weight: 700; }
.next-card .date span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.next-card h2 { font-size: 18px; line-height: 1.3; }
.next-card .meta { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.next-card .bar { margin-top: 10px; }
.focus-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-align: left; transition: transform .15s; }
.stat:active { transform: scale(.98); }
.stat b { display: block; font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.bad b { color: var(--bad); }
.stat.ok b { color: var(--ok); }
.more-btn { width: 100%; min-height: 44px; margin-top: 2px; border-radius: 12px; color: var(--brand); font-weight: 600; font-size: 14px; }
.more-btn:hover { background: var(--brand-soft); }

/* ---------- Встреча ---------- */
.events { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; margin: 0 -16px; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding: 16px; }
.events::-webkit-scrollbar { display: none; }
.event-pill { scroll-snap-align: start; flex: none; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 14px 8px 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s, transform .15s; text-align: left; }
.event-pill:active { transform: scale(.97); }
.event-pill.active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.event-pill.past { opacity: .55; }
.ep-date { width: 40px; height: 40px; border-radius: 11px; background: var(--bg-2); color: var(--ink-2); display: grid; place-content: center; text-align: center; line-height: 1; }
.ep-date b { font-size: 16px; font-weight: 700; }
.ep-date span { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.ep-date svg { width: 19px; height: 19px; }
.event-pill.active .ep-date { background: var(--brand); color: #fff; }
.ep-title { font-weight: 600; font-size: 14px; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-sub { font-size: 12px; color: var(--muted); }
.ep-draft { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); display: inline-block; margin-right: 5px; vertical-align: 1px; }
.event-add { flex: none; width: 56px; min-height: 56px; border-radius: 16px; border: 1.5px dashed var(--line-2); color: var(--muted); display: grid; place-items: center; }
.event-add:hover { color: var(--brand); border-color: var(--brand); }
.event-add svg { width: 22px; height: 22px; }

.event-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; padding: 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 14px; }
.eh-kicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--muted); font-weight: 500; }
.event-head h1 { font-size: clamp(21px, 4vw, 27px); line-height: 1.2; margin: 6px 0 4px; }
.eh-meta { color: var(--muted); font-size: 14px; }
.eh-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fact { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 10px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.fact svg { width: 14px; height: 14px; color: var(--muted); }
.eh-about { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.eh-about summary { cursor: pointer; color: var(--brand); font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; }
.eh-about summary::-webkit-details-marker { display: none; }
.eh-about summary svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.eh-about[open] summary svg { transform: rotate(90deg); }
.eh-about p { margin: 4px 0 0; }
.eh-about p b { font-weight: 600; }
.eh-side { display: grid; justify-items: end; gap: 6px; }
.eh-bar { display: none; align-items: center; gap: 10px; margin: 8px 0 2px; }
.eh-bar .bar { flex: 1; }
.eh-bar b { font-size: 13px; font-weight: 600; color: var(--muted); }
.person { cursor: pointer; transition: box-shadow .2s, transform .15s; }
.person:hover { box-shadow: var(--shadow); }
.person:active { transform: scale(.99); }
.eh-actions { display: flex; gap: 2px; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.search { position: relative; flex: 1 1 220px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px; min-height: 44px; }
.filters { margin-bottom: 12px; }

/* кольца прогресса */
.ring { width: 44px; height: 44px; position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--bg-2); }
.ring .bar { stroke: var(--c, var(--brand)); transition: stroke-dashoffset .9s var(--ease), stroke .3s; }
.ring.full .bar { stroke: var(--ok); }
.ring > span { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; font-size: 11px; font-weight: 600; color: var(--ink-2); letter-spacing: -.02em; text-align: center; }
.ring.full > span { color: var(--ok); }
.ring.full > span svg { width: 16px; height: 16px; stroke-width: 2.4; transform: none; }
.ring.lg { width: 76px; height: 76px; }
.ring.lg > span { font-size: 17px; font-weight: 700; line-height: 1.1; }
.ring.lg > span small { font-size: 10.5px; font-weight: 500; color: var(--muted); display: block; }
.ring.pop { animation: ringPop .6s var(--spring); }

.bar { height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c, var(--brand)); transition: width .8s var(--ease), background .3s; }
.bar.full i { background: var(--ok); }

/* карточки зон */
.zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.zone-card { text-align: left; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 10px; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.zone-card:hover { box-shadow: var(--shadow); border-color: var(--line-2); }
.zone-card:active { transform: scale(.98); }
.zone-card.complete { background: color-mix(in srgb, var(--ok-soft) 45%, var(--surface)); }
.zc-top { display: flex; justify-content: space-between; align-items: center; }
.zc-name { font-weight: 600; font-size: 15.5px; line-height: 1.3; }
.zc-owner { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 2px; min-width: 0; }
.zc-owner span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zc-foot { font-size: 13px; color: var(--muted); min-height: 22px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.zc-foot .late { color: var(--bad); font-weight: 600; }
.zc-foot .okc { color: var(--ok); font-weight: 600; }
.show-empty { margin-top: 10px; }

.group-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 4px 4px; margin-bottom: 10px; }
.group-card h3 { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; padding: 6px 12px 4px; }
.group-card h3 > svg { width: 18px; height: 18px; color: var(--muted); }
.group-card h3 .muted { font-weight: 500; font-size: 13px; margin-left: auto; }
.group-card.today { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---------- Задачи ---------- */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { position: relative; border-radius: 14px; overflow: hidden; touch-action: pan-y; }
@media (hover: none) { .task { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }
.task-inner { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 2px; padding: 2px 4px 2px 2px; background: var(--surface); border-radius: 14px; transition: background .2s; }
.task.swiping .task-inner, .task.dragging .task-inner { transition: none; user-select: none; -webkit-user-select: none; }
.task.settle .task-inner { transition: transform .3s var(--ease), background .2s; }
@media (hover: hover) { .task-inner:hover { background: var(--surface-2); } }
.swipe-bg { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 20px; font-weight: 600; font-size: 14px; color: #fff; border-radius: 14px; }
.swipe-bg span { display: flex; align-items: center; gap: 6px; opacity: 0; transition: opacity .15s; }
.swipe-bg svg { width: 20px; height: 20px; }
.task.swipe-r .swipe-bg { background: var(--ok); }
.task.swipe-l .swipe-bg { background: var(--bad); }
.task.swipe-r .sb-done, .task.swipe-l .sb-del { opacity: 1; }
.task.dragging { z-index: 5; overflow: visible; }
.task.dragging .task-inner { box-shadow: var(--shadow-lg); background: var(--surface); }
.task.removing { animation: collapse .32s var(--ease) forwards; }
.task.flash .task-inner { animation: flash 1.6s var(--ease); }

.check { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; flex: none; position: relative; }
.check:active svg { transform: scale(.85); }
.check svg { width: 26px; height: 26px; overflow: visible; transition: transform .15s; }
.check circle { stroke: var(--line-2); stroke-width: 1.8; fill: transparent; transition: stroke .25s, fill .3s var(--ease); }
@media (hover: hover) { .check:hover circle { stroke: var(--ok); } }
.check path { stroke: #fff; stroke-width: 2.4; stroke-dasharray: 16; stroke-dashoffset: 16; transition: stroke-dashoffset .35s var(--ease) .08s; }
.task.done .check circle { fill: var(--ok); stroke: var(--ok); }
.task.done .check path { stroke-dashoffset: 0; }
.task.just-done .check svg { animation: pop .45s var(--spring); }
.burst { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; pointer-events: none; animation: burst .6s var(--ease) forwards; }

.t-body { flex: 1; min-width: 0; padding: 10px 4px 10px 2px; cursor: pointer; }
.t-text { display: inline; font-weight: 500; line-height: 1.4; word-break: break-word; background: linear-gradient(currentColor, currentColor) no-repeat 0 60% / 0 1.5px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-size .45s var(--ease), color .3s; }
.task.done .t-text { color: var(--faint); background-size: 100% 1.5px; }
.t-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-top: 3px; font-size: 13px; color: var(--muted); }
.t-meta:empty { display: none; }
.t-meta span { display: inline-flex; align-items: center; gap: 5px; }
.t-meta svg { width: 13px; height: 13px; }
.t-meta .late { color: var(--bad); font-weight: 600; }
.t-meta .soon { color: var(--warn); font-weight: 600; }
.task.done .t-meta { opacity: .6; }
.tg-badge { font-size: 11.5px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 1px 7px; border-radius: 6px; }
.grip { width: 32px; height: 44px; display: grid; place-items: center; color: var(--faint); cursor: grab; touch-action: none; flex: none; opacity: 0; transition: opacity .2s; }
.grip svg { width: 18px; height: 18px; }
@media (hover: hover) { .task-inner:hover .grip { opacity: 1; } }
@media (hover: none) { .grip { display: none; } }

.add-row { display: flex; gap: 8px; margin: 8px 4px 4px; }
.add-row input { flex: 1; min-height: 46px; background: var(--surface-2); border-style: dashed; }
.add-row input:focus { border-style: solid; background: var(--surface); }

/* ---------- Листы (панели и диалоги) ---------- */
.layer { position: fixed; inset: 0; z-index: 50; }
.layer-dim { position: absolute; inset: 0; background: rgba(28, 26, 20, .34); opacity: 0; transition: opacity .3s; }
.layer.open .layer-dim { opacity: 1; }
.sheet { position: absolute; background: var(--bg); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.sheet.side { top: 0; right: 0; bottom: 0; width: min(560px, 100vw); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .42s var(--ease); }
.sheet.dialog { left: 50%; top: 50%; width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border-radius: 24px; background: var(--surface); transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .35s var(--spring), opacity .22s; }
.layer.open .sheet.side { transform: none; }
.layer.open .sheet.dialog { transform: translate(-50%, -50%); opacity: 1; }
.sheet-grab { display: none; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 14px 10px 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface); }
.sheet.dialog .sheet-head { border-bottom: 0; padding: 18px 12px 4px 22px; border-radius: 24px 24px 0 0; }
.sheet-head h2 { font-size: 19px; flex: 1; min-width: 0; line-height: 1.25; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 10px 8px 24px; -webkit-overflow-scrolling: touch; }
.sheet.dialog .sheet-body { padding: 10px 22px 22px; }
.sheet-sub { padding: 0 18px 14px; background: var(--surface); border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.sheet-sub .row { display: flex; gap: 8px; align-items: center; }
.sheet-sub select { width: auto; flex: 1; min-height: 42px; font-size: 15px; }
.sheet-sub .bar { flex: 1; }
.sheet-sub b { font-weight: 600; font-size: 14px; }
.owners { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.owners-label { font-size: 13px; color: var(--muted); font-weight: 600; margin-right: 2px; }
.owner-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 4px 0 12px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; font-weight: 500; }
.owner-x { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.owner-x:hover { background: var(--bg-2); color: var(--bad); }
.owner-x svg { width: 14px; height: 14px; }
.sheet-sub select.owner-add { flex: 0 0 auto; width: auto; min-height: 36px; font-size: 14px; border-radius: 99px; border-style: dashed; color: var(--brand); font-weight: 600; }
.chip-check { cursor: pointer; position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-check:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.form { display: grid; gap: 14px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-text { margin: 0 0 18px; color: var(--ink-2); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick button { min-height: 36px; padding: 0 12px; border-radius: 10px; background: var(--bg-2); font-size: 13.5px; font-weight: 500; transition: background .2s, transform .15s; }
.quick button:active { transform: scale(.95); }
.notes-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin-top: 12px; padding: 0 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-2); font-weight: 600; font-size: 14px; transition: transform .15s; }
.notes-btn:active { transform: scale(.97); }
.notes-btn svg { width: 17px; height: 17px; }
.notes-btn .tab-badge { width: auto; padding: 0 8px; height: 20px; border-radius: 10px; font-size: 11.5px; }
.note-add { display: grid; gap: 8px; margin: 4px 4px 0; }
.note-add textarea { min-height: 84px; }
.note-add .btn { justify-self: end; }
.notes { display: grid; gap: 8px; padding: 0 4px; }
.note { padding: 14px 14px 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); animation: fadeUp .35s var(--ease) both; }
.note.handled { background: var(--surface-2); }
.note.handled .note-text { color: var(--muted); }
.note-text { margin: 0; font-weight: 500; line-height: 1.45; }
.note-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.note-meta svg { width: 13px; height: 13px; }
.note-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.note-actions .icon-btn { margin-left: auto; width: 36px; height: 36px; }
.note-result { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--ok); }
.note-result svg { width: 15px; height: 15px; }
.note-result .btn { margin-left: auto; color: var(--muted); }
.done-toggle { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 16px; border-radius: 14px; background: var(--bg-2); font-weight: 600; font-size: 15px; transition: background .25s, color .25s; }
.done-toggle svg { width: 22px; height: 22px; }
.done-toggle.on { background: var(--ok-soft); color: var(--ok); }
.task-title { width: 100%; border: 1px solid transparent !important; background: transparent !important; font-size: 19px; font-weight: 600; line-height: 1.35; padding: 4px 6px !important; margin: 0 -6px; min-height: 0 !important; resize: none; border-radius: 10px !important; }
.task-title:focus { border-color: var(--line) !important; background: var(--surface-2) !important; box-shadow: none !important; }

.icon-pick { display: grid; grid-template-columns: repeat(auto-fill, 44px); gap: 6px; }
.icon-pick label { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-2); color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s; position: relative; }
.icon-pick label svg { width: 20px; height: 20px; }
.icon-pick input, .swatches input { position: absolute; opacity: 0; pointer-events: none; }
.icon-pick label:has(input:checked) { background: var(--ink); color: #fff; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatches label { width: 32px; height: 32px; border-radius: 50%; background: var(--c); cursor: pointer; transition: transform .15s; position: relative; }
.swatches label:has(input:checked) { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }

/* меню действий */
.menu-list { display: grid; gap: 2px; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 12px; border-radius: 12px; font-size: 15px; font-weight: 500; text-align: left; transition: background .15s; }
.menu-item:hover, .menu-item:active { background: var(--bg-2); }
.menu-item svg { width: 20px; height: 20px; color: var(--muted); }
.menu-item.danger, .menu-item.danger svg { color: var(--bad); }

.popover { position: fixed; z-index: 60; min-width: 250px; max-width: calc(100vw - 24px); padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-4px) scale(.98); pointer-events: none; transition: opacity .16s, transform .22s var(--spring); }
.popover.open { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Команда ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.person { display: flex; gap: 12px; align-items: center; padding: 12px 6px 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 600; font-size: 15px; color: #fff; background: var(--c, var(--brand)); position: relative; flex: none; }
.avatar .dot { position: absolute; right: -2px; bottom: -2px; border: 2.5px solid var(--surface); width: 13px; height: 13px; }
.p-main { flex: 1; min-width: 0; }
.p-name { font-weight: 600; }
.p-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-zones { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px 0 3px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); }

/* ---------- Рассылка и настройки ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 12px; align-items: start; }
.setting { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.setting:first-of-type { border-top: 0; padding-top: 6px; }
.setting > svg { width: 20px; height: 20px; color: var(--muted); }
.s-title { font-weight: 600; font-size: 14.5px; }
.s-desc { font-size: 13px; color: var(--muted); }
.s-ctl { display: flex; gap: 6px; align-items: center; }
.s-ctl input[type=time] { width: 104px; min-height: 40px; padding: 0 10px; font-size: 15px; }
.s-ctl select { width: auto; min-height: 40px; font-size: 14px; }
.s-extra { grid-column: 2 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.days-pick { display: flex; gap: 4px; flex-wrap: wrap; }
.days-pick button { min-width: 40px; min-height: 36px; border-radius: 10px; background: var(--bg-2); font-size: 13px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s, transform .15s; }
.days-pick button.on { background: var(--brand); color: #fff; }
.days-pick button:active { transform: scale(.92); }
.switch { position: relative; width: 50px; height: 30px; 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: 99px; background: var(--line-2); transition: background .25s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .3s var(--spring); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch.danger input:checked + span { background: var(--bad); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.bot-ok { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.token-row { display: flex; gap: 8px; margin-top: 12px; }
.steps { margin: 12px 0 0; padding-left: 20px; font-size: 14px; color: var(--ink-2); display: grid; gap: 4px; }
.steps code { background: var(--bg-2); padding: 1px 6px; border-radius: 6px; font-size: 13px; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); text-align: left; transition: transform .15s, border-color .2s; min-height: 92px; }
.qa:hover { border-color: var(--line-2); }
.qa:active { transform: scale(.98); }
.qa svg { width: 22px; height: 22px; color: var(--brand); }
.qa b { font-weight: 600; font-size: 14.5px; }
.qa span { font-size: 12.5px; color: var(--muted); }
.qa.loading { opacity: .6; pointer-events: none; }

.phone { background: #DDE3D5; border-radius: 18px; padding: 14px 10px; min-height: 160px; }
.bubble { background: #fff; border-radius: 16px 16px 16px 4px; padding: 10px 12px 6px; max-width: 94%; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); animation: bubble .45s var(--spring) both; word-break: break-word; }
.bubble s { color: #8b8f99; }
.bubble b { font-weight: 700; }
.bubble-time { text-align: right; font-size: 11px; color: #9aa0a6; }
.kb { display: grid; gap: 4px; margin-top: 4px; max-width: 94%; }
.kb-row { display: flex; gap: 4px; }
.kb span { flex: 1; min-width: 0; background: rgba(255, 255, 255, .6); border-radius: 9px; padding: 9px 10px; text-align: center; font-size: 13.5px; font-weight: 600; color: #2b5278; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb span.kb-head { background: rgba(255, 255, 255, .28); color: #4b5a48; font-weight: 500; font-size: 12.5px; }
.empty-bubble { text-align: center; color: #56654f; font-weight: 500; font-size: 14px; padding: 36px 0; }
.log { display: grid; max-height: 420px; overflow-y: auto; margin: 0 -8px; }
.log-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; padding: 9px 8px; border-radius: 10px; font-size: 13.5px; align-items: start; }
.log-row > span > svg { width: 16px; height: 16px; margin-top: 2px; }
.log-row .okc { color: var(--ok); }
.log-row .errc { color: var(--bad); }
.log-row .when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.log-row .what { min-width: 0; }
.log-row .what b { font-weight: 600; }
.log-row .what small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.log-row .what small.err { color: var(--bad); }
.zone-pick { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 12px; }

.tpl-list { display: grid; gap: 8px; }
.tpl-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); text-align: left; width: 100%; }
.tpl-row .grow { flex: 1; min-width: 0; }
.tpl-row b { font-weight: 600; display: block; }
.tpl-row span { font-size: 13px; color: var(--muted); }
.tpl-item { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: center; padding: 10px 8px; }
.tpl-item + .tpl-item { border-top: 1px solid var(--line); }
.tpl-item input[type=text] { grid-column: 1 / -1; min-height: 42px; font-size: 15px; font-weight: 500; }
.tpl-item select, .tpl-item input[type=time] { min-height: 40px; font-size: 14px; }
.tpl-zone { display: flex; align-items: center; gap: 10px; margin: 18px 8px 4px; font-weight: 600; }
.tpl-zone .muted { font-weight: 500; }
.tpl-group { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 2px 4px 6px; }

/* ---------- Тосты, конфетти ---------- */
.toasts { position: fixed; z-index: 80; left: 50%; bottom: calc(20px + var(--tabbar-h) + var(--safe-b)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 480px; }
.toast { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; min-height: 48px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 500; font-size: 14.5px; box-shadow: var(--shadow-lg); animation: toastIn .45s var(--spring) both; max-width: 100%; pointer-events: auto; }
.toast > svg { width: 18px; height: 18px; }
.toast span { flex: 1; padding: 4px 6px 4px 0; }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast.bad { background: var(--bad); }
.toast button { min-height: 36px; padding: 0 12px; border-radius: 10px; background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; font-size: 14px; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 85; }

/* ---------- Анимации ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes ringPop { 0% { transform: scale(1); } 45% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes burst { from { transform: translate(0, 0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }
@keyframes collapse { 0% { opacity: 1; max-height: 120px; } 100% { opacity: 0; max-height: 0; transform: translateX(30px); } }
@keyframes flash { 0%, 100% { background: var(--surface); } 20% { background: var(--brand-soft); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(47, 127, 90, .45); } 70% { box-shadow: 0 0 0 6px rgba(47, 127, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 127, 90, 0); } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes bubble { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes float { 50% { transform: translateY(-5px); } }

/* ---------- Планшет ---------- */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .tabs button .lbl { display: none; }
  .tabs button { padding: 0 12px; }
}

/* ---------- Телефон ---------- */
@media (max-width: 640px) {
  :root { --tabbar-h: 58px; }
  body { font-size: 15.5px; }
  .tabs { display: none; }
  .topbar-in { padding: 8px 16px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 env(safe-area-inset-right) var(--safe-b) env(safe-area-inset-left);
    background: rgba(252, 250, 246, .97); border-top: 1px solid var(--line);
  }
  .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--faint); position: relative; transition: color .2s; }
  .tabbar button svg { width: 24px; height: 24px; transition: transform .25s var(--spring); }
  .tabbar button.active { color: var(--brand); }
  .tabbar button.active svg { transform: translateY(-1px) scale(1.06); }
  .tabbar .tab-badge { position: absolute; top: 5px; left: calc(50% + 6px); }
  .page-head h1 { font-size: 24px; }
  .event-head { padding: 16px; border-radius: 20px; gap: 10px; }
  #eh-ring { display: none; }
  .eh-bar { display: flex; }
  .event-head { grid-template-columns: 1fr auto; }
  .eh-side { grid-row: 1; grid-column: 2; }
  .zones { grid-template-columns: 1fr 1fr; gap: 8px; }
  .zone-card { padding: 12px; gap: 8px; }
  .zone-card .zi { width: 36px; height: 36px; border-radius: 11px; }
  .zone-card .ring { width: 38px; height: 38px; }
  .zone-card .ring > span { font-size: 10px; }
  .zc-name { font-size: 14.5px; }
  .zc-owner { font-size: 12.5px; }
  .zc-foot { font-size: 12.5px; }
  .people { grid-template-columns: 1fr; }
  .focus-stats .stat { padding: 12px; }
  .focus-stats .stat b { font-size: 21px; }
  .next-card { grid-template-columns: auto 1fr; padding: 14px; }
  .next-card > .ring { display: none; }

  .sheet.side, .sheet.dialog {
    left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: calc(100dvh - 40px);
    border-radius: 22px 22px 0 0; border-left: 0; transform: translateY(100%); opacity: 1;
    transition: transform .42s var(--ease); padding-bottom: var(--safe-b);
  }
  .sheet.side { height: calc(100dvh - 40px); }
  .layer.open .sheet.side, .layer.open .sheet.dialog { transform: none; }
  .sheet.dragging { transition: none !important; }
  .sheet-grab { display: block; position: absolute; top: 0; left: 0; right: 0; height: 26px; z-index: 2; touch-action: none; }
  .sheet-grab::after { content: ''; position: absolute; left: 50%; top: 8px; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--line-2); }
  .sheet-head { padding-top: 24px; border-radius: 22px 22px 0 0; }
  .sheet.dialog .sheet-head { padding: 26px 10px 4px 20px; border-radius: 22px 22px 0 0; }
  .sheet.dialog .sheet-body { padding: 10px 20px 20px; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-actions .btn { width: 100%; }
  .form-actions .spacer { display: none; }
  .quick-actions { grid-template-columns: 1fr; }
  .setting { grid-template-columns: auto 1fr; }
  .setting .s-ctl { grid-column: 2; }
  .toolbar .search { flex-basis: 100%; }
}

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