/* Проход impeccable + taste-skill: фото и папки, приёмка, читаемость, телефон. Подключается после live.css. */
body.live { --line-strong: #6d6d77; --ph: #9a99a3; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.live-page { grid-template-columns: minmax(0, 1fr); }
.table-scroll { min-width: 0; }

/* Читаемость: на рабочих экранах не мельче 12 px, поля 16 px на телефоне */
body.live .form-hint, body.live .event-meta, body.live .event-time small, body.live .breadcrumb, body.live .profile small,
body.live .field, body.live .picker-count { font-size: 13px; }
body.live .tag { font-size: 12px; padding: 3px 9px; }
body.live .event-time { font-size: 13px; }
body.live .event-title { font-size: 15px; }
body.live .field input, body.live .field select, body.live .field textarea, body.live .button { font-size: 14px; }
body.live .field input, body.live .field select, body.live .field textarea { min-height: 44px; border-color: var(--line-strong); }
body.live ::placeholder { color: var(--ph); opacity: 1; }
body.live .nav-caption { display: none; }
body.live .brand small { font-size: 11px; }
body.live .gear-table th { font-size: 12px; }

/* Диалоги: отступы у содержимого, кнопки остаются в кадре, ошибка заметна */
body.live dialog .dialog-body { padding: 4px 24px 24px; }
body.live dialog .dialog-head { padding: 20px 24px 8px; }
body.live .dialog-body .form-actions { position: sticky; bottom: -24px; margin: 16px -24px -24px; padding: 14px 24px 18px; background: var(--surface); border-top: 1px solid var(--line); }
body.live .form-error { border-radius: 12px; }
body.live .form-error.has-error { margin: 8px 0; padding: 12px 14px; background: rgb(239 148 137 / .1); border: 1px solid rgb(239 148 137 / .45); color: var(--text); }
body.live .form-error.has-error ul { margin: 6px 0; padding-left: 18px; color: var(--dim); }
body.live .form-error:focus { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Фото техники */
.photo { display: inline-grid; place-items: center; flex: none; object-fit: contain; background: #fff; border-radius: 12px; border: 1px solid var(--line); overflow: hidden; }
.photo.ph { background: var(--card); color: var(--muted); }
.photo.ph svg { width: 45%; height: 45%; stroke: currentColor; fill: none; stroke-width: 1.6; }
.photo.xs { width: 36px; height: 36px; border-radius: 8px; }
.photo.sm { width: 52px; height: 52px; border-radius: 10px; }
.photo.md { width: 76px; height: 76px; }
.thumb-row { display: flex; gap: 6px; }

/* Выбор техники: папки внутри папок */
.picker-list { max-height: min(52dvh, 460px); padding: 6px; }
.pick-folder { border-radius: 12px; }
.pick-folder > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px; cursor: pointer; list-style: none; border-radius: 12px; }
.pick-folder > summary::-webkit-details-marker { display: none; }
.pick-folder > summary::after { content: ""; margin-left: 4px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .2s cubic-bezier(.16, 1, .3, 1); }
.pick-folder[open] > summary::after { transform: rotate(45deg); }
.pick-folder > summary:hover { background: var(--card); }
.pick-folder .f-icon svg { width: 20px; height: 20px; stroke: var(--accent); fill: none; stroke-width: 1.7; }
.pick-folder .f-count { margin-left: auto; font-size: 13px; color: var(--muted); }
.picker-sub { padding: 10px 12px 4px 18px; font-size: 13px; color: var(--muted); }
.pick-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 10px; border-radius: 10px; min-height: 64px; }
.pick-row.is-busy .pick-info small { color: var(--orange); }
.pick-info small { font-size: 13px; }

/* Папки и модели в каталоге */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.crumb { min-height: 36px; padding: 0 10px; border-radius: 8px; border: 0; background: none; color: var(--dim); font: inherit; cursor: pointer; }
.crumb:hover { color: var(--text); background: var(--card); }
.crumb[aria-current="page"] { color: var(--text); font-weight: 600; }
.folder-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.folder-card { display: grid; gap: 10px; text-align: left; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .2s, transform .2s cubic-bezier(.16, 1, .3, 1); }
.folder-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.folder-card:active { transform: scale(.985); }
.folder-card strong { font: 600 16px/1.3 var(--body); }
.folder-card small { color: var(--muted); font-size: 13px; }
.folder-pics { display: flex; gap: 6px; }
.model-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); align-items: start; }
.model-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.model-card > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; cursor: pointer; list-style: none; min-height: 64px; }
.model-card > summary::-webkit-details-marker { display: none; }
.model-card .m-name strong { display: block; font-weight: 600; }
.model-card .m-name small { color: var(--muted); font-size: 13px; }
.model-card .m-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.model-card .m-count { color: var(--dim); font-variant-numeric: tabular-nums; }
.unit-list { list-style: none; margin: 0; padding: 4px 14px 12px; display: grid; gap: 4px; }
.unit-list li { display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid var(--line); }
.unit-list li span:first-child { flex: 1; font-variant-numeric: tabular-nums; }

/* Приёмка */
.back { margin-bottom: -8px; }
.sheet-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sheet-list { display: grid; gap: 8px; }
.sheet-row { padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: grid; gap: 10px; }
.sheet-row.is-done { border-color: rgb(221 242 71 / .4); }
.sheet-row.has-issue { border-color: rgb(233 181 132 / .6); }
.sheet-main { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.accept-check { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 52px; flex: 1; min-width: 220px; }
.accept-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.accept-check .box { width: 32px; height: 32px; flex: none; border-radius: 10px; border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; transition: background .15s, border-color .15s; }
.accept-check .box svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.accept-check input:checked + .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.accept-check input:focus-visible + .box { outline: 2px solid var(--accent); outline-offset: 3px; }
.accept-check.static .box { color: var(--accent); border-color: var(--line); }
.sheet-row.has-issue .accept-check.static .box { color: var(--orange); }
.accept-check .who strong { display: block; font-weight: 600; }
.accept-check .who small { color: var(--muted); font-size: 13px; }
.issue-block { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.issue-block .full { grid-column: 1 / -1; }
.issue-note { margin: 0; color: var(--dim); }
.sheet-page { padding-bottom: 8px; }
.sheet-bar { position: sticky; bottom: 0; display: grid; gap: 10px; padding: 14px 0 16px; background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -12px 16px -8px var(--bg); }
.sheet-bar .button { width: 100%; min-height: 48px; justify-content: center; }
.sheet-bar .button:disabled { opacity: .45; cursor: not-allowed; }
.issue-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; }
.issue-body { display: grid; gap: 8px; }
.history-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.history-list li { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }

/* Расписание и мелочи */
.free-days { margin: 0; }
.date-jump { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 13px; margin-left: auto; }
.date-jump input { min-height: 40px; }
.tab .count { margin-left: 4px; }
.gear-request { gap: 12px; }

/* Телефон: цели не меньше 44 px, профиль и выход доступны, ничего не выезжает за экран */
.topbar-profile { display: none; }
@media (max-width: 640px) {
  .topbar-profile { display: inline-grid; }
  body.live .button { min-height: 44px; }
  body.live .icon-button, body.live #bell { min-width: 44px; min-height: 44px; width: 44px; height: 44px; }
  .chip, .crumb { min-height: 44px; }
  .stepper button { width: 44px; height: 44px; }
  .stepper input { height: 44px; width: 56px; }
  .password-row .reveal { min-height: 44px; }
  body.live .field input, body.live .field select, body.live .field textarea { font-size: 16px; min-height: 48px; }
  body.live .event-row > .tag.type-tag { font-size: 12px; width: auto; height: auto; padding: 3px 9px; border-radius: 999px; }
  body.live .sidebar .nav-item span:not(.nav-badge) { font-size: 11px; }
  body.live dialog .dialog-body { padding: 4px 16px 20px; }
  body.live dialog .dialog-head { padding: 16px 16px 8px; }
  body.live .dialog-body .form-actions { margin: 16px -16px -20px; padding: 12px 16px 16px; bottom: -20px; }
  .date-jump { margin-left: 0; width: 100%; }
  .model-card > summary { grid-template-columns: auto minmax(0, 1fr); }
  .model-card .m-meta { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
}
@media (min-width: 641px) and (max-width: 950px) {
  .sidebar .nav-item span:not(.nav-badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
@media (prefers-reduced-motion: reduce) {
  .folder-card, .accept-check .box, .pick-folder > summary::after { transition: none; }
  .folder-card:hover { transform: none; }
}

/* Календарь расписания: цвет и подпись показывают тип заявки (аренда студии, аренда техники, продакшн) */
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.seg-btn { min-height: 38px; padding: 0 16px; border: 0; border-radius: 9px; background: none; color: var(--dim); font: inherit; font-weight: 500; cursor: pointer; }
.seg-btn:hover { color: var(--text); }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--dim); font-size: 13px; }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; background: var(--c); box-shadow: inset 0 0 0 1px var(--cb); }
.swatch.studio, .cal-ev.studio, .m-ev.studio { --c: rgb(221 242 71 / .2); --cb: rgb(221 242 71 / .7); }
.swatch.rental, .cal-ev.rental, .m-ev.rental { --c: rgb(233 181 132 / .22); --cb: rgb(233 181 132 / .75); }
.swatch.production, .cal-ev.production, .m-ev.production { --c: rgb(185 162 237 / .24); --cb: rgb(185 162 237 / .8); }

.cal-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.cal-grid { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(0, 1fr)); min-width: min(100%, 760px); }
.cal-grid[style*="--cols:1"] { min-width: 0; }
.cal-head { height: 52px; display: grid; place-content: center; text-align: center; border-bottom: 1px solid var(--line); line-height: 1.2; }
.cal-head small { color: var(--muted); text-transform: lowercase; font-size: 12px; }
.cal-head b { font: 600 18px/1.2 var(--body); font-variant-numeric: tabular-nums; }
.cal-col.today .cal-head b { color: var(--accent); }
.cal-col { border-left: 1px solid var(--line); min-width: 0; }
.cal-gutter { color: var(--muted); font-size: 12px; }
.cal-hours { position: relative; }
.cal-hours span { position: absolute; right: 8px; transform: translateY(-50%); font-variant-numeric: tabular-nums; }
.cal-body { position: relative; cursor: copy; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 51px, var(--line) 51px, var(--line) 52px); }
.cal-body:hover { background-color: rgb(255 255 255 / .02); }
.cal-ev { position: absolute; display: grid; align-content: start; gap: 2px; padding: 4px 8px; border: 0; border-radius: 8px; background: var(--c); box-shadow: inset 0 0 0 1px var(--cb); color: var(--text); text-align: left; font: inherit; font-size: 12px; line-height: 1.25; overflow: hidden; cursor: pointer; z-index: 1; }
.cal-ev strong { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev span { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cal-ev:hover { filter: brightness(1.2); }
.now-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--danger); z-index: 2; pointer-events: none; }

.day-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.day-strip::-webkit-scrollbar { display: none; }
.day-pill { flex: 1; min-width: 46px; min-height: 64px; display: grid; place-content: center; gap: 2px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; position: relative; }
.day-pill small { color: var(--muted); font-size: 12px; text-transform: lowercase; }
.day-pill b { font-variant-numeric: tabular-nums; }
.day-pill.today b { color: var(--accent); }
.day-pill.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day-pill.on small, .day-pill.on b { color: var(--accent-ink); }
.day-pill i { position: absolute; bottom: 6px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: currentColor; }

.m-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.m-wd { padding: 8px 6px; background: var(--surface); color: var(--muted); font-size: 12px; text-align: center; }
.m-cell { min-height: 108px; padding: 4px; background: var(--surface); display: grid; align-content: start; gap: 3px; min-width: 0; }
.m-cell.out { background: var(--bg); }
.m-cell.out .m-num { color: var(--muted); }
.m-cell.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.m-num { justify-self: start; min-width: 32px; min-height: 32px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: 600 14px/1 var(--body); cursor: pointer; font-variant-numeric: tabular-nums; }
.m-cell.today .m-num { background: var(--accent); color: var(--accent-ink); }
.m-num:hover { background: var(--card); }
.m-cell.today .m-num:hover { background: var(--accent); }
.m-ev { display: block; width: 100%; padding: 2px 6px; border: 0; border-radius: 6px; background: var(--c); box-shadow: inset 0 0 0 1px var(--cb); color: var(--text); text-align: left; font: inherit; font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.m-ev span { color: var(--dim); font-variant-numeric: tabular-nums; }
.m-more { justify-self: start; border: 0; background: none; color: var(--dim); font: inherit; font-size: 12px; cursor: pointer; padding: 2px 6px; }
.m-more:hover { color: var(--text); }
@media (max-width: 720px) {
  .m-cell { min-height: 64px; padding: 2px; }
  .m-ev { width: 8px; height: 8px; padding: 0; font-size: 0; border-radius: 50%; display: inline-block; box-shadow: none; background: var(--cb); }
  .m-cell { grid-auto-flow: row; }
  .m-more { display: none; }
  .seg-btn { padding: 0 12px; }
}

/* Цены и документ заявки */
.price { color: var(--accent); font-variant-numeric: tabular-nums; }
.quote-line { padding: 10px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); color: var(--dim); }
.quote-line strong { color: var(--text); font-variant-numeric: tabular-nums; }
.doc-page { gap: 16px; }
.od-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: end; }
.od-disc { display: inline-flex; gap: 6px; }
.od-disc input { width: 90px; }

.price-edit { display: grid; gap: 8px; padding: 4px 14px 8px; }
.price-edit input { max-width: 220px; }
.money-page .live-head { margin-bottom: 4px; }

/* Режим приложения: вырезы экрана и нижняя панель на телефоне, окно на компьютере */
.install-box { display: grid; gap: 10px; margin: 12px 0; padding: 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.install-box p { margin: 0; color: var(--dim); }
@media (max-width: 640px) {
  body.live .sidebar { height: calc(66px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); }
  body.live main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body.live .topbar { padding-top: env(safe-area-inset-top); }
}
@media (display-mode: standalone) { body.live .topbar { padding-top: max(8px, env(safe-area-inset-top)); } }

/* Логин сотрудника на экране приглашения и в окне ссылки: крупно, чтобы не потерять */
.login-badge { display: grid; gap: 4px; margin: 4px 0 16px; padding: 14px 16px; border-radius: 14px; background: rgb(221 242 71 / .1); border: 1px solid rgb(221 242 71 / .45); }
.login-badge span { font-size: 13px; color: var(--dim); }
.login-badge strong { font: 600 24px/1.2 var(--body); letter-spacing: .01em; color: var(--accent); word-break: break-all; }
.login-badge small { color: var(--dim); font-size: 13px; }
#invite-text { width: 100%; font-size: 13px; }
.admin-table input[type="email"] { min-height: 40px; width: 100%; min-width: 180px; }

/* Брони в календаре различаются цветом, значком и подписью типа; черновик пунктирный */
.cal-ev .ev-type, .tag.type-tag { display: inline-flex; align-items: center; gap: 4px; }
.cal-ev .ev-type { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev .ev-type svg, .tag.type-tag svg, .m-ev svg { width: 12px; height: 12px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; }
.cal-ev.studio .ev-type svg, .m-ev.studio svg { color: var(--accent); }
.cal-ev.rental .ev-type svg, .m-ev.rental svg { color: var(--orange); }
.cal-ev.production .ev-type svg, .m-ev.production svg { color: var(--purple); }
.m-ev { display: flex; align-items: center; gap: 4px; }
.cal-ev.draft, .m-ev.draft { box-shadow: inset 0 0 0 1px var(--cb); outline: 1px dashed var(--cb); outline-offset: -3px; background: transparent; }
/* Перетаскивание */
.cal-ev[data-drag], .m-ev[data-drag] { touch-action: none; cursor: grab; user-select: none; }
.cal-dragging, .cal-dragging * { cursor: grabbing !important; }
.cal-ev.dragging, .m-ev.dragging { z-index: 5; opacity: .9; box-shadow: inset 0 0 0 2px var(--cb), 0 12px 24px -12px rgb(0 0 0 / .7); }
.cal-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; cursor: ns-resize; }
.cal-resize::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 24px; height: 3px; margin-left: -12px; border-radius: 2px; background: var(--cb); opacity: .8; }
.drag-tip { position: absolute; left: 4px; bottom: 100%; margin-bottom: 4px; padding: 3px 8px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: 12px; white-space: nowrap; pointer-events: none; }
.m-cell.drop-target { box-shadow: inset 0 0 0 2px var(--accent); background: rgb(221 242 71 / .06); }
.drag-undo.bad { border-color: rgb(239 148 137 / .6); }
@media (prefers-reduced-motion: reduce) { .cal-ev.dragging { transition: none; } }

/* Бронь студии: правка состава техники (−/+), освободить под аренду */
.st-qty { display: inline-flex; align-items: center; gap: 4px; }
.st-qty .icon-button { width: 32px; height: 32px; font-size: 18px; line-height: 1; }
.st-qty .bk-qty { min-width: 22px; text-align: center; }
.bk-cart-row.off > div { color: var(--dim); text-decoration: line-through; }
.st-qty-note { display: block; color: var(--orange); }
.st-qty-reset { margin: 6px 0; }
.st-add-gear { margin-top: 8px; }
@media (pointer: coarse) { .st-qty .icon-button { width: 44px; height: 44px; } }
