/* Технологічні карти — головний сайт. Каркас: бічне меню + сторінка. */
.w-80 { width: 80px; }
.u-acts { white-space: nowrap; }
:root {
  --bg: #f4f5f7; --panel: #fff; --border: #e4e7ec; --border-strong: #d0d5dd;
  --text: #101828; --muted: #667085; --muted-2: #98a2b3;
  --accent: #1f6feb; --accent-hover: #1a5fd0; --accent-weak: #eef4ff;
  --crit: #d92d20; --crit-bg: #fef3f2; --crit-line: #fecdca;
  --warn: #b54708; --warn-bg: #fffaeb; --warn-line: #fedf89;
  --ok: #067647; --ok-bg: #ecfdf3;
  --cosm: #475467; --cosm-bg: #f2f4f7;
  --ai: #6941c6; --ai-bg: #f4f3ff;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16,24,40,.05);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.14);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; }

/* ── кнопки й поля ── */
button, .btn {
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--text);
  border-radius: var(--radius-sm); padding: 8px 14px; min-height: 38px; white-space: nowrap; box-shadow: var(--shadow);
}
button:hover, .btn:hover { background: #f9fafb; }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid #c7d7fe; outline-offset: 1px; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-hover); }
button.ghost, .btn.ghost { box-shadow: none; }
button.danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.danger-t { color: var(--crit) !important; }
button.ai { color: var(--ai); border-color: #d9d6fe; background: var(--ai-bg); }
button.sm, .btn.sm { min-height: 32px; padding: 5px 10px; font-size: 13px; }
button.block { width: 100%; }
button:disabled { opacity: .5; cursor: default; }
.icon-btn { border: 0; background: none; box-shadow: none; min-height: 32px; width: 32px; padding: 0; color: var(--muted); font-size: 15px; }
.icon-btn:hover { background: var(--cosm-bg); color: var(--text); }
.icon-btn.del:hover { color: var(--crit); background: var(--crit-bg); }

input, select, textarea {
  font: inherit; font-size: 14px; width: 100%; padding: 8px 11px; min-height: 38px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: #fff; color: var(--text);
}
input:disabled, select:disabled, textarea:disabled { background: #f9fafb; color: var(--text); }
textarea { resize: vertical; line-height: 1.5; }
select.w-auto { width: auto; }
.field { margin-bottom: 14px; }
.field label, label { display: block; font-size: 13px; font-weight: 500; color: #344054; margin-bottom: 6px; }
.field label i { color: var(--crit); font-style: normal; }
.hint { font-size: 12.5px; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ── вхід ── */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { background: var(--panel); padding: 36px 32px; border-radius: 16px; box-shadow: var(--shadow-lg); text-align: center; width: 100%; max-width: 380px; }
.login-box h1 { font-size: 22px; margin-bottom: 6px; }
.login-box p { color: var(--muted); margin: 0 0 24px; }

/* ── каркас ── */
.shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--border); padding: 16px 12px; overflow-y: auto; z-index: 30; }
.side-backdrop, .mobilebar { display: none; }
.brand { font-weight: 700; font-size: 16px; padding: 4px 10px 18px; }

.proj { position: relative; margin: 0 0 14px; }
.proj-l { font-size: 11px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; padding: 0 8px 6px; }
.proj-btn { width: 100%; justify-content: flex-start; padding: 7px 10px; min-height: 48px; text-align: left; }
.proj-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; text-align: left; }
.proj-caret { color: var(--muted); }
.proj-logo { flex: none; width: 30px; height: 30px; border-radius: 8px; overflow: hidden; }
.proj-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.proj-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.proj-opt { width: 100%; justify-content: flex-start; border: 0; box-shadow: none; padding: 6px 8px; min-height: 42px; }
.proj-opt.on { background: var(--accent-weak); }
.proj-opt.add { color: var(--accent); border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 4px; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: #344054; font-weight: 500; }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--accent-weak); color: var(--accent); }
.ni-ic { width: 20px; text-align: center; font-size: 15px; opacity: .85; }
.ni-l { flex: 1; }
.ni-count { font-size: 12px; color: var(--muted); }
.ni-badge { font-size: 11px; font-weight: 700; background: var(--crit); color: #fff; border-radius: 999px; padding: 1px 7px; }
.nav-sec { font-size: 11px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; padding: 18px 10px 6px; }
.me { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--border); padding: 12px 6px 0; margin-top: 12px; }
.me-t { flex: 1; min-width: 0; }
.me-n { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-r { font-size: 12px; color: var(--muted); }

.main { min-width: 0; }
.page { padding: 24px 32px 48px; max-width: 1440px; }

/* ── шапка сторінки ── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.ph-sub { color: var(--muted); margin-top: 4px; }
.ph-a { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.ph-t { min-width: 0; }
.page-head.sticky { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 10px 0 12px; margin: 0 0 8px; box-shadow: 0 1px 0 var(--border); }
.head-status { border: 0; box-shadow: none; background: none; padding: 0; min-height: 0; margin-top: 8px; gap: 8px; font-weight: 500; color: var(--accent); font-size: 13px; }
.head-status:hover { background: none; text-decoration: underline; }
@media (min-width: 1501px) { .head-status span:last-child { display: none; } }
.crumbs { display: flex; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.crumbs a { font-weight: 500; }

/* ── панель інструментів, чіпи ── */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select { width: auto; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 16px; }
.search input { padding-left: 32px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
.seg button { border: 0; border-radius: 0; box-shadow: none; min-height: 36px; padding: 0 12px; color: var(--muted); font-size: 16px; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button.on { background: var(--accent-weak); color: var(--accent); }
.result-count { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }

/* ── каталог: категорії зліва ── */
.catalog { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.cat-list { display: flex; flex-direction: column; gap: 1px; }
.cat-h { font-size: 11px; font-weight: 600; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; padding: 0 10px 8px; }
.cat-item { justify-content: space-between; border: 0; box-shadow: none; background: none; min-height: 34px; padding: 6px 10px; font-weight: 500; color: #344054; text-align: left; white-space: normal; }
.cat-item small { color: var(--muted); font-weight: 400; font-size: 12px; }
.cat-item:hover { background: #eaecf0; }
.cat-item.on { background: var(--panel); color: var(--accent); box-shadow: var(--shadow); border: 1px solid var(--border); }
.cat-item.add { color: var(--accent); justify-content: flex-start; margin-top: 6px; }
.cat-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; padding: 10px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.cat-tools span { width: 100%; }

/* ── статуси ── */
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.crit { background: var(--crit-bg); color: var(--crit); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.cosm, .pill.muted { background: var(--cosm-bg); color: var(--cosm); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.role-admin { background: var(--ai-bg); color: var(--ai); }
.pill.role-chef { background: var(--accent-weak); color: var(--accent); }
.pill.role-cook { background: var(--ok-bg); color: var(--ok); }
.pill.role-viewer { background: var(--cosm-bg); color: var(--cosm); }

/* ── каталог ТК ── */
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.dish-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; color: var(--text); box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.dish-card:hover { box-shadow: 0 6px 16px rgba(16,24,40,.08); transform: translateY(-1px); }
.dish-card.st-crit { border-color: var(--crit-line); }
.dish-card.no-photo .dc-body { padding-top: 14px; }
.ph-img { display: block; width: 100%; height: 140px; object-fit: cover; background: var(--bg); }
.ph-img.ph { display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700; color: #d0d5dd; background: linear-gradient(135deg, #f2f4f7, #e4e7ec); }
.dc-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.dc-name { font-weight: 600; line-height: 1.3; }
.dc-meta { font-size: 12.5px; color: var(--muted); }
.dc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; }
.cost { font-size: 13px; font-weight: 600; color: #344054; white-space: nowrap; }

.dish-list { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.dish-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 90px; gap: 14px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--border); color: var(--text); border-left: 3px solid transparent; }
.dish-row:last-child { border-bottom: 0; }
.dish-row.no-th { grid-template-columns: minmax(0, 1fr) auto 90px; }
.dish-row:hover { background: #f9fafb; }
.dish-row.st-crit { border-left-color: var(--crit); }
.dish-row.st-warn { border-left-color: #f79009; }
.dish-row .th { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.dr-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-name small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.dr-cost { text-align: right; }

.empty-card { background: var(--panel); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 40px 20px; text-align: center; color: var(--muted); }
.empty-card b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty-inline { color: var(--muted); padding: 14px 0; }
.empty-inline.ok { color: var(--ok); font-weight: 500; }
td.empty-inline { text-align: center; padding: 24px; }

/* ── картки секцій ── */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow-x: auto; }
.card h2 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2 { margin: 0; }
.card-h.pad { padding: 16px 20px 0; }
.btn-row { display: flex; gap: 6px; }
.alert { border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; font-size: 13.5px; }
.alert.crit { background: var(--crit-bg); color: var(--crit); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.alert.info { background: var(--accent-weak); color: #1849a9; }

/* ── редактор ТК ── */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.analysis { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.analysis .card-h h2 { font-size: 16px; }
.basics { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .span2 { grid-column: span 2; }
.basics .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.basics .form-grid .span2 { grid-column: span 3; }
.photo img, .photo-empty { width: 100%; height: 150px; border-radius: 10px; object-fit: cover; display: block; background: var(--bg); }
.photo-empty { display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border-strong); color: var(--muted); font-size: 13px; }
.photo-acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.photo .hint { margin-top: 8px; }

.ing-scroll { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.ing-table { width: 100%; min-width: 680px; border-collapse: collapse; table-layout: fixed; }
.ing-table th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; padding: 0 4px 8px; white-space: nowrap; }
.ing-table td { padding: 3px 4px; }
.ing-table input { min-height: 34px; padding: 6px 8px; font-size: 13.5px; }
.ing-table .c-n { width: 30px; color: var(--muted); text-align: center; }
.ing-table th:nth-child(3) { width: 56px; }
.ing-table th:nth-child(n+4):not(.c-del) { width: 80px; }
.ing-table .c-name { width: auto; }
.ing-table .c-del { width: 36px; }
.add-row { margin-top: 8px; color: var(--accent); border-style: dashed; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.bad b { color: var(--crit); }
.summary { background: var(--accent-weak); color: #1d2939; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 13.5px; }
.analysis .pills { margin-bottom: 14px; }
.issues-h { font-size: 13px; font-weight: 700; margin: 16px 0 8px; }
.issues-h.crit { color: var(--crit); } .issues-h.warn { color: var(--warn); } .issues-h.cosm { color: var(--cosm); }
.issue { border: 1px solid var(--border); border-left: 3px solid var(--cosm); border-radius: 0; padding: 10px 12px; margin-bottom: 8px; font-size: 13.5px; }
.issue.crit { border-left-color: var(--crit); } .issue.warn { border-left-color: #f79009; }
.is-cat { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
.is-what { margin-bottom: 4px; }
.is-fix, .is-vals { color: var(--muted); font-size: 13px; }
.is-vals b { color: var(--text); }

/* ── таблиці ── */
.table, table.simple { width: 100%; border-collapse: collapse; }
.table th, table.simple th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: #f9fafb; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td, table.simple td { padding: 8px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table input, .table select { min-height: 34px; }
.w-44 { width: 44px; } .w-160 { width: 160px; } .w-90 { width: 90px; } .w-120 { width: 120px; } .w-140 { width: 140px; } .w-220 { width: 220px; }
.u-n { font-weight: 600; }

.role-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 20px; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.role-legend .pill { margin-right: 4px; }

.proj-cards { display: grid; gap: 12px; }
.proj-card { display: flex; align-items: center; gap: 16px; margin: 0; }
.pc-logo { flex: none; width: 56px; height: 56px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.pc-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pc-body { flex: 1; min-width: 0; }
.pc-n { font-weight: 600; font-size: 16px; }
.pc-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.prompt-area { min-height: 62vh; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; line-height: 1.55; margin-bottom: 8px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 10px; }
.kpi { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi b { display: block; font-size: 26px; margin-top: 4px; }
.kpi.bad b { color: var(--crit); }
.kpis + .muted { margin-bottom: 16px; }

/* ── модальні вікна, тост ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(16,24,40,.5); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.modal-box { background: var(--panel); border-radius: 14px; padding: 22px; width: 400px; max-width: 100%; box-shadow: var(--shadow-lg); }
.modal-box h3 { font-size: 17px; margin-bottom: 12px; }
.modal-box p { color: var(--muted); margin: 0 0 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--text); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13.5px; z-index: 300; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 40px); }
.toast.show { opacity: 1; transform: none; }
.toast.err { background: var(--crit); }

.analyzing-modal { text-align: center; width: 360px; padding: 32px 26px; }
.analyzing-icon { font-size: 30px; color: var(--ai); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.2); opacity: 1; } }
.analyzing-text { margin-top: 14px; font-weight: 600; min-height: 20px; transition: opacity .25s; }
.analyzing-text.fade { opacity: 0; }
.analyzing-bar { position: relative; height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; margin: 16px 0 10px; }
.analyzing-bar-fill { position: absolute; top: 0; left: -35%; height: 100%; width: 35%; border-radius: 999px; background: var(--ai); animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0% { left: -35%; } 100% { left: 100%; } }
.analyzing-hint { font-size: 12px; color: var(--muted); }

/* ── заявки шефів (requests.js) ── */
.req-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.req-board > .empty-card { grid-column: 1 / -1; }
.req-col { background: #eaecf0; border-radius: var(--radius); padding: 10px; min-height: 140px; }
.req-col-title { font-size: 13px; font-weight: 700; margin: 2px 4px 10px; display: flex; justify-content: space-between; }
.req-col-title span { color: var(--muted); font-weight: 600; }
.req-col-new .req-col-title { color: var(--accent); }
.req-col-in_progress .req-col-title { color: var(--warn); }
.req-col-done .req-col-title { color: var(--ok); }
.req-card { display: block; width: 100%; text-align: left; white-space: normal; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; min-height: 0; }
.req-card:hover { border-color: var(--accent); background: var(--panel); }
.req-card-t { font-weight: 600; margin-bottom: 3px; }
.req-card-s { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.req-flag { display: inline-block; margin-top: 6px; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.req-flag.ans { background: var(--crit-bg); color: var(--crit); }
.req-flag.wait { background: var(--cosm-bg); color: var(--cosm); }
.req-empty { font-size: 12.5px; color: var(--muted); text-align: center; padding: 18px 0; }
.modal-box.req-modal { width: 680px; max-height: calc(100vh - 32px); overflow-y: auto; }
.req-m-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.req-badge { flex: none; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.req-st-new { background: var(--accent-weak); color: var(--accent); }
.req-st-in_progress { background: var(--warn-bg); color: var(--warn); }
.req-st-done { background: var(--ok-bg); color: var(--ok); }
.req-items { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.req-items td:first-child, .req-items th:first-child { width: 40px; color: var(--muted); }
.req-items td:last-child, .req-items th:last-child { text-align: right; white-space: nowrap; }
.req-comment { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 13.5px; white-space: pre-wrap; }
.req-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; }
.req-create { display: flex; gap: 6px; align-items: center; }
.req-create select { width: 230px; }
.req-chat { border-top: 1px solid var(--border); padding-top: 14px; }
.req-chat h4 { margin: 0 0 8px; font-size: 13.5px; }
.req-msg { background: var(--accent-weak); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; font-size: 13.5px; }
.req-txt { white-space: pre-wrap; }
.req-msg.chef { background: var(--bg); }
.req-log { margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ── адаптив ── */
@media (max-width: 1500px) {
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; height: auto; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(16,24,40,.4); z-index: 25; }
  .mobilebar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 22; background: var(--panel); border-bottom: 1px solid var(--border); padding: 8px 12px; min-height: 52px; }
  .burger { border: 0; box-shadow: none; font-size: 20px; min-height: 40px; width: 40px; padding: 0; }
  .mb-title { font-weight: 600; }
  .page { padding: 16px 16px 40px; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 20px; }
  .page-head.sticky { position: static; box-shadow: none; padding: 0; margin-bottom: 16px; }
  .ph-a { margin-left: 0; }
  .search { max-width: none; min-width: 0; flex-basis: 100%; }
  .basics { grid-template-columns: minmax(0, 1fr); }
  .basics .form-grid, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .basics .form-grid .span2, .form-grid .span2 { grid-column: auto; }
  .photo img { height: 180px; }
  .photo-empty { height: 64px; }
  .photo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .photo img, .photo-empty { flex: 1 1 100%; }
  .photo-acts { margin-top: 0; }
  .catalog { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .cat-list { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
  .cat-h { display: none; }
  .cat-item { flex: none; white-space: nowrap; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); min-height: 34px; gap: 6px; }
  .cat-item.on { background: var(--text); color: #fff; border-color: var(--text); }
  .cat-item.on small { color: #d0d5dd; }
  .cat-item.add { margin-top: 0; border-style: dashed; }
  .cat-tools { flex: none; margin: 0; padding: 0 0 0 6px; border: 0; flex-wrap: nowrap; }
  .cat-tools span { display: none; }
  .dish-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .ph-img { height: 110px; }
  .dish-row { grid-template-columns: 40px minmax(0, 1fr); padding: 10px 12px; }
  .dish-row.no-th { grid-template-columns: minmax(0, 1fr); }
  .dish-row.no-th .dr-st { grid-column: 1; }
  .dish-row .th { width: 40px; height: 40px; }
  .dr-st { grid-column: 2; } .dr-cost { display: none; }
  .req-board { grid-template-columns: minmax(0, 1fr); }
  .req-create, .req-create select { width: 100%; }
  .proj-card { flex-wrap: wrap; }
  .pc-acts { justify-content: flex-start; width: 100%; }
  .table th, .table td { padding: 8px 10px; }
  .users-table th:nth-child(2), .users-table td:nth-child(2) { display: none; }
  .users-table { table-layout: fixed; }
  .users-table .w-220 { width: 150px; }
  .users-table td { overflow-wrap: anywhere; }
  .card { padding: 16px; }
  .ing-scroll { margin: 0 -16px; padding: 0 16px; }
  .toast { left: 16px; right: 16px; bottom: 16px; }
}
button.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.boot-loading { min-height: 100vh; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.analysis { scroll-margin-top: 150px; }
/* бічне меню і рядок категорій на телефоні — без видимої смуги прокрутки */
.side, .cat-list { scrollbar-width: none; -ms-overflow-style: none; }
.side::-webkit-scrollbar, .cat-list::-webkit-scrollbar { display: none; }

/* випадні списки: однакова стрілка скрізь (нативна стоїть по-різному в різних браузерах) */
select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23667085' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px;
}
select:disabled { cursor: default; opacity: .7; }
select::-ms-expand { display: none; }

/* ── вхід через Telegram (tg-login.js) ── */
.tg-login { text-align: left; }
.tg-login .field { margin-bottom: 14px; }
.tg-login label { display: block; font-size: 13px; font-weight: 500; color: #344054; margin-bottom: 6px; }
.tg-login button.block { width: 100%; }
.tg-login button.link { border: 0; background: none; box-shadow: none; color: var(--accent); min-height: 0; padding: 12px 0 0; font-size: 13.5px; }
.tg-err { background: var(--crit-bg); color: var(--crit); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 12px; }
.tg-err a { color: inherit; text-decoration: underline; }
.tg-hint { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 12px; }
.tg-sent { background: var(--accent-weak); color: #1849a9; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin-bottom: 14px; }
.tg-code { font-size: 22px !important; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }

[hidden] { display: none !important; }

.link-btn { border: 0; background: none; box-shadow: none; padding: 0; min-height: 0; color: var(--accent); font-size: inherit; font-weight: 500; }
.link-btn:hover { background: none; text-decoration: underline; }
.pw-state { margin-top: 4px; }
