:root {
  --bg: #F3F2EE;
  --bg2: #E9E7E1;
  --seg: #E6E4DD;
  --card: #FFFFFF;
  --ink: #121212;
  --ink2: #1E1E1E;
  --ink3: #2A2A2A;
  --line: #F0EEE8;
  --text2: #3F3D38;
  --muted: #6A675F;
  --muted-d: #B9B6AD;
  --accent: #FF5B1F;
  --ok: #1B7A4E;
  --ok-d: #7BE3AE;
  --bad: #A1112B;
  --info: #2B4BEE;
  --display: Unbounded, system-ui, sans-serif;
  --sans: Onest, system-ui, -apple-system, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.display { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.fade { animation: fade .28s ease both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.task, .msg { animation-name: rise; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Picker ---------- */
.picker { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(32px + var(--safe-t)) 16px 40px; gap: 28px; }
.picker h1 { margin: 0; font-family: var(--display); font-size: clamp(30px, 6vw, 52px); letter-spacing: -0.04em; text-align: center; line-height: 1.05; }
.picker p { margin: 0; color: var(--muted); text-align: center; max-width: 440px; }
.roles { width: 100%; max-width: 920px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.role { background: var(--card); border-radius: 26px; padding: 20px; display: flex; flex-direction: column; gap: 10px; text-align: left; min-height: 170px; transition: transform .15s, box-shadow .15s; }
.role:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(18,18,18,.08); }
.role.dark { background: var(--ink); color: var(--bg); }
.role .av { width: 44px; height: 44px; border-radius: 15px; background: var(--bg); color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.role.dark .av { background: var(--accent); }
.role b { font-size: 17px; }
.role span { font-size: 13px; color: var(--muted); }
.role.dark span { color: var(--muted-d); }
.logo { width: 44px; height: 44px; border-radius: 15px; background: var(--ink); display: flex; align-items: center; justify-content: center; }
.logo.sm { width: 36px; height: 36px; border-radius: 12px; }
.logo.or { background: var(--accent); }

/* ---------- Mobile shell ---------- */
.phone { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; }
.phone-body { padding: calc(20px + var(--safe-t)) 16px calc(124px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; }
.top .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.top .who small { font-size: 12px; color: var(--muted); font-weight: 500; }
.top .who strong { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.avatar { width: 44px; height: 44px; border-radius: 22px; background: var(--ink); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; background: var(--card); display: flex; align-items: center; justify-content: center; position: relative; flex: none; }
.icon-btn .pip { position: absolute; top: 10px; right: 11px; width: 9px; height: 9px; border-radius: 5px; background: var(--accent); border: 2px solid #fff; }

.tabbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + var(--safe-b)); width: min(448px, calc(100% - 32px)); height: 68px; border-radius: 34px; background: var(--ink); display: flex; align-items: center; justify-content: space-around; padding: 0 8px; box-shadow: 0 18px 40px rgba(18,18,18,.25); z-index: 20; }
.tabbar button { height: 48px; padding: 0 14px; min-width: 68px; border-radius: 24px; font-size: 13px; font-weight: 600; color: var(--muted-d); transition: background .2s, color .2s; }
.tabbar button[aria-current="page"] { background: var(--accent); color: var(--ink); }

.card { background: var(--card); border-radius: 22px; padding: 16px; }
.card.pad-lg { padding: 18px 16px; }
.hero { background: var(--ink); color: var(--bg); border-radius: 28px; padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 16px; position: relative; overflow: hidden; }
.hero .blob { position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 80px; background: var(--accent); }
.hero .tag { position: absolute; right: 18px; top: 18px; font-family: var(--display); font-size: 11px; color: var(--ink); letter-spacing: .04em; }
.hero .label { font-size: 13px; color: var(--muted-d); position: relative; }
.big { font-family: var(--display); font-weight: 600; letter-spacing: -0.03em; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.chip.ok-d { background: #1E3A2C; color: var(--ok-d); }
.chip.dim-d { background: var(--ink3); color: #E6E3DA; font-weight: 500; }
.pill { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.pill.bad { background: #FCE4E8; color: var(--bad); }
.pill.warn { background: #FFE6D9; color: #8A3200; }
.pill.info { background: #E6E9FB; color: #22359E; }
.pill.ok { background: #DDF3E7; color: #12613C; }
.pill.dim { background: var(--bg); color: var(--text2); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bar { height: 6px; border-radius: 3px; background: #EEECE6; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--ink); border-radius: 3px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.track { position: relative; height: 12px; border-radius: 6px; background: #EEECE6; }
.track > i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.track > b { position: absolute; top: -4px; width: 2px; height: 20px; background: var(--ink); border-radius: 1px; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.sec-title { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 4px 0; }
.sec-title b { font-family: var(--display); font-size: 16px; font-weight: 600; }
.sec-title span { font-size: 13px; color: var(--muted); }
.list { background: var(--card); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 62px; text-align: left; border-bottom: 1px solid var(--line); width: 100%; }
.li:last-child { border-bottom: 0; }
.li .t { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.li .t b { font-size: 14px; font-weight: 600; }
.li .t small { font-size: 12px; color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 5px; flex: none; }
.days { display: flex; gap: 8px; }
.days button { flex: 1; height: 44px; border-radius: 14px; background: var(--card); font-size: 13px; font-weight: 600; transition: background .2s; }
.days button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg { display: flex; gap: 6px; background: var(--seg); padding: 4px; border-radius: 16px; }
.seg button { flex: 1; height: 40px; border-radius: 12px; font-size: 13px; font-weight: 600; color: #5B5850; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.btn { white-space: nowrap; height: 44px; border-radius: 14px; font-size: 14px; font-weight: 600; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.dark { background: var(--ink); color: var(--bg); }
.btn.light { background: var(--bg); }
.btn.white { background: var(--card); }
.btn.acc { background: var(--accent); color: var(--ink); font-weight: 700; }
.btn.lg { height: 56px; border-radius: 18px; font-size: 16px; font-weight: 700; }
.btn.grow { flex: 1; }
.split { display: flex; height: 44px; border-radius: 14px; overflow: hidden; }
.split div { display: flex; align-items: center; padding-left: 14px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.mini { background: var(--bg); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.mini small { font-size: 12px; color: var(--muted); }
.mini b { font-family: var(--display); font-size: 18px; font-weight: 600; }
.h1 { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 12px 14px; font-size: 14px; line-height: 1.45; animation: fade .25s ease both; }
.msg.ai { align-self: flex-start; background: var(--card); border-radius: 20px 20px 20px 6px; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--bg); border-radius: 20px 20px 6px 20px; }
.msg.typing { color: var(--muted); }
.ask { display: flex; gap: 8px; align-items: center; background: var(--card); border-radius: 999px; padding: 6px 6px 6px 18px; }
.ask input { flex: 1; border: 0; outline: none; background: transparent; font-size: 15px; min-width: 0; }
.ask .send { width: 44px; height: 44px; border-radius: 22px; background: var(--accent); display: flex; align-items: center; justify-content: center; flex: none; }
.sugg { display: flex; gap: 8px; flex-wrap: wrap; }
.sugg button { padding: 0 14px; min-height: 44px; border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 500; }

/* tasks */
.task { background: var(--card); border-radius: 22px; padding: 16px; display: flex; flex-direction: column; gap: 10px; animation: fade .25s ease both; }
.task .title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.person { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text2); }
.person i { width: 28px; height: 28px; border-radius: 14px; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; font-style: normal; color: var(--ink); }
.askbox { background: #FFF1EA; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.note { font-size: 12px; color: var(--muted); text-align: center; padding: 4px 20px; }

/* shift */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.step { background: var(--ink2); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.step .m { width: 26px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.step b { font-size: 13px; }
.step small { font-size: 11px; color: var(--muted-d); }
.pick-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.pick-grid button, .pick-row button { height: 48px; border-radius: 14px; background: var(--card); font-size: 15px; font-weight: 600; transition: background .15s; }
.pick-grid button[aria-pressed="true"] { background: var(--accent); }
.pick-row { display: flex; gap: 8px; }
.pick-row button { flex: 1; font-size: 14px; }
.pick-row button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.field-label { font-size: 13px; font-weight: 600; color: var(--text2); }
textarea.field { border: 0; border-radius: 18px; background: var(--card); padding: 14px 16px; font-size: 15px; resize: none; outline: none; width: 100%; }

/* hostess */
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text2); padding: 0 4px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; }
.zone { background: var(--card); border-radius: 22px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.tables { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tbl { height: 66px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: transform .12s; }
.tbl:active { transform: scale(.96); }
.tbl b { font-family: var(--display); font-size: 16px; font-weight: 600; }
.tbl small { font-size: 11px; opacity: .8; }
.tbl.free { background: var(--card); border: 1.5px solid #CFCBC0; }
.tbl.book { background: var(--accent); }
.tbl.seat { background: var(--ink); color: var(--bg); }
.tbl[aria-pressed="true"] { outline: 3px solid var(--info); outline-offset: 2px; }
.sheet { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(480px, 100%); background: var(--ink); color: var(--bg); border-radius: 30px 30px 0 0; padding: 12px 20px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -12px 40px rgba(18,18,18,.2); z-index: 20; }
.sheet .grip { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: #3A3A3A; }
.sheet p { margin: 0; font-size: 14px; color: #D8D5CC; }
.hostess-body { padding-bottom: calc(240px + var(--safe-b)); }

/* ---------- Desktop ---------- */
.desk { min-height: 100dvh; display: flex; }
.side { width: 248px; flex: none; background: var(--ink); color: var(--bg); padding: 24px 16px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100dvh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand b { font-family: var(--display); font-size: 15px; font-weight: 600; }
.brand small { display: block; font-size: 12px; color: var(--muted-d); }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav button { height: 44px; padding: 0 12px; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; color: #D8D5CC; transition: background .15s; }
.side nav button:hover { background: var(--ink2); }
.side nav button[aria-current="page"] { background: var(--bg); color: var(--ink); }
.side nav button em { font-style: normal; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--ink3); }
.side nav button[aria-current="page"] em { background: var(--accent); color: var(--ink); }
.me-card { margin-top: auto; background: var(--ink2); border-radius: 18px; padding: 12px; display: flex; gap: 10px; align-items: center; text-align: left; }
.me-card i { width: 36px; height: 36px; border-radius: 18px; background: var(--accent); color: var(--ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-style: normal; flex: none; }
.me-card small { display: block; font-size: 12px; color: var(--muted-d); }
.main { flex: 1; min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 48px; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.page-head h1 { margin: 0; font-family: var(--display); font-size: clamp(26px, 3vw, 36px); font-weight: 600; letter-spacing: -0.03em; }
.search { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; padding: 0 14px; height: 44px; min-width: 240px; }
.search input { border: 0; outline: none; background: transparent; font-size: 14px; flex: 1; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.kpi small { font-size: 13px; color: var(--muted); }
.kpi b { font-family: var(--display); font-size: 26px; font-weight: 600; }
.kpi span { font-size: 13px; font-weight: 600; }
.kpi.dark { background: var(--ink); color: var(--bg); }
.kpi.dark small { color: var(--muted-d); }
.kpi.acc { background: var(--accent); }
.kpi.acc small { color: var(--ink); }
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.col { background: var(--bg2); border-radius: 24px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px; font-size: 14px; font-weight: 700; }
.col-head span { display: inline-flex; align-items: center; gap: 8px; }
.kcard { background: var(--card); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; text-align: left; transition: box-shadow .15s, transform .15s; }
.kcard:hover { box-shadow: 0 10px 24px rgba(18,18,18,.07); transform: translateY(-1px); }
.kcard .title { font-size: 15px; font-weight: 600; line-height: 1.35; }
.table-box { background: var(--card); border-radius: 24px; overflow-x: auto; }
table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; padding: 16px 12px; }
td { padding: 14px 12px; border-top: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
.empty { background: var(--card); border-radius: 24px; padding: 48px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }

.odesk-top { background: var(--ink); color: var(--bg); }
.odesk-top .in { max-width: 1360px; margin: 0 auto; padding: 16px clamp(16px, 3vw, 40px); display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.seg-d { display: flex; gap: 4px; background: var(--ink2); padding: 4px; border-radius: 14px; }
.seg-d button { height: 36px; padding: 0 16px; border-radius: 10px; font-size: 13px; font-weight: 600; color: #D8D5CC; }
.seg-d button[aria-pressed="true"] { background: var(--accent); color: var(--ink); }
.odesk { max-width: 1360px; margin: 0 auto; padding: 32px clamp(16px, 3vw, 40px) 56px; display: flex; flex-wrap: wrap; gap: 24px; }
.odesk .left { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.odesk aside { flex: 1 1 340px; min-width: 0; background: var(--card); border-radius: 28px; padding: 22px; display: flex; flex-direction: column; gap: 14px; align-self: flex-start; position: sticky; top: 24px; }
.odesk aside .msg.ai { background: var(--bg); }
.odesk aside .ask { background: var(--bg); }
.odesk aside .sugg button { background: var(--bg); min-height: 40px; }
.dhero { background: var(--ink); color: var(--bg); border-radius: 32px; padding: clamp(20px, 3vw, 36px); display: flex; flex-wrap: wrap; gap: 28px; position: relative; overflow: hidden; }
.dhero .blob { position: absolute; right: -90px; bottom: -120px; width: 320px; height: 320px; border-radius: 160px; background: var(--accent); }
.dhero > div { position: relative; }
.floor-d { background: var(--ink2); border-radius: 20px; padding: 16px; display: flex; justify-content: space-between; align-items: center; }
.floor-d small { display: block; font-size: 13px; color: var(--muted-d); margin-bottom: 4px; }
.cards2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.cards2 .card { border-radius: 26px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }

/* hostess desktop */
.hostess-desk { max-width: 1280px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 40px); display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.hostess-desk .tables { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hostess-desk .tbl { height: 84px; }
.hostess-desk .sheet { position: sticky; top: 28px; left: auto; transform: none; width: auto; border-radius: 28px; padding: 22px; }

/* Role switch floating (desktop) */
.switcher { position: fixed; right: 16px; bottom: calc(16px + var(--safe-b)); z-index: 30; height: 44px; padding: 0 16px; border-radius: 22px; background: var(--card); box-shadow: 0 8px 24px rgba(18,18,18,.14); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }

#toast { position: fixed; left: 50%; top: calc(16px + var(--safe-t)); transform: translate(-50%, -140%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 16px; font-size: 14px; font-weight: 500; z-index: 50; transition: transform .3s cubic-bezier(.2,.8,.2,1); max-width: calc(100% - 32px); box-shadow: 0 12px 30px rgba(18,18,18,.25); }
#toast.on { transform: translate(-50%, 0); }

@media (max-width: 1023px) {
  .hostess-desk { display: block; padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Tab bar with icons (iOS-style) ---------- */
.tabbar { height: 72px; border-radius: 28px; padding: 0 6px; background: rgba(18,18,18,.94); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); }
.tabbar button { flex: 1; min-width: 0; height: 60px; padding: 0; border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #8E8B83; background: none; transition: color .2s; }
.tabbar button[aria-current="page"] { background: none; color: #F3F2EE; }
.tabbar .ti { position: relative; width: 52px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; transition: background .25s, color .25s; }
.tabbar button[aria-current="page"] .ti { background: var(--accent); color: var(--ink); }
.tabbar button:active .ti { transform: scale(.92); }
.tabbar .ti em { position: absolute; top: -3px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--ink); font-style: normal; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #121212; }
.tabbar button[aria-current="page"] .ti em { background: #F3F2EE; }
.tabbar .tl { font-size: 11px; font-weight: 600; letter-spacing: .01em; }
.tile { width: 40px; height: 40px; border-radius: 13px; background: var(--bg); display: flex; align-items: center; justify-content: center; flex: none; }

/* =====================================================================
   v2 — все экраны: модалки, формы, Telegram, mini-app, состояния
   ===================================================================== */
.still .fade, .still .task, .still .msg { animation: none; }
body.locked { overflow: hidden; }
a.role { text-decoration: none; color: inherit; }
.role.tgc { background: #2B4BEE; color: #fff; }
.role.tgc .av { background: #fff; color: #2B4BEE; }
.role.tgc span { color: #D9DEFB; }
.body { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text2); }
.row-gap { display: flex; gap: 8px; flex-wrap: wrap; }
.row-gap > .btn { min-width: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 12px; gap: 6px; }
.icon-btn.dark { background: var(--ink2); color: var(--bg); }
.icon-btn.dark .pip { border-color: var(--ink2); }
.card.flat { background: var(--card); border-radius: 16px; padding: 14px; font-size: 14px; }
.modal .card.flat, .modal .mini.white { background: var(--card); }
.mini.white { background: var(--card); }
.list-cap { padding: 14px 16px 4px; font-size: 13px; color: var(--muted); }
.chip.bad-d { background: #3A1E24; color: #FF9AA9; }
.pill.sq { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; padding: 0; flex: none; }
.alert-row { display: flex; gap: 12px; align-items: center; text-align: left; border-radius: 20px; min-height: 64px; padding: 14px 16px; width: 100%; }
.alert-row .t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.alert-row .t b { font-size: 14px; }
.alert-row .t small { font-size: 12px; color: var(--muted); }
.card.stat { padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; border-radius: 20px; text-align: left; }
.card.stat small { font-size: 12px; color: var(--muted); }
.card.stat small:last-child { font-size: 11px; }
.card.stat b { font-size: 24px; }
.card.stat.dark { background: var(--ink); color: var(--bg); }
.card.stat.dark small { color: var(--muted-d); }
.timechip { min-width: 54px; height: 36px; border-radius: 12px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none; }
.daybox { width: 44px; height: 44px; border-radius: 14px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.task { width: 100%; text-align: left; }
.task .row-between { display: flex; }
.kpi { text-align: left; }
button.kpi:hover { box-shadow: 0 10px 24px rgba(18,18,18,.07); }
tr.click { cursor: pointer; }
tr.click:hover td { background: #FAF9F6; }
.subhead { display: flex; align-items: center; gap: 12px; }
.back { width: 44px; height: 44px; border-radius: 22px; background: var(--card); display: flex; align-items: center; justify-content: center; flex: none; }
.side nav .nv { display: flex; align-items: center; gap: 12px; }
.empty { color: var(--ink); }
.empty svg { color: var(--muted); }

/* banners */
.banner { display: flex; gap: 10px; align-items: flex-start; background: #FFE6D9; color: #6E2800; border-radius: 16px; padding: 12px 14px; font-size: 13px; line-height: 1.45; }
.banner svg { flex: none; margin-top: 1px; }
.banner.soft { background: var(--card); color: var(--text2); }
.modal .banner.soft { background: var(--card); }
.banner.ok { background: #DDF3E7; color: #12613C; }

/* skeleton */
.skel { background: linear-gradient(90deg, #E6E4DD 25%, #F2F1EC 50%, #E6E4DD 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 22px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* switch */
.switch { width: 50px; height: 30px; border-radius: 15px; background: #D6D3CA; position: relative; flex: none; transition: background .2s; display: inline-block; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 12px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .2s; }
.switch[aria-checked="true"] { background: #1B9A5E; }
.switch[aria-checked="true"]::after { left: 23px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border-radius: 16px; padding: 0 14px; min-height: 56px; font-size: 15px; font-weight: 500; width: 100%; text-align: left; }

/* demo panel on picker */
.demo { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 8px; }

/* modal */
.backdrop { position: fixed; inset: 0; background: rgba(18,18,18,.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.backdrop.anim { animation: fade .2s ease both; }
.backdrop.anim .modal { animation: sheetUp .32s cubic-bezier(.2,.8,.2,1) both; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal { background: var(--bg); width: min(480px, 100%); max-height: 92dvh; border-radius: 28px 28px 0 0; display: flex; flex-direction: column; box-shadow: 0 -20px 50px rgba(18,18,18,.25); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }
.modal-head h2 { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.modal-head .close { width: 40px; height: 40px; border-radius: 20px; background: var(--card); display: flex; align-items: center; justify-content: center; flex: none; }
.modal-body { overflow-y: auto; padding: 6px 20px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
@media (min-width: 1024px) {
  .backdrop { align-items: center; }
  .modal { border-radius: 28px; width: min(560px, calc(100% - 48px)); max-height: 86dvh; }
}

/* forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.f { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.f > label, .field-label { font-size: 13px; font-weight: 600; color: var(--text2); }
.inp { height: 48px; border: 0; border-radius: 14px; background: var(--card); padding: 0 14px; font-size: 16px; outline: none; width: 100%; -webkit-appearance: none; appearance: none; }
.inp.area { height: auto; padding: 12px 14px; resize: none; line-height: 1.45; }
select.inp { 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='%236A675F' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.chipsel { display: flex; gap: 8px; flex-wrap: wrap; }
.chipsel button { min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--card); font-size: 13px; font-weight: 600; transition: background .15s; }
.chipsel button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.stepper { display: flex; align-items: center; justify-content: space-between; background: var(--card); border-radius: 14px; height: 48px; }
.stepper button { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.stepper b { font-family: var(--display); font-size: 18px; }
.pick-grid button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; line-height: 1.1; }
.pick-grid button small { font-size: 10px; font-weight: 500; opacity: .7; }
.pick-grid button:disabled { opacity: .35; text-decoration: line-through; }
.form .pick-grid button[aria-pressed="true"] { background: var(--accent); }
.askbox.info { background: #E6E9FB; }
.askbox b { font-size: 14px; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; background: var(--card); border-radius: 16px; overflow: hidden; }
.timeline li { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { width: 64px; flex: none; font-size: 12px; color: var(--muted); padding-top: 1px; }

/* steps light (in modal) */
.steps.light .step { background: var(--card); }
.steps.light .step b { color: var(--ink); }
.steps.light .step small { color: var(--muted); }

/* hours + day rows */
.hours { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; align-items: end; height: 120px; }
.hours div { display: flex; flex-direction: column; align-items: center; gap: 4px; justify-content: flex-end; height: 100%; }
.hours i { display: block; width: 100%; max-width: 22px; background: var(--ink); border-radius: 5px 5px 2px 2px; }
.hours small { font-size: 10px; color: var(--muted); }
.dayrow { display: grid; grid-template-columns: 52px minmax(0, 1fr) 76px; gap: 12px; align-items: center; font-size: 13px; }
.dayrow > span:last-child { text-align: right; font-weight: 600; }
.dbar { position: relative; height: 14px; border-radius: 7px; background: #EEECE6; }
.dbar i { display: block; height: 100%; border-radius: 7px; background: var(--ink); }
.dbar b { position: absolute; top: -4px; width: 2px; height: 22px; background: var(--accent); border-radius: 1px; }

/* hostess */
.tbl.free small, .tbl.book small { opacity: .85; }
.pill.tbl-pill.book { background: var(--accent); color: var(--ink); }
.pill.tbl-pill.seat { background: var(--ink); color: var(--bg); }
.pill.tbl-pill.free { background: var(--card); color: var(--ink); border: 1.5px solid #CFCBC0; }
.hpanel { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 28px; }
.daytl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.daytl li { display: flex; gap: 12px; align-items: flex-start; }
.daytl time { width: 48px; flex: none; font-weight: 700; font-size: 14px; padding-top: 16px; }
.daytl li.seated, .daytl li.done, .daytl li.noshow, .daytl li.cancelled { opacity: .62; }

/* assistant */
.msg-acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.msg-acts button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 999px; background: var(--bg); font-size: 12px; font-weight: 600; color: var(--text2); }
.odesk aside .msg-acts button { background: var(--card); }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 4px; background: var(--muted); animation: blink 1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* Telegram */
.tg { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: #DCE3D6; background-image: radial-gradient(circle at 20% 20%, rgba(255,255,255,.35) 0 2px, transparent 3px), radial-gradient(circle at 70% 60%, rgba(255,255,255,.3) 0 2px, transparent 3px); background-size: 60px 60px, 80px 80px; }
.tg-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 12px 10px; background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(0,0,0,.06); }
.tg-back { width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; color: #2B4BEE; flex: none; }
.tg-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tg-title b { font-size: 16px; }
.tg-title small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-av { width: 48px; height: 48px; border-radius: 24px; background: var(--ink); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.tg-av.sm { width: 38px; height: 38px; }
.tg-av.light { background: var(--accent); color: var(--ink); font-size: 14px; }
.tg-list { background: #fff; }
.tg-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; width: 100%; text-align: left; border-bottom: 1px solid var(--line); min-height: 70px; }
.tg-row .t { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tg-row .t b { font-size: 15px; }
.tg-row .t small { font-size: 13px; color: var(--muted); }
.tg-row em { font-style: normal; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #2B4BEE; color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tg-body { padding: 12px 10px 40px; display: flex; flex-direction: column; gap: 6px; }
.tg-day { align-self: center; background: rgba(18,18,18,.28); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; margin: 4px 0 8px; }
.tg-msg { align-self: flex-start; max-width: 88%; background: #fff; border-radius: 18px 18px 18px 6px; padding: 10px 12px 6px; font-size: 14.5px; line-height: 1.5; box-shadow: 0 1px 1px rgba(0,0,0,.08); margin-top: 6px; }
.tg-msg time { display: block; text-align: right; font-size: 11px; color: #8E8B83; margin-top: 2px; }
.tg-msg.me { align-self: flex-end; background: #E1F7CF; border-radius: 18px 18px 6px 18px; }
.tg-msg.me time { color: #4FA34F; }
.tg-msg.photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 200px; height: 140px; background: #C9D6BE; color: #3F5A33; font-size: 12px; }
.tg-msg .muted { color: #6A675F; }
.tg-kb { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; max-width: 88%; width: 100%; align-self: flex-start; }
.tg-kb button { min-height: 42px; border-radius: 12px; background: rgba(40,52,40,.42); color: #fff; font-size: 14px; font-weight: 600; padding: 0 8px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.tg-kb button:active { background: rgba(40,52,40,.6); }
.tg-kb .wide { grid-column: 1 / -1; }

/* mini-app */
.tgmini { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--bg); }
.mini-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + var(--safe-t)) 12px 10px; background: rgba(243,242,238,.94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-bottom: 1px solid rgba(0,0,0,.06); }
.mini-head b { display: block; font-size: 15px; }
.mini-head small { display: block; font-size: 11px; color: var(--muted); }
.mini-x { width: 40px; height: 40px; border-radius: 20px; background: var(--card); color: var(--ink); display: flex; align-items: center; justify-content: center; }

@media (max-width: 1023px) {
  .hpanel { position: static; }
}
@media (min-width: 1024px) {
  .tg, .tgmini { box-shadow: 0 0 0 1px rgba(0,0,0,.05), 0 30px 60px rgba(18,18,18,.12); }
  body:has(.tg), body:has(.tgmini) { background: var(--bg2); }
}

.modal .btn.light { background: var(--card); }
.modal .chipsel button, .modal .stepper, .modal .inp, .modal .switch-row { box-shadow: 0 0 0 1px rgba(18,18,18,.04); }

/* =====================================================================
   v3 — владелец видит всё: сетка разделов, дашборды из блоков, роли
   ===================================================================== */
.mod-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mod { position: relative; background: var(--card); border-radius: 20px; padding: 14px; display: flex; flex-direction: column; gap: 6px; text-align: left; min-height: 120px; transition: transform .12s; }
.mod:active { transform: scale(.98); }
.mod b { font-size: 15px; }
.mod small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.mod em { position: absolute; top: 12px; right: 12px; font-style: normal; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

.ops { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.op { display: flex; flex-direction: column; gap: 4px; text-align: left; border-radius: 20px; padding: 14px; }
.op small { font-size: 12px; color: var(--muted); font-weight: 600; }
.op b { font-size: 18px; font-family: var(--display); font-weight: 600; letter-spacing: -0.01em; }
.op span { font-size: 12px; color: var(--muted); }
.op:hover { box-shadow: 0 10px 24px rgba(18,18,18,.07); }
.phone .ops { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.overview { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.overview .left { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ai-side { flex: 1 1 320px; min-width: 0; background: var(--card); border-radius: 28px; padding: 22px; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 24px; }
.ai-side .msg.ai, .ai-side .ask { background: var(--bg); }
.ai-side .sugg button, .ai-side .msg-acts button { background: var(--bg); min-height: 40px; }
.seg-d.light { background: var(--card); }
.seg-d.light button { color: var(--text2); }

.dash-tabs { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.blocks.one { grid-template-columns: minmax(0, 1fr); }
.block { background: var(--card); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.block.wide { grid-column: span 2; }
.blocks.one .block.wide { grid-column: auto; }
.block-x { width: 32px; height: 32px; border-radius: 16px; background: var(--bg); display: flex; align-items: center; justify-content: center; flex: none; color: var(--muted); }
.formula summary { font-size: 12px; color: var(--muted); cursor: pointer; font-weight: 600; }
.formula p { margin: 8px 0 0; font-size: 13px; color: var(--text2); line-height: 1.45; }
.formula pre { margin: 8px 0 0; background: var(--bg); border-radius: 12px; padding: 10px 12px; font-size: 11.5px; overflow-x: auto; white-space: pre; }
.mini-table { min-width: 0; font-size: 14px; }
.mini-table th, .mini-table td { padding: 8px 0; }
.mini-table th:first-child, .mini-table td:first-child { padding-left: 0; }

.roles-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.role-list .li[aria-current="true"] { background: var(--ink); color: var(--bg); }
.role-list .li[aria-current="true"] small { color: var(--muted-d); }
table.perm { min-width: 560px; }
table.perm td, table.perm th { text-align: center; }
table.perm td:first-child, table.perm th:first-child { text-align: left; }
table.perm .nv { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; }
.perm-cb { width: 28px; height: 28px; border-radius: 9px; border: 2px solid #CFCBC0; display: inline-flex; align-items: center; justify-content: center; color: #fff; transition: background .12s; }
.perm-cb[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
.perm-cb:disabled { opacity: .55; cursor: not-allowed; }
.chip-static { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--bg); font-size: 13px; font-weight: 600; }
.switch-row:disabled { opacity: .55; }

@media (max-width: 1180px) {
  .roles-grid { grid-template-columns: minmax(0, 1fr); }
  .ops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .block.wide { grid-column: auto; }
}

.op b { font-size: 16px; }
.side nav { overflow-y: auto; min-height: 0; flex: 1; }
.side { gap: 18px; }
