/* Мини-апп «Янтарь» (описание §5.2, макет макеты/экраны-янтарь.html). Фон почти чёрный, карточки тёплые серые, один
   акцент — янтарный: «сделано», главное действие и выбранное. Красный — только «не ответил N ч» в «Вы поручили».
   Движение перенесено из дашборда Avito-бота (docs/patterns/anim.md): переход разделов, блик на главных кнопках,
   скелеты загрузки, панели из размытия; цвета образца заменены на палитру «Янтаря». Без эмодзи, иконки — SVG. */
:root {
  color-scheme: dark;
  --bg: #12100e; --card: #1d1a17; --card2: #2b2723; --line: #3d3731; --sub: #958a7e; --text: #f3ede6;
  --acc: #ffb020; --on-acc: #1a1205; --ring2: #f3ede6; --ring3: #6f665c; --warn: #ff453a;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --pop-shadow: 0 24px 60px -12px rgba(0, 0, 0, .85), inset 0 1px 0 rgba(255, 255, 255, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 14px/1.4 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
body.locked { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid rgba(255, 176, 32, .8); outline-offset: 2px; }
::selection { background: rgba(255, 176, 32, .35); }

/* ---- каркас: разделы внутри main, отступы между блоками — margin (блоки стоят одинаково и при уходе раздела) */
main { position: relative; max-width: 560px; margin: 0 auto; padding: 22px 16px calc(100px + var(--safe-b)); }
main > section > * + * { margin-top: 9px; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.top > div:first-child { min-width: 0; }
.sub { font-size: 12px; color: var(--sub); text-transform: uppercase; letter-spacing: .08em; }
.h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.sec { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 16px 2px 0; font-size: 12px; font-weight: 600;
  color: var(--sub); text-transform: uppercase; letter-spacing: .07em; }
.sec span { color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 500; }
.sec.now { color: var(--acc); }
.card { position: relative; background: var(--card); border-radius: 20px; padding: 12px 14px; font-size: 13.5px; }
.list { display: flex; flex-direction: column; gap: 7px; }
.muted { color: var(--sub); font-size: 11.5px; }
.small { font-size: 12px; }
.warn { color: var(--warn) !important; }
.hint { border: 1px dashed var(--line); border-radius: 18px; padding: 12px 14px; color: var(--sub); font-size: 12.5px; }
.empty { text-align: center; padding: 22px 16px; color: var(--sub); font-size: 13px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }

/* ---- аватар, кнопки, кружки выбора */
.ava { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none;
  border: 0; padding: 0; background: var(--card2); color: var(--text); font-weight: 700; font-size: 13px; line-height: 1; }
.ava.me { background: var(--acc); color: var(--on-acc); }
.ava.big { width: 40px; height: 40px; font-size: 16px; }
.ava.mini { width: 22px; height: 22px; font-size: 10px; }
button.ava { transition: transform .12s; }
button.ava:active { transform: scale(.92); }
.btn { position: relative; border: 0; background: var(--card2); color: var(--text); border-radius: 14px; padding: 10px 14px; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
  transition: transform .12s, background .2s, border-color .2s, color .2s, box-shadow .2s; }
.btn:active { transform: scale(.96); }
/* главная кнопка — янтарная; блик идёт под буквами (z-index: -1 внутри кнопки), текст не засвечивается */
.btn.primary { position: relative; overflow: hidden; isolation: isolate; background: var(--acc); color: var(--on-acc);
  box-shadow: 0 8px 22px -10px rgba(255, 176, 32, .55), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.primary::after { content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: 0; width: 45%; pointer-events: none;
  transform: translateX(-135%) skewX(-20deg); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  animation: sheen 3.2s ease-in-out infinite; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn:disabled::after { animation: none; display: none; }
.btn.sm { padding: 8px 12px; font-size: 13px; border-radius: 12px; }
.btn.go { width: 100%; padding: 14px; font-size: 15px; font-weight: 800; border-radius: 15px; margin-top: 2px; }
.btn.wide { width: 100%; }
.btn svg { width: 16px; height: 16px; }
.pill { border: 0; background: var(--card2); color: var(--text); border-radius: 10px; padding: 7px 10px; font-size: 12px; font-weight: 600; }
.icon-btn { width: 36px; height: 36px; border-radius: 12px; border: 0; padding: 0; background: var(--card2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; transition: transform .12s; }
.icon-btn:active, .pill:active { transform: scale(.94); }
.icon-btn:disabled { opacity: .4; }

/* ---- «Сегодня»: кольца наполняются от нуля за 900 мс */
.rcard { display: flex; align-items: center; gap: 16px; }
.rings { width: 108px; height: 108px; flex: none; transform: rotate(-90deg); }
.rings circle, .mr circle { fill: none; stroke-linecap: round; }
.rings circle { stroke-width: 11; }
.rings .r1 { stroke: var(--acc); } .rings .r2 { stroke: var(--ring2); } .rings .r3 { stroke: var(--ring3); }
.rings .tr { opacity: .16; } .rings .r2.tr { opacity: .12; } .rings .r3.tr { opacity: .22; }
.rings .v, .mr .v { transition: stroke-dasharray .9s var(--ease), opacity .2s; }
.rings .v.zero, .mr .v.zero { opacity: 0; }
.legend { display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: var(--sub); min-width: 0; }
.legend b { display: block; color: var(--text); font-size: 16px; font-weight: 700; }
.legend .l1 b { color: var(--acc); }

/* ---- строка задачи: кружок «сделано», свайп вправо — сделано, влево — перенести */
.row { position: relative; border-radius: 18px; overflow: hidden; }
.under { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
  border-radius: 18px; background: var(--card2); color: var(--text); font-size: 12.5px; font-weight: 700; opacity: 0; }
.under span { display: inline-flex; align-items: center; gap: 6px; opacity: 0; }
.row.sw-r > .under { opacity: 1; background: var(--acc); color: var(--on-acc); }
.row.sw-r > .under span:first-child, .row.sw-l > .under span:last-child { opacity: 1; }
.row.sw-l > .under { opacity: 1; }
.task { position: relative; background: var(--card); border-radius: 18px; padding: 10px 12px 10px 8px; min-height: 50px; display: flex; align-items: center; gap: 8px;
  font-size: 14px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: pan-y; transition: transform .22s var(--ease); }
.task.drag { transition: none; }
.task .tx { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.task small { display: block; font-size: 11.5px; color: var(--sub); margin-top: 1px; }
.task.done .tx > span { text-decoration: line-through; color: var(--sub); }
.chk { width: 34px; height: 34px; margin: -6px -2px; padding: 0; border: 0; background: none; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.chk i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  color: var(--on-acc); transition: background .2s, border-color .2s; }
.chk svg { width: 12px; height: 12px; stroke-width: 3.4; }
.task.done .chk i { background: var(--acc); border-color: var(--acc); }
.task.half .chk i { border-color: var(--acc); background: conic-gradient(var(--acc) 0 50%, transparent 50% 100%); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acc); flex: none; animation: pulse 2.2s infinite; }

/* ---- «Команда» */
.person { display: flex; align-items: center; gap: 10px; }
.person .nm { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.person .nm small { display: block; font-weight: 400; font-size: 11.5px; color: var(--sub); }
.mr { width: 34px; height: 34px; transform: rotate(-90deg); }
.mr circle { stroke-width: 5; stroke: var(--acc); }
.mr .tr { opacity: .18; }
.streak { font-size: 13px; font-weight: 700; min-width: 50px; text-align: right; }
.streak small { display: block; font-weight: 400; color: var(--sub); font-size: 10px; }
.streak.none { color: var(--sub); }
.row2 { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.row2 .tx { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.row2 .muted { margin-top: 1px; }
.poke { border: 0; background: var(--text); color: var(--on-acc); border-radius: 10px; padding: 7px 10px; font-size: 12px; font-weight: 700; white-space: nowrap;
  transition: transform .12s; }
.poke:active { transform: scale(.94); }
.poke:disabled { opacity: .5; }
.st-ok { color: var(--acc); font-size: 12px; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.st-ok svg { width: 13px; height: 13px; stroke-width: 3; }
.st-half { font-size: 14px; font-weight: 700; }

/* ---- «Неделя» */
.wk-nav { display: flex; gap: 6px; align-items: center; }
.wk-nav svg { width: 18px; height: 18px; }
.free { color: var(--sub); font-size: 12.5px; padding: 0 4px; }

/* ---- панели снизу: затемнение плавно, панель из лёгкого размытия, шаги — popIn */
.layer { position: fixed; inset: 0; z-index: 50; }
.dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .62); animation: fadeIn .2s ease-out backwards; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: calc(100% - 24px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 26px 26px 0 0; padding: 10px 16px calc(20px + var(--safe-b)); display: flex; flex-direction: column; gap: 11px;
  box-shadow: var(--pop-shadow); animation: boxIn .3s var(--ease) backwards; }
.grab { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 2px; flex: none; }
.sheet-h { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.step { display: flex; flex-direction: column; gap: 11px; animation: popIn .22s var(--ease) backwards; }
.opts { display: flex; flex-direction: column; gap: 11px; }
.lbl { font-size: 11.5px; color: var(--sub); margin-bottom: -5px; }
.inp { background: var(--card2); border-radius: 14px; padding: 0 12px; display: flex; align-items: center; gap: 10px; transition: box-shadow .2s; }
.inp textarea, .inp input { flex: 1; min-width: 0; background: none; border: 0; outline: none; resize: none; padding: 12px 0; font-size: 15px; line-height: 1.35;
  color: var(--text); caret-color: var(--acc); }
.inp textarea { max-height: 140px; overflow-y: hidden; }
::placeholder { color: var(--sub); opacity: 1; }
.bad { box-shadow: inset 0 0 0 2px var(--acc); border-radius: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; border: 0; background: var(--card2); color: var(--text); border-radius: 11px; padding: 8px 11px; font-size: 13px; line-height: 1.2;
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer; transition: background .2s, color .2s, transform .12s; }
.chip:active { transform: scale(.96); }
.chip.on { background: var(--acc); color: var(--on-acc); font-weight: 700; }
.chip:disabled { opacity: .4; cursor: default; }
.chip input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; cursor: pointer; }
.chip svg { width: 15px; height: 15px; }
.timebox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--card2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; color: var(--sub); border-radius: 8px; padding: 5px 13px; font-size: 13px; font-weight: 600; transition: background .2s, color .2s; }
.seg button.on { background: var(--acc); color: var(--on-acc); }
.time { background: var(--card2); border: 0; border-radius: 11px; padding: 7px 10px; font-size: 13.5px; color: var(--text); min-width: 104px; min-height: 34px; }
.tg { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; padding: 2px 0; cursor: pointer; }
.tg small { display: block; color: var(--sub); font-size: 11.5px; }
.sw { appearance: none; -webkit-appearance: none; margin: 0; width: 42px; height: 26px; border-radius: 13px; background: var(--line); position: relative; flex: none;
  cursor: pointer; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform .2s var(--ease); }
.sw:checked { background: var(--acc); }
.sw:checked::after { transform: translateX(16px); }
.sw:disabled { opacity: .4; cursor: default; }
.acts { display: flex; flex-direction: column; gap: 6px; }
.act { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; background: var(--card2); color: var(--text); border-radius: 14px; padding: 12px 14px;
  font-size: 14.5px; font-weight: 600; text-align: left; transition: transform .12s, background .2s; }
.act:active { transform: scale(.98); }
.act:disabled { opacity: .5; }
.act svg { color: var(--sub); }
.act .ava { margin: -4px 0; }
.meta { color: var(--sub); font-size: 12.5px; margin-top: -6px; overflow-wrap: anywhere; }
.link { border: 0; background: none; color: var(--sub); font-size: 13.5px; padding: 6px; align-self: center; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.field { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--card2); border-radius: 14px; padding: 5px 5px 5px 13px;
  font-size: 13.5px; color: var(--sub); }
.field input, .field select { background: var(--card); border: 0; border-radius: 10px; padding: 7px 9px; color: var(--text); font-size: 14px; min-width: 0; }
.field.wide select { flex: 1; }
.set-h { display: flex; align-items: center; gap: 12px; }
.mrow { display: flex; align-items: center; gap: 10px; background: var(--card2); border-radius: 14px; padding: 8px 8px 8px 12px; font-weight: 600; }
.mrow > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.mrow .btn, .mrow .ava { background: var(--card); }

/* ---- нижнее меню, «+» с бликом */
.nav { position: fixed; z-index: 40; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b)); max-width: 540px; margin: 0 auto; height: 60px;
  border-radius: 26px; background: var(--card2); display: flex; align-items: center; justify-content: space-around;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .9); }
.nav .tab { border: 0; background: none; color: var(--sub); display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; padding: 6px 8px;
  font-size: 10.5px; font-weight: 500; transition: color .2s; }
.nav .tab svg { width: 20px; height: 20px; }
.nav .tab.on { color: var(--text); }
.nav .plus { width: 46px; height: 46px; padding: 0; border-radius: 16px; font-size: 28px; font-weight: 300; line-height: 1; }

/* ---- полоски загрузки: текст переливается, под ним две бегущие полоски */
.c-load { background: linear-gradient(90deg, var(--sub) 0%, #f3ede6 45%, var(--sub) 90%) 0 0 / 300% 100%; -webkit-background-clip: text; background-clip: text;
  color: transparent; animation: skel 1.6s linear infinite; }
.c-load::after { content: ""; display: block; height: 40px; margin-top: 10px; border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .05) 0%, rgba(255, 255, 255, .14) 45%, rgba(255, 255, 255, .05) 90%) 0 0 / 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) 0 0 / 88% 12px no-repeat, linear-gradient(#000 0 0) 0 28px / 62% 12px no-repeat;
  mask: linear-gradient(#000 0 0) 0 0 / 88% 12px no-repeat, linear-gradient(#000 0 0) 0 28px / 62% 12px no-repeat; animation: skel 1.4s linear infinite; }

/* ---- всплывающая строка — светлая таблетка над нижним меню */
.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  background: var(--text); color: var(--on-acc); font-weight: 600; font-size: 13px; text-align: center; padding: 11px 18px; border-radius: 22px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .75); animation: toastIn .35s var(--ease) backwards; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 80; pointer-events: none; }

/* ---- переход между разделами (образец — дашборд Avito-бота): прежний размывается и уходит вверх, новый проявляется
   блоками по очереди. Только при смене раздела, перерисовка данных его не запускает */
main > section.leaving[hidden] { display: block !important; position: absolute; z-index: 2; margin: 0; pointer-events: none;
  transform-origin: 50% 0; animation: smearOut .2s ease-in forwards; }
main > section.enter > * { transform-origin: 50% 0; animation: smearIn .36s var(--ease) backwards; animation-delay: calc(var(--fx-d, 0s) + var(--fx-i, 0s)); }
main > section.enter.after { --fx-d: .19s; }
main > section.enter > :nth-child(2) { --fx-i: .05s; } main > section.enter > :nth-child(3) { --fx-i: .1s; }
main > section.enter > :nth-child(4) { --fx-i: .15s; } main > section.enter > :nth-child(n+5) { --fx-i: .2s; }

@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 176, 32, .55); } 70% { box-shadow: 0 0 0 8px rgba(255, 176, 32, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 176, 32, 0); } }
@keyframes sheen { 0%, 55% { transform: translateX(-135%) skewX(-20deg); } 85%, 100% { transform: translateX(290%) skewX(-20deg); } }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes smearOut { to { opacity: 0; filter: blur(10px); transform: translateY(-8px); } }
/* без scaleY: на длинном разделе растяжение на 3% сдвигало низ на 100+ px (образец, 18.10) */
@keyframes smearIn { from { opacity: 0; filter: blur(12px); transform: translateY(8px); } to { opacity: 1; filter: none; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; filter: blur(6px); transform: translateY(-4px); } to { opacity: 1; filter: none; transform: none; } }
@keyframes boxIn { from { opacity: 0; filter: blur(8px); transform: translateY(10px); } to { opacity: 1; filter: none; transform: none; } }
/* панели справа в образце; здесь не используется, оставлен для полноты набора */
@keyframes panelIn { from { opacity: 0; filter: blur(8px); } to { opacity: 1; filter: none; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 18px); } to { opacity: 1; transform: translateX(-50%); } }

/* без движения по желанию системы — последним правилом */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
