/* Семейный планировщик — дизайн */
:root {
  --bg: #f3f4fb;
  --surface: #ffffff;
  --surface-2: #eef0f9;
  --text: #1d2040;
  --muted: #7a7fa3;
  --line: rgba(29, 32, 64, .09);
  --brand: #6c5ce7;
  --brand-2: #8f7bff;
  --brand-soft: rgba(108, 92, 231, .12);
  --ok: #1fb571;
  --ok-soft: rgba(31, 181, 113, .14);
  --danger: #f0524f;
  --danger-soft: rgba(240, 82, 79, .12);
  --warn: #ff9f1c;
  --warn-soft: rgba(255, 159, 28, .16);
  --shadow: 0 1px 2px rgba(29, 32, 64, .05), 0 6px 18px rgba(29, 32, 64, .06);
  --r: 20px;
  --tabbar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0f1020;
  --surface: #1a1b33;
  --surface-2: #25274a;
  --text: #f1f2ff;
  --muted: #9b9ec6;
  --line: rgba(255, 255, 255, .09);
  --brand: #8b7cff;
  --brand-2: #a898ff;
  --brand-soft: rgba(139, 124, 255, .18);
  --ok: #34d08a;
  --ok-soft: rgba(52, 208, 138, .16);
  --danger: #ff6b68;
  --danger-soft: rgba(255, 107, 104, .16);
  --warn: #ffb347;
  --warn-soft: rgba(255, 179, 71, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.i { flex: none; vertical-align: -.2em; }
.ill { display: block; width: 100%; height: auto; }

body::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 320px; background: radial-gradient(110% 100% at 50% -30%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 72%); pointer-events: none; z-index: 0; }
#app { position: relative; z-index: 1; max-width: 620px; margin: 0 auto; min-height: 100vh; padding: 0 16px calc(var(--tabbar-h) + var(--safe-b) + 96px); }
.splash { display: grid; place-items: center; min-height: 70vh; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3.5px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- шапка ---------- */
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 2px 14px; }
.hdr h1 { margin: 0; font-size: 27px; line-height: 1.12; font-weight: 800; letter-spacing: -.4px; }
.hdr .sub { margin-top: 3px; color: var(--muted); font-size: 14.5px; }
.avstack { display: flex; flex: none; padding-left: 8px; }
.avstack .av { margin-left: -10px; border: 2.5px solid var(--bg); }

.av { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(145deg, hsl(var(--h, 250) 70% 62%), hsl(calc(var(--h, 250) + 28) 70% 52%)); position: relative; }
.av.md { width: 36px; height: 36px; font-size: 15px; }
.av.lg { width: 46px; height: 46px; font-size: 19px; }
.av.ok::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2l2 2 4-4.4' fill='none' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/10px no-repeat; border: 2px solid var(--surface); }

/* ---------- карточка «сегодня» ---------- */
.today { position: relative; overflow: hidden; border-radius: 24px; padding: 18px 20px; color: #fff; background: linear-gradient(135deg, #7a68f5 0%, #5b4bdb 100%); box-shadow: 0 10px 26px rgba(91, 75, 219, .32); }
.today::after { content: ""; position: absolute; right: -30px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .13); }
.today::before { content: ""; position: absolute; right: 40px; bottom: -50px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255, 255, 255, .09); }
.today > * { position: relative; z-index: 1; }
.today .big { font-size: 26px; font-weight: 800; letter-spacing: -.4px; line-height: 1.15; }
.today .small { margin-top: 4px; opacity: .88; font-size: 14.5px; }
.today.calm { background: linear-gradient(135deg, #2ec98a 0%, #139e68 100%); box-shadow: 0 10px 26px rgba(19, 158, 104, .28); }
.today.alert { background: linear-gradient(135deg, #ff7a6b 0%, #e8473f 100%); box-shadow: 0 10px 26px rgba(232, 71, 63, .3); }
.bar { height: 8px; margin-top: 12px; border-radius: 4px; background: rgba(255, 255, 255, .28); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 4px; background: #fff; transition: width .4s; }

/* ---------- переключатель ---------- */
.seg { display: flex; margin: 16px 0 4px; padding: 4px; background: var(--surface-2); border-radius: 15px; }
.seg button { flex: 1; padding: 10px 0; border-radius: 12px; font-weight: 700; font-size: 15px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; transition: .15s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg .cnt { min-width: 20px; padding: 0 6px; height: 20px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); font-size: 12px; display: grid; place-items: center; }

/* ---------- секции и карточки дел ---------- */
.sec-h { display: flex; align-items: center; justify-content: space-between; margin: 22px 4px 10px; font-size: 14px; font-weight: 800; letter-spacing: .3px; text-transform: uppercase; color: var(--muted); }
.sec-h.danger { color: var(--danger); }
.sec-h .link { text-transform: none; letter-spacing: 0; font-size: 14.5px; font-weight: 700; color: var(--brand); }
.stack { display: grid; gap: 10px; }

.task { display: flex; align-items: flex-start; gap: 13px; padding: 14px 14px 14px 12px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); cursor: pointer; transition: transform .1s; }
.task:active { transform: scale(.985); }
.task.late { box-shadow: inset 4px 0 0 var(--danger), var(--shadow); }
.task.done { opacity: .62; }
.task.done .ttl { text-decoration: line-through; color: var(--muted); }
.task .main { flex: 1; min-width: 0; }
.ttl { font-size: 17px; font-weight: 700; line-height: 1.28; word-break: break-word; }
.note { margin-top: 2px; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--muted); }
.tag .i { width: 15px; height: 15px; }
.tag.brand { background: var(--brand-soft); color: var(--brand); }
.tag.late { background: var(--danger-soft); color: var(--danger); }
.tag.soon { background: var(--warn-soft); color: #c87400; }
[data-theme="dark"] .tag.soon { color: var(--warn); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag .avs { display: inline-flex; margin-left: 2px; }
.tag .avs .av { width: 18px; height: 18px; font-size: 10px; margin-left: -5px; border: 1.5px solid var(--surface-2); }
.tag .avs .av:first-child { margin-left: 0; }
.tag .avs .av.ok::after { width: 9px; height: 9px; right: -3px; bottom: -3px; border-width: 1.5px; background-size: 7px; }

.chk { flex: none; width: 32px; height: 32px; margin-top: 1px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--muted) 60%, transparent); display: grid; place-items: center; color: transparent; transition: .18s; background: transparent; }
.chk .i { width: 18px; height: 18px; stroke-width: 3.2; }
.chk.on { background: var(--ok); border-color: var(--ok); color: #fff; transform: scale(1.04); }
.chk.static { border-style: dashed; opacity: .45; cursor: default; }
.chk.urgent { border-color: var(--danger); }

/* ---------- пустые состояния ---------- */
.empty { text-align: center; padding: 18px 20px 6px; }
.empty .ill { width: 200px; margin: 0 auto 8px; }
.empty h3 { margin: 0 0 6px; font-size: 21px; font-weight: 800; }
.empty p { margin: 0 auto 16px; max-width: 300px; color: var(--muted); font-size: 15.5px; }
.empty .btn { max-width: 260px; margin: 0 auto; }

/* ---------- кнопки ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 12px 18px; border-radius: 16px; font-weight: 800; font-size: 16px; background: var(--brand-soft); color: var(--brand); transition: transform .1s, opacity .1s; }
.btn:active { transform: scale(.97); opacity: .85; }
.btn.primary { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 38%, transparent); }
.btn.ok { background: linear-gradient(135deg, #34d08a, #1fb571); color: #fff; box-shadow: 0 6px 16px rgba(31, 181, 113, .32); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.plain { background: var(--surface-2); color: var(--text); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; min-width: 0; padding-left: 10px; padding-right: 10px; font-size: 15px; }

.fab { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); z-index: 5; display: flex; align-items: center; gap: 8px; padding: 0 24px 0 18px; height: 56px; border-radius: 28px; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; font-weight: 800; font-size: 17px; box-shadow: 0 10px 26px color-mix(in srgb, var(--brand) 50%, transparent); transition: transform .1s; }
.fab:active { transform: translateX(-50%) scale(.95); }
.fab .i { width: 24px; height: 24px; stroke-width: 2.6; }

/* ---------- нижние вкладки ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.tabbar-in { max-width: 620px; margin: 0 auto; display: flex; padding: 0 8px; }
.tab { flex: 1; height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 700; position: relative; }
.tab .pill { display: grid; place-items: center; width: 54px; height: 30px; border-radius: 15px; transition: .2s; position: relative; }
.tab .i { width: 24px; height: 24px; }
.tab.on { color: var(--brand); }
.tab.on .pill { background: var(--brand-soft); }
.badge { position: absolute; top: -5px; right: 2px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }

/* ---------- покупки ---------- */
.addbar { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 18px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); }
.addbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 10px 0; font-size: 17px; }
.addbar input::placeholder { color: var(--muted); }
.addbar .go { flex: none; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; display: grid; place-items: center; }
.addbar .go .i { width: 24px; height: 24px; stroke-width: 2.6; }
.urg-toggle { flex: none; display: flex; align-items: center; gap: 4px; height: 36px; padding: 0 11px 0 8px; border-radius: 18px; background: var(--surface-2); color: var(--muted); font-size: 14px; font-weight: 700; transition: .15s; }
.urg-toggle.on { background: var(--danger-soft); color: var(--danger); }
.urg-toggle .i { width: 18px; height: 18px; }
.help { margin: 8px 8px 0; font-size: 13.5px; color: var(--muted); min-height: 20px; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.qchip { padding: 8px 14px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-size: 14.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.qchip .i { width: 15px; height: 15px; color: var(--brand); stroke-width: 2.8; }
.qchip:active { transform: scale(.95); }

.item { display: flex; align-items: center; gap: 13px; padding: 12px 8px 12px 12px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.item.urgent { box-shadow: inset 4px 0 0 var(--danger), var(--shadow); }
.item.done { opacity: .6; }
.item.done .ttl { text-decoration: line-through; color: var(--muted); }
.item .main { flex: 1; min-width: 0; cursor: pointer; }
.item .ttl { font-size: 17px; font-weight: 600; }
.item .by { font-size: 13px; color: var(--muted); margin-top: 1px; }
.ibtn { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.ibtn:active { background: var(--surface-2); }
.ibtn .i { width: 21px; height: 21px; }
.ibtn.flame { opacity: .4; }
.ibtn.flame.on { opacity: 1; color: var(--danger); }

/* ---------- семья ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin-top: 14px; }
.card h3 { margin: 0 0 4px; font-size: 19px; font-weight: 800; }
.card p { margin: 4px 0 14px; color: var(--muted); font-size: 15px; }
.person { display: flex; align-items: center; gap: 13px; padding: 12px 8px 12px 14px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.person .main { flex: 1; min-width: 0; }
.person .name { font-weight: 700; font-size: 16.5px; }
.person .sub { color: var(--muted); font-size: 13.5px; }
.badge-tag { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 2px 8px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); font-size: 11.5px; font-weight: 800; vertical-align: 2px; }
.badge-tag .i { width: 12px; height: 12px; }
.invite { background: linear-gradient(135deg, #7a68f5, #5b4bdb); color: #fff; padding: 18px; }
.invite h3, .invite p { color: #fff; }
.invite p { opacity: .9; }
.invite .ill { width: 150px; margin: 0 auto 6px; }
.invite .btn.primary { background: #fff; color: var(--brand); box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.invite .btn.plain { background: rgba(255, 255, 255, .18); color: #fff; }
.row-set { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; }
.row-set + .row-set { border-top: 1px solid var(--line); }
.row-set .t { font-size: 15.5px; font-weight: 600; }
.row-set .d { font-size: 13px; color: var(--muted); margin-top: 1px; }
.switch { flex: none; width: 52px; height: 32px; border-radius: 16px; background: color-mix(in srgb, var(--muted) 38%, transparent); position: relative; transition: .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); transition: .2s; }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(20px); }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin: 22px 8px 0; }

/* ---------- приветствие ---------- */
.hero { padding: 26px 20px 4px; text-align: center; }
.hero .ill { width: 230px; margin: 0 auto 6px; }
.hero h1 { margin: 6px 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -.4px; }
.hero p { margin: 0 auto; max-width: 320px; color: var(--muted); font-size: 16px; }
.steps { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.steps li { display: flex; align-items: center; gap: 13px; padding: 12px 14px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); font-size: 15px; font-weight: 600; }
.steps b { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: 15px; }

/* ---------- ввод ---------- */
.field, input[type=text], input[type=time], input[type=date], input[type=number], textarea {
  width: 100%; min-height: 52px; padding: 13px 16px; border-radius: 15px; border: 2px solid transparent; background: var(--surface-2); outline: 0; appearance: none; -webkit-appearance: none; font-size: 17px;
}
input[type=text]:focus, input[type=time]:focus, input[type=date]:focus, input[type=number]:focus, textarea:focus { border-color: var(--brand); background: var(--surface); }
textarea { resize: none; display: block; }
input[type=date], input[type=time] { text-align: left; min-width: 0; }

/* ---------- шторка ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; background: rgba(10, 10, 30, .5); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: 100%; max-width: 620px; max-height: 94vh; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); border-radius: 28px 28px 0 0; padding: 10px 16px calc(18px + var(--safe-b)); animation: up .28s cubic-bezier(.2, .8, .2, 1); }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
.sheet h2 { margin: 0 0 14px 2px; font-size: 24px; font-weight: 800; letter-spacing: -.3px; }
@keyframes up { from { transform: translateY(50px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.step { background: var(--surface); border-radius: var(--r); padding: 14px 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.step > .q { display: flex; align-items: center; gap: 10px; margin: 0 2px 12px; font-size: 16.5px; font-weight: 800; }
.step > .q b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 13.5px; }
.step .hint { margin: 10px 4px 0; font-size: 13.5px; color: var(--muted); }
.step .sub-q { margin: 14px 2px 8px; font-size: 14px; font-weight: 700; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 10px 15px; border-radius: 999px; background: var(--surface-2); border: 2px solid transparent; font-size: 15px; font-weight: 700; transition: .12s; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.chip .i { width: 17px; height: 17px; }
.chip.day { min-width: 46px; justify-content: center; padding: 10px 0; }
.chip.sm { padding: 7px 13px; font-size: 14px; }
.chip .av { width: 24px; height: 24px; font-size: 12px; }
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode button { padding: 12px 10px; border-radius: 16px; background: var(--surface-2); border: 2px solid transparent; text-align: left; display: grid; gap: 3px; }
.mode button .i { width: 24px; height: 24px; color: var(--muted); margin-bottom: 2px; }
.mode button b { font-size: 15.5px; }
.mode button span { font-size: 12.5px; color: var(--muted); line-height: 1.25; }
.mode button.on { background: var(--brand-soft); border-color: var(--brand); }
.mode button.on .i, .mode button.on b { color: var(--brand); }
.two { display: grid; grid-template-columns: 1.25fr 1fr; gap: 10px; }
.two label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 4px 5px; }
.inline { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.inline > input { flex: 1; min-width: 0; }
.inline > span { flex: none; color: var(--muted); font-size: 15px; font-weight: 600; }
.check-line { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 15.5px; font-weight: 600; cursor: pointer; }
.check-line input { width: 24px; height: 24px; flex: none; accent-color: var(--brand); color-scheme: light; }
.sum { margin-bottom: 12px; padding: 16px; border-radius: var(--r); background: var(--brand-soft); border: 2px dashed color-mix(in srgb, var(--brand) 45%, transparent); }
.sum h4 { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; color: var(--brand); }
.sum ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.sum li { display: flex; gap: 10px; font-size: 15px; line-height: 1.35; }
.sum li .i { width: 18px; height: 18px; margin-top: 2px; color: var(--brand); }
.sticky { position: sticky; bottom: calc(-18px - var(--safe-b)); padding: 12px 0 0; display: grid; gap: 10px; background: linear-gradient(to top, var(--bg) 72%, transparent); }

/* ---------- подробности дела ---------- */
.d-title { font-size: 25px; font-weight: 800; line-height: 1.2; letter-spacing: -.3px; margin: 2px 2px 4px; word-break: break-word; }
.d-note { margin: 0 2px 12px; color: var(--muted); font-size: 16px; white-space: pre-wrap; }
.d-card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 4px 16px; margin-bottom: 12px; }
.d-row { display: flex; gap: 12px; padding: 12px 0; }
.d-row + .d-row { border-top: 1px solid var(--line); }
.d-row > .i { width: 22px; height: 22px; margin-top: 1px; color: var(--brand); }
.d-row .k { font-size: 12.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.d-row .v { font-size: 16px; font-weight: 600; margin-top: 2px; }
.d-row .v ul { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-weight: 500; font-size: 15px; }
.who-line { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 600; font-size: 15.5px; }
.who-line .st { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--muted); }
.who-line .st.ok { color: var(--ok); }
.d-actions { display: grid; gap: 10px; margin-top: 4px; }

/* ---------- прочее ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 84px); transform: translate(-50%, 20px); max-width: 90vw; padding: 12px 18px; border-radius: 16px; background: #22244a; color: #fff; font-size: 15px; font-weight: 600; opacity: 0; pointer-events: none; transition: .22s; z-index: 60; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: #d93f3c; }
.err-screen { text-align: center; padding: 70px 24px; }
.err-screen h2 { margin: 12px 0 6px; font-size: 22px; }
.err-screen p { margin: 0 auto 18px; max-width: 320px; color: var(--muted); }
.err-screen code { display: block; margin: 0 auto 18px; max-width: 340px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; word-break: break-all; }
.err-screen .btn { max-width: 240px; margin: 0 auto; }
.logo { display: block; margin: 0 auto 10px; }

/* кнопка в шапке */
.hbtn { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 10px 15px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 14.5px; }
.hbtn:active { opacity: .7; }

.d-row .v li { display: flex; gap: 9px; align-items: flex-start; }
.d-row .v li .i { width: 18px; height: 18px; margin-top: 3px; color: var(--brand); }
.mode button { align-content: start; }
.addbar input[type=text] { background: none; border: 0; min-height: 0; padding: 10px 0; border-radius: 0; }
.addbar input[type=text]:focus { background: none; }

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

/* ---------- плавное появление экранов ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.enter > * { animation: rise .38s cubic-bezier(.2, .8, .2, 1) both; }
.enter > *:nth-child(2) { animation-delay: .04s; }
.enter > *:nth-child(3) { animation-delay: .08s; }
.enter > *:nth-child(4) { animation-delay: .12s; }
.enter > *:nth-child(5) { animation-delay: .16s; }
.enter > *:nth-child(n+6) { animation-delay: .2s; }

/* ---------- скелетон загрузки ---------- */
.skel { margin: 0 2px; }
.skel .bar-s, .skel .card-s { background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 60%, var(--surface)) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel .bar-s { height: 26px; width: 62%; border-radius: 10px; margin: 24px 0 8px; }
.skel .bar-s.sm { height: 14px; width: 34%; margin: 0 0 20px; }
.skel .hero-s { height: 110px; border-radius: 24px; margin-bottom: 16px; background: linear-gradient(90deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 50%, transparent), var(--brand-soft)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.skel .card-s { height: 92px; border-radius: var(--r); margin-bottom: 10px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- «салют» при выполнении ---------- */
.confetti { position: fixed; z-index: 70; width: 9px; height: 9px; border-radius: 3px; pointer-events: none; animation: pop .8s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes pop { 0% { transform: translate(0, 0) scale(1) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(.4) rotate(var(--rot)); opacity: 0; } }
.chk.on { animation: tick .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes tick { from { transform: scale(.6); } to { transform: scale(1.04); } }

/* ---------- подсказка новичку ---------- */
.tip { position: relative; margin-top: 14px; padding: 14px 40px 14px 16px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); border: 1.5px solid var(--brand-soft); }
.tip h4 { margin: 0 0 8px; font-size: 15.5px; font-weight: 800; }
.tip ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 14.5px; color: var(--muted); }
.tip li { display: flex; gap: 10px; align-items: center; }
.tip li b { color: var(--text); }
.tip li .i { width: 18px; height: 18px; color: var(--brand); }
.tip .x { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.tip .x .i { width: 18px; height: 18px; }

/* ---------- форма: «Настроить подробнее» ---------- */
.more { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 12px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); text-align: left; }
.more .t { flex: 1; min-width: 0; }
.more .t b { display: block; font-size: 16px; }
.more .t span { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more > .i { width: 20px; height: 20px; color: var(--muted); transition: transform .2s; }
.more.open > .i { transform: rotate(90deg); }
.more .gear { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }

/* ---------- прочее ---------- */
#toast { display: flex; align-items: center; justify-content: center; gap: 9px; }
#toast .i { width: 19px; height: 19px; stroke-width: 3; flex: none; }
.day-h { text-transform: none; letter-spacing: 0; font-size: 15px; }

.mode button { display: flex; align-items: center; gap: 10px; padding: 12px; }
.mode button .i { margin: 0; flex: none; }
.mode button b { display: block; font-size: 15px; line-height: 1.2; }
.mode button span { display: block; margin-top: 2px; font-size: 12.5px; }

.grab-area { margin: -10px -16px 4px; padding: 10px 0 12px; cursor: grab; touch-action: none; }
.sheet .grab { margin: 0 auto; }

.upd { position: sticky; top: 8px; z-index: 8; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 8px; padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; font-weight: 800; font-size: 14.5px; box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 45%, transparent); }

/* длинные слова без пробелов (название, заметка, имя) переносятся и не растягивают страницу */
body { overflow-wrap: anywhere; }
.hdr > div:first-child { min-width: 0; flex: 1; }
.hdr h1 { hyphens: auto; }
.main, .body, .t { min-width: 0; }

/* ---------- роли и права ---------- */
.badge-tag.rolebadge { background: var(--surface-2); color: var(--muted); }
.roles { display: grid; gap: 8px; }
.role { text-align: left; display: grid; gap: 3px; padding: 13px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); border: 2px solid transparent; }
.role b { font-size: 16px; }
.role span { font-size: 13.5px; color: var(--muted); line-height: 1.3; }
.role.on { border-color: var(--brand); background: var(--brand-soft); }
.role.on b { color: var(--brand); }
.perm { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; font-size: 15px; }
.perm .i { margin-top: 2px; stroke-width: 3; }
.perm.yes .i { color: var(--ok); }
.perm.no { color: var(--muted); }
.perm.no .i { color: var(--danger); opacity: .8; }
.perm.no span { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }

/* ---------- полоска недели ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 8px; }
.wd { display: grid; justify-items: center; gap: 3px; padding: 7px 0 6px; border-radius: 14px; color: var(--muted); font-weight: 600; }
.wd .n { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
.wd .dd { font-size: 12px; }
.wd .m { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.wd .m .i { stroke-width: 3; }
.wd.today { background: var(--brand-soft); color: var(--brand); }
.wd.done .m { background: var(--ok); color: #fff; }
.wd.partial .m { background: var(--warn-soft); color: var(--warn); }
.wd.missed .m { background: var(--danger-soft); color: var(--danger); }
.wd.skipped .m { background: var(--surface-2); color: var(--muted); }
.wd.open .m { background: var(--brand); color: #fff; }
.wd.late .m { background: var(--danger); color: #fff; }
.wd.future .m { background: transparent; border: 2px dashed color-mix(in srgb, var(--muted) 55%, transparent); }
.wd.none .m { background: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend .ok { color: var(--ok); } .legend .warn { color: var(--warn); } .legend .danger { color: var(--danger); }
.wstat { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.wstat b { color: var(--text); }
