:root {
  --bg: #faf5f2; --card: #fff; --ink: #2b1a1e; --muted: #7b6a6c; --line: #efe4e1; --line2: #e0d1cd;
  --brand: #be123c; --brand-d: #9f1239; --soft: #fdecef; --soft2: #fbf6f4; --danger: #dc2626;
  --ok: #dcfce7; --low: #fef3c7; --high: #fed7aa; --warn: #b45309;
  --r: 14px; --shadow: 0 1px 2px rgba(60,24,30,.05), 0 6px 20px rgba(60,24,30,.05);
}
* { box-sizing: border-box; }
html { font-size: 15px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h2, h3 { margin: 0; letter-spacing: -.015em; line-height: 1.25; }
h3 { font-size: 1.07rem; font-weight: 650; margin-bottom: 12px; }
h3 + p.muted { margin-top: -6px; margin-bottom: 12px; }
p { margin: 8px 0; }
main p:last-child, .card > :last-child { margin-bottom: 0; }
button { font-family: inherit; }
svg { width: 20px; height: 20px; flex: none; }

/* ---------- Каркас ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.nav { background: #fff; border-right: 1px solid var(--line); padding: 18px 12px 16px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 18px; }
.brand b { display: block; font-size: 1.14rem; font-weight: 800; letter-spacing: .01em; line-height: 1.2; }
.brand small { display: block; color: var(--muted); font-size: .74rem; line-height: 1.3; white-space: nowrap; }
.logo-svg { width: 40px; height: 40px; flex: none; border-radius: 12px; box-shadow: 0 4px 12px rgba(190,18,60,.3); }
.logo { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #e11d48, #9f1239); box-shadow: 0 4px 12px rgba(225,29,72,.35); }
.navi { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; background: none; font: inherit; color: #55474a; padding: 0 12px; height: 40px; line-height: 1.2; border-radius: 10px; cursor: pointer; text-align: left; transition: background-color .15s, color .15s, transform .12s; }
.navi:hover { background: var(--soft2); color: var(--ink); transform: translateX(2px); }
.navi.active { background: var(--soft); color: var(--brand-d); font-weight: 600; }
.navi svg { opacity: .85; }
.nav-foot { margin-top: auto; padding: 12px 12px 0; color: var(--muted); font-size: .8rem; }
.backdrop { display: none; }
.page { min-width: 0; }
.bar { display: flex; align-items: center; gap: 10px; padding: 20px 28px 6px; min-height: 64px; }
.bar h2 { font-size: 1.5rem; font-weight: 750; letter-spacing: -.02em; }
.burger { display: none; border: 0; background: none; padding: 8px; border-radius: 10px; color: var(--ink); cursor: pointer; }
main { padding: 12px 28px 48px; max-width: 1480px; }

.split { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 16px; align-items: start; }
.side { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px; position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column; }
.side-tools { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.side-tools input { width: 100%; }
.list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.list > p { margin: 8px 4px; }
.item { padding: 9px 12px; gap: 1px; line-height: 1.35; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; border-left: 3px solid transparent; transition: background-color .15s, transform .15s; }
.item:hover { background: var(--soft2); }
.item:not(.active):hover { transform: translateX(3px); }
.item.active { background: var(--soft); border-left-color: var(--brand); color: var(--brand-d); }
.item small { opacity: .75; font-size: .8rem; font-weight: 400; }
.item b { font-weight: 600; }
.only-mobile { display: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.row { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; margin-bottom: 14px; }
.row > h3 { margin-bottom: 0; align-self: center; }
.row.actions { justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.row.actions .danger { margin-left: 4px; }
.grow { flex: 1 1 200px; }
span.grow:empty { flex: 1 1 0; }
.row > select { max-width: 240px; }
.fieldhint { align-self: center; line-height: 1.4; }
.addmeal { margin-bottom: 16px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .8rem; line-height: 1.2; color: var(--muted); font-weight: 500; }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
label.block { margin-top: 8px; }
.lbl { font-size: .8rem; color: var(--muted); align-self: center; font-weight: 500; }

input, select, textarea { font-family: inherit; font-size: .95rem; font-weight: 400; line-height: 1.3; color: var(--ink); padding: 0 11px; height: 38px; border: 1px solid var(--line2); border-radius: 9px; background: #fff; min-width: 0; transition: border-color .15s, box-shadow .15s, background-color .15s; }
input:hover, select:hover { border-color: #cdb8b4; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(225,29,72,.2); }
input.num { text-align: right; font-variant-numeric: tabular-nums; }
input.w60 { width: 62px; } input.w70 { width: 76px; } input.w90 { width: 96px; } input.w160 { width: 170px; }
input.wide { width: 100%; min-width: 150px; }
input[type=file] { height: auto; padding: 8px; }
input.warn { border-color: var(--warn); background: #fffbeb; }
input[type=checkbox] { width: 18px; height: 18px; padding: 0; margin: 0; flex: none; accent-color: var(--brand); }
textarea { width: 100%; height: auto; padding: 10px 11px; line-height: 1.5; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }
select.mealname { font-weight: 700; font-size: 1.02rem; border-color: transparent; background-color: var(--soft); color: var(--brand-d); }

.btn { font: inherit; font-size: .93rem; font-weight: 500; line-height: 1.2; padding: 0 15px; min-height: 38px; border: 1px solid var(--line2); border-radius: 9px; background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background-color .15s, border-color .15s, transform .08s, box-shadow .15s; }
.btn:hover { background: var(--soft2); box-shadow: 0 2px 8px rgba(70,30,36,.1); }
.btn:active { transform: scale(.96); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(190,18,60,.25); }
.btn.primary:hover { background: var(--brand-d); }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.ghost { border-color: transparent; background: none; color: var(--brand-d); padding-left: 8px; padding-right: 10px; }
.btn.small { padding: 0 12px; min-height: 32px; font-size: .86rem; }
.btn.icon { padding: 0; width: 30px; min-height: 30px; border-color: transparent; color: var(--muted); background: none; box-shadow: none; }
.btn.icon:hover { color: var(--danger); transform: scale(1.15); box-shadow: none; }
.chip { display: inline-flex; align-items: center; line-height: 1.3; padding: 3px 10px; border-radius: 999px; background: var(--soft); color: var(--brand-d); font-size: .82rem; font-weight: 600; }
.chip.al { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; padding: 1px 8px; }

/* ---------- Таблиці ---------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; margin: 0 0 14px; font-size: .95rem; font-variant-numeric: tabular-nums; }
.grid th, .grid td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: right; vertical-align: middle; line-height: 1.35; }
.grid tbody td { background-color: #fff; }
.grid th { background: var(--soft2); font-weight: 600; font-size: .76rem; line-height: 1.3; text-align: center; color: #65565a; border-bottom: 1px solid var(--line2); padding: 9px 8px; }
.grid td:has(> input), .grid td:has(> select), .grid td:has(> .btn) { padding-top: 5px; padding-bottom: 5px; }
.grid td input, .grid td select { height: 34px; padding: 0 9px; }
.grid td .btn.icon + .btn.icon { margin-left: 2px; }
.grid td:has(> input.num) { padding-left: 4px; padding-right: 4px; }
.grid th { overflow-wrap: normal; }
.grid td input.w70 { width: 68px; } .grid td input.w60 { width: 58px; }
.grid td:has(> .btn.icon) { padding-left: 4px; padding-right: 4px; }
.grid td select { max-width: 190px; }
.grid td input[type=date] { width: 134px; padding: 0 7px; }
.prod td select { width: 150px; }
.prod td input.w70 { width: 56px; } .prod td input.w60 { width: 50px; } .prod td input.w160 { width: 142px; } .prod td input.w90 { width: 76px; }
.prod td:has(> input:not(.num)), .prod td:has(> select) { padding-left: 5px; padding-right: 5px; }
.ing th, .ing td { padding-left: 6px; padding-right: 6px; }
.ing td:first-child, .ing th:first-child { padding-left: 10px; }
@media (min-width: 961px) and (max-width: 1439px) { .ing th:nth-child(6), .ing td:nth-child(6):not([colspan]) { display: none; } }
.scroll > table.grid { margin-bottom: 0; }
.scroll { margin-bottom: 14px; }
.report .scroll td:first-child, .report .scroll th:first-child { position: sticky; left: 0; z-index: 1; }
.report .scroll td:first-child { min-width: 150px; }
.grid thead tr:first-child th:first-child { border-top-left-radius: 10px; }
.grid thead tr:first-child th:last-child { border-top-right-radius: 10px; }
.grid td:first-child, .grid th:first-child { text-align: left; }
.grid.left td { text-align: left; }
.grid td.c { text-align: center; }
.grid td.dishcell { width: 100%; min-width: 170px; }
.grid td.dishcell + td, .grid td.dishcell ~ td { white-space: nowrap; }
.grid tbody tr { transition: background-color .12s; }
.grid tbody tr:hover td { background-image: linear-gradient(rgba(225,29,72,.045), rgba(225,29,72,.045)); }
.grid tr.mealrow td { background: var(--soft); color: var(--brand-d); font-weight: 700; text-align: left; }
.grid tr.total td { font-weight: 700; background: var(--soft2); }
.grid tr.day td { background: #fbd5dc; }
.grid tr.norm td { color: var(--muted); font-style: italic; }
.grid tr.grp td { font-weight: 600; }
.grid tr.sub td { color: var(--muted); font-size: .85rem; }
.grid tr.sub td:first-child { padding-left: 24px; }
.grid td.sep, .grid th.sep { border-left: 2px solid #d9c5c1; }
.grid td.b { font-weight: 700; }
.grid td.ok, .grid td.low, .grid td.high { font-style: normal; color: var(--ink); transition: background-color .3s; }
.grid td.ok { background: var(--ok); } .grid td.low { background: var(--low); } .grid td.high { background: var(--high); }

.subtabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.subtab { font: inherit; font-size: .9rem; font-weight: 500; line-height: 1.2; color: #55474a; border: 1px solid var(--line2); background: #fff; padding: 0 14px; height: 34px; border-radius: 999px; cursor: pointer; transition: background-color .18s, color .18s, border-color .18s, transform .08s; }
.subtab:hover { border-color: var(--brand); color: var(--brand-d); }
.subtab:active { transform: scale(.96); }
.subtab.active { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 2px 8px rgba(190,18,60,.25); }
.rep-tools { display: flex; gap: 6px; justify-content: flex-end; margin: 0 0 10px auto; }
.rep-tools .btn { min-height: 32px; padding: 0 12px; font-size: .86rem; }
.rep-title { margin: 0 0 12px; line-height: 1.4; }
.rep-title .org { color: var(--muted); font-size: .85rem; }

/* ---------- Сезонне меню ---------- */
table.season { border-collapse: separate; border-spacing: 10px; width: 100%; table-layout: fixed; margin: -6px -10px; width: calc(100% + 20px); }
.season td { vertical-align: top; padding: 0; }
.tcell { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 120px; background: #fff; cursor: pointer; font-size: .85rem; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tcell:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(70,30,36,.12); border-color: #f5b5c2; }
.tcell.empty { cursor: default; background: var(--soft2); border-style: dashed; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.tcell.empty:hover { transform: none; box-shadow: none; border-color: var(--line); }
.tc-h { font-weight: 700; margin-bottom: 4px; }
.tc-meal { color: var(--brand-d); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; margin-top: 6px; }
.tc-k { margin-top: 8px; color: var(--muted); font-size: .8rem; }

.prewrap { white-space: pre-wrap; }
textarea.prose { font-family: inherit; font-size: inherit; }
.muted { color: var(--muted); }
.small { font-size: .84rem; line-height: 1.45; }
.nowrap { white-space: nowrap; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 5px; white-space: normal; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.warn-text { color: var(--warn); }
.paste { background: var(--soft2); border: 1px dashed var(--line2); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 14px; }
label.check { flex-direction: row; align-items: center; gap: 9px; color: var(--ink); font-size: .95rem; line-height: 1.35; font-weight: 400; padding: 5px 0; min-height: 38px; }
.help li { margin-bottom: 6px; }

.saved { position: fixed; right: 18px; bottom: 18px; z-index: 50; opacity: 0; pointer-events: none; font-size: .85rem; background: #2b1a1e; color: #fff; padding: 7px 14px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.saved.show { animation: savedPulse 1.6s ease both; }

/* ---------- Анімації (лише transform/opacity — легкі для слабкого комп'ютера) ---------- */
@keyframes savedPulse { 0% { opacity: 0; transform: translateY(8px); } 15%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
@keyframes drawerIn { from { transform: translateX(-100%); } to { transform: none; } }
.enter main .card, .enter main > p, .enter .subtabs { animation: rise .28s ease both; }
.enter main .card:nth-of-type(2) { animation-delay: .04s; }
.enter main .card:nth-of-type(3) { animation-delay: .08s; }
.enter main .card:nth-of-type(4) { animation-delay: .12s; }
.enter main .card:nth-of-type(n+5) { animation-delay: .16s; }
.enter .side .item { animation: slideIn .22s ease both; }
.enter .bar h2 { animation: fadeIn .3s ease both; }
.enter .tcell { animation: rise .3s ease both; }
.enter-rep .report .scroll, .enter-rep .report .rep-title { animation: fadeIn .25s ease both; }

/* ---------- Планшет і телефон ---------- */
@media (max-width: 960px) {
  html { font-size: 16px; }
  .shell { display: block; }
  .nav { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 272px; height: auto; transform: translateX(-100%); box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .nav-open .nav { transform: none; animation: drawerIn .22s ease both; }
  .nav-open .backdrop { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(40,14,20,.45); animation: fadeIn .2s ease both; }
  .navi { height: 46px; }
  .burger { display: inline-flex; }
  .bar { position: sticky; top: 0; z-index: 20; background: rgba(250,245,242,.92); backdrop-filter: blur(8px); padding: 8px 12px; min-height: 56px; border-bottom: 1px solid var(--line); }
  .bar h2 { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  main { padding: 12px 12px 80px; }
  .card { padding: 16px 14px; margin-bottom: 12px; }
  .row.actions { justify-content: stretch; }
  .row.actions > * { flex: 1 1 auto; }
  .row.actions .danger { margin-left: 0; }
  .split { display: block; }
  .side { position: static; max-height: none; margin-bottom: 12px; }
  .split.detail > .side { display: none; }
  .split:not(.detail) > .content { display: none; }
  .only-mobile { display: block; }
  .back { margin-bottom: 6px; }
  .btn { min-height: 44px; }
  .btn.small, .rep-tools .btn { min-height: 38px; }
  .btn.icon { min-height: 38px; width: 38px; }
  input, select, .grid td input, .grid td select { height: 44px; font-size: 1rem; }
  input[type=checkbox] { height: 20px; width: 20px; }
  .subtab { height: 38px; }
  .row > label:not(.inline) { flex: 1 1 140px; }
  .row > label.grow { flex-basis: 100%; }
  .stack.ing td:nth-child(11) { margin-top: -6px; }
  .row > label:not(.inline) > input, .row > label:not(.inline) > select { width: 100%; }
  .subtabs { flex-wrap: nowrap; overflow-x: auto; padding: 0 12px 4px; margin: 0 -12px 12px; scrollbar-width: none; }
  .subtabs::-webkit-scrollbar { display: none; }
  .subtab { white-space: nowrap; flex: none; }
  .rep-tools { justify-content: flex-start; margin-left: 0; }
  .checks { grid-template-columns: 1fr; }

  /* Таблиці введення перетворюються на картки */
  table.stack, .stack tbody { display: block; }
  .stack thead { display: none; }
  .stack tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: #fff; align-items: start; }
  .stack td { border: 0; padding: 0 !important; text-align: left; display: flex; flex-direction: column; gap: 4px; background: none !important; white-space: normal !important; width: auto !important; min-width: 0 !important; }
  .stack td:empty { display: none; }
  .stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .72rem; font-weight: 500; }
  .stack td.dishcell, .stack td[colspan] { grid-column: 1 / -1; min-width: 0; }
  .stack td input, .stack td select { width: 100% !important; min-width: 0 !important; }
  .stack td:last-child { flex-direction: row; justify-content: flex-end; align-items: center; grid-column-end: -1; align-self: end; }
  .stack tr.total, .stack tr.norm { background: var(--soft2); }
  .stack tr.total td:first-child, .stack tr.norm td:first-child { grid-column: 1 / -1; font-weight: 700; }
  .stack.ing tr { grid-template-columns: repeat(4, 1fr); }
  .stack.ing td:nth-child(2)::before { content: "Брутто, г"; } .stack.ing td:nth-child(3)::before { content: "Нетто, г"; }
  .stack.ing td:nth-child(4)::before { content: "Відходи, %"; } .stack.ing td:nth-child(5)::before { content: "Тепл. обр., %"; }
  .stack.ing td:nth-child(6) { display: none; }
  .stack.ing td:nth-child(7)::before { content: "Білки"; } .stack.ing td:nth-child(8)::before { content: "Жири"; }
  .stack.ing td:nth-child(9)::before { content: "Вугл."; } .stack.ing td:nth-child(10)::before { content: "ккал"; }
  .stack.ing td::before { color: var(--muted); font-size: .72rem; font-weight: 500; }
  .stack.ing td:first-child::before { content: none; }
  .stack.ing td:nth-child(11) { grid-column: 1 / -1; }

  table.season, .season tbody, .season tr, .season td { display: block; width: auto; margin: 0; }
  .season td { margin-bottom: 8px; }
  .tcell { min-height: 0; }
  .saved { right: 50%; transform: translateX(50%); bottom: 14px; }
  @keyframes savedPulse { 0% { opacity: 0; } 15%, 70% { opacity: 1; } 100% { opacity: 0; } }
}
/* ---------- Довідка та знайомство ---------- */
.helpbtn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line2); background: #fff; color: var(--brand-d); font: inherit; font-size: .88rem; font-weight: 500; padding: 6px 12px 6px 9px; border-radius: 999px; cursor: pointer; transition: background-color .15s, transform .08s, box-shadow .15s; }
.helpbtn:hover { background: var(--soft); box-shadow: 0 2px 8px rgba(70,30,36,.1); }
.helpbtn:active { transform: scale(.96); }
.helpbtn svg { width: 18px; height: 18px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86em; background: var(--soft2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.ok-text { color: #15803d; font-weight: 600; }
.guide-hero { display: flex; align-items: center; gap: 18px; background: linear-gradient(135deg, #fdecef, #fff4e8); border-color: #f8cdd5; }
.guide-hero h3 { font-size: 1.25rem; }
.guide-hero p { max-width: 62ch; }
.guide-hero .row { margin: 12px 0 0; }
.gh-text { flex: 1 1 auto; min-width: 0; }
.gh-art { flex: none; width: 84px; height: 84px; animation: floaty 5s ease-in-out infinite; }
.gh-art svg { width: 100%; height: 100%; border-radius: 24px; box-shadow: 0 8px 22px rgba(190,18,60,.3); }
.tour-logo svg { width: 56px; height: 56px; border-radius: 16px; margin: 4px 0 10px; display: block; }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 2px 0 10px; }
.progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #e11d48, #9f1239); transform-origin: left center; transition: transform .4s ease; }
.steps { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.step { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; transition: background-color .2s, border-color .2s; }
.step.done { background: #f0fdf4; border-color: #bbf7d0; }
.step-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.step-t small { color: var(--muted); }
.step.done .step-t b { text-decoration: line-through; text-decoration-color: #86efac; }
.tick { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line2); background: #fff; color: var(--muted); font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; display: grid; place-items: center; padding: 0; transition: background-color .2s, border-color .2s, transform .12s; }
.tick:not(:disabled):hover { border-color: var(--brand); transform: scale(1.08); }
.step.done .tick { background: #22c55e; border-color: #22c55e; color: #fff; }
.tick:disabled { cursor: default; }
.flow { display: flex; align-items: stretch; gap: 8px; margin: 12px 0; }
.flow-i { flex: 1 1 0; min-width: 0; text-align: left; font: inherit; color: var(--ink); background: var(--soft2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; transition: background-color .15s, border-color .15s, transform .12s; }
.flow-i:hover { background: var(--soft); border-color: #f5b5c2; transform: translateY(-2px); }
.flow-i small { color: var(--muted); }
.flow-a { align-self: center; color: var(--brand); font-size: 1.3rem; flex: none; }
.acc { border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.acc.open { border-color: #f5b5c2; box-shadow: 0 4px 16px rgba(190,18,60,.08); }
.acc-h { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; background: none; font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .15s; }
.acc-h:hover { background: var(--soft2); }
.acc-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--soft); color: var(--brand-d); }
.acc-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.acc-t small { color: var(--muted); }
.acc-x { flex: none; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
.acc.open .acc-x { transform: rotate(-135deg); }
.acc-b { padding: 2px 16px 14px; border-top: 1px solid var(--line); animation: rise .22s ease both; }
.acc-b h4 { margin: 12px 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.acc-b ol, .acc-b ul { margin: 4px 0 10px; padding-left: 22px; }
.acc-b li { margin-bottom: 6px; }
.acc-b .row { margin: 12px 0 0; }
.tips { list-style: none; padding-left: 0 !important; }
.tips li { background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 8px 12px; }
.formulas { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.fm { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.fm code { white-space: normal; }
.fm small { color: var(--muted); }
.gloss { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 4px 24px; }
.gloss div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.gloss dt { font-weight: 600; }
.gloss dd { margin: 0; color: var(--muted); }

.tour { position: fixed; inset: 0; z-index: 200; animation: fadeIn .2s ease both; }
.tour.out { opacity: 0; transition: opacity .18s; pointer-events: none; }
.tour-block { position: absolute; inset: 0; }
.tour-hole { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(40,14,20,.6), 0 0 0 2px rgba(251,113,133,.9); pointer-events: none; transition: left .3s ease, top .3s ease, width .3s ease, height .3s ease; }
.tour-card { position: fixed; width: 360px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto; background: #fff; border-radius: 16px; padding: 16px 18px; box-shadow: 0 20px 50px rgba(40,14,20,.35); transition: left .3s ease, top .3s ease; }
.tour-card.center { left: 50% !important; top: 50% !important; margin: 0; transform: translate(-50%, -50%); transition: none; }
.tour-card.big { width: 440px; padding: 22px 24px; }
.tour-card.big h3 { font-size: 1.4rem; }
.tour-card.pop > * { animation: fadeIn .25s ease both; }
.tour-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tour-n { font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.tour-x { border: 0; background: none; color: var(--muted); font-size: 1rem; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.tour-x:hover { background: var(--soft2); color: var(--ink); }
.tour-card h3 { font-size: 1.12rem; margin-bottom: 6px; }
.tour-body ul { margin: 4px 0; padding-left: 20px; }
.tour-body li { margin-bottom: 3px; }
.tour-dots { display: flex; gap: 5px; margin: 12px 0; }
.tour-dots i { width: 6px; height: 6px; border-radius: 999px; background: var(--line2); transition: transform .25s, background-color .25s; transform-origin: left center; }
.tour-dots i.on { background: var(--brand); transform: scaleX(2.4); margin-right: 8px; }
.tour-btns { display: flex; align-items: center; gap: 8px; }
.tour-btns .grow { flex: 1 1 auto; }
@media (max-width: 960px) {
  .helpbtn { padding: 8px; border-radius: 50%; }
  .helpbtn span { display: none; }
  .helpbtn svg { width: 22px; height: 22px; }
  .guide-hero { align-items: flex-start; }
  .gh-art { width: 52px; height: 52px; animation: none; }
  .gh-art svg { border-radius: 15px; }
  .flow { flex-direction: column; }
  .flow-a { transform: rotate(90deg); line-height: 1; }
  .step { flex-wrap: wrap; }
  .step-t { flex-basis: calc(100% - 46px); }
  .step .btn { margin-left: 42px; }
  .acc-h { padding: 12px 10px; }
  .acc-b { padding: 2px 12px 12px; }
  .tour-card, .tour-card.big { width: auto; left: 8px !important; right: 8px; padding: 16px; }
  .tour-card.center { left: 8px !important; transform: translateY(-50%); }
}


/* ---------- Акаунт, вхід, синхронізація ---------- */
.nav-org { padding: 0 2px; }
.acct { display: flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--line); background: var(--soft2); border-radius: 12px; padding: 9px 12px; margin-bottom: 10px; font: inherit; color: var(--ink); text-align: left; cursor: pointer; transition: background-color .15s, border-color .15s; }
.acct:hover { background: var(--soft); border-color: #f5b5c2; }
.acct-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.acct-t b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-t small { color: var(--muted); font-size: .74rem; }
.sync-dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; }
.sync-dot.s-busy { background: #f59e0b; animation: pulse 1s ease-in-out infinite; }
.sync-dot.s-off { background: #9ca3af; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.acct-big { display: flex; align-items: center; gap: 12px; }
.acct-big b { display: block; font-size: 1.05rem; }
.acct-big small { color: var(--muted); display: flex; align-items: center; gap: 6px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--brand-d); font-weight: 700; font-size: 1.1rem; flex: none; }
.err-text { color: var(--danger); font-weight: 500; }
.auth-on #app { display: none; }
.auth { position: fixed; inset: 0; z-index: 300; overflow-y: auto; display: flex; flex-direction: column; align-items: center; padding: 24px 16px 18px; background: radial-gradient(1200px 600px at 50% -10%, #fdecef, var(--bg)); animation: fadeIn .25s ease both; }
.auth-card { margin: auto; width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: 0 20px 50px rgba(70,30,36,.12); display: flex; flex-direction: column; gap: 14px; animation: rise .3s ease both; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.auth-brand .logo-svg { width: 52px; height: 52px; border-radius: 15px; }
.auth-brand b { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.15; }
.auth-brand small { color: var(--muted); font-size: .85rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--soft2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.auth-tabs button { border: 0; background: none; font: inherit; font-weight: 600; font-size: .93rem; height: 36px; border-radius: 9px; color: var(--muted); cursor: pointer; transition: background-color .15s, color .15s; }
.auth-tabs button.on { background: #fff; color: var(--brand-d); box-shadow: 0 1px 4px rgba(70,30,36,.12); }
.auth-card label { font-size: .84rem; gap: 6px; }
.auth-card input { height: 44px; width: 100%; font-size: 1rem; }
.pw { position: relative; display: block; }
.pw input { padding-right: 46px; }
.pw-eye { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: 1rem; opacity: .6; }
.pw-eye:hover { opacity: 1; background: var(--soft2); }
.auth-go { min-height: 46px; font-size: 1rem; font-weight: 600; margin-top: 4px; }
.auth-go:disabled { opacity: .6; cursor: default; }
.auth-err, .auth-note { margin: 0; padding: 10px 12px; border-radius: 10px; font-size: .9rem; line-height: 1.4; }
.auth-err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.auth-note { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.auth-foot { margin: 0; text-align: center; }
.auth-love { flex: none; margin: 20px 0 0; font-size: .86rem; letter-spacing: .02em; color: var(--muted); text-align: center; }
.auth-love span { display: inline-block; font-size: .95em; margin-left: 2px; animation: heartbeat 2.4s ease-in-out infinite; }
@keyframes heartbeat { 0%, 28%, 100% { transform: scale(1); } 8% { transform: scale(1.18); } 16% { transform: scale(1); } 22% { transform: scale(1.12); } }
.modal { position: fixed; inset: 0; z-index: 310; display: flex; padding: 16px; overflow-y: auto; background: rgba(40,14,20,.55); animation: fadeIn .2s ease both; }
.modal-card { margin: auto; width: 100%; max-width: 520px; background: #fff; border-radius: 18px; padding: 24px; box-shadow: 0 20px 50px rgba(40,14,20,.35); animation: rise .25s ease both; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.choice-i { text-align: left; font: inherit; color: var(--ink); background: var(--soft2); border: 1px solid var(--line2); border-radius: 12px; padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; transition: background-color .15s, border-color .15s, transform .12s; }
.choice-i:hover, .choice-i:focus-visible { background: var(--soft); border-color: var(--brand); outline: 0; transform: translateY(-2px); }
.choice-i small { color: var(--muted); line-height: 1.4; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--brand-d); text-decoration: underline; cursor: pointer; }
@media (max-width: 960px) {
  .auth-card { padding: 22px 18px; }
  .choice { grid-template-columns: 1fr; }
}


@media (max-width: 420px) {
  .stack.ing tr { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  html { font-size: 11px; }
  body { background: #fff; }
  .no-print, .side, .nav, .bar, .backdrop, .saved, .tour, .auth, .modal { display: none !important; }
  .shell, .split { display: block; }
  main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; margin: 0 0 12px; box-shadow: none; }
  .card:not(.report) { display: none; }
  body.printing .report { display: none; }
  body.printing .report.print-me { display: block; }
  .scroll { overflow: visible; }
  table.grid { border-collapse: collapse; }
  .grid th, .grid td { border: 1px solid #555; }
  .tcell { border-color: #555; break-inside: avoid; }
}
