/*
 * CRM «Новий Вік» — стиль робочого місця. Кольори й шрифти сайту novyi-vik.com.ua (темно-синій, бронза, пісок;
 * Manrope і Montserrat). Спершу телефон: великі кнопки (від 48 px), без прокрутки вбік (урок YP).
 */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/manrope-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/manrope-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/manrope-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/manrope-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("/assets/montserrat-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("/assets/montserrat-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("/assets/montserrat-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("/assets/montserrat-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #1b3352;
  --navy-d: #142640;
  --navy-ink: #131c2b;
  --bronze: #b08a5b;
  --bronze-d: #8b6a41;
  --gold: #e2c9a2;
  --sand: #f7f1e8;
  --sand-2: #efe5d7;
  --sand-line: #e7dac8;
  --ink: #1a1f29;
  --text: #3b4250;
  --muted: #6c7381;
  --line: #ece2d4;
  --bg: #f5efe6;
  --card: #fffdf9;
  --blue: #2f6fd1;
  --blue-soft: #e8f0fc;
  --orange: #c9741f;
  --orange-soft: #fbefe1;
  --green: #2f8a57;
  --green-soft: #e5f4ea;
  --red: #b3372f;
  --red-soft: #fbe9e7;
  --r: 22px;
  --r-s: 14px;
  --shadow: 0 1px 1px rgba(27, 51, 82, 0.04), 0 14px 34px -20px rgba(27, 51, 82, 0.32);
  /* Перелив кнопок і панелі, як у макетах Юлії (правка 12). */
  --navy-grad: linear-gradient(135deg, #22406a 0%, #172f4f 55%, #0f2038 100%);
  --bronze-grad: linear-gradient(135deg, #d2b07d 0%, #b08a5b 50%, #8f6a40 100%);
  --tile: linear-gradient(145deg, #f9eedf 0%, #efdec6 100%);
  --f-head: "Montserrat", "Manrope", system-ui, sans-serif;
  --f-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font: 16px / 1.5 var(--f-body);
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}
h1,
h2,
h3 {
  font-family: var(--f-head);
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 0.6em;
}
h1 {
  font-size: 1.45rem;
  font-weight: 700;
}
h2 {
  font-size: 1.15rem;
  font-weight: 700;
}
h3 {
  font-size: 1rem;
  font-weight: 700;
}
p {
  margin: 0 0 0.8em;
}
a {
  color: var(--navy);
}
img {
  max-width: 100%;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.lead {
  font-size: 1.02rem;
}
.nowrap {
  white-space: nowrap;
}
.right {
  text-align: right;
}
.hidden,
[hidden] {
  display: none !important;
}

/* Шапка і меню */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--navy);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}
.brand img {
  flex: none;
  border-radius: 50%;
  background: #fff;
}
.brand-name {
  font: 700 1.05rem / 1 var(--f-head);
  white-space: nowrap;
}
.brand-sub {
  font-size: 0.78rem;
  color: var(--gold);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.menu {
  position: relative;
}
/* Вкладки разделов — всегда под шапкой (правка Юлии 8): на телефоне листаются пальцем вбок. */
.top {
  flex-wrap: wrap;
  row-gap: 8px;
}
.top-tabs {
  order: 3;
  flex: 1 0 100%;
  display: flex;
  gap: 4px;
  margin: 0 -16px -4px;
  padding: 0 16px 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.top-tabs::-webkit-scrollbar {
  display: none;
}
.top-tabs a {
  flex: none;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 13px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.85;
}
.top-tabs a:hover {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
}
.top-tabs a.current {
  background: #fff;
  color: var(--navy);
  opacity: 1;
}
.menu summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
  min-height: 44px;
}
.menu summary::-webkit-details-marker {
  display: none;
}
.burger,
.burger::before,
.burger::after {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  position: relative;
}
.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
}
.burger::before {
  top: -6px;
}
.burger::after {
  top: 6px;
}
.sections {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(300px, calc(100vw - 32px));
  background: var(--card);
  border-radius: var(--r);
  box-shadow: 0 18px 48px -12px rgba(19, 28, 43, 0.35);
  padding: 8px;
  display: grid;
  gap: 2px;
}
.sections a,
.sections .link {
  display: block;
  padding: 12px 14px;
  border-radius: var(--r-s);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  text-align: left;
  width: 100%;
}
.sections a:hover,
.sections a.current {
  background: var(--sand-2);
}
.sections form {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 18px 16px 96px;
}
.back {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: 6px 0;
}

/* Картки */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  margin: 0 0 14px;
  box-shadow: var(--shadow);
}
.card > :last-child {
  margin-bottom: 0;
}
.card h2 {
  margin-bottom: 0.5em;
}
.grid2 {
  display: grid;
  gap: 12px;
}
@media (min-width: 720px) {
  .grid2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Кнопки */
button,
.button {
  font: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--navy);
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:hover,
.button:hover {
  background: var(--navy-d);
}
button:disabled {
  opacity: 0.55;
  cursor: progress;
}
.secondary {
  background: #fff;
  color: var(--navy);
}
.secondary:hover {
  background: var(--sand);
}
.accent {
  background: var(--bronze);
  border-color: var(--bronze);
}
.accent:hover {
  background: var(--bronze-d);
}
.danger {
  background: #fff;
  color: var(--red);
  border-color: var(--red);
}
.link {
  background: none;
  border: 0;
  color: var(--navy);
  min-height: 0;
  padding: 6px 0;
  text-decoration: underline;
  font-weight: 600;
}
.link:hover {
  background: none;
}
.wide {
  width: 100%;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 12px 0 0;
}
.actions > * {
  flex: 1 1 auto;
}
@media (min-width: 720px) {
  .actions > * {
    flex: 0 0 auto;
  }
}

/* Головна: дві великі кнопки */
.quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 16px;
}
.quick .button {
  min-height: 64px;
  font-size: 1.02rem;
  flex-direction: column;
  gap: 2px;
}
.quick .plus {
  font-size: 1.4rem;
  line-height: 1;
}

/* Поля */
label.field,
.field {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
}
.field > span,
.legend {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
}
.hint {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
}
input,
select,
textarea {
  font: inherit;
  font-size: 16px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1.5px solid var(--sand-line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
textarea {
  min-height: 90px;
  resize: vertical;
}
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(162, 128, 90, 0.35);
  border-color: var(--bronze);
}
input[type="checkbox"],
input[type="radio"] {
  width: 22px;
  min-height: 22px;
  height: 22px;
  accent-color: var(--navy);
  flex: none;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
  min-width: 0;
}
legend {
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  padding: 0;
}
.row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}
.row3 {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr 1fr;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 600;
  color: var(--ink);
}

/* Перемикачі-плитки (замість випадних списків: урок YP — на iPhone select підводив) */
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.choice {
  position: relative;
}
.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.choice > span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 8px 14px;
  border: 1.5px solid var(--sand-line);
  border-radius: 12px;
  background: #fff;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}
.choice input:checked + span {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.choice input:focus-visible + span {
  outline: 3px solid rgba(162, 128, 90, 0.45);
}
.choices.column {
  flex-direction: column;
}
.wide-choice > span {
  display: grid;
  justify-content: stretch;
  text-align: left;
  padding: 12px 14px;
  gap: 2px;
}
.wide-choice input:checked + span .muted {
  color: var(--gold);
}
.choice.busy > span {
  background: var(--sand-2);
  color: #a6a29b;
  text-decoration: line-through;
}
.choice.busy input:checked + span {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  text-decoration: none;
}

/* 30 днів */
.days {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}
.days .choice > span {
  flex-direction: column;
  min-height: 66px;
  padding: 6px 4px;
  gap: 0;
}
.days .wd {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.days .dn {
  font: 700 1.25rem / 1.1 var(--f-head);
}
.days .mn {
  font-size: 0.72rem;
  color: var(--muted);
}
.days .load {
  font-size: 0.7rem;
  color: var(--bronze-d);
  min-height: 1em;
}
.days .weekend span {
  background: var(--sand);
}
.days .choice input:checked + span .wd,
.days .choice input:checked + span .mn,
.days .choice input:checked + span .load {
  color: var(--gold);
}
.times {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
}
.time-free {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.time-free input {
  max-width: 160px;
}

/* Підказка клієнтів */
.suggest {
  position: relative;
}
.suggest-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
.suggest-list button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 0;
  min-height: 52px;
  border-radius: 10px;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  font-weight: 600;
}
.suggest-list button:hover,
.suggest-list button:focus {
  background: var(--sand-2);
}
.suggest-list .muted {
  font-weight: 400;
  font-size: 0.85rem;
}
.picked {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--navy-ink);
  margin: 0 0 12px;
}

/* Списки і рядки */
.lines {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lines > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.lines > li:last-child {
  border-bottom: 0;
}
.line-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.line-main strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* Календар */
.month {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.month .wdh {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  padding: 4px 0;
}
.month a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  min-height: 52px;
  padding: 6px 2px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 700;
}
.month a.other {
  opacity: 0.4;
}
.month a.today {
  border-color: var(--bronze);
  box-shadow: inset 0 0 0 1px var(--bronze);
}
.month a.selected {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.dots {
  display: flex;
  gap: 3px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.dot.m {
  background: var(--blue);
}
.dot.i {
  background: var(--orange);
}
.month a.selected .dot.m {
  background: #9fc2ff;
}
.month a.selected .dot.i {
  background: var(--gold);
}
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 10px;
}
.month-nav a {
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
}
.events {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.event {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  text-decoration: none;
  color: var(--text);
}
.event.install {
  border-left-color: var(--orange);
}
.event.cancelled {
  opacity: 0.55;
}
.event .when {
  font: 700 1.05rem / 1.2 var(--f-head);
  color: var(--ink);
}
.event .what {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.event .what strong {
  color: var(--ink);
}
.event .addr {
  overflow-wrap: anywhere;
}
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--sand-2);
  color: var(--navy-ink);
  white-space: nowrap;
}
.tag.m {
  background: var(--blue-soft);
  color: var(--blue);
}
.tag.i {
  background: var(--orange-soft);
  color: var(--orange);
}
.tag.ok {
  background: var(--green-soft);
  color: var(--green);
}
.tag.bad {
  background: var(--red-soft);
  color: var(--red);
}
.tag.draft {
  background: var(--sand-2);
  color: var(--bronze-d);
}

/* Повідомлення */
.notice {
  background: var(--green-soft);
  color: #1e5a39;
  padding: 12px 14px;
  border-radius: 12px;
}
.error {
  background: var(--red-soft);
  color: var(--red);
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 600;
}
.warn {
  background: var(--orange-soft);
  color: #7a4512;
  padding: 12px 14px;
  border-radius: 12px;
}

/* Розрахунок приміщення: назва ліворуч, сума праворуч — без прокрутки вбік на телефоні */
.calc {
  list-style: none;
  margin: 0;
  padding: 0;
}
.calc li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.calc-sum {
  white-space: nowrap;
  font-weight: 700;
  color: var(--ink);
}
form.inline {
  display: inline;
  margin: 0;
}
.calc .calc-total {
  border-bottom: 0;
  font-weight: 800;
  color: var(--ink);
}
.calc .calc-total .calc-sum {
  font-size: 1.05rem;
}

/* Таблиці договору */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table th,
.table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.table th {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.table td.num,
.table th.num {
  text-align: right;
  white-space: nowrap;
}
.table tfoot td {
  font-weight: 800;
  color: var(--ink);
  border-bottom: 0;
}
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.totals {
  display: grid;
  gap: 6px;
  font-size: 1.02rem;
}
.totals div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.totals .due {
  font: 800 1.3rem / 1.2 var(--f-head);
  color: var(--navy);
  border-top: 2px solid var(--line);
  padding-top: 8px;
}
.room-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.sketch-thumb {
  width: 96px;
  height: 96px;
  flex: none;
  background: var(--sand);
  border-radius: 10px;
}
.sketch-thumb polygon {
  fill: rgba(27, 51, 82, 0.08);
  stroke: var(--navy);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

/* Фото */
.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.photos figure {
  margin: 0;
  position: relative;
}
.photos img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  background: var(--sand);
  display: block;
}
.photos form {
  position: absolute;
  top: 6px;
  right: 6px;
  margin: 0;
}
.photos form button {
  min-height: 36px;
  padding: 4px 10px;
  font-size: 0.8rem;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.tile {
  display: grid;
  gap: 6px;
  padding: 10px;
  border-radius: var(--r);
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}
.tile img,
.tile .noimg {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--sand);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
}
.tile strong {
  color: var(--ink);
}
.qty {
  font: 800 1.1rem / 1 var(--f-head);
  color: var(--navy);
  white-space: nowrap;
}
.qty.low {
  color: var(--red);
}
/* Вибір клієнта для нового договору: торкнулися — одразу розрахунок (правка Юлії 15). */
.picks {
  display: grid;
  gap: 8px;
}
button.pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 14px;
  text-align: left;
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  font-weight: 400;
}
button.pick:hover,
button.pick:focus-visible {
  border-color: var(--navy);
  background: var(--card);
  color: var(--ink);
}
button.pick > span:first-child {
  display: grid;
  gap: 2px;
}
.pick-go {
  flex: none;
  font: 800 1.3rem / 1 var(--f-head);
  color: var(--bronze);
}
/* Поле дати з календариком не вилазить за край картки на телефоні. */
input[type="date"] {
  min-width: 0;
  max-width: 100%;
}

/* Вкладки */
.tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 14px;
  overflow-x: auto;
}
.tabs a {
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink);
}
.tabs a.current {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* Креслення приміщення (бриф, 2.6) */
.sketch-box {
  display: grid;
  gap: 10px;
  /* Площа й периметр не прилипають до кнопки «Намалювати» (зауваження Юлії на знімку). */
  margin-bottom: 14px;
}
.sketch-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.sketch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: var(--navy);
  color: #fff;
}
.sketch-bar strong {
  font-family: var(--f-head);
}
.sketch-bar button {
  min-height: 44px;
  padding: 8px 14px;
}
.sketch-area {
  position: relative;
  touch-action: none;
  overflow: hidden;
  background-color: #fff;
  background-image:
    linear-gradient(var(--sand-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--sand-2) 1px, transparent 1px);
  background-size: 24px 24px;
}
.sketch-area svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.sketch-help {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  font-size: 0.92rem;
  color: var(--ink);
  pointer-events: none;
}
.sketch-tools {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
}
.sketch-tools button {
  min-height: 52px;
}
.sketch-sum {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  color: var(--ink);
}
.sk-wall {
  stroke: var(--navy);
  stroke-width: 4;
  stroke-linecap: round;
}
.sk-closing {
  stroke: var(--bronze);
  stroke-width: 4;
  stroke-dasharray: 10 8;
}
.sk-ghost {
  stroke: var(--bronze);
  stroke-width: 4;
  stroke-dasharray: 6 6;
}
.sk-fill {
  fill: rgba(27, 51, 82, 0.07);
}
.sk-point {
  fill: #fff;
  stroke: var(--navy);
  stroke-width: 4;
}
.sk-point.last {
  fill: var(--bronze);
  stroke: var(--bronze-d);
}
.sk-point.first {
  fill: var(--navy);
}
/* Крайні точки — від них ведемо нову стіну (остання й перша, правка Юлії 4). */
.sk-point.end {
  fill: var(--bronze);
  stroke: var(--bronze-d);
}
.sk-letter {
  font: 800 15px var(--f-head);
  fill: var(--navy);
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 5px;
  stroke-linejoin: round;
}
.sk-angle {
  font: 700 13px var(--f-body);
  fill: var(--bronze-d);
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 4px;
  stroke-linejoin: round;
}
.sk-angle.live {
  font-size: 16px;
}
.sk-diagonal {
  stroke: var(--bronze);
  stroke-width: 2;
  stroke-dasharray: 8 6;
}
.sk-label.diagonal {
  font-size: 13px;
  fill: var(--bronze-d);
}
.sk-label {
  font: 700 15px var(--f-body);
  fill: var(--navy-ink);
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 5px;
  stroke-linejoin: round;
}
.sk-label.closing {
  fill: var(--bronze-d);
}
.sketch-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(19, 28, 43, 0.45);
  padding: 16px;
}
.sketch-dialog form {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.5);
}
.sketch-dialog input {
  font: 800 1.6rem / 1 var(--f-head);
  text-align: center;
  min-height: 60px;
}
.sketch-dialog .actions {
  margin-top: 12px;
}
.sketch-dialog .dialog-label {
  margin: 6px 0 4px;
  font-weight: 600;
  color: var(--ink);
}
.sketch-dialog .dialog-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-weight: 600;
  color: var(--ink);
}
.sketch-dialog .dialog-row input {
  width: 110px;
  font-size: 1.3rem;
  min-height: 50px;
}
.sketch-dialog input:disabled {
  opacity: 0.4;
}
.sketch-dialog .dialog-diagonal {
  margin: 12px 0 0;
  padding: 10px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.sketch-dialog .dialog-diagonal legend {
  font-weight: 600;
  color: var(--ink);
  padding: 0;
}
.sketch-dialog .dialog-diagonal .choices {
  margin: 6px 0 8px;
}
.sketch-dialog .dialog-diagonal input[type="number"] {
  font-size: 1.3rem;
  min-height: 50px;
}
.sketch-dialog form {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
.sketch-preview {
  display: flex;
  gap: 14px;
  align-items: center;
}
.sketch-preview svg {
  width: 120px;
  height: 120px;
  flex: none;
  background: var(--sand);
  border-radius: 12px;
}
/* Готове креслення з підписами сторін, буквами точок, діагоналями й кутами (правки Юлії 3 і 7). */
.sketch-preview svg.sketch-view {
  flex: 1 1 100%;
  width: 100%;
  height: auto;
}
.sketch-view .sk-wall {
  stroke-width: 3;
}
.sketch-view .sk-label {
  font-size: 21px;
  stroke-width: 6px;
}
.sketch-view .sk-letter {
  font-size: 22px;
}
.sketch-view .sk-angle {
  font-size: 18px;
}
.sketch-view .sk-label.diagonal {
  font-size: 17px;
}
.sketch-export {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sketch-export button {
  min-height: 48px;
  padding: 8px 10px;
  font-size: 0.95rem;
}
/* «Надіслати» є не на кожному пристрої — тоді одна кнопка на всю ширину. */
.sketch-export:has(> button[hidden]) {
  grid-template-columns: 1fr;
}

/* Світильники в кімнаті */
.light-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0 0 10px;
  background: var(--sand);
}
.light-row .row3 input {
  min-width: 0;
}
.light-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
  color: var(--ink);
}
/* Лампа до світильника — з відступом під ним (правка Юлії 6). */
.light-row.linked {
  margin-left: 18px;
  border-left: 4px solid var(--bronze);
}
/* «+ Світильник» і «+ Лампа»: з наявності чи під замовлення — чотири кнопки 2 × 2. */
.light-add {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.light-add button {
  min-height: 48px;
  padding: 8px 10px;
  font-size: 0.92rem;
  line-height: 1.2;
}
.sum-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px -16px -96px;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--navy);
  color: #fff;
}
.sum-bar strong {
  font: 800 1.2rem / 1 var(--f-head);
}
.sum-bar button {
  background: var(--bronze);
  border-color: var(--bronze);
}

/* ═══ Дизайн за макетами Юлії (правка 12): тепле пісочне тло, світлі картки зі значками в плитках,
   синя й бронзова кнопки з переливом, синя панель розділів зліва на комп'ютері. ═══ */
body.desk {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='320' fill='none' stroke='%23d8bf98' stroke-opacity='.35'%3E%3Cpath d='M900 30C760 120 640 60 520 140S300 300 120 290'/%3E%3Cpath d='M900 70C780 150 660 100 540 180S330 320 150 320'/%3E%3C/svg%3E")
    no-repeat right top / 900px auto,
    radial-gradient(
      1100px 520px at 100% -8%,
      rgba(255, 252, 246, 0.95) 0%,
      rgba(255, 252, 246, 0) 62%
    ),
    linear-gradient(180deg, #f7f1e8 0%, #f2eadf 100%);
  background-attachment: fixed;
}
h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy-ink);
  letter-spacing: -0.01em;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.back .icon {
  width: 20px;
  height: 20px;
}

/* Картки й плитки зі значками */
.card {
  border-radius: var(--r);
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--card);
}
@media (min-width: 720px) {
  .card {
    padding: 22px 24px;
  }
}
.card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
}
.card-head h2 {
  margin: 0;
  flex: 1;
}
.tile {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--tile);
  color: var(--bronze-d);
  box-shadow: inset 0 0 0 1px rgba(176, 138, 91, 0.18);
}
.tile .icon {
  width: 24px;
  height: 24px;
}
.count {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f3e3cb;
  color: var(--navy-ink);
  font: 800 0.95rem / 1 var(--f-head);
}

/* Кнопки: синя й бронзова з переливом, контурна — світла */
button,
.button {
  border-radius: 14px;
  background: var(--navy-grad);
  border-color: #1b3352;
  box-shadow: 0 10px 22px -16px rgba(15, 32, 56, 0.9);
}
button:hover,
.button:hover {
  background: linear-gradient(135deg, #2a4b78 0%, #142a45 100%);
}
.accent {
  background: var(--bronze-grad);
  border-color: #a98152;
  color: #fff;
}
.accent:hover {
  background: linear-gradient(135deg, #d9bb8c 0%, #9d774a 100%);
}
.secondary {
  background: #fffdf9;
  color: var(--navy);
  border-color: #1b3352;
  box-shadow: none;
}
.secondary:hover {
  background: #f7efe3;
}
.danger {
  background: #fffdf9;
  box-shadow: none;
}
.link {
  box-shadow: none;
}
button .icon,
.button .icon {
  width: 20px;
  height: 20px;
  flex: none;
}

/* Поля й перемикачі — м'які, теплі */
input,
select,
textarea {
  border-radius: 14px;
  border-color: var(--sand-line);
  background: #fffdfa;
}
input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(176, 138, 91, 0.28);
}
.choices:not(.column) > .choice > span {
  border-radius: 999px;
  padding: 8px 18px;
  background: #fffdf9;
  border-color: #e3d4bf;
}
/* Зайнятий час на замірі — сірий, а вибраний зайнятий — червоний (сильніше за пігулки). */
.choices:not(.column) > .choice.busy > span {
  background: var(--sand-2);
  color: #a6a29b;
}
.choices:not(.column) > .choice.busy > input:checked + span {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
/* Вибраний варіант — синій з білим текстом; правило сильніше за світлий фон пігулок вище. */
.choice input:checked + span,
.choices:not(.column) > .choice > input:checked + span {
  background: var(--navy-grad);
  border-color: #1b3352;
  color: #fff;
  box-shadow: 0 8px 16px -12px rgba(15, 32, 56, 0.9);
}

/* М'яка бежева кнопка з олівцем — «Намалювати приміщення» (макет Юлії) */
.soft {
  background: var(--tile);
  border-color: #e3cfae;
  color: var(--navy-ink);
  box-shadow: 0 8px 18px -14px rgba(110, 80, 40, 0.6);
}
.soft:hover {
  background: linear-gradient(145deg, #f6e6cf, #ead5b6);
}
.soft .icon {
  color: var(--navy);
}

/* Головна: великі кнопки «Новий замір» (синя, рулетка) і «Новий монтаж» (бронзова, дриль) */
.quick {
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 560px) {
  .quick {
    grid-template-columns: 1fr 1fr;
  }
}
.big-action {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 74px;
  padding: 14px 22px;
  border-radius: 20px;
  color: #fff;
  text-decoration: none;
  font: 700 1.18rem / 1.2 var(--f-head);
  background: var(--navy-grad);
  box-shadow: 0 16px 30px -20px rgba(15, 32, 56, 0.95);
}
.big-action.bronze {
  background: var(--bronze-grad);
  box-shadow: 0 16px 30px -20px rgba(110, 80, 40, 0.9);
}
.big-action:hover {
  filter: brightness(1.06);
}
.big-action .icon {
  width: 34px;
  height: 34px;
  flex: none;
}
.big-action .go {
  width: 24px;
  height: 24px;
  margin-left: auto;
}
.big-action .sep {
  flex: none;
  width: 1.5px;
  height: 30px;
  background: rgba(255, 255, 255, 0.4);
}

/* Рядки зі значком: «Замовити», події */
.lines .with-tile {
  display: flex;
  align-items: center;
  gap: 14px;
}
.lines .with-tile .tile {
  width: 42px;
  height: 42px;
}
.lines .with-tile .line-main {
  flex: 1;
}
/* Телефон: кнопка «Замовлено» — під текстом, текст не стискається у вузький стовпчик. */
@media (max-width: 560px) {
  .lines .with-tile {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: start;
    gap: 8px 12px;
  }
  .lines .with-tile > form {
    grid-column: 2;
  }
  .lines .with-tile > form button {
    width: 100%;
  }
}
.done-button .icon {
  color: var(--navy);
}
.count.bad {
  background: var(--red-soft);
  color: var(--red);
}

/* Фільтри календаря: «Усі події · Заміри · Монтажі» з лічильниками */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 0 14px;
  padding: 6px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.filters::-webkit-scrollbar {
  display: none;
}
.filters a {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--navy-ink);
  font-weight: 700;
  white-space: nowrap;
}
.filters a .icon {
  width: 22px;
  height: 22px;
  color: var(--bronze-d);
}
.filters a.current {
  background: var(--tile);
}
.filters .count {
  min-width: 26px;
  height: 26px;
  font-size: 0.85rem;
  background: #efe2cd;
}

/* Місяць: на телефоні — крапки, на комп'ютері — події прямо в днях (макет Юлії) */
.month-nav strong {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 800 1.25rem / 1.2 var(--f-head);
  color: var(--navy-ink);
}
.month-nav strong .icon {
  width: 26px;
  height: 26px;
  color: var(--bronze-d);
}
.month-nav a {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  background: #fffdf9;
  box-shadow: var(--shadow);
}
.month-nav a .icon {
  width: 22px;
  height: 22px;
}
.month a {
  border-radius: 14px;
  background: #fffdf9;
  border-color: #efe5d6;
}
.month a.today {
  border-color: var(--bronze);
  background: linear-gradient(180deg, #fffaf2, #f9eedd);
  box-shadow: inset 0 0 0 1px var(--bronze);
}
.month a.selected {
  background: var(--navy-grad);
  border-color: #1b3352;
}
.month .evs {
  display: none;
}
@media (min-width: 900px) {
  .month {
    gap: 6px;
  }
  .month a {
    align-items: stretch;
    min-height: 92px;
    padding: 8px;
    text-align: left;
  }
  .month a .dots {
    display: none;
  }
  .month .evs {
    display: grid;
    gap: 4px;
    margin-top: 4px;
  }
  .month .ev {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border-radius: 9px;
    font: 700 0.74rem / 1.2 var(--f-body);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--blue-soft);
    color: #1d4f9a;
    border: 1px solid #cddcf3;
  }
  .month .ev .icon {
    width: 15px;
    height: 15px;
    flex: none;
  }
  .month .ev.i {
    background: #f8ecdb;
    color: #7a5326;
    border-color: #ead5b6;
  }
  .month .ev.done {
    background: var(--green-soft);
    color: var(--green);
    border-color: #c8e6d2;
  }
  .month .ev.cancelled {
    background: var(--red-soft);
    color: var(--red);
    border-color: #f1cfcb;
    text-decoration: line-through;
  }
  .month .ev.more {
    background: none;
    border: 0;
    color: var(--muted);
  }
  .month a.selected .ev {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
  }
}
.event {
  border-radius: 16px;
  background: #fffdf9;
  border-color: #efe5d6;
}

/* Сума внизу: синя смуга з бронзовою «Зберегти →» */
.sum-bar {
  background: var(--navy-grad);
  border-radius: 20px 20px 0 0;
}
.sum-bar button {
  background: var(--bronze-grad);
  border-color: #a98152;
  min-width: 140px;
}
@media (min-width: 720px) {
  .sum-bar {
    bottom: 14px;
    margin: 18px 0 16px;
    border-radius: 20px;
    padding: 14px 18px;
    box-shadow: 0 18px 34px -20px rgba(15, 32, 56, 0.9);
  }
}

/* Шапка телефона: перелив і вкладки зі значками */
.top {
  background: var(--navy-grad);
}
.top-tabs a {
  gap: 7px;
}
.top-tabs a .icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.sections a,
.sections .link {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sections .icon {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--bronze-d);
}
.side {
  display: none;
}

/* Комп'ютер: синя панель розділів зліва, шапки телефона немає */
@media (min-width: 1024px) {
  body.with-side .top {
    display: none;
  }
  body.with-side .page {
    max-width: 1120px;
    margin: 0 0 0 272px;
    padding: 34px 44px 120px;
  }
  h1 {
    font-size: 2.1rem;
  }
  .side {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 26px;
    width: 272px;
    padding: 28px 18px 20px;
    color: #fff;
    overflow-y: auto;
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='272' height='260' fill='none' stroke='%23d8b37a'%3E%3Cpath stroke-opacity='.55' d='M-10 250C60 230 120 170 160 120S240 30 290 20'/%3E%3Cpath stroke-opacity='.25' d='M-10 230C70 200 110 150 150 100S230 20 290 0'/%3E%3C/svg%3E")
      no-repeat left bottom / 100% auto,
      linear-gradient(180deg, #1c3556 0%, #13284a 55%, #0d1c33 100%);
  }
  .side-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    color: #fff;
    text-decoration: none;
  }
  .side-brand img {
    flex: none;
    border-radius: 50%;
    background: #fff;
  }
  .side-brand strong {
    display: block;
    font: 800 1.3rem / 1.1 var(--f-head);
  }
  .side-brand small {
    display: block;
    margin-top: 3px;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
  }
  .side-nav {
    display: grid;
    gap: 4px;
  }
  .side-nav a,
  .side-foot a,
  .side .side-out {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 0;
    border-radius: 14px;
    background: none;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.86);
    font: 600 0.98rem / 1.2 var(--f-body);
    text-decoration: none;
    cursor: pointer;
  }
  .side-nav a:hover,
  .side-foot a:hover,
  .side .side-out:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }
  .side-nav a.current,
  .side-foot a.current {
    background: var(--bronze-grad);
    color: #fff;
    box-shadow: 0 10px 20px -12px rgba(0, 0, 0, 0.7);
  }
  .side .icon {
    width: 22px;
    height: 22px;
    flex: none;
  }
  .side-foot {
    display: grid;
    gap: 2px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }
  .side-foot form {
    margin: 0;
  }
}

/* «Монтажі» (правка 13): найближчі монтажі — картки з залишком і відмітками «Замовлено» */
.installs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.install {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.install > .line-main {
  text-decoration: none;
  color: inherit;
}
.install > .line-main .tag {
  justify-self: start;
  white-space: normal;
}
.install .lines > li {
  padding: 8px 0;
}
.pay-line,
.stat-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
}
.pay-line strong,
.stat-line strong {
  color: var(--navy-ink);
}
.line-main .tag {
  justify-self: start;
}

/* «Бухгалтерія» (правка 13): рядки-розшифровки під підсумком, від'ємна маржа — червоним */
.totals .sub {
  padding-left: 14px;
  font-size: 0.92rem;
  color: var(--muted);
}
.bad-text {
  color: var(--red);
}

/* Рядок-посилання в списках — без підкреслення, як у макетах; назва синя, підкреслюється під пальцем/мишею */
a.line-main {
  color: inherit;
  text-decoration: none;
}
a.line-main strong {
  color: var(--navy);
}
a.line-main:hover strong,
a.line-main:focus-visible strong {
  text-decoration: underline;
}
/* Місяць усередині картки («Монтажі за місяць») — в один рядок на телефоні */
.card .month-nav strong {
  font-size: 1.05rem;
  white-space: nowrap;
}
.card .month-nav strong .icon {
  width: 22px;
  height: 22px;
}

/* Підсумки: сума — завжди в один рядок; швидкий вибір періоду — переноситься, а не ховається за край */
.totals div > :last-child {
  white-space: nowrap;
}
.filters.wrap {
  flex-wrap: wrap;
  overflow: visible;
}

/* Крива, коло й овал на кресленні (правки 16 і 17): бронзова лінія, точки X, 1, 2…, Y, відстані від стін */
.sk-curve {
  fill: none;
  stroke: var(--bronze);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sk-curve-point {
  fill: var(--bronze-d);
}
.sk-guide {
  stroke: var(--bronze);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}
.sk-mark {
  font: 800 13px var(--f-head);
  fill: var(--bronze-d);
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 4px;
  stroke-linejoin: round;
}
.sk-label.figure {
  fill: var(--bronze-d);
}
.sk-hit-group {
  cursor: pointer;
}
.sk-hit {
  fill: transparent;
}
.sk-label.guide {
  font-size: 12px;
  fill: var(--bronze-d);
}
.sketch-view .sk-curve {
  stroke-width: 3;
}
.sketch-view .sk-mark {
  font-size: 17px;
}
.sketch-view .sk-label.guide {
  font-size: 16px;
}
.sketch-sum {
  flex-wrap: wrap;
}
.sketch-dialog .dialog-options {
  display: grid;
  gap: 10px;
  margin: 12px 0 8px;
}
.sketch-dialog .dialog-options button {
  min-height: 56px;
  justify-content: flex-start;
  text-align: left;
}
.sketch-dialog .dialog-walls input {
  font-size: 1.3rem;
  min-height: 50px;
}

/* Крива, коло й овал на маленькій картинці приміщення */
.sketch-thumb .curve {
  fill: none;
  stroke: var(--bronze);
  stroke-width: 1.6;
}

/* Робота без інтернету (правка 14): смужка «Немає зв'язку / збережено на телефоні / не прийнято» */
.offline-bar {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--sand-2);
  border: 1px solid var(--line);
  color: var(--navy-ink);
}
.offline-bar p {
  margin: 0;
}
.offline-bar .offline-title {
  font-weight: 700;
}
.offline-bar .offline-items {
  margin: 0;
  padding-left: 18px;
}
.offline-bar .offline-failed {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--red-soft);
  color: var(--red);
}
.offline-bar .offline-done {
  font-weight: 700;
  color: var(--green);
}
.offline-bar button {
  justify-self: start;
}

/* Друк */
@media print {
  .top,
  .no-print,
  .actions,
  .sum-bar {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .card {
    box-shadow: none;
  }
}

/* Вибір зі складу: назва зліва, залишок і ціна — під нею. */
[data-stock-list] button {
  display: grid;
  justify-items: start;
  text-align: left;
  gap: 2px;
}
