:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --bg2: var(--tg-theme-secondary-bg-color, #f2f3f5);
  --text: var(--tg-theme-text-color, #111111);
  --hint: var(--tg-theme-hint-color, #8a8f98);
  --link: var(--tg-theme-link-color, #2b7de9);
  --btn: var(--tg-theme-button-color, #2b7de9);
  --btn-text: var(--tg-theme-button-text-color, #ffffff);
  --danger: #e5484d;
  --ok: #2fa84f;
  --warn: #e6a700;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg2); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
#app { max-width: 640px; margin: 0 auto; padding: 12px 12px 90px; }
h1 { font-size: 20px; margin: 4px 0 12px; }
h2 { font-size: 16px; margin: 18px 0 8px; color: var(--hint); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
p { margin: 6px 0; }
a { color: var(--link); }
.center { text-align: center; padding: 40px 12px; }
.muted { color: var(--hint); }
.small { font-size: 13px; }
.pre { white-space: pre-wrap; }
.card { background: var(--bg); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.card.click { cursor: pointer; }
.card.click:active { opacity: .7; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.title { font-weight: 600; }
.btn { display: block; width: 100%; padding: 13px 14px; border: none; border-radius: var(--radius);
  background: var(--btn); color: var(--btn-text); font-size: 15px; font-weight: 600; cursor: pointer; margin: 8px 0; text-align: center; }
.btn:disabled { opacity: .5; }
.btn.secondary { background: var(--bg); color: var(--link); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { display: inline-block; width: auto; padding: 7px 12px; font-size: 13px; margin: 0; }
.btn.ghost { background: transparent; color: var(--link); padding: 6px 0; text-align: left; font-weight: 500; }
.menu .card { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.menu .icon { font-size: 22px; width: 30px; text-align: center; }
.badge { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; text-align: center; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 12px; background: var(--bg2); color: var(--hint); }
.tag.ok { background: rgba(47,168,79,.15); color: var(--ok); }
.tag.bad { background: rgba(229,72,77,.12); color: var(--danger); }
.tag.warn { background: rgba(230,167,0,.15); color: #a77900; }
label { display: block; margin: 10px 0 4px; font-size: 13px; color: var(--hint); }
input, select, textarea { width: 100%; padding: 11px 12px; border: 1px solid rgba(128,128,128,.25); border-radius: 10px;
  background: var(--bg); color: var(--text); font-size: 15px; font-family: inherit; }
textarea { min-height: 90px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: 14px; color: var(--text); }
.check input { width: auto; margin-top: 3px; }
.weekdays { display: flex; gap: 6px; flex-wrap: wrap; }
.weekdays label { margin: 0; display: flex; align-items: center; gap: 4px; color: var(--text); background: var(--bg); padding: 6px 10px; border-radius: 8px; }
.weekdays input { width: auto; }
.cal { background: var(--bg); border-radius: var(--radius); padding: 10px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; }
.cal-head button { background: none; border: none; font-size: 22px; color: var(--link); padding: 0 12px; cursor: pointer; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-grid .wd { font-size: 12px; color: var(--hint); padding: 4px 0; }
.cal-grid .day { padding: 10px 0; border-radius: 10px; color: var(--hint); }
.cal-grid .day.on { background: var(--btn); color: var(--btn-text); font-weight: 600; cursor: pointer; }
.cal-grid .day.picked { outline: 2px solid var(--ok); }
.slot { display: flex; justify-content: space-between; align-items: center; }
.slot .time { font-size: 18px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { padding: 6px 10px; border-radius: 8px; background: var(--bg2); font-size: 13px; cursor: pointer; border: none; color: var(--text); }
.chip.full { background: rgba(229,72,77,.12); }
.chip.some { background: rgba(47,168,79,.15); }
.chip.closed { text-decoration: line-through; opacity: .6; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; overflow-x: auto; }
.tabs button { flex: none; padding: 7px 12px; border-radius: 18px; border: none; background: var(--bg); color: var(--text); font-size: 13px; cursor: pointer; }
.tabs button.on { background: var(--btn); color: var(--btn-text); }
.qr { display: block; max-width: 240px; width: 100%; margin: 10px auto; border-radius: 8px; background: #fff; }
.big { font-size: 26px; font-weight: 700; }
.hidden { display: none !important; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal .sheet { background: var(--bg2); width: 100%; max-width: 640px; border-radius: 16px 16px 0 0; padding: 16px; max-height: 90vh; overflow-y: auto; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: rgba(20,20,20,.9); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: 90%; text-align: center; font-size: 14px; }
.list-line { padding: 8px 0; border-bottom: 1px solid rgba(128,128,128,.15); }
.list-line:last-child { border-bottom: none; }
.plus { color: var(--ok); font-weight: 700; }
.minus { color: var(--danger); font-weight: 700; }
.back { background: none; border: none; color: var(--link); font-size: 15px; padding: 4px 0 10px; cursor: pointer; }
