@font-face { font-family: "Manrope"; src: url("/static/fonts/Manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("/static/fonts/Cormorant.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }

:root {
  --bg: #FDFDFA;
  --paper: #F4F3EE;
  --sand: #EEEBE3;
  --card: #FFFFFF;
  --line: #E2DFD5;
  --line-strong: #C9C5B8;
  --ink: #1C1C1A;
  --muted: #5C5B55;
  --olive: #AAB873;
  --olive-soft: #E8ECD8;
  --olive-ink: #4E5A25;
  --terra: #B5603E;
  --terra-soft: #F6E3D9;
  --sky-soft: #E3ECF1;
  --g-plants: #AAB873; --g-protein: #D39A7A; --g-carbs: #E2C27E; --g-fats: #A9BFB9; --g-dairy: #FFFFFF;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(28,28,26,.04), 0 6px 24px rgba(28,28,26,.05);
  --serif: "Cormorant", "Times New Roman", serif;
  --sans: "Manrope", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --safe-top: max(var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px), env(safe-area-inset-top, 0px));
  --safe-bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
a { color: var(--olive-ink); }
:focus-visible { outline: 2px solid var(--olive-ink); outline-offset: 2px; border-radius: 6px; }

/* ---------- каркас ---------- */
#app { min-height: 100vh; padding-top: var(--safe-top); }
.page { max-width: 760px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + var(--safe-bottom) + 28px); }
.page.wide { max-width: 1180px; }
.page.no-nav { padding-bottom: calc(var(--safe-bottom) + 110px); }
.topbar { display: flex; align-items: center; gap: 10px; margin: 2px 0 18px; min-height: 40px; }
.brand { font-family: var(--serif); font-size: 19px; letter-spacing: .14em; text-transform: uppercase; font-weight: 500; }
.brand small { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: .06em; color: var(--muted); text-transform: none; }
.spacer { flex: 1; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: .01em; line-height: 1.12; }
h1 { font-size: 34px; text-transform: uppercase; letter-spacing: .03em; }
h2 { font-size: 26px; text-transform: uppercase; letter-spacing: .03em; margin: 28px 0 12px; }
h3 { font-size: 22px; font-weight: 500; margin: 0 0 6px; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.lead { font-size: 17px; color: var(--muted); margin: 8px 0 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.xs { font-size: 12.5px; }
p { margin: 0 0 10px; }

/* ---------- карточки ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card.paper { background: var(--paper); box-shadow: none; }
.card.olive { background: var(--olive-soft); border-color: #D3DABB; box-shadow: none; }
.card.personal { background: #FFFDF6; border: 1.5px solid var(--olive); }
.card.private { background: #FFF6F0; border: 1.5px dashed var(--terra); box-shadow: none; }
.card.flat { box-shadow: none; }
.card.tap { cursor: pointer; transition: transform .08s ease; }
.card.tap:active { transform: scale(.99); }
.row { display: flex; align-items: center; gap: 12px; }
.row.top { align-items: flex-start; }
.row.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 22px; border-radius: 14px;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.btn.primary { background: var(--olive-ink); border-color: var(--olive-ink); color: #fff; }
.btn.dark { background: var(--ink); color: #fff; }
.btn.ghost { border-color: transparent; text-transform: none; letter-spacing: 0; font-weight: 600; padding: 10px 12px; min-height: 44px; color: var(--olive-ink); }
.btn.danger { border-color: var(--terra); color: var(--terra); }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 8px 14px; font-size: 12.5px; border-radius: 11px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn:active:not([disabled]) { transform: translateY(1px); }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.link { background: none; border: 0; padding: 0; color: var(--olive-ink); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- чипы, бейджи ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--card); cursor: pointer; font-size: 15px; display: inline-flex; align-items: center; gap: 7px;
  -webkit-tap-highlight-color: transparent;
}
.chip[aria-pressed="true"], .chip.on { background: var(--olive-soft); border-color: var(--olive-ink); color: var(--olive-ink); font-weight: 600; }
.chip[aria-pressed="true"]::before, .chip.on::before { content: "✓"; font-weight: 700; }
.chip .dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--ink); flex: none; }
.chip.on .dot { display: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--sand); color: var(--ink); white-space: nowrap; }
.badge.ok { background: var(--olive-soft); color: var(--olive-ink); }
.badge.warn { background: var(--terra-soft); color: #8A3F22; }
.badge.info { background: var(--sky-soft); color: #2F5266; }
.badge.dark { background: var(--ink); color: #fff; }
.count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--terra); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- этапы ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 16px; top: 34px; bottom: 2px; width: 2px; background: var(--line); }
.steps li.done:not(:last-child)::after { background: var(--olive); }
.step-mark { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line-strong); background: var(--card); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.steps li.done .step-mark { background: var(--olive); border-color: var(--olive-ink); color: var(--ink); }
.steps li.current .step-mark { background: var(--ink); border-color: var(--ink); color: #fff; }
.steps li.locked .step-mark { color: var(--muted); }
.step-title { font-weight: 600; padding-top: 5px; }
.step-sub { font-size: 13.5px; color: var(--muted); }

.obs-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.obs-day { border: 1.5px dashed var(--line-strong); border-radius: 14px; padding: 12px 8px; text-align: center; background: var(--card); }
.obs-day.done { border: 1.5px solid var(--olive-ink); background: var(--olive-soft); }
.obs-day .n { font-family: var(--serif); font-size: 28px; line-height: 1; }
.obs-day .s { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.obs-day.done .s { color: var(--olive-ink); font-weight: 600; }

/* ---------- нижняя навигация ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(253,253,250,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom);
}
.nav-inner { max-width: 760px; margin: 0 auto; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.nav button { height: var(--nav-h); background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; letter-spacing: .03em; color: var(--muted); cursor: pointer; position: relative; }
.nav button svg { width: 24px; height: 24px; }
.nav button[aria-current="page"] { color: var(--ink); font-weight: 700; }
.nav button[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--ink); border-radius: 2px; }
.nav .count { position: absolute; top: 8px; right: calc(50% - 22px); }

.fab-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-bottom)); padding: 10px 16px; z-index: 15; pointer-events: none; }
.fab-bar .btn { pointer-events: auto; max-width: 728px; margin: 0 auto; display: flex; box-shadow: 0 8px 24px rgba(28,28,26,.18); }
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(253,253,250,.97); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + var(--safe-bottom)); z-index: 30; }
.bottom-bar .inner { max-width: 728px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }

/* ---------- формы ---------- */
.field { margin-bottom: 22px; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: 8px; font-size: 16px; }
.field .hint { font-size: 13.5px; color: var(--muted); margin: -2px 0 8px; }
.req { color: var(--terra); font-weight: 700; }
input[type=text], input[type=number], input[type=time], input[type=date], textarea, select {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 13px; background: var(--card);
  padding: 13px 14px; font-size: 16px; min-height: 50px; outline: none; transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--olive-ink); box-shadow: 0 0 0 3px var(--olive-soft); }
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.with-unit { display: flex; align-items: center; gap: 10px; }
.with-unit input { max-width: 170px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 6px 0; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--olive-ink); flex: none; }
.err-text { color: #8A3F22; font-size: 14px; margin-top: 6px; }
.field.invalid input, .field.invalid textarea { border-color: var(--terra); }

.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale.s10 { grid-template-columns: repeat(10, 1fr); gap: 4px; }
.scale button { min-height: 46px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--card); font-weight: 700; cursor: pointer; padding: 0; font-size: 15px; }
.scale button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.scale button.guide { box-shadow: inset 0 -3px 0 var(--olive); }
.scale-labels { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 6px; gap: 8px; }
.scale-desc { margin-top: 8px; font-size: 14px; min-height: 21px; }

.progress { height: 6px; background: var(--sand); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--olive-ink); border-radius: 3px; transition: width .3s; }

.save-state { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-state.err { color: #8A3F22; font-weight: 600; }
.save-state.ok::before { content: "✓"; color: var(--olive-ink); font-weight: 700; }

/* ---------- фото ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--sand); border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .rm { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(28,28,26,.7); color: #fff; font-size: 18px; cursor: pointer; }
.photo .st { position: absolute; left: 4px; bottom: 4px; font-size: 11px; background: rgba(255,255,255,.9); border-radius: 6px; padding: 1px 6px; }
.photo-add { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed var(--line-strong); background: var(--paper); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font-size: 13px; color: var(--muted); }

/* ---------- дневник ---------- */
.datestrip { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.datestrip::-webkit-scrollbar { display: none; }
.dchip { flex: none; width: 56px; padding: 8px 0; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-align: center; cursor: pointer; }
.dchip .w { font-size: 11.5px; color: var(--muted); text-transform: uppercase; }
.dchip .d { font-family: var(--serif); font-size: 24px; line-height: 1.1; }
.dchip .m { height: 8px; display: flex; justify-content: center; gap: 3px; margin-top: 2px; }
.dchip .m i { width: 6px; height: 6px; border-radius: 50%; background: var(--olive-ink); display: block; }
.dchip .m i.sq { border-radius: 1px; background: var(--terra); }
.dchip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.dchip[aria-pressed="true"] .w { color: #ddd; }
.dchip[aria-pressed="true"] .m i { background: #fff; }

.meal { display: grid; grid-template-columns: 72px 1fr; gap: 12px; }
.meal .thumb { width: 72px; height: 72px; border-radius: 12px; overflow: hidden; background: var(--sand); display: flex; align-items: center; justify-content: center; font-size: 26px; position: relative; }
.meal .thumb img { width: 100%; height: 100%; object-fit: cover; }
.meal .thumb .more { position: absolute; right: 4px; bottom: 4px; background: rgba(28,28,26,.75); color: #fff; font-size: 11px; border-radius: 6px; padding: 0 5px; }
.meal .time { font-size: 13px; color: var(--muted); }
.gtags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.gtag { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); display: inline-flex; align-items: center; gap: 5px; }
.gtag i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; border: 1px solid var(--ink); }
.soft-hint { font-size: 13px; color: #6B5A2E; background: #FBF4E2; border-radius: 10px; padding: 6px 10px; margin-top: 8px; }

/* ---------- материалы ---------- */
.mat-list .card { display: grid; grid-template-columns: 52px 1fr auto; gap: 14px; align-items: center; }
.mat-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--paper); display: flex; align-items: center; justify-content: center; font-size: 24px; border: 1px solid var(--line); }
.locked-card { opacity: .82; }
.article { font-size: 16.5px; line-height: 1.62; }
.article h2 { font-size: 24px; margin-top: 30px; }
.article ul, .article ol { padding-left: 20px; margin: 0 0 14px; }
.article li { margin-bottom: 7px; }
.article figure { margin: 18px 0; }
.article figure img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); }
.article figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.article .mcards { display: grid; gap: 10px; margin: 12px 0 16px; }
.article .mcards .card { margin: 0; padding: 14px 16px; box-shadow: none; }
.article .mcards b { display: block; margin-bottom: 3px; }
.tip { background: var(--olive-soft); border-radius: var(--radius-sm); padding: 14px 16px; margin: 16px 0; }
.tip b { display: block; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 4px; color: var(--olive-ink); }
.note { background: #FBF0E8; border-left: 3px solid var(--terra); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 12px 14px; margin: 16px 0; font-size: 15px; }
.note::before { content: "Важно. "; font-weight: 700; }
.example { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; margin: 10px 0; background: var(--card); }
.example b { font-family: var(--serif); font-size: 20px; font-weight: 500; }
.tbl-wrap { overflow-x: auto; margin: 12px 0 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
table.t { border-collapse: collapse; width: 100%; font-size: 14.5px; background: var(--card); }
table.t th, table.t td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { background: var(--paper); font-weight: 700; font-size: 13px; }
table.t tr:last-child td { border-bottom: 0; }
.tbl-cap { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.draft-flag { display: inline-block; background: #FBF4E2; color: #6B5A2E; border: 1px solid #E8D9AE; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; }

/* ---------- шкала голода ---------- */
.hs { display: grid; gap: 6px; }
.hs-row { display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: start; padding: 8px 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.hs-n { font-family: var(--serif); font-size: 26px; line-height: 1; text-align: center; }
.hs-row.hunger { border-left: 4px solid #D6B98A; }
.hs-row.neutral { border-left: 4px solid var(--olive); }
.hs-row.satiety { border-left: 4px solid var(--olive-ink); }
.hs-row.full { border-left: 4px solid #C79A86; }

/* ---------- прогресс ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { font-size: 11.5px; text-align: center; color: var(--muted); padding-bottom: 2px; }
.cal .c { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--line); background: var(--card); padding: 3px; font-size: 13px; display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; }
.cal .c.out { opacity: .35; }
.cal .c.today { border-color: var(--ink); border-width: 1.5px; }
.cal .c .mk { display: flex; gap: 3px; justify-content: center; }
.cal .c .mk i { width: 7px; height: 7px; display: block; }
.cal .c .mk i.meal { border-radius: 50%; background: var(--olive-ink); }
.cal .c .mk i.ck { background: var(--terra); transform: rotate(45deg); width: 6px; height: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; display: inline-block; }
.chart { width: 100%; height: auto; display: block; }
.metric-head { display: flex; justify-content: space-between; align-items: baseline; }

/* ---------- кабинет Полины ---------- */
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px 2px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs button { flex: none; min-height: 42px; border-radius: 999px; padding: 8px 16px; border: 1px solid var(--line-strong); background: var(--card); cursor: pointer; font-weight: 600; font-size: 14px; }
.admin-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.clients { display: grid; gap: 10px; }
.client-row { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; align-items: center; }
.client-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.qa { border-bottom: 1px solid var(--line); padding: 12px 0; }
.qa:last-child { border-bottom: 0; }
.qa .q { font-size: 13.5px; color: var(--muted); margin-bottom: 3px; }
.qa .a { white-space: pre-wrap; }
.qa.changed { background: #FFFBEA; margin: 0 -12px; padding: 12px; border-radius: 10px; }
.thread { display: grid; gap: 10px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); white-space: pre-wrap; }
.msg.mine { justify-self: end; background: var(--olive-soft); border-color: #D3DABB; }
.msg .meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.event { display: grid; grid-template-columns: 100px 1fr; gap: 10px; font-size: 14px; padding: 7px 0; border-bottom: 1px solid var(--line); }

@media (min-width: 900px) {
  .page.wide .two-col { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
  h1 { font-size: 40px; }
}

/* ---------- состояния ---------- */
.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty .ico { font-size: 34px; margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, var(--sand) 0%, var(--paper) 50%, var(--sand) 100%); background-size: 200% 100%; animation: sk 1.3s infinite; border-radius: var(--radius); height: 90px; margin-bottom: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-bottom) + 18px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14.5px; z-index: 100; max-width: calc(100% - 32px); box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.toast.err { background: #8A3F22; }
.banner { background: var(--terra-soft); color: #6E3219; padding: 10px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 14px; display: flex; gap: 10px; align-items: center; }
.banner.info { background: var(--sky-soft); color: #2F5266; }
.demo-bar { background: #2B2B27; color: #fff; font-size: 13px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.demo-bar button { background: #444; color: #fff; border: 0; border-radius: 8px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.demo-bar button[aria-pressed="true"] { background: var(--olive); color: var(--ink); font-weight: 700; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(28,28,26,.35); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; max-height: 88vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 16px calc(18px + var(--safe-bottom)); }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 22px; } }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 60; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-height: 92vh; max-width: 96vw; object-fit: contain; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
details > summary { cursor: pointer; font-weight: 600; color: var(--olive-ink); padding: 10px 0; list-style: none; }
details > summary::before { content: "＋ "; }
details[open] > summary::before { content: "－ "; }
