:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #2f6fde; --accent-soft: #e8f0fd;
  --done: #1f8a4c; --done-bg: #e5f5eb;
  --ready: #2f6fde; --ready-bg: #e8f0fd;
  --wait: #a06a00; --wait-bg: #fdf3dc;
  --warn: #c62828; --warn-bg: #fde8e8;
  --todo: #8a8f98; --todo-bg: #f0f1f3;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--muted); }

.top { display: flex; align-items: center; gap: 20px; padding: 10px 24px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.top nav { display: flex; gap: 4px; }
.top nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); }
.top nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.top nav a:hover { text-decoration: none; color: var(--text); }
#search { margin-left: auto; width: 320px; max-width: 100%; }

main { max-width: 1180px; margin: 0 auto; padding: 24px; }
.head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.head .spacer { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 18px; overflow-x: auto; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; flex: 1; }

input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); width: 100%; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
button { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--text); }
button:hover { border-color: #c5cad3; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--warn); }
button.small { padding: 4px 10px; font-size: 13px; }
button.ghost { background: transparent; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; cursor: pointer; }
.stat b { display: block; font-size: 26px; }
.stat.sel { outline: 2px solid var(--accent); }
.stat.warn b { color: var(--warn); } .stat.ready b { color: var(--ready); } .stat.wait b { color: var(--wait); } .stat.done b { color: var(--done); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fafbfc; }
td.empty { color: var(--muted); text-align: center; padding: 24px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.b-done { background: var(--done-bg); color: var(--done); }
.b-ready { background: var(--ready-bg); color: var(--ready); }
.b-wait { background: var(--wait-bg); color: var(--wait); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-todo { background: var(--todo-bg); color: var(--todo); }
.progress { width: 70px; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; display: inline-block; vertical-align: middle; }
.progress i { display: block; height: 100%; background: var(--done); }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.step { border: 1px solid var(--line); border-top: 4px solid var(--todo); border-radius: 10px; padding: 10px 12px; background: #fff; }
.step.done { border-top-color: var(--done); } .step.ready { border-top-color: var(--ready); }
.step.wait { border-top-color: var(--wait); } .step.warn { border-top-color: var(--warn); background: #fffafa; }
.step .t { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.step .h { font-size: 13px; color: var(--muted); }
.step.warn .h { color: var(--warn); }
.next { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; }
.next.warn { background: var(--warn-bg); } .next.ready { background: var(--ready-bg); } .next.wait { background: var(--wait-bg); } .next.done, .next.todo { background: var(--done-bg); }

.info { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 20px; }
.info div span { display: block; font-size: 12px; color: var(--muted); }
.docs { display: flex; flex-wrap: wrap; gap: 8px; }
.docs a { padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.docs a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols .card { margin-bottom: 0; }
.owner-list .animals { color: var(--muted); font-size: 13px; }

dialog { border: none; border-radius: 14px; padding: 22px; width: min(720px, 95vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20,25,35,.45); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.grid label.wide { grid-column: 1 / -1; }
.grid label small { color: var(--wait); }
.actions { display: flex; gap: 8px; margin-top: 18px; align-items: center; }
.actions .spacer { flex: 1; }
.error { color: var(--warn); min-height: 1em; margin: 10px 0 0; }

#toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1d2330; color: #fff; padding: 10px 18px; border-radius: 10px; opacity: 0; transition: opacity .2s; pointer-events: none; }
#toast.show { opacity: 1; }
.note { font-size: 13px; color: var(--muted); margin-top: 10px; }
a.btn { display: inline-block; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); }
a.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.copy { display: flex; gap: 8px; margin-top: 8px; }
.copy input { flex: 1; }
.msgs { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow: auto; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; max-width: 80%; }
.msg.out { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.msg-meta { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.msg-text { white-space: pre-wrap; word-break: break-word; }
ol.muted { padding-left: 20px; }
ol.muted li { margin-bottom: 4px; }
main.wide { max-width: none; }
.grid-wrap { overflow: auto; max-height: calc(100vh - 190px); background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
table.sheet { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; font-size: 13px; }
.sheet th, .sheet td { padding: 0; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); height: 30px; vertical-align: middle; }
.sheet thead th { position: sticky; top: 0; z-index: 2; background: #f0f2f5; padding: 6px 6px; text-transform: none; letter-spacing: 0; font-size: 12px; color: #444; }
.sheet tfoot td { position: sticky; bottom: 0; background: #f0f2f5; padding: 0 6px; font-weight: 600; }
.sheet td.num, .sheet th.num { text-align: right; }
.sheet input { border: 0; border-radius: 0; padding: 4px 6px; height: 29px; background: transparent; font-size: 13px; }
.sheet input:focus { outline: 2px solid var(--accent); outline-offset: -2px; background: #fff; }
.sheet input.num { text-align: right; }
.sheet input.bad { color: var(--warn); font-weight: 600; }
.sheet input.excl { color: var(--todo); }
.sheet input.err { background: var(--warn-bg); }
.sheet input[type=date] { padding: 2px 4px; }
.sheet input[type=checkbox] { width: auto; height: auto; margin: 0; }
.sheet td.flag { text-align: center; }
.sheet td.calc { padding: 0 6px; font-weight: 600; background: #fafbfc; }
.sheet td.rn { color: var(--muted); text-align: center; font-size: 11px; background: #fafbfc; }
.sheet td.links, .sheet td.acts { text-align: center; white-space: nowrap; }
.sheet td[data-calc=status] { padding: 0 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sheet tr.month td { background: #eef3fc; padding: 0 6px; height: 32px; }
.sheet tr.month td.num { font-weight: 600; }
.sheet tr.saved td { background: var(--done-bg); transition: background .3s; }
button.icon { border: 0; background: transparent; color: var(--muted); padding: 2px 6px; }
button.icon:hover { color: var(--warn); }
.stat.urgent b { color: var(--warn); }
.stat.now b { color: var(--ready); }
.urgent-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 700; background: var(--warn); color: #fff; white-space: nowrap; }
tr.urgent-row td { background: #fff6f6; }
.sheet tr.urgent-row td { background: #fff1f1; }
.check-card { grid-column: span 1; flex-direction: column; align-items: flex-start; display: flex; align-items: center; gap: 12px; justify-content: space-between; cursor: default; }
.stat.passport b, .stat.titer b { color: var(--warn); }
.sheet td.c-ok { background: #e9f7ef; }
.sheet td.c-wait { background: #fff6dc; }
.sheet td.c-bad { background: #fde3e3; }
.sheet td.c-grey { background: #f0f1f3; }
code { background: var(--todo-bg); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

@media (max-width: 900px) {
  .steps { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cols, .grid { grid-template-columns: 1fr; }
  main { padding: 16px; }
  #search { width: 100%; }
}

/* ширина колонок */
.sheet thead th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet th .rz { position: absolute; top: 0; right: 0; width: 8px; height: 100%; cursor: col-resize; z-index: 3; touch-action: none; }
.sheet th .rz:hover, .sheet th .rz.active { background: rgba(255,255,255,.55); }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none; }
.sheet td { overflow: hidden; }

/* ================================================================ как в Google-таблицах */
.grid-wrap { border: 1px solid #c4c7c5; border-radius: 6px; box-shadow: none; }
table.sheet { font-family: Arial, "Segoe UI", sans-serif; }
.sheet th, .sheet td { border-right: 1px solid #e2e3e3; border-bottom: 1px solid #e2e3e3; }
.sheet thead th { background: #f8f9fa; color: #1f1f1f; font-weight: 700; font-size: 12.5px; border-bottom: 1px solid #c4c7c5; }
.sheet thead th .rz:hover, .sheet thead th .rz.active { background: #1a73e8; }
.sheet td.rn { background: #f8f9fa; color: #5f6368; border-right: 1px solid #c4c7c5; cursor: context-menu; }
.sheet tr.month td { background: #fff2cc; color: #1f1f1f; font-weight: 600; border-bottom: 1px solid #e2e3e3; }
.sheet td.calc { background: transparent; }
.sheet tfoot td { background: #f8f9fa; color: #1f1f1f; border-top: 1px solid #c4c7c5; }
.sheet td.st { padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.sheet input:focus { outline: 2px solid #1a73e8; background: transparent; }
.sheet tr.urgent-row td { background: transparent; }
.sheet tr.urgent-row td[data-cell=travel_date] input { color: #d93025; font-weight: 700; }
.sheet tr.saved td { box-shadow: inset 0 0 0 9999px rgba(26,115,232,.08); }
.sheet input.tg { color: inherit; }

/* палитра заливки */
.palette { position: fixed; z-index: 50; background: #fff; border: 1px solid #dadce0; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.2); padding: 10px 12px; width: 252px; font-size: 13px; }
.pal-head { margin-bottom: 6px; }
.pal-scope { display: flex; gap: 14px; margin-bottom: 8px; }
.pal-scope label { display: flex; align-items: center; gap: 4px; }
.pal-scope input { width: auto; }
.pal-clear { width: 100%; text-align: left; padding: 5px 8px; margin-bottom: 8px; font-size: 13px; }
.pal-grid { display: grid; grid-template-columns: repeat(10, 20px); gap: 4px; }
.pal-own { margin-top: 8px; }
.pal-own div { display: flex; gap: 4px; margin-top: 4px; }
.sw { width: 20px; height: 20px; padding: 0; border: 1px solid rgba(0,0,0,.15); border-radius: 50%; cursor: pointer; }
.sw:hover { transform: scale(1.15); border-color: #1a73e8; }
.pal-chip { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; border-top: 1px solid #eee; padding-top: 8px; }
.pal-chip button { text-align: left; padding: 5px 8px; font-size: 13px; }
.pal-chip button.on { border-color: #1a73e8; background: #e8f0fe; }

/* пустые строки внизу таблицы */
.sheet tr.blank td.rn { color: #9aa0a6; }

/* версия, плашка обновления, история версий */
.app-ver { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.app-ver:hover { color: var(--accent); }
.ttn-chip.warn { background: #fef3c7; border-color: #f59e0b; }
.pt-src { font-size: 12px; margin-top: 3px; }
.app-hist { font-size: 12.5px; color: var(--muted); white-space: nowrap; text-decoration: none; }
.app-hist:hover, .app-hist.active { color: var(--accent); }
.upd-bar { position: fixed; right: 30px; bottom: 28px; z-index: 60; width: min(300px, calc(100% - 24px));
  background: #fff; border: 1.5px solid var(--accent); border-radius: 14px; padding: 11px 14px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.upd-text { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; }
.upd-text div { font-size: 12px; color: var(--muted); font-weight: 700; margin-top: 1px; font-variant-numeric: tabular-nums; }
dialog.changelog { width: min(640px, 95vw); max-height: 85vh; padding: 18px 22px; }
.cl-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -18px; background: #fff; padding-top: 4px; }
.cl-head h2 { margin: 0; }
.cl-entry { padding: 14px 0 8px; border-top: 1px solid var(--line); }
.cl-entry:first-child { border-top: 0; }
.cl-ver { display: flex; align-items: baseline; gap: 10px; }
.cl-ver b { font-size: 17px; }
.cl-ver span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cl-title { font-weight: 700; margin: 2px 0 4px; }
.cl-sec { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 8px 0 3px; }
.cl-item { display: flex; gap: 8px; line-height: 1.45; padding: 2px 0; }
.cl-item span:first-child { color: var(--done); }

/* дашборд: строка проверки под счётчиками */
.check-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px 0 16px; font-size: 13px; }

/* выделение строк по номеру, как в Google-таблицах */
.sheet td.rn { cursor: pointer; user-select: none; }
.sheet td.rn:hover { background: #e8eaed; }
.sheet tr.sel td { box-shadow: inset 0 0 0 9999px rgba(26,115,232,.10); }
.sheet tr.sel td.rn { background: #d3e3fd; color: #0b57d0; font-weight: 700; box-shadow: none; }
.sheet thead th { cursor: context-menu; }

/* меню колонок и заголовков */
.palette.menu { width: auto; padding: 6px; }
.palette.menu button { display: block; width: 100%; text-align: left; border: 0; padding: 7px 10px; font-size: 13px; }
.palette.menu button:hover { background: #f1f3f4; }
.palette.cols-menu { width: 280px; }
.cols-list { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; margin: 6px 0; }
.cols-list label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cols-list input { width: auto; }
.pal-chip button.danger { color: var(--warn); }

/* «Добавить N строк внизу», как в Google-таблицах */
.add-rows { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; color: #444; background: #fff; border-top: 1px solid #e2e3e3; }
.add-rows input { width: 80px; padding: 5px 8px; }
.add-rows button { padding: 5px 14px; }

/* жирный шрифт в ячейках (Ctrl+B) */
.sheet td[data-b], .sheet td[data-b] input { font-weight: 700; }
.bold-btn { min-width: 38px; font-size: 15px; }
.pal-bold { width: 100%; text-align: left; padding: 5px 8px; margin-bottom: 6px; font-size: 13px; }
.pal-bold.on { border-color: #1a73e8; background: #e8f0fe; }

.pal-sub { font-size: 12px; color: var(--muted); font-weight: 600; margin: 2px 0 4px; }

/* контакт в один клик */
.sheet td.ct { position: relative; }
.sheet td.ct input { padding-right: 24px; }
.ct-link { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; line-height: 20px; text-align: center;
  border-radius: 50%; color: #229ed9; font-size: 13px; text-decoration: none; }
.ct-link:hover { background: #229ed9; color: #fff; text-decoration: none; }
.ct-ico { color: #229ed9; text-decoration: none; padding: 0 3px; border-radius: 50%; }
.ct-ico:hover { background: #229ed9; color: #fff; text-decoration: none; }

/* весь текст в таблице — по центру */
.sheet th, .sheet td, .sheet td.num, .sheet th.num,
.sheet input, .sheet input.num, .sheet td.st, .sheet td.calc, .sheet tr.month td { text-align: center; }
.sheet input[type=date]::-webkit-datetime-edit { display: flex; justify-content: center; }
.sheet td.ct input { padding-left: 3px; padding-right: 21px; } /* место под значок ✈ справа, текст не обрезается */

/* «Оплата» — выпадающий список в ячейке */
.sheet select { border: 0; background: transparent; width: 100%; height: 29px; padding: 0 4px; font-size: 13px; text-align: center; text-align-last: center; cursor: pointer; }
.sheet select:focus { outline: 2px solid #1a73e8; outline-offset: -2px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* масштаб таблицы */
.zoom { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.zoom button { border: 0; border-radius: 0; padding: 7px 11px; font-size: 15px; line-height: 1; }
.zoom select { border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; width: auto; padding: 7px 6px; }

/* вход */
body.auth-mode .top nav, body.auth-mode #search, body.auth-mode .app-ver, body.auth-mode .app-hist, body.auth-mode .user-box { display: none; }
.auth-card { max-width: 380px; margin: 60px auto; display: flex; flex-direction: column; gap: 12px; }
.auth-card h1 { margin-bottom: 4px; }
.auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.user-box { font-size: 13px; color: var(--muted); white-space: nowrap; }
.user-box a { margin-left: 6px; }

/* Новая почта: выбор города и отделения */
.np-city { position: relative; }
.np-suggest { position: absolute; z-index: 30; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.15); max-height: 240px; overflow: auto; padding: 4px; }
.np-suggest button { display: block; width: 100%; text-align: left; border: 0; padding: 6px 8px; font-size: 13px; color: var(--text); }
.np-suggest button:hover { background: #f1f3f4; }
.np-suggest div { padding: 6px 8px; font-size: 13px; }
dialog.ttn-dlg { width: min(760px, 96vw); }

/* перестановка колонок */
.sheet thead th[draggable] { cursor: grab; }
.sheet thead th.dragging { opacity: .45; }
.sheet thead th.drop-l { box-shadow: inset 3px 0 0 #1a73e8; }
.sheet thead th.drop-r { box-shadow: inset -3px 0 0 #1a73e8; }

/* меню аккаунтов */
.acc-btn { border: 1px solid var(--line); background: #fff; padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.palette.acc-menu { width: 280px; }
.palette.acc-menu button[disabled] { color: var(--text); opacity: 1; cursor: default; background: #e8f0fe; }
.palette.acc-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* мастер регистрации */
.reg-card { max-width: 720px; margin: 30px auto; }
.reg-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 16px; }
.reg-steps span { padding: 4px 10px; border-radius: 99px; background: var(--todo-bg); color: var(--muted); font-size: 13px; font-weight: 600; }
.reg-steps span.on { background: var(--accent); color: #fff; }
.reg-steps span.done { background: var(--done-bg); color: var(--done); }
.reg-form { display: flex; flex-direction: column; gap: 10px; }
.reg-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

.pal-chip a.btn { display: block; text-align: left; padding: 5px 8px; font-size: 13px; }
a.btn.small-link { padding: 4px 10px; font-size: 13px; }

.time-range { display: flex; align-items: center; gap: 6px; }
.time-range input { width: auto; flex: 1; }

ol.reg-howto { padding-left: 20px; line-height: 1.55; }
ol.reg-howto li { margin-bottom: 6px; }

/* вкладки таблицы, как листы в Google-таблицах */
.sheet-tabs { display: flex; gap: 2px; margin: -6px 0 10px; border-bottom: 1px solid #c4c7c5; }
.sheet-tabs a { padding: 7px 18px; border: 1px solid transparent; border-bottom: none; border-radius: 8px 8px 0 0;
  color: #444; font-weight: 600; font-size: 14px; text-decoration: none; margin-bottom: -1px; }
.sheet-tabs a:hover { background: #f1f3f4; text-decoration: none; }
.sheet-tabs a.on { background: #fff; border-color: #c4c7c5; color: #0b57d0; }

/* «ТТ»: вышли / ждём / нет — метка видна на любой заливке строки */
.tt-badge { display: inline-block; margin-left: 5px; padding: 0 7px; border: 1px solid; border-radius: 10px; font-size: 11.5px;
  font-weight: 700; line-height: 17px; vertical-align: middle; white-space: nowrap; text-decoration: none; }
a.tt-badge:hover { text-decoration: underline; }
.tt-badge.ok { background: #e6f4ea; color: #137333; border-color: #34a853; }
.tt-badge.old { background: #f3f4f6; color: #4b5563; border-color: #9ca3af; }
.doc-issues { font-size: 13px; line-height: 1.45; margin-bottom: 4px; }
.doc-warn { display: inline-block; margin-left: 3px; padding: 0 3px; border: 1px solid #ea4335; border-radius: 8px;
  background: #fce8e6; color: #c5221f; font-size: 11px; line-height: 15px; font-weight: 700; cursor: help; }
/* 👤 заказ через партнёра (Иру) в работе — у клички */
.sheet td[data-via] { position: relative; }
.sheet td[data-via]::after { content: "👤"; position: absolute; right: 3px; top: 50%; transform: translateY(-50%); font-size: 11px; pointer-events: none; }
.via-mark { font-size: 12px; }
.tt-badge.wait { background: #fef7e0; color: #8a5a00; border-color: #f9ab00; }
.tt-badge.bad { background: #fce8e6; color: #c5221f; border-color: #ea4335; }

/* что перенеслось из Google-таблицы */
.sync-changes { margin-top: 6px; }
.sync-changes summary { cursor: pointer; color: #0b57d0; }
.sync-changes ul { margin: 6px 0 0; padding-left: 20px; max-height: 220px; overflow: auto; font-size: 13px; }
.tt-badge.none { background: #f1f3f4; color: #3c4043; border-color: #9aa0a6; }

/* таблицу тянут мышкой */
.grid-wrap.panning, .grid-wrap.panning * { cursor: grabbing !important; user-select: none !important; }
/* ползунок ◀ ▶ внизу экрана */
.hbar { position: sticky; bottom: 8px; z-index: 6; display: flex; align-items: center; gap: 8px; margin-top: 8px;
  padding: 6px 8px; background: rgba(255, 255, 255, .96); border: 1px solid #c4c7c5; border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.hbar[hidden] { display: none; }
.hbar-btn { padding: 2px 12px; font-size: 12px; line-height: 18px; }
.hbar-track { position: relative; flex: 1; height: 16px; background: #e8eaed; border-radius: 8px; cursor: pointer; }
.hbar-thumb { position: absolute; top: 0; left: 0; height: 100%; background: #9aa0a6; border-radius: 8px; cursor: grab; touch-action: none; }
.hbar-thumb:hover, .hbar-thumb.active { background: #3346d3; }
.hbar-thumb.active { cursor: grabbing; }

/* ползунок внизу — тонкий */
.hbar { bottom: 4px; gap: 4px; margin-top: 4px; padding: 2px 4px; border-radius: 7px; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.hbar .hbar-btn { height: 14px; padding: 0 5px; font-size: 8px; line-height: 12px; border-radius: 4px; }
.hbar-track { height: 8px; border-radius: 4px; }
.hbar-thumb { border-radius: 4px; }

/* ползунок внизу — совсем тонкий, без плашки */
.hbar { bottom: 2px; gap: 3px; margin-top: 2px; padding: 1px 2px; background: rgba(255, 255, 255, .85); border: 0; border-radius: 4px; box-shadow: none; }
.hbar .hbar-btn { height: 10px; padding: 0 3px; font-size: 6px; line-height: 9px; border-radius: 3px; border-color: #dadce0; }
.hbar-track { height: 5px; border-radius: 3px; }
.hbar-thumb { border-radius: 3px; }

/* свои окна вместо системных */
dialog.ask-dlg { width: min(440px, 92vw); padding: 22px 24px 18px; }
dialog.ask-dlg h3 { margin: 0 0 8px; font-size: 18px; }
dialog.ask-dlg p { margin: 0 0 12px; line-height: 1.45; }
dialog.ask-dlg label { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
dialog.ask-dlg input { font-size: 15px; padding: 9px 11px; color: var(--text); }
dialog.ask-dlg label small { font-size: 12px; }
dialog.ask-dlg .actions { margin-top: 16px; }
button.danger-btn { background: var(--warn); color: #fff; border-color: var(--warn); }
button.danger-btn:hover { filter: brightness(1.08); }

/* плашка обновления — справа внизу, над ползунком; выезжает сбоку */
.upd-bar { animation: upd-in .25s ease-out; }
@keyframes upd-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
/* поиск по таблице — результат рядом с вкладками */
.sheet-tabs { align-items: flex-end; }
.sheet-tabs .spacer { flex: 1; }
.grid-found { align-self: center; font-size: 13px; color: #444; padding: 0 4px 4px; white-space: nowrap; }
.grid-found button.icon { padding: 0 4px; }

/* пустые строки внизу — чистые: без «дд.мм.гггг», галочек и списков, пока в строке ничего нет.
   Нажали в ячейку даты — формат появляется; начали печатать — строка становится настоящей со всеми полями */
.sheet tr.blank input[type=date]:not(:focus)::-webkit-datetime-edit { color: transparent; }
.sheet tr.blank input[type=date]:not(:focus)::-webkit-calendar-picker-indicator { opacity: 0; }
.sheet tr.blank input[type=checkbox] { visibility: hidden; }
.sheet tr.blank select:not(:focus) { opacity: 0; }

/* окно регистрации в Animal ID */
dialog.aid-dlg { width: min(620px, 94vw); }
dialog.aid-dlg .grid { margin-top: 4px; }
dialog.aid-dlg label.aid-consent { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; margin-top: 10px; }
dialog.aid-dlg label.aid-consent input { width: auto; }

/* Настройки — выразительнее: тёмный текст, чёткие карточки и поля */
main.settings-page .head h1 { font-size: 26px; }
main.settings-page .head .muted { color: #374151; font-size: 15px; }
main.settings-page .card { border: 1px solid #d3d8e0; border-left: 4px solid var(--accent); border-radius: 12px;
  padding: 20px 22px; box-shadow: 0 1px 3px rgba(16, 24, 40, .06); }
main.settings-page .card h2 { font-size: 19px; font-weight: 700; color: #111827; padding-bottom: 10px; margin-bottom: 14px;
  border-bottom: 1px solid #e5e7eb; }
main.settings-page .card-head { padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid #e5e7eb; }
main.settings-page .card-head h2 { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
main.settings-page .muted { color: #374151; }
main.settings-page .card p, main.settings-page .card li { font-size: 15px; line-height: 1.55; color: #1f2937; }
main.settings-page .card p.muted, main.settings-page .card li.muted { color: #374151; }
main.settings-page .grid label { color: #111827; font-size: 14px; font-weight: 600; gap: 6px; }
main.settings-page .grid label small { font-weight: 500; }
main.settings-page input, main.settings-page select, main.settings-page textarea { border-color: #c3cad5; font-size: 15px; font-weight: 400; }
main.settings-page button:not(.primary):not(.icon) { border-color: #c3cad5; color: #111827; font-weight: 500; }
main.settings-page th { color: #374151; font-size: 12.5px; }
main.settings-page td { color: #111827; }
/* окна — подписи полей тоже тёмные */
dialog.ask-dlg label { color: #111827; font-weight: 600; }
dialog.ask-dlg label small { font-weight: 400; color: #4b5563; }
dialog.ask-dlg p.muted { color: #374151; }

/* один владелец: при наведении на кличку — подсвечены клички всех его животных */
.sheet td.owner-hl { outline: 2px solid rgba(47, 111, 222, .45); outline-offset: -2px; }

/* переход между страницами: если грузится дольше мгновения — тонкая полоска сверху, старая страница бледнеет и не нажимается */
main#view { transition: opacity .1s; }
body.nav-busy main#view { opacity: .6; pointer-events: none; transition: opacity .15s .15s; }
body.nav-busy::after { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; pointer-events: none;
  background: linear-gradient(90deg, transparent, #1a73e8, transparent) no-repeat; background-size: 40% 100%;
  animation: nav-bar 1.1s .15s linear infinite both; }
@keyframes nav-bar { from { background-position: -60% 0; } to { background-position: 160% 0; } }

/* карточка ТТН при наведении */
.ttn-card { position: fixed; z-index: 70; width: 340px; max-width: calc(100vw - 16px); background: #fff; color: #1f1f1f;
  border: 1px solid #dadce0; border-radius: 14px; padding: 12px 14px 10px; font-size: 13px; line-height: 1.35;
  box-shadow: 0 12px 32px rgba(32, 33, 36, .18), 0 2px 6px rgba(32, 33, 36, .08); animation: tc-in .12s ease-out; }
@keyframes tc-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ttn-card .tc-head { display: flex; align-items: center; gap: 8px; }
.ttn-card .tc-self { display: inline-block; margin: 6px 0 2px; padding: 2px 9px; border-radius: 999px; background: #ede9fe;
  color: #5b21b6; font-size: 12.5px; font-weight: 700; }
.ttn-card .tc-row.eta b { color: #1a73e8; }
/* 🔁 ТТН от себя на себя — заметно: плашка в карточке, рамка у статуса, полоса у ячейки */
.ttn-card .tc-row.self b { color: #6d28d9; }
.ttn-card .tc-kind { font-weight: 700; color: #3c4043; }
.ttn-card .tc-pill { margin-left: auto; padding: 3px 11px; border-radius: 999px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.tc-pill.ok { background: #e6f4ea; color: #137333; }
.tc-pill.go { background: #fff0db; color: #b45309; }
.tc-pill.idle { background: #f1f3f4; color: #5f6368; }
.tc-pill.bad { background: #fce8e6; color: #c5221f; }
.ttn-card .tc-num { display: flex; align-items: center; gap: 4px; margin: 6px 0 2px; font: 700 17px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .4px; color: #202124; }
.ttn-card .tc-copy { border: 0; background: transparent; color: #80868b; cursor: pointer; padding: 1px 5px; border-radius: 6px; font-size: 15px; line-height: 1; }
.ttn-card .tc-copy:hover { background: #e8f0fe; color: #1a73e8; }
.ttn-card .tc-steps { display: grid; grid-template-columns: repeat(4, 1fr); margin: 12px -4px 6px; }
.tc-steps div { position: relative; text-align: center; font-size: 11px; color: #9aa0a6; }
.tc-steps div i { position: relative; z-index: 1; display: block; width: 10px; height: 10px; margin: 2px auto 5px; border-radius: 50%; background: #dadce0; }
.tc-steps div:not(:first-child)::before { content: ""; position: absolute; top: 6px; right: 50%; width: 100%; height: 2px; background: #e3e5e8; }
.tc-steps div.done, .tc-steps div.now { color: #3c4043; }
.tc-steps div.done i { background: #34a853; }
.tc-steps div.done::before, .tc-steps div.now::before { background: #34a853 !important; }
.tc-steps div.now i { width: 14px; height: 14px; margin: 0 auto 3px; }
.tc-steps div.now span { font-weight: 700; color: #202124; }
.tc-steps div.now.ok i { background: #34a853; box-shadow: 0 0 0 4px rgba(52, 168, 83, .18); }
.tc-steps div.now.go i { background: #f29900; box-shadow: 0 0 0 4px rgba(242, 153, 0, .2); }
.tc-steps div.now.idle i { background: #9aa0a6; box-shadow: 0 0 0 4px rgba(154, 160, 166, .2); }
.ttn-card .tc-np { color: #5f6368; font-style: italic; margin: 4px 0 2px; }
.ttn-card .tc-note { color: #3c4043; margin: 6px 0 2px; line-height: 1.45; }
.ttn-card .tc-rows { display: grid; gap: 5px; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f1f3f4; }
.ttn-card .tc-row { display: grid; grid-template-columns: 118px 1fr; gap: 8px; }
.ttn-card .tc-row span { color: #5f6368; }
.ttn-card .tc-row b { font-weight: 600; color: #202124; }
.ttn-card .tc-row.warn b { color: #c5221f; }
.ttn-card .tc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 8px; border-top: 1px solid #f1f3f4; font-size: 12px; color: #80868b; }
.ttn-card .tc-foot a { color: #1a73e8; font-weight: 600; text-decoration: none; white-space: nowrap; }
.ttn-card .tc-foot span { white-space: nowrap; }
.ttn-card .tc-foot a:hover { text-decoration: underline; }

/* заглушка вместо ещё не дорисованных строк длинной таблицы */
.sheet tr.gap td { padding: 0; border: 0; background: transparent; }

/* «Кинул»: строка бледная, отметка в «Следующем шаге» — чёткая */
.sheet tr.dropped td:not(.rn):not([data-calc=status]) { opacity: .42; }
.sheet tr.dropped td.rn { text-decoration: line-through; }
/* Задачи: сортировка по колонкам, срочный выезд, копирование чипа, спрятанный список «Кинули» */
.card th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.card th.sortable:hover { color: var(--accent); }
.card th .arr { margin-left: 4px; font-size: 10px; opacity: .35; }
.card th.sorted .arr { opacity: 1; color: var(--accent); }
.card tr.urgent-hot td { background: #ffe8e8; }
.nr-badge { display: inline-block; margin-top: 5px; padding: 1px 8px; border-radius: 999px; background: #fde3e3; color: #b42318; font-size: 12px; font-weight: 700; white-space: nowrap; }
.chip-line { display: flex; align-items: center; gap: 2px; }
.chip-copy { visibility: hidden; border: 0; background: transparent; color: #6b7280; cursor: pointer; padding: 0 5px; border-radius: 6px; font-size: 14px; line-height: 1.3; }
tr:hover .chip-copy { visibility: visible; }
.chip-copy:hover { background: #e8f0fe; color: #1a73e8; }
.dash-hidden { margin-top: 10px; text-align: right; font-size: 13px; }
.dash-hidden a { color: #9ca3af; text-decoration: none; }
.dash-hidden a:hover { color: #374151; text-decoration: underline; }

/* карточка ТТН — компактнее */
.ttn-card { width: 292px; padding: 10px 12px 8px; font-size: 12.5px; border-radius: 12px; }
.ttn-card .tc-num { margin: 4px 0 0; font-size: 15px; }
.ttn-card .tc-steps { margin: 8px -4px 4px; }
.tc-steps div { font-size: 10.5px; }
.ttn-card .tc-route { margin: 4px 0 0; font-weight: 600; color: #3c4043; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttn-card .tc-rows { gap: 3px; margin-top: 6px; padding-top: 6px; }
.ttn-card .tc-row { grid-template-columns: 96px 1fr; }
.ttn-card .tc-note { margin: 4px 0 0; }
.ttn-card .tc-foot { margin-top: 7px; padding-top: 6px; font-size: 11.5px; }

/* календарь для дат в таблице */
.dp { position: fixed; z-index: 80; width: 252px; padding: 10px; background: #fff; border: 1px solid #dadce0; border-radius: 14px;
  box-shadow: 0 12px 32px rgba(32, 33, 36, .18), 0 2px 6px rgba(32, 33, 36, .08); font-size: 13px; user-select: none; animation: tc-in .1s ease-out; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-head b { font-size: 14px; color: #202124; }
.dp button { border: 0; background: transparent; cursor: pointer; font: inherit; color: #202124; border-radius: 8px; padding: 0; }
.dp-head button { width: 30px; height: 30px; font-size: 20px; line-height: 1; color: #5f6368; }
.dp-head button:hover { background: #f1f3f4; color: #1a73e8; }
.dp-week, .dp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-week span { text-align: center; font-size: 11px; font-weight: 600; color: #80868b; padding: 2px 0 4px; }
.dp-days button { height: 31px; font-size: 13px; }
.dp-days button:hover { background: #e8f0fe; color: #1a73e8; }
.dp-days button.we { color: #c5221f; }
.dp-days button.out { color: #bdc1c6; }
.dp-days button.today { box-shadow: inset 0 0 0 1.5px #1a73e8; font-weight: 700; }
.dp-days button.sel { background: #1a73e8; color: #fff; font-weight: 700; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f1f3f4; }
.dp-foot button { padding: 5px 10px; font-size: 12.5px; font-weight: 600; color: #1a73e8; }
.dp-foot button:hover { background: #e8f0fe; }
.dp-foot button[data-clear] { color: #5f6368; }

/* «Настройки» — шестерёнка справа вверху */
.gear { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; color: var(--muted); }
.gear:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.gear.active { background: var(--accent-soft); color: var(--accent); }
.gear:hover svg { transform: rotate(40deg); }
.gear svg { transition: transform .25s; }
body.auth-mode .gear { display: none; }

/* «⚡ Срочный клиент» */
.urg-mark { font-size: 13px; cursor: help; }
.sheet tr.urg td[data-cell=name] { position: relative; }
.sheet tr.urg td[data-cell=name]::after { content: "⚡"; position: absolute; right: 3px; top: 50%; transform: translateY(-50%); font-size: 11px; pointer-events: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; max-width: 100%; }
.top-right #search { margin-left: 0; }
@media (max-width: 760px) { .top-right { width: 100%; } .top-right #search { flex: 1; } }

/* «Кинул»: заметка */
.drop-note { margin-top: 4px; font-size: 13.5px; color: #374151; font-style: italic; white-space: pre-wrap; }
.drop-note-ic { font-size: 12px; cursor: help; }
dialog.ask-dlg textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
/* «Вышли — не отправлены» — оранжевым */
.b-soon { background: #fff0db; color: #b45309; }
.stat.unsent b { color: #d97706; }

/* верхнее меню «Задачи» / «Таблица» — надписи выразительнее (сами страницы — как были) */
.top nav a { font-weight: 600; color: #1f2937; }
.top nav a:hover { color: #111827; background: #f1f3f4; }
.top nav a.active { font-weight: 700; color: var(--accent); background: var(--accent-soft); }

/* срочный выезд: огонёк заметнее */
.urgent-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 7px; font-size: 13px; font-weight: 700;
  background: #fdeceb; color: #b42318; border: 1px solid #f6c9c6; }
.urgent-pill .fire { font-size: 15px; line-height: 1; display: inline-block; transform-origin: 50% 90%; animation: fire-flicker 1.4s ease-in-out infinite; }
@keyframes fire-flicker { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.18) rotate(3deg); } }
.stat.urgent.hot { border-color: #f5a3a3; background: linear-gradient(180deg, #fff5f5, #fff); box-shadow: 0 0 0 3px rgba(213, 0, 0, .08); }
.stat.urgent.hot b { color: #d50000; }
@media (prefers-reduced-motion: reduce) { .urgent-pill .fire { animation: none; } }
/* Таблица: «⚡ Срочный клиент» — крупная молния у клички */
.sheet tr.urg td[data-cell=name]::after { font-size: 19px; line-height: 1; right: 4px; filter: drop-shadow(0 0 3px rgba(255, 170, 0, .75)); }
.sheet tr.urg td[data-cell=name] input { padding-right: 24px; }
/* Таблица: «Все месяцы», масштаб, «Колонки» — компактно */
main.wide .head { align-items: center; gap: 6px; margin-bottom: 12px; }
main.wide .head > select, main.wide .head > button { height: 30px; padding: 3px 9px; font-size: 13px; border-radius: 7px; }
main.wide .head > select { width: auto; padding-right: 4px; }
main.wide .head .zoom { height: 30px; border-radius: 7px; }
main.wide .head .zoom button { height: 28px; padding: 0 9px; font-size: 14px; }
main.wide .head .zoom select { height: 28px; padding: 0 2px 0 6px; font-size: 13px; }

/* заявка в лабораторию */
dialog.lab-dlg { width: min(1080px, 96vw); max-height: 92vh; padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 60px rgba(17, 24, 39, .28); }
dialog.lab-dlg::backdrop { background: rgba(17, 24, 39, .35); }
.lab-dlg form { display: flex; flex-direction: column; max-height: 92vh; }
.lab-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px 10px; border-bottom: 1px solid var(--line); }
.lab-head h3 { margin: 0; font-size: 18px; }
.lab-cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; padding: 14px 18px; overflow: auto; }
.lab-paste, .lab-contact, .lab-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; color: #4b5563; }
.lab-paste textarea { font-size: 13px; min-height: 110px; resize: vertical; }
.lab-contact { margin-top: 8px; }
.lab-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; margin-top: 10px; }
.lab-fields label.wide { grid-column: 1 / -1; }
.lab-fields input, .lab-fields textarea { padding: 6px 9px; font-size: 14px; font-weight: 400; color: var(--text); }
.lab-fields .from-table { border-color: #b9cdf5; }
.lab-fields .guess { border-color: #f3c46b; background: #fffaf0; }
.lab-fields .miss { border-color: #f1a5a5; background: #fff6f6; }
.lab-miss-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 9px 12px;
  border: 1px solid #f5c2c0; border-radius: 10px; background: #fff4f4; color: #8a1c1c; font-size: 13.5px; }
.lab-ok { padding: 9px 12px; border-radius: 10px; background: #e9f7ef; color: #137333; font-weight: 600; }
.lab-msg { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lab-msg-h { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px; background: #f8f9fa; border-bottom: 1px solid var(--line); font-size: 13px; }
.lab-msg pre { margin: 0; padding: 10px 12px; max-height: 300px; overflow: auto; white-space: pre-wrap; font: 13px/1.45 system-ui, "Segoe UI", sans-serif; }
.lab-dlg .actions { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 18px 14px; border-top: 1px solid var(--line); }
.lab-mark { display: flex; align-items: center; gap: 6px; font-size: 13.5px; }
.lab-mark input { width: auto; }
@media (max-width: 860px) { .lab-cols { grid-template-columns: 1fr; } }
.lab-contact[hidden] { display: none; }
.lab-note { margin-top: 8px; padding: 8px 12px; border: 1px solid #f3d38b; border-radius: 10px; background: #fff8e6; color: #7a4b00; font-size: 13px; }
.lab-paste textarea { overflow: hidden; }

/* заявка: что делаем, чей чип */
.lab-svc { display: flex; gap: 10px; margin-left: auto; margin-right: 10px; font-size: 12.5px; font-weight: 600; }
.lab-svc label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.lab-svc input, .lab-chipown input { width: auto; margin: 0; }
.lab-field { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; color: #4b5563; }
.lab-chip-head { display: flex; align-items: center; gap: 10px; }
.lab-chipown { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: #374151; cursor: pointer; }
.lab-chipown[hidden], .lab-nochip[hidden] { display: none; }
.lab-nochip { font-weight: 400; }
.lab-fields select { padding: 6px 9px; font-size: 14px; font-weight: 400; }
#tariffs { font: 14px/1.5 ui-monospace, Consolas, monospace; }
.lab-fields .lab-chipown, .lab-svc label { flex-direction: row; }

/* заявка: недостающее — мягко; что спросить у клиента и что вписать самим */
.lab-fields .miss { border-color: #f0b4b4; background: #fff; }
.lab-fields .fill { border-color: #f3d38b; background: #fff; }
.lab-miss-box { background: #fff7f7; border-color: #f3caca; color: #7f1d1d; }
.lab-self-box { margin-top: 8px; padding: 8px 12px; border: 1px solid #f3dfa8; border-radius: 10px; background: #fffbf0; color: #6b4e00; font-size: 13px; }
/* Настройки: статус — сразу после названия карточки */
.card-status { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-head.st-head h2 { flex: 0 1 auto; }

/* «Подать заявку» — заметная кнопка в Задачах и Таблице */
button.accent { background: #eef4ff; border-color: #a9c1fb; color: #1d4ed8; font-weight: 600; }
button.accent:hover { background: #e0eaff; border-color: #7da2f7; }
.clients-card .card-head { margin-bottom: 0; }

/* Google-таблица: из Конторы → в Google */
.push-box { margin-top: 14px; padding-top: 12px; border-top: 1px solid #eef0f3; }
.push-head { margin-bottom: 8px; }
.push-box label small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; }
/* перенос в Google: скрипт старый — что сделать */
.push-upd { margin: 10px 0; padding: 10px 14px; border: 1px solid #f3d38b; border-radius: 10px; background: #fff8e6; color: #5c3d00; font-size: 14px; }
.push-upd ol { margin: 6px 0 0; padding-left: 20px; }
.push-upd li { margin: 4px 0; }
/* «⇪ Сверить с Google»: что уйдёт — по животным и ячейкам, ровными колонками */
dialog.push-prev { width: min(760px, calc(100vw - 32px)); border: none; border-radius: 16px; padding: 20px 22px; box-shadow: 0 24px 64px rgba(15, 23, 42, .28); }
dialog.push-prev::backdrop { background: rgba(15, 23, 42, .45); }
dialog.push-prev h3 { margin: 0 0 10px; font-size: 18px; }
.pp-sum, .pp-cols { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; }
.pp-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #eef4ff; color: #1d4ed8; font-size: 12.5px; font-weight: 600; }
.pp-colchip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid #dbe3f0; border-radius: 999px; cursor: pointer; font-size: 13px; }
.pp-colchip input, .pp-name input, .pp-cell input { width: auto; margin: 0; }
.pp-list { max-height: min(52vh, 520px); overflow: auto; border: 1px solid #eef0f3; border-radius: 10px; }
.pp-item { padding: 8px 12px; border-bottom: 1px solid #f1f3f6; }
.pp-item:last-child { border-bottom: none; }
.pp-item.new { background: #f6fbf6; }
.pp-name { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.pp-cells { margin: 4px 0 2px 26px; display: grid; gap: 2px; }
.pp-cell { display: grid; grid-template-columns: 18px 130px 1fr; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.pp-col { color: #4b5563; }
.pp-val { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pp-from { color: #9ca3af; text-decoration: line-through; }
.pp-arrow { color: #9ca3af; }
.pp-to { color: #111827; font-weight: 600; }
.pp-sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .2); }
.pp-note { margin: 10px 0 0; font-size: 12.5px; }
.pp-same { color: #374151; }
.pp-color { display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; font-size: 12.5px; }
/* Задачи → «⇪ В Google: проверить»: по ячейкам, ровными колонками */
.gp-cells { display: grid; gap: 3px; margin-bottom: 6px; }
.gp-cell { display: grid; grid-template-columns: 110px 1fr; align-items: center; column-gap: 8px; row-gap: 1px; font-size: 13.5px; }
.pp-why { font-size: 12px; color: #6b7280; line-height: 1.35; }
.gp-cell .pp-why { grid-column: 2; }
.pp-cell .pp-why { grid-column: 3; margin-top: -4px; }
.gp-new { font-size: 13px; font-weight: 600; color: #166534; }
.push-how { margin: 0 0 10px; font-size: 13px; color: #4b5563; }
.push-how summary { cursor: pointer; color: #1d4ed8; font-weight: 600; }
.push-how ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; }
#push-result p { margin: 8px 0 0; }

/* заявка: кнопка «Создать ТТН» у поля ТТН паспорта; кличка и чип — жирным */
.lab-field.wide { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 600; color: #4b5563; }
.lab-field.wide .lab-chip-head button { margin-left: auto; }
.lab-msg pre b { font-weight: 700; color: #111827; }

/* инструкция по подключению Google-таблицы */
dialog.help-dlg { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 40px); border: none; border-radius: 16px; padding: 20px 24px; box-shadow: 0 24px 64px rgba(15, 23, 42, .28); }
dialog.help-dlg::backdrop { background: rgba(15, 23, 42, .45); }
.help-steps { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 10px; font-size: 14px; line-height: 1.5; color: #1f2937; }
.help-later { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: #f3f4f6; font-size: 13.5px; line-height: 1.5; color: #374151; }
.help-steps kbd { font: 12px ui-monospace, monospace; padding: 1px 5px; border: 1px solid #d1d5db; border-bottom-width: 2px; border-radius: 4px; background: #f9fafb; }
.help-steps .copy { margin-top: 6px; }
#help-result { margin: 6px 0 0; }
.help-dlg .lab-head { padding: 0 0 10px; margin-bottom: 8px; }
.help-dlg .lab-head .spacer { flex: 1; }

/* окно ТТН: что подставлено из заявки */
.ttn-dlg .lab-note { margin: 6px 0; padding: 7px 10px; border-radius: 8px; background: #fffbf0; border: 1px solid #f3dfa8; color: #6b4e00; font-size: 13px; }

/* Задачи: срочный клиент (⚡) — в одной группе со скорым выездом */
.urgent-pill.urg-client { background: #fdeceb; color: #b42318; }

/* строка из окна заявки, а заявку не подали */
.sheet input.draft::placeholder { color: #b42318; font-weight: 700; opacity: 1; }

/* окно заявки: Animal ID по чипу */
.lab-aid { margin-bottom: 8px; padding: 8px 12px; border-radius: 10px; border: 1px solid #e5e7eb; background: #f9fafb; color: #374151; font-size: 13px; }
.lab-aid.ok { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.lab-aid.warn { background: #fffbf0; border-color: #f3dfa8; color: #6b4e00; }

/* «ТТН тест»: титры вышли — кнопка прямо в ячейке; выбор получателя */
.sheet td.has-btn { position: relative; }
.sheet td.has-btn input { padding-right: 58px; }
.cell-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); height: 22px; padding: 0 7px; font-size: 12px;
  font-weight: 700; border-radius: 6px; border: 1px solid #a9c1fb; background: #eef4ff; color: #1d4ed8; cursor: pointer; white-space: nowrap; }
.cell-btn:hover { background: #e0eaff; }
dialog.ttn-who { width: min(520px, calc(100vw - 32px)); }
.who-opt { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px; padding: 10px 12px; margin: 8px 0 !important;
  border: 1px solid #e5e7eb; border-radius: 10px; cursor: pointer; color: #1f2937 !important; font-size: 14px !important; }
.who-opt input { width: auto; margin-top: 3px; }
.who-opt:has(input:checked) { border-color: #93b4fb; background: #f5f8ff; }

/* «ТТН книжка» и «ТТН тест»: кнопка в пустой ячейке — только при наведении, чтобы не пестрило */
.sheet td.has-btn .cell-btn.hover-only { display: none; }
/* чип: ⧉ поверх ячейки только при наведении — номер не сдвигается и не обрезается */
.sheet td.has-copy { position: relative; }
.sheet td.has-copy .cell-copy { display: none; padding: 0 5px; }
.sheet td.has-copy:hover .cell-copy { display: inline-block; }
.sheet td.has-btn:hover .cell-btn.hover-only, .sheet td.has-btn:focus-within .cell-btn.hover-only { display: inline-block; }

/* подтверждение ТТН: откуда → куда, кому, условия — наглядно */
dialog.ttn-confirm { width: min(620px, calc(100vw - 32px)); border: none; border-radius: 16px; padding: 20px 22px; box-shadow: 0 24px 64px rgba(15, 23, 42, .28); }
dialog.ttn-confirm::backdrop { background: rgba(15, 23, 42, .45); }
dialog.ttn-confirm h3 { margin: 0 0 14px; font-size: 18px; }
.route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; }
.route .pt { border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px 12px; background: #f9fafb; min-width: 0; }
.route-arrow { align-self: center; font-size: 22px; color: #9ca3af; }
.pt-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #6b7280; font-weight: 700; margin-bottom: 4px; }
.pt-who { font-weight: 600; color: #111827; }
.pt-place { margin-top: 4px; color: #1f2937; }
.pt-addr { font-size: 12.5px; margin-top: 1px; }
.ttn-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }
.ttn-chip { padding: 4px 10px; border-radius: 999px; background: #eef2ff; font-size: 13px; color: #1f2937; }
@media (max-width: 560px) { .route { grid-template-columns: 1fr; } .route-arrow { transform: rotate(90deg); justify-self: center; } }
/* выбор получателя ТТН на тест — карточки */
.who-body { display: block; min-width: 0; }
.who-title { display: block; font-weight: 700; color: #111827; margin-bottom: 2px; }
.opt-tag { margin-top: 5px; margin-right: 4px; display: inline-block; padding: 1px 8px; border-radius: 999px; background: #f3f4f6; color: #4b5563; font-size: 12px; }

/* меню правой кнопки: действия по ячейке — сверху */
.pal-acts { margin: 6px 0 4px; }
.pal-acts .pal-chip { margin-top: 4px; border-top: none; padding-top: 0; }
.pal-chip button:disabled { opacity: .55; cursor: not-allowed; }
/* доручення: телефон клиента в карточке */
.pt-phone { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; font-size: 12px; color: #6b7280; }
.pt-phone input { font-size: 14px; }
.trustee-note { margin: 8px 0 0; font-size: 12.5px; }

/* 📣 срочные смс: слева кого включить, справа готовое сообщение */
dialog.nudge-dlg { width: min(900px, calc(100vw - 32px)); border: none; border-radius: 16px; padding: 20px 22px; box-shadow: 0 24px 64px rgba(15, 23, 42, .28); }
dialog.nudge-dlg::backdrop { background: rgba(15, 23, 42, .45); }
dialog.nudge-dlg h3 { margin: 0 0 12px; font-size: 18px; }
.nd-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.nd-tabs button { border-radius: 999px; padding: 5px 12px; background: #f3f4f6; border: 1px solid transparent; }
.nd-tabs button.on { background: #eef2ff; border-color: #6366f1; color: #3730a3; font-weight: 600; }
.nd-one { padding: 5px 12px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-weight: 600; }
.nd-count { font-size: 12px; color: #6b7280; margin-left: 2px; font-weight: 400; }
.nd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.nd-list { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow: auto; padding: 1px; }
.nd-all { font-size: 13px; color: #6b7280; }
.nd-all button { background: none; border: none; padding: 0; color: #4f46e5; cursor: pointer; font-size: 13px; }
.nd-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #e5e7eb; border-radius: 12px; padding: 9px 12px; background: #fff; cursor: pointer; }
.nd-card.on { border-color: #a5b4fc; background: #f5f7ff; }
.nd-card.need { cursor: default; background: #fffbeb; border-color: #fde68a; align-items: center; }
.nd-card input[type="checkbox"] { width: 16px; height: 16px; margin: 3px 0 0; flex: none; display: inline-block; }
.nd-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nd-card .ttn-chips { margin: 6px 0 0; }
.ttn-chip.hot { background: #fee2e2; }
.nd-msg { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; }
.nd-head { font-weight: 700; }
.nd-n { text-transform: none; letter-spacing: 0; font-weight: 400; }
.nd-preview { border: 1px solid #e5e7eb; border-radius: 12px; background: #f9fafb; padding: 10px 12px; line-height: 1.45; max-height: 52vh; overflow: auto; font-size: 14px; user-select: text; }
.nd-tip { font-size: 12.5px; }
.nd-badge { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 3px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; }
@media (max-width: 720px) { .nd-grid { grid-template-columns: 1fr; } .nd-msg { position: static; } .nd-list { max-height: 36vh; } .nd-preview { max-height: none; } .nd-tip { display: none; } }

/* заявка подана: оба сообщения рядом, крупно, с кнопками «Скопировать» */
.lab-done .lab-left, .lab-done .lab-svc { display: none; }
.lab-done .lab-cols { grid-template-columns: 1fr; }
.lab-done .lab-right { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: start; }
.lab-done .lab-missing { grid-column: 1 / -1; }
.lab-done .lab-msg pre { max-height: 60vh; font-size: 14px; }
.lab-done .lab-msg-h button { background: #4f46e5; color: #fff; border-color: #4f46e5; }
@media (max-width: 860px) { .lab-done .lab-right { grid-template-columns: 1fr; } }

/* срочные смс по титрам: «Выход» из документа лаборатории */
.nd-out { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 2px; font-size: 13px; }
.nd-out input.nd-date { width: 104px; padding: 2px 6px; font-size: 13px; height: auto; }
.nd-out .nd-src { font-size: 12px; color: #6b7280; }
.nd-out.warn input.nd-date { border-color: #f59e0b; background: #fffbeb; }
.nd-out.warn .nd-src { color: #b45309; }
.nd-out a { font-size: 12.5px; }

/* профиль: смс заявки 1 и 2 рядом */
.prof-sms .card-head { gap: 8px; }
.prof-sms-msgs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: start; }
.prof-sms .lab-msg pre { max-height: 420px; }
@media (max-width: 860px) { .prof-sms-msgs { grid-template-columns: 1fr; } }

/* срочные смс: ⧉ у каждого блока и «⧉ Всё» */
.nd-preview { position: relative; }
.nd-cp-all { position: absolute; top: 8px; right: 8px; }
.nd-blk { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; padding: 7px 0; border-top: 1px dashed #e5e7eb; }
.nd-blk-head { border-top: none; padding: 2px 76px 7px 0; }
.nd-blk-t { min-width: 0; }
.nd-cp { flex: none; border: 1px solid #e5e7eb; background: #fff; border-radius: 8px; padding: 2px 9px; cursor: pointer; color: #4f46e5; font-size: 14px; line-height: 1.4; }
.nd-cp:hover { background: #eef2ff; border-color: #a5b4fc; }

/* окно регистрации в Animal ID: «Животное» и «Владелец» отдельными блоками */
dialog.aid-dlg { width: min(680px, 94vw); }
dialog.aid-dlg h3 { margin-bottom: 12px; }
dialog.aid-dlg .aid-sec { border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px 14px 12px; margin-bottom: 10px; background: #f9fafb; }
dialog.aid-dlg .aid-sec .pt-lbl { margin-bottom: 6px; }
dialog.aid-dlg .aid-sec label.aid-consent { margin-top: 8px; }
dialog.aid-dlg input.miss, dialog.aid-dlg select.miss { border-color: #f59e0b; background: #fffbeb; }
dialog.aid-dlg .lab-note { margin-top: 8px; }

/* шапка: «Подать заявку» и «Срочные смс» — сразу у заголовка; «Колонки» — маленькая */
.head .head-acts { display: flex; gap: 8px; align-items: center; align-self: center; flex-wrap: wrap; }
#grid-cols { padding: 5px 9px; font-size: 14px; line-height: 1.2; }
#grid-cols .cols-n { display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 2px; border-radius: 999px; background: #e5e7eb; color: #4b5563; font-size: 11px; text-align: center; }

/* ТТН конверта: сообщение клиенту */
dialog.book-msg .nd-preview { margin-top: 6px; font-size: 15px; max-height: none; }

/* резервные копии: что уже сделано, что осталось */
.bk-steps { list-style: none; margin: 4px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.bk-steps li span { display: inline-block; width: 18px; color: #9ca3af; }
.bk-steps li.ok span { color: #16a34a; font-weight: 700; }

/* тарифы и сертификат: фиксированные строки, цена — своя */
.price-rows { display: flex; flex-direction: column; gap: 8px; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 10px; flex-direction: row; }
.price-row > span:first-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.price-row > span:first-child .muted { font-size: 12.5px; font-weight: 400; }
.price-in { display: flex; align-items: center; gap: 6px; flex: none; }
.price-in input { width: 110px; text-align: right; }
.price-in input[type="checkbox"] { width: auto; }
.tariff-row { flex-wrap: wrap; }
/* 📜 история действий */
.h-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.h-filters select, .h-filters input { width: auto; }
.h-filters input { flex: 1 1 220px; min-width: 0; }
.h-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.h-groups button { padding: 5px 12px; border-radius: 999px; font-size: 13px; }
.h-groups button.sel { background: #1a73e8; border-color: #1a73e8; color: #fff; }
.h-list { padding: 4px 0; }
.h-day { padding: 12px 16px 6px; font-weight: 700; color: #3c4043; border-top: 1px solid #f1f3f4; }
.h-day:first-child { border-top: 0; }
.h-item { display: grid; grid-template-columns: 46px 24px minmax(0, 1fr) auto; align-items: baseline; gap: 8px; padding: 6px 16px; font-size: 14px; }
.h-item:hover { background: #f8fafc; }
.h-time { color: #5f6368; font-variant-numeric: tabular-nums; }
.h-ws { padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--c); border: 1px solid var(--c); white-space: nowrap; }
.h-ic { text-align: center; }
.h-main { min-width: 0; overflow-wrap: anywhere; }
.h-who { margin-right: 4px; }
.h-arrow { color: #9aa0a6; }
.h-empty { color: #9aa0a6; font-style: italic; }
.h-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid #d1d5db; vertical-align: -2px; }
.h-undo { font-size: 12px; color: #b45309; }
.h-dev { color: #9aa0a6; font-size: 12px; white-space: nowrap; }
.h-more { text-align: center; margin: 12px 0; }
@media (max-width: 760px) {
  .h-item { grid-template-columns: 40px 22px minmax(0, 1fr); }
  .h-dev { grid-column: 3; }
}
/* 📮 адреса для отправки */
.npa-list { display: flex; flex-direction: column; gap: 10px; }
.card.npa { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.6fr); gap: 10px 18px; align-items: start; margin: 0; }
.npa-contact { font-size: 15px; }
.npa-animals { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.npa-chip { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; padding: 6px 12px; border: 1px solid #e5e7eb; border-radius: 10px; color: inherit; text-decoration: none; font-size: 15px; }
.npa-chip b { font-size: 18px; }
.npa-chipno { font: 600 16px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .3px; color: #374151; }
.npa-copy { visibility: hidden; border: 0; background: transparent; color: #6b7280; cursor: pointer; padding: 0 5px; border-radius: 6px; font-size: 15px; }
.npa-chip:hover .npa-copy { visibility: visible; }
.npa-copy:hover { background: #e8f0fe; color: #1a73e8; }
.npa-chip:hover { border-color: #93c5fd; }
.npa-need { font-size: 13px; color: #b45309; }
.npa-ttn { padding: 6px 10px; border: 1px solid #bfdbfe; border-radius: 8px; background: #eff6ff; color: #1e3a8a; font-size: 13px; }
.npa-ttn .muted { font-size: 12px; }
.card.npa.has-ttn { box-shadow: inset 4px 0 0 #60a5fa; }
.npa input.from-ttn, .npa select.from-ttn { border-color: #60a5fa; background: #eff6ff; }
.npa-ttn-n { color: #1e40af; }
.npa-form { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.npa-paste { width: 100%; resize: vertical; box-sizing: border-box; }
.npa-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.npa-place { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
.npa-fields label, .npa-place label { display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; color: #6b7280; margin: 0; min-width: 0; }
.npa-fields input, .npa-place input, .npa-place select { width: 100%; box-sizing: border-box; color: #111827; }
.npa-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.npa-foot [data-npa-save] { margin-left: auto; }
.npa-state { min-width: 0; max-width: 100%; }
.npa-state .badge { white-space: normal; }
.card.npa.saved { opacity: .65; }
@media (max-width: 760px) {
  .card.npa { grid-template-columns: 1fr; }
  .npa-fields { grid-template-columns: 1fr 1fr; }
  .npa-place { grid-template-columns: 1fr; }
}
.tariff-ins { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.tariff-ins .price-in .lbl { font-size: 12.5px; color: #6b7280; width: 46px; text-align: right; }
.tariff-ins .price-in input, #price-cert { width: 84px; }

/* Новая почта одним блоком: ключ и статусы, ниже — создание ТТН */
.np-part { display: block; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.np-part.np-first { border-top: none; padding-top: 0; margin-top: 4px; }
.np-sub { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 15px; }

/* окно Animal ID: дата рождения из документа лаборатории — сверить */
dialog.aid-dlg .aid-doc { margin-top: 8px; padding: 6px 10px; border: 1px solid #bfdbfe; border-radius: 8px; background: #eff6ff; color: #1e3a8a; font-size: 13px; }
dialog.aid-dlg .aid-doc.aid-doc-miss { border-color: #f3d38b; background: #fff8e6; color: #7a4b00; }
dialog.aid-dlg input.from-doc { border-color: #60a5fa; background: #eff6ff; }

/* подсказка — в строке названия поля: поля в ряду стоят ровно */
.grid label .lbl small { margin-left: 4px; }
/* лаборатория: до 3 времён проверки в ряд */
.lab-times { display: flex; gap: 8px; }
.lab-times input { flex: 1; min-width: 0; }
/* Animal ID сохранил не всё */
dialog.aid-dlg table.aid-miss { width: 100%; border-collapse: collapse; font-size: 14px; }
dialog.aid-dlg table.aid-miss th { text-align: left; font-size: 12px; color: #6b7280; font-weight: 600; padding: 4px 8px; }
dialog.aid-dlg table.aid-miss td { padding: 6px 8px; border-top: 1px solid #e5e7eb; }

/* ↶ ↷ в Таблице */
.undo-redo { display: inline-flex; gap: 2px; }
.undo-redo button { font-size: 18px; line-height: 1; padding: 6px 10px; }
.undo-redo button.off { opacity: .35; }

/* «через кого» заказ */
.via-tag { display: inline-block; padding: 0 6px; border-radius: 8px; background: #eef2ff; color: #3730a3; font-size: 12px; white-space: nowrap; }

/* «⟳ Обновить всё» — итог */
dialog.refresh-dlg .rf-row { display: grid; grid-template-columns: 160px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); align-items: baseline; }
dialog.refresh-dlg .rf-list { margin: 0 0 6px 170px; padding-left: 16px; font-size: 13px; color: var(--muted); }
@media (max-width: 600px) { dialog.refresh-dlg .rf-row { grid-template-columns: 1fr; } dialog.refresh-dlg .rf-list { margin-left: 0; } }

/* «Паспорт Ира» */
dialog.ira-dlg .ira-route { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
dialog.ira-dlg .ira-arrow { font-size: 22px; color: var(--muted); }
@media (max-width: 600px) { dialog.ira-dlg .ira-route { grid-template-columns: 1fr; } dialog.ira-dlg .ira-arrow { transform: rotate(90deg); justify-self: center; } }
.lab-ira { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

dialog.ira-dlg .ira-from { display: flex; gap: 14px; margin: 4px 0 10px; }
dialog.ira-dlg .ira-from label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
/* заявка: клиент уже подавал — данные владельца из прошлой заявки */
.lab-prior { display: grid; gap: 4px; padding: 8px 12px; margin-bottom: 8px; border: 1px solid #c7dbf5; background: #f2f7fe; border-radius: 10px; color: #1f2937; font-size: 13px; }
.lab-prior.offer { border-color: #f0d9a8; background: #fffaf0; }
.lab-prior-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.lab-prior button { justify-self: start; }
/* «Выхода теста»: ожидаемая дата, пока результата нет */
input.expected::placeholder { color: #6b7280; font-style: italic; opacity: 1; }
/* заявка: дата подачи рядом с отметкой */
.lab-subdate { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; font-size: 13px; color: #4b5563; }
.lab-subdate input { width: 110px; margin: 0; }
.lab-subdate[hidden] { display: none; } /* подачу не отмечаем — даты не видно */
/* ТТН за границу */
.intl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.intl-dlg .grid select, .intl-dlg .grid input { width: 100%; }
.intl-dlg .grid label[hidden] { display: none; }
/* заявка: «Паспорт через Иру» — отдельно от «Нужно …» */
.lab-ira-opt { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 8px 12px; border: 1px solid #e3d5f5; background: #faf6ff; border-radius: 10px; font-size: 13px; cursor: pointer; }
.lab-ira-opt input { width: auto; flex: none; margin: 3px 0 0; }
.lab-ira-opt > span { display: grid; gap: 2px; }
.lab-done .lab-ira-opt { display: none; }

