:root {
  --bg: #F3EEE6; --bg2: #EFE8DD; --card: #FCFAF6; --card2: #F7F2EA; --line: #E7DFD2; --line2: #EFE9DF;
  --ink: #26302B; --ink2: #4B524D; --muted: #8C877E; --muted2: #A9A398;
  --green: #1F3F33; --green-2: #2C5A47; --green-3: #3E7A5F; --green-bg: #E4EEE6; --green-ink: #2E6B4E;
  --red: #C0533F; --red-bg: #F7E4DD; --orange: #D9893A; --orange-bg: #FBEBD6; --gold: #C79A4E;
  --blue: #4F79A8; --blue-bg: #E3ECF5; --violet: #7D68B3; --violet-bg: #ECE7F6;
  --serif: 'Cormorant Garamond', 'Times New Roman', serif; --sans: 'Manrope', system-ui, -apple-system, sans-serif;
  --r: 14px; --shadow: 0 1px 2px rgba(60, 48, 30, .04), 0 8px 24px -12px rgba(60, 48, 30, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -.01em; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: var(--green); color: #E9EFEA; padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px 22px; }
.brand b { font-family: var(--serif); font-size: 21px; font-weight: 600; display: block; line-height: 1.1; }
.brand small { opacity: .65; font-size: 11px; }
.brand svg { width: 34px; height: 34px; stroke: #D8C9A3; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; color: #CFDCD4; font-weight: 500; margin-bottom: 2px; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.on { background: #EAF0EA; color: var(--green); }
.nav a .cnt { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; border-radius: 10px; padding: 0 7px; }
.nav .sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 10px 8px; }
.me { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 14px 8px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.me b { display: block; font-size: 13px; } .me small { opacity: .6; font-size: 11px; }
.me button { margin-left: auto; background: none; border: 0; color: #CFDCD4; cursor: pointer; }
.main { min-width: 0; padding: 18px 26px 40px; }
.top { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.top .grow { flex: 1; }
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; min-width: 240px; color: var(--muted); }
.search input { border: 0; background: none; outline: none; width: 100%; color: var(--ink); }
.sel { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 7px 30px 7px 12px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238C877E' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.ibtn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--card); border: 1px solid var(--line); cursor: pointer; position: relative; color: var(--ink2); }
.ibtn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }

/* ---------- atoms ---------- */
.card { background: var(--card); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card h3 { font-family: var(--sans); font-size: 14.5px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3 .r { margin-left: auto; font-weight: 500; font-size: 12.5px; color: var(--muted); }
.ttl { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ttl h1 { font-size: 34px; }
.ttl .grow { flex: 1; }
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 9px 16px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.btn:hover { border-color: var(--muted2); }
.btn.pri { background: var(--green); border-color: var(--green); color: #fff; }
.btn.pri:hover { background: var(--green-2); }
.btn.sm { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }
.btn.ghost { background: none; border-color: transparent; color: var(--green-ink); }
.btn:disabled { opacity: .5; cursor: default; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 20px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.b-ok { background: var(--green-bg); color: var(--green-ink); } .b-red { background: var(--red-bg); color: var(--red); }
.b-warn { background: var(--orange-bg); color: #B5691E; } .b-mut { background: var(--bg2); color: var(--muted); } .b-blue { background: var(--blue-bg); color: var(--blue); }
.neg { color: var(--red); } .pos { color: var(--green-ink); } .mut { color: var(--muted); } .sm { font-size: 12.5px; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; color: #5A4632; letter-spacing: .02em; }
.av.lg { width: 112px; height: 112px; border-radius: 18px; font-size: 34px; font-family: var(--serif); }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who b { font-weight: 600; } .who small { display: block; color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 0; color: var(--muted); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.tabs a.on { color: var(--ink); border-color: var(--green); }
.tabs a .n { color: var(--muted2); font-weight: 500; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills a { padding: 6px 14px; border-radius: 9px; background: var(--card2); border: 1px solid var(--line2); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.pills a.on { background: var(--green); color: #fff; border-color: var(--green); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .g5 { grid-template-columns: repeat(5, 1fr); }
.row { display: flex; gap: 12px; align-items: center; }
.stack > * + * { margin-top: 16px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- table ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: var(--card2); }
.tbl .r { text-align: right; }
.tblwrap { overflow-x: auto; margin: 0 -8px; }
.pager { display: flex; gap: 6px; align-items: center; margin-top: 12px; }
.pager a { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; cursor: pointer; font-size: 12.5px; }
.pager a.on { background: var(--green); color: #fff; }

/* ---------- dashboard ---------- */
.hello { display: grid; grid-template-columns: 1fr 380px; gap: 16px; margin-bottom: 16px; }
.hello h1 { font-size: 40px; line-height: 1.05; }
.hello p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.hero { border-radius: var(--r); min-height: 128px; position: relative; overflow: hidden; color: #F7F1E6; padding: 20px 22px; display: flex; align-items: flex-end;
  background: radial-gradient(120% 140% at 85% 0%, #E9C99A 0%, #B98656 32%, #6C5039 62%, #3A3A2C 100%); }
.hero::after { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='380' height='160' viewBox='0 0 380 160' fill='none' stroke='%23F6E7CB' stroke-opacity='.28' stroke-width='1.2'%3E%3Cpath d='M300 160c0-50 10-90 40-120M340 40c-20 4-34 18-38 36 18-2 32-14 38-36zM318 80c-22-2-40 8-48 26 20 4 38-6 48-26zM326 110c16-12 36-14 50-6-12 14-32 16-50 6zM40 160c6-30 0-60-20-84M20 76c18 4 28 18 28 34-16-4-26-16-28-34z'/%3E%3C/svg%3E") right bottom / cover no-repeat; }
.hero span { font-family: var(--serif); font-size: 21px; line-height: 1.2; max-width: 260px; position: relative; z-index: 1; }
.kpi { cursor: pointer; transition: transform .15s; padding: 16px 18px; }
.kpi:hover { transform: translateY(-1px); border-color: var(--line); }
.kpi .v { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.kpi .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.kpi .d { font-size: 12px; margin-top: 8px; font-weight: 600; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.attn a { display: flex; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line2); }
.attn a:last-of-type { border: 0; }
.attn .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.donut-wrap { display: flex; gap: 18px; align-items: center; }
.leg2 { flex: 1; font-size: 12.5px; }
.leg2 div { display: flex; gap: 8px; align-items: center; padding: 4px 0; cursor: pointer; }
.leg2 i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.leg2 span:last-child { margin-left: auto; color: var(--muted); }
.bar { height: 8px; border-radius: 6px; background: var(--bg2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--green-3); }
.chart { position: relative; }
.chart .tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 12px; min-width: 170px; display: none; z-index: 2; }
.chart .tip b { display: block; margin-bottom: 4px; }
.chart .tip div { display: flex; justify-content: space-between; gap: 12px; }

/* ---------- child card ---------- */
.chead { display: flex; gap: 22px; align-items: flex-start; }
.chead h1 { font-size: 34px; }
.chead .meta { color: var(--ink2); font-size: 13px; display: grid; grid-template-columns: auto auto; gap: 4px 14px; margin-top: 10px; }
.balbox { margin-left: auto; background: var(--red-bg); border-radius: 12px; padding: 12px 20px; min-width: 170px; }
.balbox.ok { background: var(--green-bg); }
.balbox small { color: var(--muted); display: block; }
.balbox b { font-family: var(--serif); font-size: 32px; font-weight: 600; }
.ev { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line2); font-size: 13px; align-items: flex-start; }
.ev:last-child { border: 0; }
.ev .d { width: 74px; color: var(--muted); flex: none; }
.tl { position: relative; padding-left: 4px; }
.tl .it { display: flex; gap: 12px; align-items: center; padding: 8px 0; }
.tl .t { width: 46px; color: var(--muted); font-size: 13px; }
.tl .dt { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--blue); flex: none; }
.goal { padding: 12px 0; border-bottom: 1px solid var(--line2); }
.goal:last-child { border: 0; }
.goal .row { justify-content: space-between; }
.ico-sq { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; }

/* ---------- payments ---------- */
.op { display: grid; grid-template-columns: 30px minmax(220px, 1fr) minmax(260px, 1.2fr) auto; gap: 16px; align-items: center; padding: 14px 6px; border-bottom: 1px solid var(--line2); }
.op:last-child { border: 0; }
.op .amt { font-weight: 700; font-size: 15px; }
.op .sug { display: flex; gap: 10px; align-items: center; min-width: 0; }
.op .act { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.op .act .row { gap: 6px; }
.unk { display: flex; gap: 10px; align-items: center; color: var(--orange); font-weight: 600; }
.unk i { width: 26px; height: 26px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-style: normal; }

/* ---------- crm ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; }
.kcol { background: var(--card2); border-radius: 12px; padding: 10px; min-height: 200px; }
.kcol h4 { margin: 2px 4px 10px; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.kcol h4 .badge { margin-left: auto; }
.kcard { background: var(--card); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 12.5px; }
.kcard b { font-size: 13px; display: block; }
.kcard .row { margin-top: 8px; justify-content: space-between; }

/* ---------- schedule ---------- */
.sched { display: grid; grid-template-columns: 60px repeat(var(--cols), minmax(170px, 1fr)); gap: 0; overflow-x: auto; }
.sched .h { font-weight: 700; font-size: 12.5px; padding: 8px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); }
.sched .tm { color: var(--muted); font-size: 12px; padding: 8px 6px; border-top: 1px solid var(--line2); }
.sched .cell { border-top: 1px solid var(--line2); border-left: 1px solid var(--line2); padding: 4px; min-height: 52px; }
.slot { border-radius: 9px; padding: 7px 9px; font-size: 12px; margin-bottom: 4px; cursor: pointer; border-left: 3px solid; }
.slot b { display: block; font-size: 12.5px; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; gap: 14px; max-width: 920px; }
.msg { max-width: 80%; padding: 12px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line2); }
.msg.me { align-self: flex-end; background: var(--green); color: #fff; border-color: var(--green); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips a { padding: 7px 12px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 13px; }
.chips a:hover { border-color: var(--green-3); }
.askbar { display: flex; gap: 10px; position: sticky; bottom: 0; padding: 14px 0; background: var(--bg); }
.askbar input { flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--card); outline: none; }

/* ---------- modal / toast ---------- */
.ov { position: fixed; inset: 0; background: rgba(30, 35, 30, .38); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--card); border-radius: 16px; padding: 22px 24px; width: min(640px, 100%); max-height: 88vh; overflow: auto; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .35); }
.modal.wide { width: min(980px, 100%); }
.modal h2 { font-size: 26px; margin-bottom: 14px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.fld label { font-size: 12px; color: var(--muted); font-weight: 600; }
.fld input, .fld select, .fld textarea { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: #fff; outline: none; }
.fld textarea { min-height: 80px; resize: vertical; font-family: ui-monospace, monospace; font-size: 12px; }
.fld input:focus, .fld select:focus, .fld textarea:focus { border-color: var(--green-3); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--green); color: #fff; padding: 11px 18px; border-radius: 12px; z-index: 60; box-shadow: var(--shadow); font-weight: 600; }
.toast.err { background: var(--red); }
.note { background: var(--card2); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; color: var(--ink2); font-size: 13px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1.2fr; }
.login .l { display: grid; place-items: center; padding: 30px; }
.login .box { width: min(400px, 100%); background: var(--card); border-radius: 20px; padding: 32px 26px; box-shadow: var(--shadow); text-align: center; }
.login .box svg.logo { width: 56px; height: 56px; stroke: var(--green); }
.login .box h1 { font-size: 34px; } .login .box p { color: var(--muted); margin: 2px 0 22px; }
.login .opt { display: flex; gap: 12px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; cursor: pointer; text-align: left; font-weight: 600; }
.login .opt:hover { border-color: var(--green-3); background: var(--card2); }
.login .opt small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.login .opt svg:last-child { margin-left: auto; color: var(--muted); }
.login .r { background: radial-gradient(90% 90% at 70% 20%, #F0D3A8 0%, #C9925F 30%, #7D5A3E 60%, #31402F 100%); color: #FBF3E4; padding: 60px; display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden; }
.login .r h2 { font-size: 46px; line-height: 1.05; max-width: 520px; position: relative; z-index: 1; }
.login .r p { max-width: 420px; opacity: .85; position: relative; z-index: 1; }
.login .r ul { list-style: none; padding: 0; margin: 20px 0 0; position: relative; z-index: 1; }
.login .r li { display: flex; gap: 10px; align-items: center; padding: 5px 0; }

/* ---------- phone apps ---------- */
.phone-stage { min-height: 100vh; display: flex; gap: 40px; align-items: center; justify-content: center; padding: 30px; background: radial-gradient(100% 80% at 80% 10%, #F2DDBE 0%, var(--bg) 60%); }
.phone-side { max-width: 320px; }
.phone-side h2 { font-size: 40px; line-height: 1.05; }
.phone-side p { color: var(--muted); }
.phone { width: 390px; height: 800px; background: var(--card); border-radius: 46px; box-shadow: 0 0 0 10px #2A2A26, 0 40px 80px -20px rgba(0, 0, 0, .4); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.phone .sb { height: 44px; display: flex; justify-content: space-between; align-items: center; padding: 0 28px; font-weight: 700; font-size: 14px; flex: none; }
.phone .scr { flex: 1; overflow-y: auto; padding: 4px 18px 20px; }
.phone .hdr { display: flex; align-items: center; gap: 10px; padding: 6px 0 14px; }
.phone .hdr h2 { font-family: var(--sans); font-size: 17px; font-weight: 700; flex: 1; }
.phone .tb { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); border-top: 1px solid var(--line2); padding: 8px 6px 22px; background: var(--card); }
.phone .tb a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--muted); cursor: pointer; }
.phone .tb a.on { color: var(--green); font-weight: 700; }
.pc { background: #fff; border: 1px solid var(--line2); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.ptitle { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.1; }
.ring { display: grid; place-items: center; margin: 6px auto 10px; }
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; text-align: center; font-size: 12px; }
.mgrid a { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.daystrip { display: flex; justify-content: space-between; margin-bottom: 14px; }
.daystrip a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 12px; font-size: 11px; color: var(--muted); cursor: pointer; }
.daystrip a b { font-size: 15px; color: var(--ink); }
.daystrip a.on { background: var(--green); color: #E6EEE9; } .daystrip a.on b { color: #fff; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; gap: 4px; font-size: 12.5px; }
.cal span { padding: 6px 0; border-radius: 50%; }
.cal .on { background: var(--green); color: #fff; font-weight: 700; }
.cal .has { position: relative; } .cal .has::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--orange); }
.chk { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line2); cursor: pointer; }
.chk .box { width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line); display: grid; place-items: center; flex: none; }
.chk.on .box { background: var(--green); border-color: var(--green); color: #fff; }
.moods { display: flex; justify-content: space-between; }
.moods a { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line); cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); }
.moods a.on { border-color: var(--green); background: var(--green-bg); color: var(--green); }
.phone textarea, .phone input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; outline: none; resize: vertical; }
.timer { font-family: var(--serif); font-size: 40px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .g5 { grid-template-columns: repeat(3, 1fr); } .hello { grid-template-columns: 1fr; } .hero { display: none; } }
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; overflow-x: auto; gap: 8px; }
  .brand { padding: 0 8px 0 0; } .brand small, .me { display: none; }
  .nav { display: flex; gap: 2px; } .nav a { white-space: nowrap; padding: 7px 10px; } .nav .sep { display: none; }
  .main { padding: 16px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .g5 { grid-template-columns: 1fr 1fr; }
  .op { grid-template-columns: 1fr; } .op .act { align-items: flex-start; }
  .chead { flex-wrap: wrap; } .balbox { margin-left: 0; }
  .login { grid-template-columns: 1fr; } .login .r { display: none; }
  .phone-side { display: none; }
  .search { min-width: 0; flex: 1; }
}
@media (max-width: 520px) {
  .phone-stage { padding: 0; } .phone { width: 100vw; height: 100dvh; border-radius: 0; box-shadow: none; }
  .ttl h1, .hello h1 { font-size: 30px; } .kpi .v { font-size: 24px; } .av.lg { width: 76px; height: 76px; font-size: 24px; }
}
.chk .box svg { opacity: 0; } .chk.on .box svg { opacity: 1; }

/* ================= v2: операционный контур ================= */
.brand img { width: 40px; height: 40px; }
.nav .sec { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #8FA89A; padding: 14px 12px 6px; }
.av.img { background-size: cover !important; background-position: center 25% !important; color: transparent; }
.av.sm { width: 26px; height: 26px; font-size: 10px; }
.av.md { width: 44px; height: 44px; }
.av.xl { width: 72px; height: 72px; border-radius: 50%; }
.ill { width: 46px; height: 46px; border-radius: 12px; background-size: cover; background-position: center; flex: none; mix-blend-mode: multiply; }
.ill.lg { width: 64px; height: 64px; border-radius: 16px; }
.ill.xl { width: 96px; height: 96px; }

/* заголовок раздела с фото */
.phead { position: relative; overflow: hidden; border-radius: 18px; background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow); padding: 22px 26px; margin-bottom: 16px; display: flex; align-items: center; gap: 16px; min-height: 104px; }
.phead .num { width: 34px; height: 34px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.phead h1 { font-size: 36px; line-height: 1.05; }
.phead p { margin: 4px 0 0; color: var(--muted); }
.phead .img { position: absolute; right: 0; top: 0; bottom: 0; width: 46%; background-size: cover; background-position: center; -webkit-mask-image: linear-gradient(90deg, transparent, #000 40%); mask-image: linear-gradient(90deg, transparent, #000 40%); opacity: .95; }
.phead .act { margin-left: auto; position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.phead .txt { position: relative; z-index: 1; max-width: 56%; }

/* глобальный поиск */
.gs { position: relative; }
.gs-drop { position: absolute; top: calc(100% + 6px); left: 0; width: min(620px, 92vw); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 60px -20px rgba(40, 35, 25, .35); z-index: 40; max-height: 70vh; overflow: auto; padding: 8px; }
.gs-drop h5 { margin: 10px 8px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.gs-drop a { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 9px; }
.gs-drop a:hover, .gs-drop a.on { background: var(--card2); }
.gs-drop a small { color: var(--muted); display: block; font-size: 12px; }
.gs-drop .ico-sq { width: 30px; height: 30px; border-radius: 8px; }

/* операционный день */
.day-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.cal-wrap { overflow-x: auto; }
.cal-grid { display: grid; position: relative; min-width: 760px; }
.cal-col { position: relative; border-left: 1px solid var(--line2); }
.cal-col.drop { background: rgba(46, 107, 78, .06); }
.cal-col .off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, rgba(140, 135, 126, .07) 0 6px, transparent 6px 12px); pointer-events: none; }
.cal-head { position: sticky; top: 0; z-index: 3; background: var(--card); padding: 8px 8px 10px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 12.5px; display: flex; gap: 8px; align-items: center; min-height: 52px; }
.cal-head small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }
.cal-times { position: relative; }
.cal-times span { position: absolute; right: 8px; font-size: 11px; color: var(--muted2); transform: translateY(-6px); }
.cal-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line2); pointer-events: none; }
.cal-line.half { border-top-style: dashed; opacity: .6; }
.now-line { position: absolute; left: 0; right: 0; border-top: 2px solid var(--red); z-index: 2; pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.blk { position: absolute; left: 4px; right: 4px; border-radius: 9px; padding: 5px 8px; font-size: 11.5px; line-height: 1.25; overflow: hidden; cursor: pointer; border-left: 3px solid; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: box-shadow .15s, transform .15s; z-index: 1; }
.blk:hover { box-shadow: 0 6px 16px -6px rgba(40, 35, 25, .3); z-index: 2; }
.blk b { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk .t { opacity: .75; }
.blk.conf { outline: 2px solid var(--red); outline-offset: -1px; }
.blk.st-done::after { content: '✓'; position: absolute; right: 6px; top: 4px; font-weight: 700; }
.blk.st-cancelled, .blk.st-noshow { opacity: .45; text-decoration: line-through; }
.blk.st-pending { border-style: dashed; border-left-style: solid; background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .5) 0 5px, transparent 5px 10px) !important; }
.blk.group { border-left-width: 0; border-radius: 10px; font-weight: 600; }
.blk[draggable=true] { cursor: grab; }
.side-card { margin-bottom: 14px; }
.side-card h3 { margin-bottom: 8px; }
.cf { display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; background: var(--red-bg); margin-bottom: 6px; font-size: 12.5px; cursor: pointer; }
.cf.warn { background: var(--orange-bg); }
.cf .i { color: var(--red); margin-top: 1px; }
.cf.warn .i { color: #B5691E; }
.pend { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line2); font-size: 12.5px; }
.pend:last-child { border: 0; }
.pend button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; }
.pend button.ok { color: var(--green-ink); } .pend button.no { color: var(--red); }
.minical { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 11.5px; }
.minical a { padding: 5px 0; border-radius: 7px; cursor: pointer; }
.minical a:hover { background: var(--card2); }
.minical a.on { background: var(--green); color: #fff; font-weight: 700; }
.minical a.td { outline: 1.5px solid var(--green-3); }
.minical .wd { color: var(--muted2); font-size: 10.5px; padding: 3px 0; }
.legend2 { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.legend2 i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.stat-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }
.stat-row b { font-size: 15px; }
.seg { display: inline-flex; background: var(--card2); border: 1px solid var(--line2); border-radius: 10px; padding: 3px; }
.seg a { padding: 6px 14px; border-radius: 8px; font-weight: 600; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.seg a.on { background: var(--green); color: #fff; }

/* карточки-плитки */
.tile { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line2); border-radius: 14px; background: #fff; }
.tile small { display: block; color: var(--muted); font-size: 11.5px; }
.tile b { font-size: 14px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--muted); }
.lock { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; color: #8A5A2B; background: #F6EAD8; border-radius: 6px; padding: 1px 7px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs span { width: 74px; height: 56px; border-radius: 10px; background-size: cover; background-position: center; border: 1px solid var(--line2); }
.thumbs .more { display: grid; place-items: center; background: var(--card2); color: var(--muted); font-weight: 700; }
.fld.inline { flex-direction: row; align-items: center; gap: 10px; }

/* пакеты */
.pk { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line2); border-radius: 16px; background: #fff; margin-bottom: 10px; }
.pk .bar { height: 10px; margin: 8px 0 6px; }
.pk .bar i { background: linear-gradient(90deg, #3E7A5F, #6FA585); }
.pk.warn .bar i { background: linear-gradient(90deg, #D9893A, #E9B26E); }
.pk.done { opacity: .62; }
.pk .meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.pk .meta b { color: var(--ink); }
.pk .btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pk .left { text-align: right; }
.pk .left b { font-family: var(--serif); font-size: 30px; display: block; line-height: 1; }

/* семья */
.fam-hero { display: grid; grid-template-columns: 260px 1fr auto; gap: 22px; align-items: center; }
.fam-hero .ph { height: 150px; border-radius: 16px; background-size: cover; background-position: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 11.5px; padding: 2px 9px; border-radius: 20px; background: var(--card2); border: 1px solid var(--line2); color: var(--ink2); }
.chip.g { background: var(--green-bg); border-color: transparent; color: var(--green-ink); }
.alloc { display: flex; height: 8px; border-radius: 5px; overflow: hidden; margin-top: 6px; background: var(--bg2); }
.alloc i { display: block; height: 100%; }

/* закрытие периода */
.chk-row { display: flex; gap: 12px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line2); }
.chk-row:last-child { border: 0; }
.chk-row .st { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; font-weight: 700; font-size: 13px; }
.chk-row .st.ok { background: var(--green-3); } .chk-row .st.warn { background: var(--orange); } .chk-row .st.block { background: var(--red); }
.chk-row .n { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.bigbtn { width: 100%; justify-content: center; padding: 15px; font-size: 15px; border-radius: 14px; }

/* загрузка */
.ring2 { position: relative; display: grid; place-items: center; }
.ring2 b { position: absolute; font-family: var(--serif); font-size: 22px; }
.bars7 { display: flex; align-items: flex-end; gap: 10px; height: 120px; padding-top: 10px; }
.bars7 div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: 11px; color: var(--muted); }
.bars7 i { width: 100%; max-width: 28px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #6FA585, #2E6B4E); }
.bars7 i.hi { background: linear-gradient(180deg, #E9B26E, #D9893A); }
.lst a { display: flex; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 10px; }
.lst a.on, .lst a:hover { background: var(--card2); }
.lst a .r { margin-left: auto; font-weight: 700; font-size: 12.5px; }

/* документы */
.doc-prev { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 22px; aspect-ratio: 1 / 1.25; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 12px 30px -18px rgba(40, 35, 25, .35); }
.doc-prev .ln { height: 6px; border-radius: 3px; background: var(--bg2); }
.doc-prev h4 { font-family: var(--serif); font-size: 20px; margin: 6px 0; }
.doc-prev .stamp { margin-top: auto; align-self: flex-end; width: 70px; height: 70px; border-radius: 50%; border: 2px solid rgba(46, 107, 78, .5); color: rgba(46, 107, 78, .8); display: grid; place-items: center; font-size: 10px; font-weight: 700; transform: rotate(-12deg); text-align: center; }
.ftypes a { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.ftypes a.on { background: var(--green); color: #fff; } .ftypes a.on .mut { color: #D9E6DE; }
.ftypes a span:last-child { margin-left: auto; }

/* таймлайн */
.tline { position: relative; padding-left: 26px; }
.tline::before { content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tline .ev2 { position: relative; padding: 8px 0 12px; }
.tline .ev2::before { content: ''; position: absolute; left: -23px; top: 12px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2.5px solid var(--green-3); }
.tline .ev2.red::before { border-color: var(--red); } .tline .ev2.or::before { border-color: var(--orange); } .tline .ev2.bl::before { border-color: var(--blue); } .tline .ev2.pl::before { border-style: dashed; border-color: var(--muted2); }
.tline .ev2 small { color: var(--muted); display: block; }
.dayhdr { font-weight: 700; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 4px; }

/* программа */
.dirs a { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; }
.dirs a.on { background: #fff; border-color: var(--line2); box-shadow: var(--shadow); }
.dirs a small { display: block; color: var(--muted); font-size: 11.5px; }
.gprog { position: relative; height: 12px; border-radius: 8px; background: var(--bg2); margin: 22px 0 26px; }
.gprog i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; background: linear-gradient(90deg, #6FA585, #2E6B4E); }
.gprog span { position: absolute; top: 16px; font-size: 11px; color: var(--muted); transform: translateX(-50%); white-space: nowrap; }
.gprog span.top { top: -20px; color: var(--ink); font-weight: 700; }
.norm { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 7px; }
.norm.ok { background: var(--green-bg); color: var(--green-ink); } .norm.lo { background: var(--red-bg); color: var(--red); }
.mbar { height: 9px; border-radius: 5px; background: var(--bg2); position: relative; }
.mbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.mbar .nm { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink2); opacity: .5; }

/* уведомления */
.nt { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 6px; border-bottom: 1px solid var(--line2); }
.nt:last-child { border: 0; }
.ch { font-size: 11px; border-radius: 6px; padding: 1px 7px; background: var(--blue-bg); color: var(--blue); font-weight: 700; }

/* пустое состояние */
.empty2 { text-align: center; padding: 28px; color: var(--muted); }
.empty2 .ill { margin: 0 auto 10px; width: 110px; height: 110px; }

@media (max-width: 1180px) { .day-layout { grid-template-columns: 1fr; } .fam-hero { grid-template-columns: 1fr; } .phead .img { width: 40%; opacity: .5; } .phead .txt { max-width: 100%; } }
@media (max-width: 980px) { .pk { grid-template-columns: 48px 1fr; } .pk .btns, .pk .left { grid-column: 1 / -1; text-align: left; justify-content: flex-start; } .kv { grid-template-columns: 1fr; } .phead h1 { font-size: 28px; } }

/* ===== полировка ===== */
.fld textarea { font-family: inherit; font-size: 13.5px; line-height: 1.45; }
#txt { font-family: ui-monospace, monospace; font-size: 12px; }
.gprog span.s { transform: none; } .gprog span.e { transform: translateX(-100%); }
.ttl { background: var(--card); border: 1px solid var(--line2); border-radius: 18px; box-shadow: var(--shadow); padding: 22px 26px; min-height: 96px; position: relative; overflow: hidden; }
.ttl h1 { font-size: 36px; }
.ttl::after { content: ''; position: absolute; right: -30px; top: -20px; width: 220px; height: 150px; background: url(img/logo-mark.png) center / contain no-repeat; opacity: .06; pointer-events: none; }
.brand img { width: 46px; height: 46px; }
.brand small { line-height: 1.3; display: block; margin-top: 2px; }
.search { min-width: 360px; }
.nav a { font-size: 13.5px; padding: 8px 12px; }
.card h3 svg.i { color: var(--green-3); }
.tbl tr.click:hover td:first-child { box-shadow: inset 3px 0 0 var(--green-3); }
.btn.pri { box-shadow: 0 6px 14px -8px rgba(31, 63, 51, .6); }
.kpi .v { letter-spacing: -.01em; }
::selection { background: #DCE8DF; }
.main { max-width: 1680px; }
.kcol.drop { background: var(--green-bg); }
.kcard.lead { cursor: pointer; transition: box-shadow .15s; }
.kcard.lead:hover { box-shadow: 0 8px 18px -10px rgba(40, 35, 25, .35); }
.kcard .chip svg.i { width: 12px; height: 12px; vertical-align: -2px; }
.kanban { grid-template-columns: repeat(6, minmax(210px, 1fr)); }
/* перетаскивание в календаре */
.cal-wrap { touch-action: pan-x; user-select: none; -webkit-user-select: none; }
.blk.dragok { cursor: grab; }
.blk.dragging { opacity: .35; }
.blk.ghost { position: fixed !important; z-index: 80; pointer-events: none; box-shadow: 0 18px 40px -12px rgba(30, 30, 20, .45); transform: rotate(-1.5deg); opacity: .95; right: auto !important; }
.blk .rs { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.blk .rs::after { content: ''; position: absolute; left: 50%; bottom: 2px; width: 18px; height: 2px; margin-left: -9px; border-radius: 2px; background: currentColor; opacity: .3; }
.drag-tip { position: fixed; z-index: 81; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 8px; pointer-events: none; box-shadow: var(--shadow); }
.sel-range { position: absolute; left: 3px; right: 3px; background: rgba(46, 107, 78, .14); border: 1.5px dashed var(--green-3); border-radius: 9px; z-index: 3; font-size: 11.5px; font-weight: 700; color: var(--green-ink); padding: 4px 8px; pointer-events: none; }
.pop { position: fixed; z-index: 70; width: 330px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: 0 24px 60px -18px rgba(40, 35, 25, .4); }
.toast .btn { color: var(--green); }
.blk.st-done:not(.group)::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .35) 0 4px, transparent 4px 8px); pointer-events: none; }

/* ================= мобильная вёрстка ================= */
.mhead, .mtab, .navshade { display: none; }
.cal-wrap { touch-action: auto; }
.blk { touch-action: none; }
.fam-kpi { min-width: 420px; }
@media (max-width: 1100px) {
  .grid[style*="grid-template-columns"] { grid-template-columns: 1fr 1fr !important; }
  .day-layout, .grid.g5 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  html, body { font-size: 14px; }
  .app { display: block; }
  .mhead { display: flex; position: sticky; top: 0; z-index: 30; align-items: center; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(243, 238, 230, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line2); }
  .mhead img { width: 30px; height: 30px; }
  .mhead b { flex: 1; font-family: var(--serif); font-size: 21px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mtab { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(252, 250, 246, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .mtab a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); padding: 4px 0; cursor: pointer; }
  .mtab a.on { color: var(--green); font-weight: 700; }
  .mtab svg.i { width: 22px; height: 22px; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: 84vw; max-width: 320px; height: 100dvh; z-index: 50; transform: translateX(-102%); transition: transform .25s ease; flex-direction: column; align-items: stretch; padding: 18px 12px; padding-top: max(18px, env(safe-area-inset-top)); overflow-y: auto; }
  .side .nav { display: block; } .side .nav a { white-space: normal; padding: 10px 12px; } .side .nav .sec { display: block; } .side .me, .side .brand small { display: flex; } .side .brand small { display: block; }
  .app.nav-open .side { transform: none; box-shadow: 20px 0 60px rgba(0, 0, 0, .3); }
  .app.nav-open .navshade { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(20, 25, 20, .35); }
  .main { padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); max-width: none; }
  .top { margin-bottom: 12px; gap: 8px; }
  .top > .sel, .top .ibtn, .top .badge, .top .grow { display: none; }
  .top .search { min-width: 0; width: 100%; flex: 1 1 100%; }
  .top .sel#periodSel { display: block; width: 100%; }
  .phead, .ttl { padding: 16px; min-height: 0; border-radius: 16px; flex-wrap: wrap; gap: 10px; }
  .phead h1, .ttl h1 { font-size: 26px; }
  .phead p { font-size: 13px; }
  .phead .img { width: 100%; opacity: .16; -webkit-mask-image: none; mask-image: none; }
  .phead .txt { max-width: 100%; }
  .phead .act { margin-left: 0; width: 100%; justify-content: flex-start; }
  .phead .act .btn { padding: 8px 12px; font-size: 12.5px; }
  .hello h1 { font-size: 28px; }
  .grid, .grid[style*="grid-template-columns"], .day-layout, .g2, .g3, .g4 { grid-template-columns: 1fr !important; }
  .grid.g5, .grid.g4.kpis { grid-template-columns: 1fr 1fr !important; }
  .grid.g5 > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .card { padding: 14px; border-radius: 14px; }
  .kpi .v { font-size: 22px; }
  .tbl { font-size: 13px; } .tbl th, .tbl td { padding: 8px 8px; }
  .card:has(> .tbl), .card:has(> table) { overflow-x: auto; }
  .tblwrap { margin: 0 -4px; }
  .tabs { gap: 16px; margin-left: -12px; margin-right: -12px; padding: 0 12px; }
  .row { flex-wrap: wrap; }
  .seg a { padding: 6px 10px; }
  .chead { gap: 14px; } .chead h1 { font-size: 26px; } .chead .meta { grid-template-columns: 1fr; }
  .balbox { width: 100%; }
  .fam-hero .ph { height: 160px; } .fam-kpi { min-width: 0; grid-template-columns: 1fr 1fr 1fr !important; } .fam-kpi b { font-size: 18px !important; }
  .kanban { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -12px; padding: 0 12px 6px; }
  .kcol { flex: 0 0 82vw; scroll-snap-align: start; }
  .cal-grid { min-width: 0 !important; }
  .cal-wrap { margin: 0; }
  .cal-grid > .cal-times { position: sticky; left: 0; z-index: 4; background: var(--card); }
  .cal-grid > .cal-head:first-child { position: sticky; left: 0; z-index: 5; }
  .pk { grid-template-columns: 52px 1fr; padding: 12px; } .pk .left { text-align: left; } .pk .left b { display: inline; font-size: 22px; margin-right: 6px; }
  .op { padding: 12px 0; gap: 8px; }
  .ov { place-items: end stretch; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .modal .grid { grid-template-columns: 1fr !important; }
  .pop { width: calc(100vw - 24px); left: 12px !important; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); left: 12px; right: 12px; transform: none; text-align: center; }
  .kv { grid-template-columns: 110px 1fr; }
  .nt { grid-template-columns: 34px 1fr; } .nt > div:last-child { grid-column: 1 / -1; text-align: left !important; }
  .chk-row { flex-wrap: wrap; } .chk-row .btn { margin-left: 38px; }
  .bars7 { gap: 6px; }
  .askbar { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .legend2, .legend { font-size: 11px; }
  .login { min-height: 100dvh; }
  .gprog span { font-size: 10px; }
}

/* ================= вау-слой ================= */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(192, 83, 63, .45); } 100% { box-shadow: 0 0 0 18px rgba(192, 83, 63, 0); } }
@keyframes wave { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
@keyframes flash { 0% { background: #E4F1E8; } 100% { background: #fff; } }
.fade-in > * { animation: fadeUp .35s ease both; }
.fade-in > *:nth-child(2) { animation-delay: .04s; } .fade-in > *:nth-child(3) { animation-delay: .08s; } .fade-in > *:nth-child(4) { animation-delay: .12s; }
.shimmer { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, #EFE8DD 0, #F8F4EC 50%, #EFE8DD 100%); background-size: 800px 100%; animation: shimmer 1.2s linear infinite; }
.shimmer.line { margin: 12px 0; height: 16px; }
.typing { display: inline-flex; gap: 4px; } .typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--green-3); animation: blink 1.2s infinite; } .typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
.flash { animation: flash 1.6s ease; }

/* брифинг */
.brief { background: linear-gradient(135deg, #FCFAF6 0%, #F4EEDF 100%); border: 1px solid #EADFC9; position: relative; overflow: hidden; }
.brief::after { content: ''; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px; background: url(img/logo-mark.png) center / contain no-repeat; opacity: .07; }
.brief-h { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 15px; position: relative; z-index: 1; }
.brief-h svg.i { color: var(--gold); width: 20px; height: 20px; } .brief-h b { flex: 1; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.brief-items { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; position: relative; z-index: 1; }
.brief-it { display: flex; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 10px; animation: fadeUp .4s ease both; font-size: 13.5px; }
.brief-it:hover { background: rgba(255, 255, 255, .7); } .brief-it > span:nth-child(2) { flex: 1; } .brief-it > svg.i:last-child { color: var(--muted2); }
.brief-it .ico-sq { width: 34px; height: 34px; border-radius: 10px; }

/* чат */
.msg { animation: fadeUp .3s ease both; }
.sqlbox { margin-top: 8px; font-size: 12px; } .sqlbox summary { cursor: pointer; color: var(--green-ink); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.sqlbox pre { background: #1F2A25; color: #CFE3D6; padding: 10px 12px; border-radius: 10px; overflow-x: auto; white-space: pre-wrap; font-size: 11.5px; margin: 6px 0 0; }

/* микрофон */
.mic-wrap { display: flex; align-items: center; gap: 18px; justify-content: center; margin: 6px 0 14px; }
.mic { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--green); color: #fff; display: grid; place-items: center; cursor: pointer; }
.mic svg.i { width: 30px; height: 30px; } .mic.on { background: var(--red); animation: pulse 1.2s infinite; }
.wave { display: flex; gap: 4px; height: 34px; align-items: center; opacity: .25; } .wave i { width: 5px; height: 100%; border-radius: 3px; background: var(--green-3); transform: scaleY(.3); }
.wave.on { opacity: 1; } .wave.on i { animation: wave .9s ease-in-out infinite; } .wave.on i:nth-child(2) { animation-delay: .1s; } .wave.on i:nth-child(3) { animation-delay: .2s; } .wave.on i:nth-child(4) { animation-delay: .3s; } .wave.on i:nth-child(5) { animation-delay: .4s; }

/* живые события */
#liveBox { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 8px; width: 340px; pointer-events: none; }
.live-it { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--green-3); border-radius: 12px; padding: 10px 12px; font-size: 13px; box-shadow: 0 14px 34px -14px rgba(40, 35, 25, .35); display: flex; gap: 8px; align-items: center; animation: fadeUp .3s ease both; transition: opacity .5s, transform .5s; pointer-events: auto; }
.live-it small { margin-left: auto; color: var(--muted); font-size: 11px; white-space: nowrap; } .live-it svg.i { width: 16px; height: 16px; color: var(--green-3); }
.live-it.out { opacity: 0; transform: translateX(30px); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); flex: none; animation: pulse 1.4s infinite; }
.live-split { display: grid; grid-template-columns: 430px 1fr; gap: 16px; height: calc(100vh - 230px); min-height: 640px; }
.live-frame { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.live-frame iframe { width: 100%; height: 100%; border: 0; }
.live-frame .cap { position: absolute; left: 12px; top: 12px; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px; }
.phone-mini iframe { transform-origin: top left; }

/* командная строка */
.cmdk-btn { padding: 7px 12px; color: var(--ink2); } .cmdk-btn kbd, .cmdk kbd { font: 600 11px var(--sans); background: var(--card2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--muted); }
.cmdk-btn svg.i { color: var(--gold); }
.cmdk-ov { place-items: start center; padding-top: 12vh; }
.cmdk { width: min(640px, 94vw); background: #fff; border-radius: 18px; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .45); overflow: hidden; animation: fadeUp .2s ease both; }
.cmdk-in { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line2); } .cmdk-in svg.i { color: var(--gold); width: 22px; height: 22px; }
.cmdk-in input { flex: 1; border: 0; outline: 0; font-size: 16px; background: none; }
.cmdk-list { max-height: 50vh; overflow: auto; padding: 6px; } .cmdk-list a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.cmdk-list a.on, .cmdk-list a:hover { background: var(--green-bg); } .cmdk-list a span { flex: 1; } .cmdk-list small { display: block; color: var(--muted); font-size: 12px; }
.cmdk-f { padding: 8px 16px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line2); background: var(--card2); }

/* тепловая карта */
.heat { display: grid; grid-template-columns: 26px repeat(11, 1fr); gap: 3px; font-size: 10.5px; color: var(--muted); }
.heat i { aspect-ratio: 1.4; border-radius: 4px; display: block; } .heat .hh { text-align: center; } .heat .hd { display: flex; align-items: center; }
.slot-chip { cursor: pointer; } .slot-chip:hover { background: var(--green-bg); border-color: var(--green-3); }
.stars { display: flex; gap: 6px; justify-content: center; margin: 8px 0 4px; font-size: 30px; } .stars a { color: #E2D6C3; cursor: pointer; transition: transform .15s; } .stars a.on { color: #E3A72F; } .stars a:hover { transform: scale(1.15); }

/* отчёт родителю */
.report { max-width: 860px; margin: 0 auto; }
.rep-hero { position: relative; height: 260px; border-radius: 22px; background-size: cover; background-position: center; display: flex; align-items: flex-end; padding: 24px; gap: 16px; overflow: hidden; }
.rep-logo { position: absolute; top: 18px; left: 22px; width: 44px; } .rep-t { flex: 1; } .rep-t small { color: var(--green-ink); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 11.5px; }
.rep-t h1 { font-size: 40px; line-height: 1.05; } .rep-hero .av { border: 4px solid #fff; box-shadow: var(--shadow); }
.rep-letter { background: #fff; border-radius: 18px; padding: 22px 26px; margin: -24px 26px 0; position: relative; box-shadow: var(--shadow); font-family: var(--serif); font-size: 21px; line-height: 1.4; color: var(--ink); }
.rep-stats { display: flex; gap: 12px; margin: 20px 0; flex-wrap: wrap; } .rep-stats > div { flex: 1; min-width: 120px; background: var(--card); border: 1px solid var(--line2); border-radius: 16px; padding: 14px; text-align: center; }
.rep-stats b { display: block; font-family: var(--serif); font-size: 34px; } .rep-stats small { color: var(--muted); } .rep-stats .ill { margin: 0 auto 4px; }
.rep-h { font-size: 28px; margin: 22px 0 10px; }
.rep-goals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .rep-goal { display: flex; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--line2); border-radius: 16px; padding: 14px; }
.rep-bar { position: relative; height: 10px; background: var(--bg2); border-radius: 6px; margin: 8px 0 4px; } .rep-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.rep-bar span { position: absolute; top: -3px; width: 3px; height: 16px; background: var(--ink2); opacity: .35; border-radius: 2px; }
.rep-hl { display: grid; gap: 10px; } .rep-q { display: flex; gap: 12px; align-items: flex-start; background: #fff; border-radius: 16px; padding: 14px; border: 1px solid var(--line2); } .rep-q p { margin: 0 0 4px; font-family: var(--serif); font-size: 18px; }
@media print { .side, .top, .mhead, .mtab, #liveBox, .row:first-child { display: none !important; } .app { display: block; } .main { padding: 0; } body { background: #fff; } }

/* путь ребёнка */
.story-m { margin-bottom: 8px; } .story-mh { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 14px 0 6px; }
.story-e { display: flex; gap: 12px; align-items: center; padding: 8px 6px 8px 0; border-radius: 10px; animation: fadeUp .35s ease both; position: relative; }
.story-e:hover { background: var(--card2); } .story-e > span:nth-child(2) { flex: 1; } .story-e small { display: block; color: var(--muted); font-size: 12px; }
.story-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); flex: none; position: relative; }
.story-dot svg.i { width: 16px; height: 16px; }
.story-e::before { content: ''; position: absolute; left: 15px; top: -8px; height: 10px; width: 2px; background: var(--line); }

canvas.confetti { position: fixed; inset: 0; z-index: 200; pointer-events: none; }

@media (max-width: 760px) {
  .brief-items, .rep-goals { grid-template-columns: 1fr; }
  .cmdk-btn span, .cmdk-btn kbd { display: none; }
  .live-split { grid-template-columns: 1fr; height: auto; } .live-frame { height: 640px; }
  #liveBox { left: 12px; right: 12px; width: auto; bottom: calc(80px + env(safe-area-inset-bottom)); }
  .rep-hero { height: 200px; } .rep-t h1 { font-size: 28px; } .rep-letter { margin: -18px 8px 0; font-size: 18px; padding: 16px; }
}
.chat .msg { padding: 14px 18px; }
@media (max-width: 760px) { .chat .msg { max-width: 94%; padding: 12px 14px; } }
