/* Дизайн строго по логотипу: рисованный контур, плоская заливка, сдвинутый контур-тень вместо размытой, кляксы, много воздуха. */
:root {
  --navy: #1B3560; --blue: #0A96DC; --light: #D4F1FC; --cream: #FBF6DC;
  --coral: #F04E4A; --orange: #F2961E; --peach: #F4C79A; --white: #FFFFFF;
  --muted: #56709a;
  --line: 2.5px solid var(--navy);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --h: "Comfortaa", "Nunito", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--white); }
body {
  margin: 0; min-height: 100dvh; color: var(--navy); background: var(--white);
  font: 600 16px/1.4 "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.hidden { display: none !important; }
h1, h2, h3 { font-family: var(--h); font-weight: 700; }

/* ---------- кляксы на фоне ---------- */
.blobs { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blob { position: absolute; }
.blob path { stroke: none; }
.b1 { width: 380px; top: -130px; right: -120px; } .b1 path { fill: var(--cream); }
.b2 { width: 330px; top: 240px; left: -170px; } .b2 path { fill: var(--light); }
.b3 { width: 260px; bottom: -110px; right: -70px; } .b3 path { fill: var(--peach); opacity: .55; }
#root, #toast { position: relative; z-index: 1; }

/* ---------- значки и мотивы логотипа ---------- */
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--navy); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ico .fill-l { fill: var(--light); } .ico .fill-c { fill: var(--cream); } .ico .fill-r { fill: var(--coral); stroke: var(--navy); } .ico .fill-o { fill: var(--orange); } .ico .fill-w { fill: #fff; }
.on-fill .ico { stroke: #fff; }
.sway { animation: sway 1.6s ease-in-out infinite; transform-origin: 50% 60%; }
.dots i { display: inline-block; width: 9px; height: 9px; margin: 0 3px; border-radius: 50%; background: var(--blue); animation: pulse 1.1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .18s; } .dots i:nth-child(3) { animation-delay: .36s; }
.splash { position: absolute; width: 30px; height: 30px; top: -12px; right: -6px; fill: none; stroke: var(--coral); stroke-width: 3.2; stroke-linecap: round; }
.trail { height: 14px; margin: 22px 0 6px; border: 0; background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='64' height='14'><path d='M0 8 Q16 0 32 8 T64 8' fill='none' stroke='%230A96DC' stroke-width='3' stroke-linecap='round' stroke-dasharray='0.1 9'/></svg>") repeat-x center; }

/* ---------- вход ---------- */
.login { max-width: 430px; margin: 0 auto; padding: 34px 20px calc(30px + var(--safe-b)); text-align: center; }
.hero-wrap { position: relative; display: inline-block; }
.hero { width: 176px; height: 176px; border-radius: 50%; border: 3px solid var(--navy); box-shadow: 5px 5px 0 var(--blue); object-fit: cover; background: #fff; display: block; }
.hero-wrap .splash { top: -6px; right: -14px; width: 40px; height: 40px; }
.login h1 { margin: 26px 0 6px; font-size: 30px; line-height: 1.15; }
.login .sub { margin: 0 0 24px; color: var(--muted); font-weight: 700; }
.card { background: #fff; border: var(--line); border-radius: 20px; box-shadow: 4px 4px 0 var(--navy); padding: 20px; text-align: left; }
.steps { margin: 0 0 18px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; font-weight: 700; }
.steps li::before { content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #fff; border: 2.5px solid var(--navy); display: grid; place-items: center; font: 700 15px var(--h); }
.code-input { width: 100%; text-align: center; font: 700 28px var(--h); letter-spacing: .12em; text-transform: uppercase; padding: 12px 8px; border-radius: 16px; border: var(--line); background: var(--light); }
.code-input::placeholder { color: #8fc5e0; }
.code-input.bad { border-color: var(--coral); background: #ffe3dd; color: var(--coral); animation: shake .4s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
.error { min-height: 22px; margin: 8px 2px 0; color: var(--coral); font-weight: 800; font-size: 14px; }
.hint { min-height: 22px; margin: 8px 2px 0; color: var(--navy); font-weight: 800; font-size: 14px; animation: blink 1.2s ease-in-out infinite; }
.btn:disabled { opacity: .7; }
@keyframes blink { 50% { opacity: .45; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px 18px; border: var(--line); border-radius: 16px; background: var(--blue); color: #fff; font-weight: 900; font-size: 17px; box-shadow: 3px 3px 0 var(--navy); transition: transform .08s, box-shadow .08s; text-decoration: none; }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--navy); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn.light { background: #fff; color: var(--navy); }
.btn.coral { background: var(--coral); }
.stack { display: grid; gap: 12px; margin-top: 14px; }

/* ---------- приложение ---------- */
.app { max-width: 620px; margin: 0 auto; padding: 0 16px calc(120px + var(--safe-b)); }
.top { position: sticky; top: 0; z-index: 5; margin: 0 -16px; padding: 14px 16px 10px; background: var(--white); border-bottom: 2.5px dashed #b6dcef; }
.bar { display: flex; align-items: center; gap: 12px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; border: var(--line); object-fit: cover; background: #fff; flex: none; box-shadow: 2px 2px 0 var(--blue); }
.who { min-width: 0; flex: 1; }
.who b { display: block; font: 700 17px var(--h); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-block; margin-top: 3px; padding: 1px 10px; border-radius: 999px; border: 2px solid var(--navy); font-size: 12px; font-weight: 900; }
.badge.admin { background: var(--navy); color: #fff; } .badge.editor { background: var(--blue); color: #fff; } .badge.reader { background: var(--light); }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: var(--line); background: #fff; box-shadow: 3px 3px 0 var(--navy); display: grid; place-items: center; padding: 0; }
.icon-btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--navy); }
.tabs { display: flex; gap: 6px; margin-top: 12px; padding: 5px; border-radius: 18px; background: var(--light); border: var(--line); }
.tab { flex: 1; padding: 9px 4px; white-space: nowrap; font-size: 15px; border: 0; border-radius: 13px; background: transparent; font-weight: 900; color: var(--muted); }
.tab[aria-selected="true"] { background: var(--blue); color: #fff; box-shadow: 2px 2px 0 var(--navy); }

.day { margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
.day h2 { margin: 0; font-size: 19px; }
.pill { display: inline-block; padding: 2px 11px; border-radius: 999px; border: 2px solid var(--navy); font-size: 12.5px; font-weight: 900; color: #fff; background: var(--coral); }
.pill.tom { background: var(--orange); } .pill.soon { background: var(--coral); }

.ev { position: relative; display: grid; grid-template-columns: 76px 1fr; gap: 14px; margin: 12px 0; padding: 14px; background: #fff; border: var(--line); border-radius: 20px; box-shadow: 3px 3px 0 var(--navy); text-align: left; width: 100%; }
.ev.mine { background: var(--cream); box-shadow: 3px 3px 0 var(--blue); }
button.ev { font: inherit; }
button.ev:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--navy); }
.time { align-self: start; padding: 8px 4px; border-radius: 14px; background: var(--light); border: var(--line); text-align: center; font: 700 16px/1.2 var(--h); }
.time.none { background: var(--cream); font: 800 13px/1.2 "Nunito", system-ui, sans-serif; }
.time .until { margin-top: 3px; font: 800 12px/1.2 "Nunito", system-ui, sans-serif; color: var(--muted); }
.ev h3 { margin: 1px 0 6px; font-size: 18px; line-height: 1.25; padding-right: 52px; }
.hall { display: inline-flex; align-items: center; gap: 5px; margin: 0 6px 8px 0; padding: 1px 10px 1px 7px; border-radius: 999px; border: 2px solid var(--navy); font-size: 12.5px; font-weight: 900; background: var(--cream); }
.hall .ico { width: 15px; height: 15px; stroke-width: 2.8; }
.roles { display: grid; gap: 9px; margin: 6px 0 0; padding: 0; list-style: none; }
.roles li { font-size: 15.5px; font-weight: 800; line-height: 1.25; }
.tag { display: inline-block; margin: 0 0 2px; padding: 0 9px; border-radius: 999px; border: 2px solid var(--navy); font-size: 11.5px; font-weight: 900; letter-spacing: .01em; }
.roles .me .n { color: var(--coral); font-weight: 900; }
.mine-tag { position: absolute; top: 12px; right: 12px; }
.edit-hint { position: absolute; top: 12px; right: 12px; }
.edit-hint .ico { width: 20px; height: 20px; }

.empty { margin: 34px 6px; text-align: center; color: var(--muted); font-weight: 800; }
.cloud { position: relative; width: 132px; margin: 0 auto 8px; }
.cloud svg { width: 132px; height: 104px; fill: #fff; stroke: var(--navy); stroke-width: 2.8; stroke-linejoin: round; stroke-linecap: round; }
.cloud .dots { position: absolute; left: 0; right: 0; top: 34px; text-align: center; }
.empty h3 { margin: 6px 0 4px; color: var(--navy); font-size: 19px; }
.loading { display: grid; place-items: center; min-height: 60dvh; color: var(--muted); font-weight: 800; }

.fab { position: fixed; right: max(18px, calc(50% - 292px)); bottom: calc(22px + var(--safe-b)); width: 64px; height: 64px; border-radius: 50%; border: var(--line); background: var(--coral); box-shadow: 4px 4px 0 var(--navy); display: grid; place-items: center; z-index: 6; padding: 0; }
.fab .ico { width: 32px; height: 32px; stroke: #fff; stroke-width: 3.4; }
.fab:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--navy); }

/* ---------- площадки ---------- */
.venues { padding-top: 4px; }
.dstrip { display: flex; gap: 8px; margin: 14px -16px 0; padding: 4px 16px 10px; overflow-x: auto; scrollbar-width: none; }
.dstrip::-webkit-scrollbar { display: none; }
.dchip { flex: none; width: 66px; padding: 7px 0 8px; border: var(--line); border-radius: 16px; background: #fff; text-align: center; box-shadow: 2px 2px 0 var(--navy); }
.dchip small { display: block; font-size: 11px; font-weight: 900; color: var(--muted); }
.dchip b { font: 700 20px var(--h); }
.dchip[aria-selected="true"] { background: var(--blue); color: #fff; }
.dchip[aria-selected="true"] small { color: #fff; }
.vday { margin: 14px 0 6px; font-size: 19px; }
.addv { margin: 10px 0 4px; }
.venue { margin: 14px 0; padding: 14px; background: #fff; border: var(--line); border-radius: 20px; box-shadow: 3px 3px 0 var(--navy); }
.venue.clash { border-color: var(--coral); box-shadow: 3px 3px 0 var(--coral); }
.vhead { display: flex; align-items: center; gap: 8px; }
.vhead h3 { flex: 1; margin: 0; font-size: 18px; min-width: 0; }
.vbadge { padding: 1px 10px; border-radius: 999px; border: 2px solid var(--navy); font-size: 12px; font-weight: 900; background: var(--light); white-space: nowrap; }
.vbadge.free { background: #d9f5df; } .vbadge.bad { background: var(--coral); color: #fff; }
.mini { width: 34px; height: 34px; padding: 0; border-radius: 10px; border: 2.5px solid var(--navy); background: #fff; display: grid; place-items: center; }
.mini .ico { width: 18px; height: 18px; }
.track { position: relative; height: 16px; margin: 12px 0 2px; border-radius: 999px; border: 2.5px solid var(--navy); background: var(--cream); overflow: hidden; }
.seg { position: absolute; top: 0; bottom: 0; background: var(--blue); border-right: 2px solid var(--navy); border-left: 2px solid var(--navy); }
.seg.all { background: repeating-linear-gradient(135deg, var(--peach) 0 6px, var(--cream) 6px 12px); }
.seg.clash { background: var(--coral); }
.ticks { display: flex; justify-content: space-between; padding: 0 2px; font-size: 11px; font-weight: 800; color: var(--muted); }
.slots { display: grid; gap: 6px; margin-top: 10px; }
.slot { display: flex; gap: 10px; align-items: baseline; width: 100%; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--navy); background: var(--light); text-align: left; font-weight: 700; }
.slot b { flex: none; min-width: 92px; font-family: var(--h); }
.slot.clash { background: #ffe3dd; border-color: var(--coral); }
.warn, .note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 9px 12px; border-radius: 14px; border: 2.5px solid var(--coral); background: #ffe3dd; font-size: 14px; font-weight: 800; }
.note { margin: 12px 0 0; border-color: var(--orange); background: var(--cream); }
.warn .ico, .note .ico { margin-top: 1px; }
.hint-line { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.chip.group { display: inline-flex; align-items: center; gap: 6px; background: var(--cream); }
.chip.group .ico { width: 18px; height: 18px; }
.chip.group.on { background: var(--blue); color: #fff; }
.chip.group.on .ico { stroke: #fff; }
.groups { margin-bottom: 12px; }

/* ---------- панели, как в DNA ---------- */
body.modal-open { overflow: hidden; }
.overlay { position: fixed; inset: 0; z-index: 20; overscroll-behavior: contain; display: flex; align-items: flex-end; justify-content: center; background: rgba(27,53,96,.55); animation: fade .18s both; }
.overlay.center { align-items: center; padding: 20px; }
.sheet { width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; background: #fff; border: 3px solid var(--navy); border-bottom: 0; border-radius: 28px 28px 0 0; padding: 10px 18px calc(22px + var(--safe-b)); animation: up .26s cubic-bezier(.16,.84,.28,1) both; }
.modal { width: 100%; max-width: 380px; background: #fff; border: 3px solid var(--navy); border-radius: 24px; box-shadow: 5px 5px 0 var(--navy); padding: 20px; animation: pop .2s both; }
.handle { width: 44px; height: 5px; margin: 2px auto 10px; border-radius: 3px; background: var(--navy); opacity: .25; position: relative; cursor: grab; touch-action: none; }
.handle::after { content: ""; position: absolute; inset: -14px -30px; } /* ручку легко поймать пальцем */
.sheet h2, .modal h2 { margin: 6px 0 12px; text-align: center; font-size: 21px; }
.modal p { margin: 0 0 16px; text-align: center; color: var(--muted); }
.row2 { display: flex; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 14px; border-radius: 18px; border: var(--line); background: var(--light); font-weight: 900; text-align: left; box-shadow: 3px 3px 0 var(--navy); }
.option:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--navy); }
.option.danger { background: #fff; color: var(--coral); border-color: var(--coral); box-shadow: 3px 3px 0 var(--coral); }
.option.danger .ico { stroke: var(--coral); }
.option .ic { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: #fff; border: 2.5px solid currentColor; }

.field { display: block; margin: 14px 0 0; }
.field > span { display: block; margin: 0 0 6px 2px; font-size: 13px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.input { width: 100%; padding: 11px 13px; border: var(--line); border-radius: 14px; background: var(--light); font-weight: 700; min-height: 46px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 13px; border: 2.5px solid var(--navy); border-radius: 999px; background: #fff; font-weight: 800; font-size: 14.5px; }
.chip.on { background: var(--blue); color: #fff; box-shadow: 2px 2px 0 var(--navy); }
.chip.person { background: var(--cream); }
.chip.add { background: #fff; border-style: dashed; color: var(--blue); }
.roleblock { margin-top: 12px; padding: 12px; border-radius: 16px; border: 2.5px dashed #9fcfe8; background: #fff; }
.roleblock .tag { margin-bottom: 8px; }
.search { margin-bottom: 10px; }
.pick { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px; margin-top: 8px; border: var(--line); border-radius: 14px; background: #fff; font-weight: 800; text-align: left; }
.pick .box { width: 26px; height: 26px; flex: none; border-radius: 8px; border: 2.5px solid var(--navy); display: grid; place-items: center; background: #fff; }
.pick .box .ico { width: 16px; height: 16px; stroke: #fff; stroke-width: 3.4; }
.pick.on { background: var(--light); }
.pick.on .box { background: var(--blue); }
.link { border: 0; background: none; padding: 6px 0; color: var(--blue); font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.actions { display: flex; gap: 10px; margin-top: 20px; }
.actions .btn { flex: 1; }

#toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translate(-50%, 20px); max-width: min(92vw, 460px); display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 16px; border: var(--line); background: #fff; box-shadow: 3px 3px 0 var(--navy); font-weight: 800; opacity: 0; pointer-events: none; transition: .22s; z-index: 40; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--coral); color: #fff; }
#toast.bad .ico { stroke: #fff; }

@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(40px); opacity: 0 } }
@keyframes pop { from { transform: scale(.94); opacity: 0 } }
@keyframes sway { 0%, 100% { transform: rotate(-7deg) translateY(0) } 50% { transform: rotate(7deg) translateY(-3px) } }
@keyframes pulse { 0%, 70%, 100% { opacity: .3; transform: translateY(0) } 35% { opacity: 1; transform: translateY(-4px) } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-bottom: 3px solid var(--navy); border-radius: 28px; } }

/* тепловая карта занятости площадок */
.heat { margin: 4px 0 12px; border: var(--line); border-radius: 18px; background: var(--white); padding: 10px 8px 8px; }
.heatscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.heat table { border-collapse: separate; border-spacing: 3px; min-width: 100%; }
.heat th { font-weight: 400; color: var(--muted); text-align: center; padding: 0 2px; }
.heat th small { display: block; font-size: 10px; text-transform: uppercase; }
.heat th b { display: block; font-size: 13px; color: var(--navy); }
.heat th.sel b { color: var(--blue); text-decoration: underline; }
.heat th.hv { position: sticky; left: 0; background: var(--white); text-align: left; font-size: 12px; font-weight: 700; color: var(--navy); padding-right: 6px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; z-index: 1; }
.hm { display: block; width: 26px; height: 26px; min-width: 26px; border-radius: 8px; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--light); }
.hm.l0 { background: #EAF8EE; border-color: #BFE6CB; }
.hm.l1 { background: #FBF0B8; }
.hm.l2 { background: var(--peach); }
.hm.l3 { background: var(--orange); }
.hm.lx { background: var(--coral); }
.hm.sel { border-color: var(--navy); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend .hm { width: 12px; height: 12px; min-width: 12px; border-radius: 4px; cursor: default; }

/* подключение Telegram / ВК */
.connbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.conn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: var(--line); border-radius: 999px; background: var(--cream); color: var(--navy); font-size: 13px; font-weight: 700; text-decoration: none; }
.conn.on { background: #EAF8EE; border-width: 2px; }
.conn .ico { width: 16px; height: 16px; }

/* календарь площадок */
.calendar { margin: 10px 0 8px; padding: 12px 10px 10px; background: #fff; border: var(--line); border-radius: 22px; box-shadow: 3px 3px 0 var(--navy); }
.calhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.caltitle { text-align: center; display: grid; gap: 2px; }
.caltitle b { font: 700 20px var(--h); }
.cal-nav { width: 40px; height: 40px; border-radius: 12px; border: 2.5px solid var(--navy); background: var(--light); font: 700 24px/1 var(--h); display: grid; place-items: center; padding: 0 0 3px; }
.cal-nav:disabled { opacity: .35; }
.calwd, .calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calwd { margin-bottom: 4px; text-align: center; font-size: 11px; font-weight: 900; color: var(--muted); text-transform: uppercase; }
.calwd .we { color: var(--coral); }
.calday { position: relative; aspect-ratio: 1 / 1.08; min-width: 0; padding: 4px 0 0; border: 2px solid transparent; border-radius: 12px; background: var(--cream); display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 800; color: var(--navy); }
.calday b { font: 700 15px var(--h); }
.calday.out { background: transparent; color: #9fb0cc; }
.calday.past { opacity: .72; }
.calday.today { border-color: var(--coral); }
.calday.sel { background: var(--blue); color: #fff; border-color: var(--navy); box-shadow: 2px 2px 0 var(--navy); opacity: 1; }
.calday .dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 92%; min-height: 10px; }
.calday .dots i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #fff; box-shadow: 0 0 0 1px rgba(27,53,96,.45); }
.calday .dots em { font-style: normal; font-size: 10px; line-height: 8px; font-weight: 900; }
.vlegend { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.vchip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border: 2.5px solid var(--navy); border-radius: 999px; background: #fff; font-weight: 800; font-size: 14px; }
.vchip i, .cdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(27,53,96,.55); flex: none; }
.vchip.add { background: var(--cream); }
.vchip .ico { width: 15px; height: 15px; }
.chip.withdot { display: inline-flex; align-items: center; gap: 7px; }
.dayevents .vday { margin: 12px 0 8px; }
.plaques { display: grid; gap: 8px; }
.plaque { display: flex; gap: 12px; align-items: center; width: 100%; padding: 11px 14px; border: 2.5px solid var(--navy); border-radius: 16px; text-align: left; box-shadow: 2px 2px 0 var(--navy); }
.plaque .pt { flex: none; min-width: 74px; font: 700 15px var(--h); }
.plaque .pm { display: grid; gap: 2px; min-width: 0; }
.plaque .pm b { font-size: 16px; overflow-wrap: anywhere; }
.plaque .pm small { font-size: 12.5px; font-weight: 800; opacity: .9; }
.empty.small { padding: 18px 0; text-align: center; color: var(--muted); font-weight: 700; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--navy); display: grid; place-items: center; padding: 0; }
.swatch .ico { width: 20px; height: 20px; stroke: #fff; }
.swatch.on { box-shadow: 0 0 0 3px #fff, 0 0 0 5.5px var(--navy); }

/* карточка события */
.dmeta { display: grid; gap: 8px; margin: 4px 0 12px; }
.drow { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 8px 12px; border: 2px solid var(--navy); border-radius: 12px; background: var(--cream); }
.drow span { color: var(--muted); font-weight: 800; font-size: 13px; }
.drow b { text-align: right; }
.vtag { padding: 2px 12px; border-radius: 999px; border: 2px solid var(--navy); }
.note.ok { background: #d9f5df; }
.note.offline { background: var(--cream); border-color: var(--orange); }
.actions { flex-wrap: wrap; }
.actions .btn { flex: 1 1 140px; min-width: 0; }

/* без масштабирования: двойное касание не увеличивает страницу, поля ввода крупнее 16px (иначе iOS приближает при вводе) */
html, body, button, a, input, .calday, .plaque { touch-action: manipulation; }
input, select, textarea, .input, .code-input { font-size: 16px; }
body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* профиль */
.whobtn { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 0; background: none; border: 0; text-align: left; color: inherit; }
.profhead { display: flex; align-items: center; gap: 14px; margin: 4px 0 10px; }
.profhead h2 { margin: 0 0 6px; font-size: 21px; }
.avatar.big { width: 64px; height: 64px; }
.okchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; background: #d9f5df; border: 2px solid var(--navy); font-size: 13px; }
.okchip .ico { width: 15px; height: 15px; }
.drow .muted { color: var(--muted); font-weight: 800; }
.drow .link { margin: 0; font-weight: 800; text-align: right; }
.mono { font-family: ui-monospace, "Roboto Mono", monospace; letter-spacing: .08em; }
.offcal { padding: 10px 8px 8px; border: 2.5px solid var(--navy); border-radius: 18px; background: #fff; }
.calday.off { background: var(--coral); color: #fff; border-color: var(--navy); }
.calday.dis { opacity: .35; }
.calday:disabled { cursor: default; }
.pick.off { opacity: .5; background: #f1f3f8; }
.pick.warnp { border-color: var(--orange); }
.pick .pn { display: grid; gap: 2px; min-width: 0; }
.pick .pn small { font-size: 12px; font-weight: 800; color: var(--coral); }
.pick.warnp .pn small { color: #b86a00; }

/* ячейки календаря не растут, сколько бы площадок ни было в дне */
.calday { overflow: hidden; contain: layout; }
.calday .dots { flex-wrap: nowrap; gap: 2px; max-width: 100%; height: 10px; min-height: 10px; align-items: center; }
.calday .dots i { flex: none; }
.calday .dots em { flex: none; font-size: 10px; line-height: 10px; }
.calgrid { grid-auto-rows: auto; }
.calday .dots i { width: 9px; height: 9px; }
.input.bad { border-color: var(--coral); background: #ffe3dd; color: var(--coral); animation: shake .4s; }

/* профиль: день со сменой нельзя отметить как «не могу» */
.calday.shiftday { opacity: 1; background: var(--light); border-color: var(--blue); cursor: not-allowed; }
.calday.shiftday::after { content: "🔒"; position: absolute; right: 3px; top: 1px; font-size: 9px; }

/* аватарки */
.av { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--navy); color: #fff; font: 700 14px var(--h); object-fit: cover; flex: none; overflow: hidden; }
.av.sm { width: 32px; height: 32px; font-size: 12px; }
.av.avatar { width: 48px; height: 48px; font-size: 16px; box-shadow: 2px 2px 0 var(--blue); }
.av.avatar.big { width: 64px; height: 64px; font-size: 20px; }

/* переписка по событию */
.sheet.chat { height: 90dvh; display: flex; flex-direction: column; padding-bottom: calc(10px + var(--safe-b)); overflow: hidden; }
.chathead { display: grid; gap: 2px; padding: 2px 4px 8px; border-bottom: 2px solid var(--light); }
.chathead b { font: 700 17px var(--h); }
.chathead small { color: var(--muted); font-weight: 800; }
.msgs { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 10px 2px; display: flex; flex-direction: column; gap: 8px; }
.dsep { text-align: center; margin: 6px 0 2px; }
.dsep span { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--light); font-size: 12px; font-weight: 900; color: var(--muted); }
.msg { display: flex; align-items: flex-end; gap: 8px; max-width: 88%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.bubble { display: grid; gap: 4px; padding: 8px 12px; border: 2.5px solid var(--navy); border-radius: 18px 18px 18px 4px; background: #fff; min-width: 0; box-shadow: 2px 2px 0 var(--navy); }
.msg.mine .bubble { background: var(--blue); color: #fff; border-radius: 18px 18px 4px 18px; }

.msg.failed .bubble { background: #ffe3dd; border-color: var(--coral); color: var(--navy); cursor: pointer; }
.mname { font-size: 12.5px; color: var(--blue); }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 700; line-height: 1.35; }
.mtime { font-size: 11px; font-weight: 800; opacity: .75; display: flex; gap: 8px; align-items: center; }
.mdel { background: none; border: 0; padding: 0; font: inherit; font-size: 11px; text-decoration: underline; color: inherit; }
.mfiles { display: grid; gap: 6px; }
.mimg img { display: block; max-width: min(240px, 64vw); max-height: 240px; border-radius: 12px; border: 2px solid rgba(27,53,96,.4); object-fit: cover; }
.fchip { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 2px solid var(--navy); border-radius: 12px; background: var(--cream); color: var(--navy); text-decoration: none; font-weight: 800; min-width: 0; }
.fchip .fi { font-size: 20px; }
.fchip .fn { display: grid; min-width: 0; overflow-wrap: anywhere; font-size: 13.5px; }
.fchip .fn small { font-size: 11px; opacity: .7; }
.fdel { margin-left: auto; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--navy); background: #fff; font-size: 16px; line-height: 1; padding: 0; flex: none; }
.attach-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.achip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 8px; border: 2px solid var(--navy); border-radius: 999px; background: var(--cream); font-size: 12.5px; font-weight: 800; max-width: 100%; }
.achip img { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.achip em { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.achip button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--navy); color: #fff; padding: 0; line-height: 1; }
.composer { display: flex; align-items: flex-end; gap: 8px; padding-top: 8px; border-top: 2px solid var(--light); }
.chat-input { flex: 1; min-height: 44px; max-height: 120px; resize: none; line-height: 1.3; padding: 10px 12px; }
.clip, .send { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 2.5px solid var(--navy); display: grid; place-items: center; padding: 0; font-size: 20px; }
.clip { background: var(--cream); }
.send { background: var(--blue); }
.send .ico { stroke: #fff; width: 22px; height: 22px; }
.chat-open { width: 100%; margin: 6px 0 2px; background: var(--cream); color: var(--navy); }

/* собрание */
.seg2 { display: flex; gap: 6px; padding: 4px; border: 2.5px solid var(--navy); border-radius: 999px; background: var(--light); margin: 2px 0 6px; }
.segb { flex: 1; padding: 8px 6px; border: 0; border-radius: 999px; background: transparent; font-weight: 900; color: var(--muted); }
.segb.on { background: var(--blue); color: #fff; box-shadow: 2px 2px 0 var(--navy); }
.meetblock { display: grid; gap: 4px; }
.meetblock textarea { resize: vertical; min-height: 76px; }
.files { display: grid; gap: 8px; }
.btn.attach { width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 4px; font-weight: 800; font-size: 14px; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--blue); }
.meet-tag { display: inline-block; margin: 0 0 8px; padding: 3px 12px; border-radius: 999px; border: 2px solid var(--navy); background: var(--cream); font-weight: 900; }
.meet-note { margin: 0 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 700; }
.ev .mt { font-size: .95em; }
.ccount { display: inline-block; margin-top: 6px; padding: 1px 10px; border-radius: 999px; border: 2px solid var(--navy); background: var(--light); font-size: 12.5px; font-weight: 900; }

/* фото в переписке и просмотр */
.mimg { padding: 0; border: 0; background: none; display: block; }
.mimg .chatimg { display: block; width: min(220px, 62vw); min-height: 90px; max-height: 260px; object-fit: cover; border-radius: 12px; border: 2px solid rgba(27,53,96,.4); background: var(--light); }
.mimg.broken .chatimg { min-height: 60px; }
.lightbox { position: fixed; inset: 0; background: rgba(10,20,40,.94); display: grid; place-items: center; padding: 16px; }
.lbstage { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; cursor: zoom-in; }
.lightbox img { max-width: 96%; max-height: 84dvh; border-radius: 12px; transform-origin: center; user-select: none; -webkit-user-drag: none; will-change: transform; }
.lbbar { position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; gap: 10px; }
.lbbtn { min-width: 48px; height: 48px; padding: 0 16px; border-radius: 24px; border: 2.5px solid #fff; background: rgba(255,255,255,.14); color: #fff; font-size: 22px; font-weight: 900; }
.lbbtn.wide { font-size: 16px; }
.lbclose { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; width: 42px; height: 42px; border-radius: 50%; border: 2.5px solid #fff; background: rgba(255,255,255,.12); color: #fff; font-size: 26px; line-height: 1; padding: 0 0 3px; }

/* собрание: отличается заливкой (штриховка), значком и квадратным маркером; обводка остаётся цветом площадки */
.ev.meeting { background: repeating-linear-gradient(135deg, #FFF3C4 0 11px, #FFFBEA 11px 22px); }
.ev.meeting.mine { background: repeating-linear-gradient(135deg, #FFE9A0 0 11px, #FFF6D6 11px 22px); }
.mtag { display: inline-block; margin: 0 8px 2px 0; padding: 1px 9px; border: 2px solid var(--navy); border-radius: 999px; background: var(--navy); color: #fff; font: 800 11.5px var(--h); letter-spacing: .02em; vertical-align: middle; }
.plaque.meeting { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.26) 0 9px, rgba(255,255,255,0) 9px 18px); border-style: double; border-width: 5px; }
.calday .dots i.sq { border-radius: 3px; }

/* отчёт за период */
.rep-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.vchips { display: flex; flex-wrap: wrap; gap: 8px; }
.field > select.input { margin-top: 10px; }
.rep-out { margin-top: 16px; }
.rep-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.rep-sum div { border: 2.5px solid var(--navy); border-radius: 12px; background: var(--cream); padding: 8px 6px; text-align: center; }
.rep-sum b { display: block; font-size: 20px; }
.rep-sum span { font-size: 11px; font-weight: 800; color: var(--muted); }
.rep-wrap { overflow: auto; max-height: 46vh; border: 2.5px solid var(--navy); border-radius: 12px; }
table.rep { border-collapse: collapse; width: 100%; font-size: 13px; }
table.rep th { position: sticky; top: 0; background: var(--blue); color: #fff; padding: 8px; text-align: left; white-space: nowrap; }
table.rep td { padding: 7px 8px; border-top: 1px solid #b7cde0; vertical-align: top; }
table.rep tbody tr:nth-child(even) { background: #f1f8fc; }
table.rep tfoot td { font-weight: 900; background: var(--light); border-top: 2.5px solid var(--navy); position: sticky; bottom: 0; }

.report-btn { margin-top: 14px; }
.rep-dates .input { min-width: 0; padding-left: 8px; padding-right: 6px; }
.ver { margin-top: 14px; text-align: center; font-size: 11px; color: var(--muted); opacity: .6; }

/* крошечный индикатор «идёт отправка на сервер»: появляется, только если отправка затянулась */
.syncdot { position: fixed; right: 10px; top: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px #fff; z-index: 50; opacity: 0; pointer-events: none; }
.syncdot.on { animation: syncin .3s 1.8s forwards, syncpulse 1s 1.8s infinite; }
@keyframes syncin { to { opacity: .9; } }
@keyframes syncpulse { 50% { transform: scale(1.5); } }

/* как в приложении: текст не выделяется (кроме полей ввода, где его нужно править) */
html, body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea, select, [contenteditable] { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; -webkit-touch-callout: none; }
.ev.urgent .time { border-color: var(--coral); }
.ev.urgent .time .until { color: var(--coral); }

/* «сейчас» и «скоро»: цвет обводки (площадка) не трогаем, выделяем меткой, временем и свечением */
.ev.live .time { background: var(--coral); border-color: var(--coral); color: #fff; }
.ev.live .time .until { color: #fff; opacity: .9; }
.ev.live { animation: livepulse 2.2s ease-in-out infinite; }
@keyframes livepulse { 0%, 100% { filter: drop-shadow(0 0 0 rgba(240,78,74,0)); } 50% { filter: drop-shadow(0 0 9px rgba(240,78,74,.6)); } }
.nowtag, .soontag { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 4px; padding: 2px 10px; border-radius: 999px; font-weight: 900; font-size: 12px; color: #fff; background: var(--coral); }
.soontag { background: var(--orange); }
.nowtag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .ev.live { animation: none; } }
