/* «Я чел» — стили. Темы: black / white / pickme (+ system) */
:root {
  --bg: #000; --bg2: #121214; --card: #1c1c1f; --card2: #26262a; --line: #2e2e33;
  --text: #f4f4f6; --muted: #8e8e96; --accent: #3478f6; --accent-text: #fff;
  --danger: #ff453a; --ok: #30d158; --warn: #ffd60a; --heart: #ff375f;
  --tab-bg: rgba(28,28,31,.92); --shadow: 0 8px 30px rgba(0,0,0,.5);
  --r: 14px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
:root[data-theme="white"] {
  --bg: #f2f2f7; --bg2: #e9e9ef; --card: #fff; --card2: #f0f0f4; --line: #dcdce2;
  --text: #111114; --muted: #6c6c74; --tab-bg: rgba(255,255,255,.94); --shadow: 0 8px 30px rgba(0,0,0,.12);
  color-scheme: light;
}
:root[data-theme="pickme"] {
  --bg: #fff0f6; --bg2: #ffe3ef; --card: #fff; --card2: #ffe8f1; --line: #ffc6dc;
  --text: #4a1630; --muted: #b0668a; --accent: #ff4f9a; --tab-bg: rgba(255,255,255,.94);
  --shadow: 0 8px 30px rgba(255,79,154,.2); --heart: #ff2d7a;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg: #f2f2f7; --bg2: #e9e9ef; --card: #fff; --card2: #f0f0f4; --line: #dcdce2;
    --text: #111114; --muted: #6c6c74; --tab-bg: rgba(255,255,255,.94); --shadow: 0 8px 30px rgba(0,0,0,.12);
    color-scheme: light;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; touch-action: manipulation; -webkit-text-size-adjust: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; overscroll-behavior: none; }
body { overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; -webkit-user-select: none; user-select: none; }
input, textarea, select { font: inherit; font-size: 16px; /* меньше 16px — iPhone увеличивает страницу при вводе */ color: var(--text); background: var(--card2); border: 1px solid transparent; border-radius: 10px; padding: 10px 12px; width: 100%; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
input[type=range] { padding: 0; background: none; accent-color: var(--accent); }
input[type=color] { padding: 0; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; }
a { color: var(--accent); }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }

/* ---------- каркас ---------- */
#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
#view { flex: 1; overflow: hidden; position: relative; }
.screen { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; padding: calc(var(--safe-t) + 8px) 16px calc(110px + var(--safe-b)); -webkit-overflow-scrolling: touch; }
.screen.noscroll { overflow: hidden; padding-bottom: 0; }
.topbar { display: flex; align-items: center; gap: 8px; min-height: 52px; }
.topbar h1 { font-size: 30px; font-weight: 800; margin: 0; flex: 1; letter-spacing: -.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar h2 { font-size: 18px; margin: 0; flex: 1; text-align: center; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--card); flex: none; }
.iconbtn.ghost { background: none; }
.iconbtn:active { transform: scale(.94); }

/* ---------- таб-бар ---------- */
#tabbar { position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); display: flex; justify-content: space-around; background: var(--tab-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 26px; padding: 6px; box-shadow: var(--shadow); z-index: 20; max-width: 560px; margin: 0 auto; border: 1px solid var(--line); }
#tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--muted); padding: 6px 2px; border-radius: 20px; min-width: 0; }
#tabbar button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#tabbar button.on { color: var(--text); background: var(--card2); }
#tabbar .badge { position: absolute; margin-left: 18px; margin-top: -2px; background: var(--danger); color: #fff; border-radius: 9px; font-size: 10px; min-width: 16px; padding: 0 4px; line-height: 16px; }
body.editing #tabbar, body.hide-tabbar #tabbar { display: none; }

/* ---------- списки/карточки ---------- */
.group { background: var(--card); border-radius: var(--r); overflow: hidden; margin: 10px 0 18px; }
.group-title { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 18px 4px 6px; display: flex; align-items: center; justify-content: space-between; }
.group-title.big { text-transform: none; font-size: 18px; color: var(--text); font-weight: 700; letter-spacing: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; min-height: 48px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.item:last-child { border-bottom: 0; }
button.item:active, .item.tap:active { background: var(--card2); }
.item .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item .val { color: var(--muted); font-size: 14px; white-space: nowrap; }
.item .chev { color: var(--muted); width: 16px; height: 16px; }
.item .ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--card2); flex: none; }
.pro { font-size: 10px; font-weight: 800; font-style: italic; background: linear-gradient(90deg,#5b5bff,#a259ff); color: #fff; padding: 2px 6px; border-radius: 6px; letter-spacing: .3px; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 15px; transition: .2s; }
.switch span::after { content: ""; position: absolute; width: 26px; height: 26px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { transform: translateX(20px); }
.seg { display: flex; background: var(--card2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { flex: 1; padding: 7px 6px; border-radius: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 7px 12px; border-radius: 18px; background: var(--card2); font-size: 13px; border: 1px solid transparent; }
.chip.on { background: var(--accent); color: var(--accent-text); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 18px; border-radius: 22px; background: var(--card2); font-weight: 600; min-height: 46px; }
.btn.primary { background: var(--accent); color: var(--accent-text); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.green { background: var(--ok); color: #fff; }
.btn.block { width: 100%; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; }
.btnrow { display: flex; gap: 10px; }
.btnrow .btn { flex: 1; }
.field { margin: 10px 0; }
.field label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 4px 4px; }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }

/* ---------- модальные окна ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { background: var(--bg2); width: 100%; max-width: 560px; max-height: 92vh; border-radius: 22px 22px 0 0; overflow: auto; padding: 8px 16px calc(16px + var(--safe-b)); animation: up .25s cubic-bezier(.2,.9,.3,1); }
.sheet .grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet.full { height: 100%; max-height: 100%; border-radius: 0; padding-top: calc(var(--safe-t) + 8px); }
.sheet-head { display: flex; align-items: center; gap: 8px; position: sticky; top: -8px; background: var(--bg2); z-index: 2; padding: 6px 0; }
.sheet-head h3 { flex: 1; text-align: center; margin: 0; font-size: 18px; }
.sheet-foot { position: sticky; bottom: calc(-16px - var(--safe-b)); background: var(--bg2); padding: 10px 0 calc(6px); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }
.popover { position: fixed; z-index: 60; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; min-width: 180px; animation: fade .15s; border: 1px solid var(--line); }
.popover button { display: flex; width: 100%; padding: 10px 12px; border-radius: 8px; gap: 10px; align-items: center; }
.popover button:active { background: var(--card2); }
.page { position: fixed; inset: 0; background: var(--bg); z-index: 40; overflow-y: auto; padding: calc(var(--safe-t) + 8px) 16px calc(40px + var(--safe-b)); animation: slidein .25s cubic-bezier(.2,.9,.3,1); }
.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 14px); background: var(--card); color: var(--text); padding: 10px 16px; border-radius: 20px; box-shadow: var(--shadow); z-index: 100; font-size: 14px; animation: fade .2s; border: 1px solid var(--line); max-width: 90vw; }
.netbadge { position: fixed; top: calc(var(--safe-t) + 4px); right: 12px; z-index: 30; font-size: 11px; background: var(--warn); color: #000; padding: 2px 8px; border-radius: 10px; }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(100%) } }
@keyframes slidein { from { transform: translateX(100%) } }

/* ---------- Ещё ---------- */
.profile { display: flex; align-items: center; gap: 14px; background: var(--card); padding: 14px; border-radius: var(--r); margin-top: 6px; width: 100%; text-align: left; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg,#6a5cff,#ff5ca8); display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #fff; overflow: hidden; flex: none; background-size: cover; background-position: center; }
.avatar.sm { width: 40px; height: 40px; font-size: 16px; }
.plan-badge { font-size: 11px; padding: 2px 8px; border-radius: 8px; background: var(--card2); color: var(--muted); }
.plan-badge.prem { background: linear-gradient(90deg,#ffb800,#ff6a00); color: #000; font-weight: 700; }
.tilegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-top: 10px; }
.tile { background: var(--card); border-radius: var(--r); padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; }
.tile .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; }

/* ---------- календарь ---------- */
.cal-head { position: absolute; top: 0; left: 0; right: 0; padding: calc(var(--safe-t) + 8px) 12px 0; background: var(--bg); z-index: 5; }
.cal-head .sub { font-size: 13px; color: var(--muted); margin-top: -4px; }
.wdays { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 11px; color: var(--muted); text-align: center; padding: 6px 0 4px; }
.cal-scroll { position: absolute; left: 0; right: 0; bottom: 0; overflow-y: auto; scroll-snap-type: y mandatory; padding: 0 8px; overscroll-behavior: contain; }
.cal-scroll.free { scroll-snap-type: none; }
.month { scroll-snap-align: start; scroll-snap-stop: always; padding-bottom: 8px; }
.month-title { font-size: 15px; font-weight: 700; padding: 8px 4px 4px; color: var(--muted); }
.year .month-title { font-size: 22px; color: var(--text); }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.day { min-height: var(--dayh, 92px); border-radius: 8px; padding: 3px 2px; position: relative; display: flex; flex-direction: column; gap: 2px; overflow: hidden; background: transparent; text-align: left; }
.day.other { opacity: .35; }
.day.other.hidec .chip-s, .day.other.hidec .dots { display: none; }
.day .num { font-size: 13px; text-align: center; height: 22px; line-height: 22px; font-weight: 500; }
.day.today .num span { background: var(--danger); color: #fff; border-radius: 11px; padding: 1px 6px; font-weight: 700; }
.day.today.big .num { font-size: 17px; }
.day.today.big .num span { padding: 2px 8px; }
.day.weekend .num { color: var(--muted); }
.day.hol-frame { box-shadow: inset 0 0 0 1.5px var(--holc); }
.day.hol-fill { background: color-mix(in srgb, var(--holc) 22%, transparent); }
.day.sel { background: var(--card2); }
.editing .day .slot { border: 1px dashed var(--line); border-radius: 6px; min-height: 20px; }
.editing .day:active { background: var(--card); }
.chip-s { font-size: 9.5px; line-height: 1.15; border-radius: 4px; padding: 2px 3px; color: #111; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.chip-s .t { font-weight: 400; display: block; font-size: 9px; opacity: .85; }
.chip-s.partner { outline: 1.5px dashed var(--heart); outline-offset: -1.5px; }
.dots { display: flex; gap: 2px; justify-content: center; flex-wrap: wrap; }
.dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.ev-line { font-size: 9px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.fab { position: fixed; right: 18px; bottom: calc(96px + var(--safe-b)); width: 52px; height: 52px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; z-index: 15; border: 1px solid var(--line); }
.fab:active { transform: scale(.94); }
.heart-btn svg { transition: transform .2s; }
.heart-btn.on { background: color-mix(in srgb, var(--heart) 20%, var(--card)); color: var(--heart); }
.heart-btn.on svg { fill: var(--heart); }
.heart-btn.pop svg { animation: heartpop .5s; }
@keyframes heartpop { 0% { transform: scale(1) } 30% { transform: scale(1.45) } 60% { transform: scale(.9) } 100% { transform: scale(1) } }
.heart-btn.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--heart) 50%, transparent) } 50% { box-shadow: 0 0 0 6px transparent } }
/* неделя */
.week { scroll-snap-align: start; padding: 6px 0 10px; }
.week-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 6px; border-bottom: 1px solid var(--line); min-height: 52px; }
.week-row .d { width: 40px; text-align: center; flex: none; }
.week-row .d b { display: block; font-size: 18px; }
.week-row .d small { color: var(--muted); font-size: 11px; }
.week-row.today .d b { color: var(--danger); }
.week-row .items { flex: 1; display: flex; flex-direction: column; gap: 4px; }
/* год */
.year { scroll-snap-align: start; padding-bottom: 14px; }
.year-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
.mini h4 { margin: 0 0 4px; font-size: 13px; color: var(--danger); }
.mini .g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; font-size: 8.5px; text-align: center; }
.mini .g span { border-radius: 3px; padding: 1px 0; }
/* панель редактирования */
.edit-bar { position: fixed; left: 8px; right: 8px; bottom: calc(10px + var(--safe-b)); background: var(--tab-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 24px; padding: 8px; z-index: 25; box-shadow: var(--shadow); display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); max-width: 640px; margin: 0 auto; }
.edit-bar .scroller { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.edit-bar .scroller::-webkit-scrollbar { display: none; }
.tpl-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 64px; padding: 6px 6px; border-radius: 14px; font-size: 11px; gap: 3px; position: relative; flex: none; }
.tpl-btn.on { background: var(--card2); outline: 2px solid var(--accent); }
.tpl-btn .sym { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; }
.tpl-btn .tm { font-size: 9.5px; color: var(--muted); }
.edit-close { position: fixed; right: 16px; bottom: calc(92px + var(--safe-b)); z-index: 26; }
.edit-hint { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--safe-b)); z-index: 26; background: var(--card); border-radius: 14px; padding: 6px 12px; font-size: 12px; box-shadow: var(--shadow); white-space: nowrap; }
/* повестка */
.agenda-item { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); align-items: center; }
.agenda-item .bar { width: 4px; align-self: stretch; border-radius: 2px; }
.agenda-item .l1 { font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.agenda-item .l2 { font-size: 12px; color: var(--muted); margin-top: 2px; }
.preview-box { background: var(--card); border-radius: var(--r); padding: 4px 0; margin: 8px 0 14px; border: 1px dashed var(--line); }
.color-dot { width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; flex: none; }
.color-dot.on { border-color: var(--text); }
.sym-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px,1fr)); gap: 8px; }
.sym-grid button { height: 40px; border-radius: 50%; background: var(--card2); font-size: 18px; }
.sym-grid button.on { outline: 2px solid var(--accent); }
.rot-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.rot-cell { aspect-ratio: 1; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-size: 14px; position: relative; }
.rot-cell small { position: absolute; top: -10px; font-size: 9px; color: var(--muted); }
/* печать */
.paper-wrap { background: var(--card2); border-radius: var(--r); padding: 12px; display: flex; justify-content: center; margin: 8px 0 14px; }
.paper-wrap canvas { width: 100%; max-width: 420px; height: auto; background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,.35); border-radius: 2px; }

/* ---------- чат ---------- */
.chat-item { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.chat-item .meta { flex: 1; min-width: 0; }
.chat-item .name { font-weight: 600; }
.chat-item .last { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dot-online { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--bg); position: absolute; margin: 30px 0 0 30px; }
.unread { background: var(--accent); color: #fff; border-radius: 10px; font-size: 12px; padding: 1px 7px; }
.chat-page { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; animation: slidein .25s; }
.chat-top { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 8px) 10px 8px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.msgs { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 78%; padding: 8px 12px; border-radius: 18px; background: var(--card); align-self: flex-start; word-wrap: break-word; position: relative; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; }
.msg .tm { font-size: 10px; opacity: .65; margin-left: 8px; float: right; margin-top: 6px; }
.msg.pending { opacity: .6; }
.msg.circle { background: none !important; padding: 0; }
.msg.circle video { width: 200px; height: 200px; border-radius: 50%; object-fit: cover; display: block; background: #000; }
.msg.voice { display: flex; align-items: center; gap: 8px; min-width: 180px; }
.voice-play { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.wave { flex: 1; height: 24px; display: flex; align-items: center; gap: 2px; }
.wave i { flex: 1; background: currentColor; opacity: .55; border-radius: 1px; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(8px + var(--safe-b)); background: var(--bg2); border-top: 1px solid var(--line); }
.composer textarea { resize: none; max-height: 120px; border-radius: 20px; padding: 10px 14px; min-height: 40px; }
.rec-indicator { color: var(--danger); font-weight: 600; flex: 1; padding: 10px; }
.circle-rec { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.85); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
.circle-rec video { width: 260px; height: 260px; border-radius: 50%; object-fit: cover; transform: scaleX(-1); border: 4px solid var(--danger); }
.call-screen { position: fixed; inset: 0; z-index: 80; background: #0b0b0f; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: calc(var(--safe-t) + 40px) 20px calc(var(--safe-b) + 40px); }
.call-screen video.remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.call-screen video.local { position: absolute; right: 16px; top: calc(var(--safe-t) + 16px); width: 110px; height: 160px; object-fit: cover; border-radius: 14px; z-index: 2; transform: scaleX(-1); }
.call-screen .info, .call-screen .acts { z-index: 3; text-align: center; }
.call-screen .acts { display: flex; gap: 22px; }
.call-btn { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); color: #fff; }
.call-btn.red { background: var(--danger); }
.call-btn.green { background: var(--ok); }
.call-btn.off { background: #fff; color: #000; }

/* ---------- отношения ---------- */
.love-hero { background: linear-gradient(135deg, #ff5f8f, #a259ff); border-radius: 22px; padding: 20px; color: #fff; text-align: center; margin-top: 8px; }
.love-hero .pair { display: flex; justify-content: center; align-items: center; gap: -10px; }
.love-hero .pair .avatar { border: 3px solid #fff; }
.love-hero .days { font-size: 42px; font-weight: 800; }
.code-box { font-family: ui-monospace, Menlo, monospace; font-size: 26px; letter-spacing: 4px; background: var(--card2); padding: 10px 16px; border-radius: 12px; text-align: center; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.check-item.done .txt { text-decoration: line-through; color: var(--muted); }
.check-item .by { font-size: 10px; color: var(--muted); }

/* ---------- авто ---------- */
.car-head { display: flex; gap: 14px; align-items: center; padding: 6px 0 12px; }
.car-logo { width: 64px; height: 64px; border-radius: 50%; background: #fff; color: #0a3a8a; display: grid; place-items: center; font-weight: 800; font-size: 20px; flex: none; }
.car-stats { display: flex; gap: 12px; }
.car-stats > div { flex: 1; background: var(--card); border-radius: var(--r); padding: 12px; }
.car-stats b { font-size: 22px; }
.rec { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.rec .amt { margin-left: auto; text-align: right; font-size: 12px; white-space: nowrap; }
.rec .amt b { display: inline-block; border: 1px solid var(--line); border-radius: 10px; padding: 2px 8px; font-size: 12px; font-weight: 500; margin-bottom: 4px; }
.donut-wrap { display: flex; justify-content: center; padding: 16px 0; }
.legend-row { display: flex; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
.car-tabs { position: fixed; left: 0; right: 0; bottom: 0; }

/* ---------- экран блокировки ---------- */
.lock-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.lock-preset { border-radius: 20px; overflow: hidden; position: relative; background: var(--card); padding: 6px; text-align: center; font-size: 12px; }
.lock-preset canvas { width: 100%; border-radius: 16px; display: block; }
.lock-preset.on { outline: 3px solid var(--ok); }
.lock-preview { display: flex; justify-content: center; margin: 4px 0 10px; }
.lock-preview canvas { height: 46vh; max-height: 440px; border-radius: 26px; box-shadow: var(--shadow); }
.bg-list { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 8px; }
.bg-list button { width: 72px; height: 110px; border-radius: 12px; flex: none; background-size: cover; background-position: center; border: 3px solid transparent; }
.bg-list button.on { border-color: var(--text); }
.pal { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0; }
.pal button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; }
.pal button i { width: 42px; height: 42px; border-radius: 50%; display: block; border: 3px solid transparent; }
.pal button.on i { border-color: var(--text); }
.el-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }

/* ---------- пейвол ---------- */
.plans { display: grid; gap: 10px; margin: 14px 0; }
.plan { border: 2px solid var(--line); border-radius: 16px; padding: 14px; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); }
.plan.on { border-color: var(--accent); }
.plan .price { margin-left: auto; font-weight: 800; font-size: 18px; white-space: nowrap; }
.plan .tag { font-size: 10px; background: var(--ok); color: #000; border-radius: 6px; padding: 2px 6px; margin-left: 6px; font-weight: 700; }
.feat-list { margin: 8px 0; padding-left: 0; list-style: none; }
.feat-list li { padding: 6px 0; display: flex; gap: 8px; align-items: center; }
.drag-handle { cursor: grab; touch-action: none; color: var(--muted); padding: 4px; }
.dragging { opacity: .6; background: var(--card2); }
.social { display: flex; gap: 10px; }
.social a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; background: var(--card); border-radius: var(--r); color: var(--text); text-decoration: none; font-size: 12px; }
.social a i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-style: normal; }
.lockscreen-guard { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }

@media (min-width: 900px) {
  .screen, .page { padding-left: max(16px, calc(50% - 360px)); padding-right: max(16px, calc(50% - 360px)); }
  .cal-head, .cal-scroll { padding-left: max(8px, calc(50% - 420px)); padding-right: max(8px, calc(50% - 420px)); }
}
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; inset: 0; }
}

/* ---------- экран блокировки: «Команды» ---------- */
.update-banner { position: fixed; left: 12px; right: 12px; bottom: calc(86px + var(--safe-b)); z-index: 18; display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); max-width: 560px; margin: 0 auto; }
.step { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.code-url { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--card2); border-radius: 10px; padding: 10px; word-break: break-all; }
.guide { padding-left: 18px; margin: 8px 0; font-size: 14px; line-height: 1.5; }
.guide li { margin-bottom: 6px; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.task-row:last-child { border-bottom: 0; }
.task-row .ck { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--muted); display: grid; place-items: center; flex: none; }
.task-row.done .ck { background: var(--ok); border-color: var(--ok); color: #fff; }
.task-row.done .tt { text-decoration: line-through; color: var(--muted); }
.task-row .late { color: var(--danger); }

/* ---------- настройка нижней панели (макет) ---------- */
.tb-card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin: 12px 0; }
.tb-card h3 { margin: 0 0 4px; font-size: 18px; }
.tb-card .chips .chip { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.tb-card .chips .chip svg { width: 16px; height: 16px; }
.tb-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 10px; margin-top: 12px; }
.tb-slot { min-height: 76px; border-radius: 14px; border: 1.5px dashed var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; position: relative; }
.tb-slot.fixed { border: 0; color: var(--muted); gap: 4px; font-weight: 600; }
.tb-slot.over, .tb-pool.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.tb-slot.target { border-color: var(--accent); }
.tb-slot:has(.tb-tile) { border-style: dashed; }
.tb-pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; border: 1.5px dashed var(--line); border-radius: 18px; padding: 10px; min-height: 80px; }
.tb-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px; width: 100%; border-radius: 14px; background: var(--card2); font-size: 12px; font-weight: 700; text-align: center; padding: 6px 2px; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
.tb-slot .tb-tile { background: transparent; }
.tb-tile.sel { outline: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 15%, var(--card2)); }
.tb-tile.dragging { opacity: .35; }
.tb-ghost { position: fixed; width: 90px; z-index: 300; pointer-events: none; box-shadow: var(--shadow); background: var(--card) !important; transform: scale(1.05); }

/* ---------- ассистент ---------- */
.ai-log { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; padding: 4px 2px; }
.ai-reply { background: var(--card); border-radius: 16px; padding: 8px 10px 10px; max-width: 92%; }
.ai-card { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 12px; background: var(--card2); margin-bottom: 6px; }
.ai-card.done { opacity: .6; }
.ai-card input { margin-top: 4px; }
.ai-examples { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.ai-input { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.ai-input textarea { resize: none; border-radius: 18px; }
.iconbtn.mic.rec { background: var(--danger); color: #fff; animation: pulse 1.2s infinite; }
.ai-typing { display: flex; gap: 4px; padding: 12px 14px; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1s infinite; }
.ai-typing i:nth-child(2) { animation-delay: .15s } .ai-typing i:nth-child(3) { animation-delay: .3s }
@keyframes dot { 50% { opacity: .3 } }
.chip-s.friend { outline: 1.5px solid var(--fc); outline-offset: -1.5px; }
.friends-btn { position: relative; }
.friends-btn .cnt { position: absolute; top: -2px; right: -2px; background: var(--accent); color: #fff; font-size: 10px; border-radius: 8px; min-width: 16px; line-height: 16px; text-align: center; }
.friends-btn.on { color: var(--accent); }
.fab.ai-fab { left: 18px; right: auto; font-size: 22px; }
/* календарь: один месяц на экран, листается свайпом */
.cal-scroll.single { overflow: hidden; scroll-snap-type: none; touch-action: pan-x; }
.cal-scroll.single .month-title { display: none; }
.cal-scroll.single .month { animation: none; }
.cal-scroll.single .month.in-up { animation: inUp .28s cubic-bezier(.2,.9,.3,1); }
.cal-scroll.single .month.in-down { animation: inDown .28s cubic-bezier(.2,.9,.3,1); }
@keyframes inUp { from { transform: translateY(40%); opacity: 0 } }
@keyframes inDown { from { transform: translateY(-40%); opacity: 0 } }
/* авто: подсказки */
.ac-wrap { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 70; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 220px; overflow-y: auto; margin-top: 4px; }
.ac-list button { display: block; width: 100%; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.ac-list button:last-child { border-bottom: 0; }
.ac-list button:active, .ac-list button.hl { background: var(--card2); }
.ac-list b { color: var(--accent); }
.ai-title { padding: 4px 8px; font-weight: 700; background: var(--card); margin: 2px 0; }
