﻿/* BAUMAYER cabinet. Dark theme, mobile first, local fonts, no external assets.
   Rules of the UX pass:
   - on a phone no readable text is smaller than 15px
   - tap targets: 52px primary, 48px secondary, 64px list rows
   - one screen, one main action
   - every screen has ready, empty, error and loading states
   - no horizontal page scroll at 320 and 390 px
*/

@font-face {
  font-family: 'Dela Gothic One';
  src: url('../fonts/dela-gothic-one.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Tight';
  src: url('../fonts/inter-tight-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Inter Tight';
  src: url('../fonts/inter-tight-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #080807;
  --bg-2: #0C0C0A;
  --bg-3: #131311;
  --card: #12110F;
  --card-2: #191814;
  --ink: #F3EEE5;
  --ink-soft: #D8D0C3;
  --muted: #A79F92;
  --dim: #8A8274;
  --brass: #C79A55;
  --brass-hi: #E3BE84;
  --on-brass: #171006;
  --ok: #8FBF8A;
  --warn: #E0A458;
  --err: #E58676;
  --line: rgba(243, 238, 229, .14);
  --line-soft: rgba(243, 238, 229, .07);
  --r: 4px;
  --r-lg: 12px;
  --tap: 52px;
  --pad: 18px;
  --max: 760px;
  --ease: cubic-bezier(.23, 1, .32, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(760px 420px at 88% -8%, rgba(199, 154, 85, .11), transparent 62%),
    radial-gradient(620px 380px at -12% 24%, rgba(199, 154, 85, .05), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-wrap: break-word;
  max-width: 100%;
}
body.has-tabbar { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }

::selection { background: var(--brass); color: var(--on-brass); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; height: auto; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

/* Flex and grid children must be allowed to shrink on narrow screens. */
.topbar__tag,
.apphead__title,
.status__top > div,
.statuscard__top > div,
.sec-head > *,
.pay__body,
.payrow__body,
.doc__body,
.docrow__body,
.receipt__body,
.lead-card__who,
.objcard__top > div,
.task__body,
.foot__in > *,
.warranty__body,
.acard__top > div,
.row__body,
.menurow__body,
.demo-note { min-width: 0; }
.demo-note { max-width: 100%; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  color: var(--brass-hi);
  word-break: break-word;
  overflow-wrap: anywhere;
}

:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip {
  position: absolute;
  left: 12px;
  top: -90px;
  z-index: 200;
  padding: 12px 16px;
  background: var(--brass);
  color: var(--on-brass);
  font-size: 15px;
  border-radius: var(--r);
  transition: top .2s;
}
.skip:focus { top: 12px; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 8, 7, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__in {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px var(--pad);
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  font-family: 'Dela Gothic One', 'Inter Tight', sans-serif;
  font-size: 16px;
  letter-spacing: .05em;
  color: var(--ink);
  white-space: nowrap;
}
.brand--sm { font-size: 15px; letter-spacing: .06em; }
.topbar__tag {
  font-size: 15px;
  letter-spacing: .02em;
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--line);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }
.topbar__right .staffsig { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.topbar__right a, .topbar__right form { white-space: nowrap; }
.demo-badge {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 99px;
  background: var(--brass);
  color: var(--on-brass);
  font-size: 15px;
  letter-spacing: .02em;
}
.demo-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-left: 2px solid rgba(199, 154, 85, .5);
  background: rgba(199, 154, 85, .06);
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
}
.link-quiet {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: .02em;
  cursor: pointer;
}
.link-quiet:hover { color: var(--brass); }

/* ---------- app header for the client page ---------- */

.apphead {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--pad);
  background: rgba(8, 8, 7, .92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.apphead__in {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.apphead__title { display: flex; flex-direction: column; }
.apphead__sub { font-size: 15px; color: var(--muted); line-height: 1.2; }
.apphead__right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.iconbtn {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 19px;
  line-height: 1;
}
.iconbtn:hover, .iconbtn:focus-visible { border-color: var(--brass); color: var(--brass-hi); }

/* ---------- typography ---------- */

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -.01em;
  overflow-wrap: break-word;
}
h1 {
  font-family: 'Dela Gothic One', 'Inter Tight', sans-serif;
  font-size: clamp(30px, 7.4vw, 46px);
  line-height: 1.08;
  letter-spacing: -.015em;
  margin: 8px 0 10px;
}
h2 {
  font-family: 'Dela Gothic One', 'Inter Tight', sans-serif;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: .005em;
}
h3 { font-size: 18px; line-height: 1.3; }

.objtitle { margin: 2px 0 0; font-family: 'Dela Gothic One', 'Inter Tight', sans-serif; font-size: 25px; line-height: 1.15; }
.objmeta { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.eyebrow {
  margin: 0;
  font-size: 15px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brass);
}
.lead {
  margin: 0 0 4px;
  max-width: 56ch;
  color: var(--muted);
  font-size: 16px;
}
.label {
  display: block;
  font-size: 15px;
  letter-spacing: .04em;
  color: var(--muted);
  line-height: 1.35;
}
.fine {
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--dim);
}
.muted { color: var(--muted); }
.empty {
  margin: 0;
  padding: 18px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.brass { color: var(--brass-hi); }

/* ---------- hero ---------- */

.hero { padding-top: 24px; }
.hero__meta {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- status card ---------- */

.status,
.statuscard {
  margin-top: 18px;
  padding: 18px 16px;
  border: 1px solid rgba(199, 154, 85, .3);
  border-radius: var(--r);
  background:
    linear-gradient(158deg, rgba(199, 154, 85, .11), rgba(199, 154, 85, .015) 58%),
    var(--card);
}
.status__top,
.statuscard__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.status__stage,
.statuscard__stage {
  display: block;
  margin-top: 4px;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 600;
}
.status__pct,
.pct {
  font-family: 'Dela Gothic One', 'Inter Tight', sans-serif;
  font-size: 30px;
  line-height: .95;
  color: var(--brass-hi);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.progress {
  height: 8px;
  margin: 16px 0 6px;
  background: rgba(243, 238, 229, .1);
  border-radius: 99px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brass), var(--brass-hi));
  border-radius: 99px;
}
.progress--sm { height: 5px; margin: 10px 0; }
.status__line,
.statuscard__line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 15px;
}
.status__grid,
.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  margin-top: 16px;
}
.status__grid small,
.meta-grid small {
  display: block;
  font-size: 15px;
  letter-spacing: .02em;
  color: var(--muted);
  line-height: 1.3;
}
.status__grid b,
.status__grid a,
.meta-grid b,
.meta-grid a {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.status__grid a,
.meta-grid a {
  color: var(--brass-hi);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.status__money {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 15px;
}
.statuscard__action { margin-top: 16px; }

/* ---------- "needs your decision" ---------- */

.attention {
  margin-top: 18px;
  padding: 18px 16px;
  border: 1px solid rgba(199, 154, 85, .34);
  border-radius: var(--r);
  background:
    linear-gradient(160deg, rgba(199, 154, 85, .14), rgba(199, 154, 85, .02) 62%),
    var(--card);
}
.attention h2 { font-size: 20px; margin: 6px 0 6px; }
.attention p { margin: 0 0 14px; color: var(--ink-soft); font-size: 15px; }
.attention .btn { width: 100%; }
.attention__amount {
  font-family: 'Dela Gothic One', 'Inter Tight', sans-serif;
  font-size: 26px;
  line-height: 1.1;
  color: var(--brass-hi);
  margin: 6px 0 6px;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.btn--solid { background: var(--brass); border-color: var(--brass); color: var(--on-brass); }
.btn--solid:hover { background: var(--brass-hi); border-color: var(--brass-hi); }
.btn--ghost { border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--brass); color: var(--brass-hi); }
.btn--quiet { border-color: transparent; color: var(--muted); font-weight: 400; min-height: 48px; }
.btn--quiet:hover { color: var(--ink); }
.btn--block { width: 100%; }
.btn--sm { min-height: 48px; font-size: 16px; padding: 10px 16px; }
.btn--tiny { min-height: 48px; padding: 8px 14px; font-size: 15px; font-weight: 400; border-color: var(--line); }
.btn--tiny.btn--ghost { border-color: var(--line); }
.btn[disabled], .btn[aria-busy="true"] { opacity: .7; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 160px; }
.inline { display: inline; }
form.inline { vertical-align: middle; }

.spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(23, 16, 6, .28);
  border-top-color: var(--on-brass);
  animation: spin .7s linear infinite;
}
.btn--ghost .spinner, .btn--quiet .spinner {
  border-color: rgba(243, 238, 229, .25);
  border-top-color: var(--ink);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
}
.pill.is-active { color: var(--on-brass); background: var(--brass); border-color: var(--brass); font-weight: 600; }
.pill.is-done { color: var(--brass-hi); border-color: rgba(199, 154, 85, .4); }
.pill.is-planned, .pill.is-draft { color: var(--muted); }
.pill.is-paused { color: var(--err); border-color: rgba(229, 134, 118, .45); }
.pill--ok { color: var(--ok); border-color: rgba(143, 191, 138, .4); }
.pill--warn { color: var(--warn); border-color: rgba(224, 164, 88, .45); }
.pill--err { color: var(--err); border-color: rgba(229, 134, 118, .45); }
.pill--brass { color: var(--on-brass); background: var(--brass); border-color: var(--brass); font-weight: 600; }
.pill--soft { background: rgba(199, 154, 85, .12); border-color: rgba(199, 154, 85, .3); color: var(--brass-hi); }

/* ---------- cards, rows ---------- */

.card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.card + .card { margin-top: 12px; }
.card--accent {
  border-color: rgba(199, 154, 85, .3);
  background: linear-gradient(160deg, rgba(199, 154, 85, .12), rgba(199, 154, 85, .02) 60%), var(--card);
}
.card--alert { border-color: rgba(229, 134, 118, .38); background: rgba(229, 134, 118, .06); }
.card--flat { background: transparent; padding: 0 16px; }
.mt-16 { margin-top: 16px; }

.row, .menurow {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: inherit;
  text-align: left;
}
.row:last-child, .menurow:last-child { border-bottom: 0; }
.row__body, .menurow__body { flex: 1 1 auto; }
.row__body b, .menurow__body b { display: block; font-size: 17px; font-weight: 600; line-height: 1.3; }
.row__body small, .menurow__body small { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; }
.row__end, .menurow__end { margin-left: auto; color: var(--dim); font-size: 22px; flex: 0 0 auto; }
.menurow__badge { margin-left: auto; flex: 0 0 auto; }
.row:hover .row__body b, .menurow:hover .menurow__body b { color: var(--brass-hi); }

.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }
.stack > * + * { margin-top: 12px; }

/* ---------- chips nav ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
}
.chips a {
  flex: 0 0 auto;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink-soft);
  font-size: 15px;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: border-color .2s, color .2s;
}
.chips a b { color: var(--brass); font-weight: 600; }
.chips a:hover { border-color: var(--brass); color: var(--brass-hi); }
.chips a.is-current {
  border-color: var(--brass);
  color: var(--on-brass);
  background: var(--brass);
  font-weight: 600;
}
.chips a.is-current b { color: var(--on-brass); }
.chips__form { display: inline-flex; margin: 0; }
.chips__button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s, color .2s;
}
.chips__button:hover { border-color: var(--brass); color: var(--brass-hi); }
.staffnav { margin-top: 14px; }
.staffsig {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: .01em;
  white-space: nowrap;
}

/* ---------- bottom tab bar (client page) ---------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  background: rgba(12, 12, 10, .97);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-soft);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar__in {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: stretch;
}
.tabbar a {
  flex: 1 1 0;
  min-width: 0;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
}
.tabbar a.is-active { color: var(--brass-hi); }
.tabbar a.is-active .tabbar__ico { color: var(--brass-hi); }
.tabbar__ico { font-size: 19px; line-height: 1; color: var(--dim); }
.tabbar a:hover { color: var(--ink); }

/* ---------- anchor jump nav ---------- */

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 0;
  padding: 2px 0 4px;
  overflow-x: visible;
}
.jump a {
  max-width: 100%;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--ink-soft);
  font-size: 15px;
  white-space: nowrap;
}
.jump a:hover { border-color: var(--brass); color: var(--brass-hi); }

/* ---------- sections ---------- */

.sec {
  margin-top: 30px;
  scroll-margin-top: 84px;
}
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.sec-head span {
  color: var(--muted);
  font-size: 15px;
  text-align: right;
  margin-left: auto;
}

/* ---------- stages ---------- */

.stages, .stagelist {
  list-style: none;
  margin: 0;
  padding: 0;
}
.stage, .stageitem {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.stage:last-child, .stageitem:last-child { border-bottom: 0; }
.stage__rail, .stageitem__dot { position: relative; margin-top: 6px; }
.stage__rail i, .stageitem__dot i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--dim);
  background: transparent;
}
.stage.is-done .stage__rail i, .stageitem.is-done .stageitem__dot i { background: var(--brass); border-color: var(--brass); }
.stage.is-active .stage__rail i, .stageitem.is-active .stageitem__dot i {
  border-color: var(--brass);
  background: var(--bg);
  box-shadow: 0 0 0 4px rgba(199, 154, 85, .16);
}
.stage__body, .stageitem__head { min-width: 0; }
.stage__body b, .stageitem__head b {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.stage__body b { display: block; }
.stageitem__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.stageitem__head .pill { flex: 0 0 auto; }
.stage__body small, .stageitem__meta {
  display: block;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.stage__tag {
  align-self: start;
  justify-self: end;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 15px;
  white-space: nowrap;
}
.stage { grid-template-columns: 20px minmax(0, 1fr) auto; align-items: start; }
.stage.is-done .stage__tag { color: var(--brass-hi); border-color: rgba(199, 154, 85, .4); }
.stage.is-active .stage__tag { color: var(--on-brass); background: var(--brass); border-color: var(--brass); }
.stageitem__tasks { margin-top: 8px; }
.taskline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: var(--ink-soft);
  font-size: 15px;
}
.taskline__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); flex: 0 0 auto; }
.taskline.is-done { color: var(--dim); text-decoration: line-through; }
.taskline.is-done .taskline__dot { background: var(--brass); }
.stageitem__foot { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.checkcount { color: var(--muted); font-size: 15px; }

details.disclosure {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
details.disclosure > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--brass-hi);
  font-size: 15px;
  list-style: none;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "+"; margin-left: auto; font-size: 20px; color: var(--muted); }
details.disclosure[open] > summary::after { content: "-"; }

/* ---------- photo feed ---------- */

.day, .sec-photos article { margin-top: 22px; }
.day__head, .dayhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.day__head time, .dayhead time { font-size: 17px; font-weight: 600; }
.day__head span, .dayhead span { color: var(--muted); font-size: 15px; }
.day__note, .daynote {
  margin: 5px 0 10px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
  max-width: 62ch;
}
.shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.shots--one { grid-template-columns: 1fr; }
.shot {
  display: block;
  position: relative;
  padding: 0;
  border: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 3px;
  background: var(--card-2);
}
.shots--one .shot { aspect-ratio: 4 / 3; }
.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease), opacity .2s;
}
.shot:hover img { transform: scale(1.03); }
.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
  pointer-events: none;
}

/* ---------- money ---------- */

.money, .materials {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.money__sums, .sums {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.money__sums > div, .sums > div { min-width: 0; }
.money__sums > div:last-child, .sums > div:last-child { grid-column: 1 / -1; }
.money__sums .label, .sums span { display: block; color: var(--muted); font-size: 15px; }
.money__sums b, .sums b {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.money__sums .brass, .sums b.is-brass { color: var(--brass-hi); }
.pay, .paylist {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.pay__row, .payrow {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}
.pay__row:first-child, .payrow:first-child { border-top: 0; }
.pay__dot, .payrow__dot {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  border: 2px solid var(--dim);
}
.pay__row.is-paid .pay__dot, .payrow.is-paid .payrow__dot { background: var(--brass); border-color: var(--brass); }
.pay__row.is-canceled .pay__dot { border-color: var(--err); }
.payrow.is-planned .payrow__dot { border-color: var(--warn); }
.pay__body b, .payrow__body b { display: block; font-size: 17px; font-weight: 600; line-height: 1.3; }
.pay__body small, .payrow__body small { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; }
.pay__sum, .payrow__sum {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pay__row.is-planned .pay__sum, .payrow.is-planned .payrow__sum { color: var(--brass-hi); }
.pay__row.is-canceled .pay__sum { color: var(--dim); text-decoration: line-through; }

/* ---------- receipts ---------- */

.receipts {
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.receipt-item { border-bottom: 1px solid var(--line-soft); }
.receipt-item:last-child { border-bottom: 0; }
.receipt {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 0;
}
.receipt__mark { color: var(--brass-hi); }
.receipt__thumb {
  flex: 0 0 auto;
  width: 48px;
  height: 62px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
}
.receipt__body { flex: 1 1 auto; }
.receipt__body b { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.receipt__body small { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.receipt__sum { flex: 0 0 auto; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.receipt:hover .receipt__body b { color: var(--brass-hi); }
.receipt-items { padding: 0 0 12px; }
.receipt-items summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--brass-hi);
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}
.receipt-items summary::-webkit-details-marker { display: none; }
.receipt-items ul { list-style: none; margin: 4px 0 0; padding: 0; }
.receipt-items li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.4;
}
.receipt-items li span { min-width: 0; overflow-wrap: anywhere; }
.receipt-items li small { display: block; color: var(--muted); font-size: 15px; }
.receipt-items li b { flex: 0 0 auto; color: var(--ink); font-size: 15px; font-weight: 600; }
.receipt-upload {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.receipt-upload summary {
  display: flex;
  align-items: center;
  min-height: 52px;
  color: var(--brass-hi);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.receipt-upload summary::-webkit-details-marker { display: none; }
.receipt-upload .fine { margin-top: 8px; }

/* ---------- documents ---------- */

.docs { border-top: 1px solid var(--line-soft); }
.doc-item { border-bottom: 1px solid var(--line-soft); }
.doc-item:last-child { border-bottom: 0; }
.doc {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 0;
}
.doc__note { color: var(--dim) !important; }
.doc__ico {
  flex: 0 0 auto;
  width: 44px;
  height: 52px;
  border: 1px solid rgba(199, 154, 85, .45);
  border-radius: 3px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, rgba(199, 154, 85, .14), transparent);
}
.doc__ico i {
  font-style: normal;
  font-size: 15px;
  letter-spacing: .02em;
  color: var(--brass-hi);
}
.doc__body { flex: 1 1 auto; }
.doc__body b { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.doc__body small { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.doc__arrow { margin-left: auto; color: var(--dim); font-size: 22px; flex: 0 0 auto; }
.doc:hover .doc__body b { color: var(--brass-hi); }
.doc-history { padding: 0 0 12px; }
.doc-history summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--brass-hi);
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}
.doc-history summary::-webkit-details-marker { display: none; }
.doc-versions { list-style: none; margin: 4px 0 0; padding: 0; }
.doc-versions li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}
.doc-versions li.is-current b { color: var(--brass-hi); }
.doc-versions b { display: block; font-size: 15px; font-weight: 600; }
.doc-versions small { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.doc-versions .btn { flex: 0 0 auto; }
.docrow {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: inherit;
  text-align: left;
}
.docrow:last-child { border-bottom: 0; }
.docrow__ico {
  width: 44px;
  height: 52px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(199, 154, 85, .4);
  border-radius: 3px;
  color: var(--brass-hi);
  font-size: 15px;
  letter-spacing: .02em;
}
.docrow__body { flex: 1 1 auto; }
.docrow__body b { display: block; font-size: 16px; font-weight: 600; }
.docrow__body small { display: block; color: var(--muted); font-size: 15px; }
.docrow__arrow { margin-left: auto; color: var(--dim); font-size: 22px; }

/* ---------- acceptance ---------- */

.check { border-bottom: 1px solid var(--line-soft); }
.check summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
  font-size: 17px;
  font-weight: 600;
}
.check summary::-webkit-details-marker { display: none; }
.check summary::after {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-right: 3px;
  border-right: 1px solid var(--brass);
  border-bottom: 1px solid var(--brass);
  transform: rotate(45deg);
  transition: transform .2s;
}
.check[open] summary::after { transform: rotate(-135deg); }
.check__state {
  margin-left: auto;
  font-size: 15px;
  color: var(--muted);
  font-weight: 400;
  text-align: right;
}
.check__state.is-done { color: var(--brass-hi); }
.check__state.is-active { color: var(--brass-hi); }
.check ul, .ticks { list-style: none; margin: 0 0 12px; padding: 0; }
.check li, .ticks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.45;
}
.tick, .ticks i {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 15px;
  line-height: 1;
  color: transparent;
}
.check li.is-done .tick, .ticks li.is-done i { background: var(--brass); border-color: var(--brass); color: var(--on-brass); }
.check li.is-done .tick::after { display: none; }
.check__text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.check__by { display: block; margin-top: 2px; color: var(--brass); font-size: 15px; }
.check__note { display: block; margin-top: 1px; color: var(--muted); font-size: 15px; }
.check__form { margin-left: auto; flex: 0 0 auto; }

/* ---------- tasks and stage work ---------- */

.stage-work {
  grid-column: 1 / -1;
  margin: 8px 0 2px;
  padding: 12px 14px;
  border-left: 2px solid rgba(199, 154, 85, .35);
  background: rgba(199, 154, 85, .04);
}
.stage-work summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--brass-hi);
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}
.stage-work summary::-webkit-details-marker { display: none; }
.stage-work__block { margin-top: 12px; }
.stage-work__block > b {
  display: block;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
}
.tasks, .accept-list { list-style: none; margin: 6px 0 0; padding: 0; }
.task {
  display: block;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}
.task:first-child { border-top: 0; }
.task__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task__head b { font-size: 16px; font-weight: 600; line-height: 1.3; }
.task__meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.task__desc { margin: 6px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.task__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.task__history { margin-top: 8px; }
.task__history summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--brass-hi);
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}
.task__history summary::-webkit-details-marker { display: none; }
.timeline { list-style: none; margin: 6px 0 0; padding: 0; }
.timeline li {
  padding: 5px 0 5px 12px;
  border-left: 1px solid var(--line);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
}
.timeline span { display: block; }
.timeline small { display: block; color: var(--muted); font-size: 15px; }
.accept-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.45;
}
.accept-list li:first-child { border-top: 0; }

/* ---------- warranty and referral ---------- */

.warranty {
  display: grid;
  gap: 14px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background:
    linear-gradient(150deg, rgba(199, 154, 85, .08), transparent 60%),
    var(--card);
}
.warranty-big, .warranty__big {
  font-family: 'Dela Gothic One', 'Inter Tight', sans-serif;
  font-size: 44px;
  line-height: 1;
  color: var(--brass-hi);
  letter-spacing: -.02em;
}
.warranty p, .warranty__body p { margin: 8px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.55; }
.warranty ul { margin: 10px 0 0; padding-left: 20px; color: var(--ink-soft); font-size: 15px; }
.warranty li { margin: 4px 0; }
.warranty__body .btn { margin-top: 14px; }

.friend {
  padding: 18px 16px;
  border: 1px dashed rgba(199, 154, 85, .45);
  border-radius: var(--r);
  background: linear-gradient(160deg, rgba(199, 154, 85, .1), rgba(199, 154, 85, .02));
}
.friend__code {
  margin: 8px 0 10px;
  font-family: 'Dela Gothic One', 'Inter Tight', sans-serif;
  font-size: clamp(24px, 7vw, 34px);
  letter-spacing: .04em;
  color: var(--brass-hi);
  overflow-wrap: anywhere;
}
.friend p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.55; max-width: 52ch; }
.friend__stats { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 16px; }
.friend__stats b {
  display: block;
  font-family: 'Dela Gothic One', 'Inter Tight', sans-serif;
  font-size: 22px;
  color: var(--ink);
}
.friend__stats small { display: block; margin-top: 3px; font-size: 15px; color: var(--muted); }

/* ---------- forms ---------- */

.panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.panel h2 { margin-bottom: 14px; }
details.panel > summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--brass-hi);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; margin-left: auto; font-size: 20px; color: var(--muted); }
details.panel[open] > summary::after { content: "-"; }
details.panel > summary + * { margin-top: 4px; }
.field { margin-bottom: 14px; }
.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 15px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-2);
  color: var(--ink);
  font-family: inherit;
  font-size: 17px;
  line-height: 1.4;
  transition: border-color .2s;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--dim); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brass); }
.field input[type="file"] { padding: 10px; font-size: 15px; color: var(--muted); }
.field .hint { margin: 6px 0 0; color: var(--dim); font-size: 15px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 0; }

.flash {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-left: 2px solid var(--brass);
  background: rgba(199, 154, 85, .08);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.flash--err { border-left-color: var(--err); background: rgba(229, 134, 118, .09); }
.form-success { padding: 12px 14px; border-left: 2px solid var(--ok); background: rgba(143, 191, 138, .08); font-size: 15px; color: var(--ink-soft); }
.form-error { padding: 12px 14px; border-left: 2px solid var(--err); background: rgba(229, 134, 118, .08); font-size: 15px; color: var(--ink-soft); }

/* ---------- gate: login, index, lead form ---------- */

.gate { max-width: 560px; padding-top: 30px; }
.gate h1 { font-size: clamp(30px, 8vw, 44px); }
.gate__form { margin-top: 22px; }
.gate__list { list-style: none; margin: 26px 0 0; padding: 0; }
.gate__list li {
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.gate__list b { color: var(--ink); font-weight: 600; }
.gate__demo { margin-top: 20px; font-size: 15px; }
.gate__demo a { color: var(--brass); border-bottom: 1px solid rgba(199, 154, 85, .4); }
.gate__contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
.gate__contact p { flex: 0 0 100%; margin: 0; color: var(--muted); font-size: 15px; }
.gate__contact .fine { flex: 0 0 100%; margin: 0; }

/* ---------- states: empty, error, loading ---------- */

.statepanel { display: none; }
.statecard {
  padding: 22px 16px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r);
}
.statecard__ico {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  color: var(--brass-hi);
  font-size: 22px;
}
.statecard h3 { margin: 0 0 6px; font-size: 19px; font-weight: 600; }
.statecard p { margin: 0 0 16px; color: var(--muted); font-size: 15px; }
.statecard .btn { width: 100%; }
.statecard .btn + .btn { margin-top: 8px; }
.skel { margin-top: 14px; }
.skel i {
  display: block;
  height: 14px;
  margin-bottom: 10px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(243, 238, 229, .06), rgba(243, 238, 229, .13), rgba(243, 238, 229, .06));
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skel i:nth-child(1) { width: 62%; height: 22px; }
.skel i:nth-child(2) { width: 88%; }
.skel i:nth-child(3) { width: 74%; }
.skel i:nth-child(4) { width: 40%; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* Client panels: hidden only when the script is on. Without JS everything is shown. */
.client { padding-top: 14px; }
.client .view { display: block; }
.client.has-tabs .view { display: none; }
.client.has-tabs .view.is-active { display: block; }

/* ---------- admin shell ---------- */

.admin { max-width: 1080px; padding-top: 20px; }
.admin__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin: 18px 0 16px;
}
.admin__head h1 { margin: 4px 0 0; font-size: clamp(26px, 5vw, 38px); }
.admin__totals { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.admin__totals > div { min-width: 0; }
.admin__totals b {
  display: block;
  font-family: 'Dela Gothic One', 'Inter Tight', sans-serif;
  font-size: 20px;
  color: var(--brass-hi);
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.admin__totals small { display: block; margin-top: 3px; font-size: 15px; color: var(--muted); }
.admin__grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 18px; }
details.panel .panel { border-color: var(--line-soft); background: transparent; }
details.panel:not([open]) { padding-bottom: 10px; }
details.panel .admin__grid { margin-top: 12px; }

.acard {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.acard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.acard__top b { display: block; font-size: 18px; font-weight: 600; line-height: 1.25; }
.acard__top small { display: block; margin-top: 3px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.acard__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
}
.acard__stats b { color: var(--ink); font-size: 16px; }
.acard__stages { margin-top: 12px; }
.acard__stages summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--brass-hi);
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}
.acard__stages summary::-webkit-details-marker { display: none; }
.admin-stages { list-style: none; margin: 8px 0 0; padding: 0; }
.admin-stages li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 15px;
  min-width: 0;
}
.admin-stages__title { flex: 1 1 160px; min-width: 130px; overflow-wrap: anywhere; }
.admin-stages__weight { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- tables (staff lists) ---------- */

.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
.receipts-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.receipts-admin-head h2 { margin-bottom: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}
.table td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; }
.lead-deal-form {
  margin: 10px 0;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}
.lead-deal-form .grid2 { gap: 0 10px; }
.lead-deal-form .field { margin-bottom: 8px; }

/* ---------- lead registry ---------- */

.leads-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; }
.lead-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lead-status select { padding: 8px 10px; font-size: 15px; width: auto; min-width: 110px; }
.lead-details summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--brass-hi);
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}
.lead-details summary::-webkit-details-marker { display: none; }
.lead-details dl { margin: 8px 0 0; }
.lead-details dl div { display: flex; flex-wrap: wrap; gap: 4px 8px; padding: 3px 0; }
.lead-details dt { flex: 0 0 68px; color: var(--muted); font-size: 15px; }
.lead-details dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }

/* ---------- lead cards (owner panel) ---------- */

.lead-grid { display: block; }
.lead-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.lead-card + .lead-card { margin-top: 10px; }
.lead-card__top { display: flex; align-items: flex-start; gap: 10px; }
.lead-card__who { flex: 1 1 auto; }
.lead-card__who b { display: block; font-size: 19px; font-weight: 600; line-height: 1.25; }
.lead-card__who small { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; }
.lead-card__who a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.lead-card__desc { margin: 10px 0 0; color: var(--ink-soft); font-size: 15px; }
.lead-card__money {
  margin-top: 12px;
  padding: 12px;
  border-radius: 3px;
  background: rgba(199, 154, 85, .07);
  border: 1px solid rgba(199, 154, 85, .18);
}
.lead-card__money b { font-size: 16px; font-weight: 600; }
.lead-card__money small { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.lead-card__foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.lead-card__warn {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--err);
  background: rgba(229, 134, 118, .08);
  font-size: 15px;
  line-height: 1.45;
}
.lead-card details { margin-top: 12px; border-top: 1px solid var(--line-soft); padding-top: 6px; }
.lead-card details summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  cursor: pointer;
  color: var(--brass-hi);
  font-size: 15px;
  list-style: none;
}
.lead-card details summary::-webkit-details-marker { display: none; }
.lead-card details summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 20px; }
.lead-card details[open] summary::after { content: "-"; }
.lead-card .lead-status { margin-top: 8px; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; margin: 8px 0 0; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; color: var(--ink-soft); overflow-wrap: anywhere; }

.source { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--ink-soft); }
.source i { width: 8px; height: 8px; border-radius: 50%; background: var(--brass); display: block; flex: 0 0 auto; }
.source--site i { background: #7FA7C9; }
.source--avito i { background: #9AC77F; }
.source--maps i { background: #C9A87F; }
.source--rec i { background: #C79AC9; }
.source--none i { background: var(--err); }

/* ---------- stats, filter chips, objects ---------- */

.stat-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.stat span { display: block; color: var(--muted); font-size: 15px; }
.stat b { display: block; margin-top: 2px; font-size: 20px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.stat b.is-brass { color: var(--brass-hi); }
.stat b.is-err { color: var(--err); }
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 15px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 15px;
}
.chip[aria-pressed="true"] { background: var(--brass); border-color: var(--brass); color: var(--on-brass); font-weight: 600; }
.chip:hover { border-color: var(--brass); color: var(--brass-hi); }
.chip[aria-pressed="true"]:hover { color: var(--on-brass); }

.objgrid { display: block; }
.objcard { padding: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.objcard + .objcard { margin-top: 10px; }
.objcard__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.objcard__top b { font-size: 19px; font-weight: 600; line-height: 1.25; }
.objcard__top small { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; }
.objcard .progress { margin: 14px 0 8px; }
.objcard__stats { display: flex; gap: 6px 14px; flex-wrap: wrap; color: var(--muted); font-size: 15px; }
.objcard__stats b { color: var(--ink); font-weight: 600; }
.objcard__alert {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 2px solid var(--err);
  background: rgba(229, 134, 118, .08);
  font-size: 15px;
  color: var(--ink-soft);
}

/* ---------- reconciliation ---------- */

.totals {
  padding: 18px 16px;
  border: 1px solid rgba(199, 154, 85, .3);
  border-radius: var(--r);
  background: linear-gradient(160deg, rgba(199, 154, 85, .11), rgba(199, 154, 85, .015) 60%), var(--card);
}
.totals__big {
  font-family: 'Dela Gothic One', 'Inter Tight', sans-serif;
  font-size: clamp(30px, 8vw, 38px);
  line-height: 1.05;
  color: var(--brass-hi);
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.totals__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 14px; }
.totals__grid span { display: block; color: var(--muted); font-size: 15px; }
.totals__grid b { display: block; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.deal { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.deal:last-child { border-bottom: 0; }
.deal__top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.deal__top b { font-size: 17px; font-weight: 600; }
.deal__top small { display: block; color: var(--muted); font-size: 15px; }
.deal__money { margin-left: auto; text-align: right; white-space: nowrap; }
.deal__money b { display: block; font-size: 17px; }
.deal__money small { display: block; color: var(--muted); font-size: 15px; }
.deal__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.deal__foot .btn { margin-left: auto; }

/* ---------- tasks by day ---------- */

.taskgroup { margin-top: 20px; }
.taskgroup__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.taskgroup__head b { font-size: 17px; font-weight: 600; }
.taskgroup__head span { color: var(--muted); font-size: 15px; }
.taskgroup--late .taskgroup__head b { color: var(--err); }
.taskgroup .task { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.taskgroup .task__body { flex: 1 1 auto; }
.taskgroup .task__body b { display: block; font-size: 16px; font-weight: 600; line-height: 1.3; }
.taskgroup .task__body small { display: block; color: var(--muted); font-size: 15px; }
.task__end { margin-left: auto; flex: 0 0 auto; }

/* ---------- changes (client) ---------- */

.changes { list-style: none; margin: 12px 0 0; padding: 0; }
.change {
  display: block;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--card);
}
.change.is-sent { border-color: rgba(199, 154, 85, .34); background: linear-gradient(160deg, rgba(199, 154, 85, .12), rgba(199, 154, 85, .02) 60%), var(--card); }
.change.is-approved { border-color: rgba(143, 191, 138, .35); }
.change__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.change__head > div { min-width: 0; }
.change__head .pill { flex: 0 0 auto; }
.change__head b { display: block; font-size: 18px; font-weight: 600; line-height: 1.3; }
.change__head small { display: block; margin-top: 2px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.change__amount {
  font-family: 'Dela Gothic One', 'Inter Tight', sans-serif;
  font-size: 26px;
  line-height: 1.1;
  color: var(--brass-hi);
  margin: 10px 0 0;
}
.change__decision {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--ok);
  background: rgba(143, 191, 138, .08);
  font-size: 15px;
  color: var(--ink-soft);
}
.change__items { margin-top: 10px; }
.change__items summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--brass-hi);
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}
.change__items summary::-webkit-details-marker { display: none; }
.change__items ul { list-style: none; margin: 4px 0 0; padding: 0; }
.change__items li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 15px;
}
.change__items li small { display: block; color: var(--muted); font-size: 15px; }
.change__items li b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.change__actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.change__actions .btn { width: 100%; }
.change__confirm { margin-top: 12px; border-top: 1px solid var(--line-soft); }
.change__confirm > summary {
  display: flex;
  align-items: center;
  min-height: 52px;
  color: var(--brass-hi);
  font-size: 16px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.change__confirm > summary::-webkit-details-marker { display: none; }
.change__confirm > summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 20px; }
.change__confirm[open] > summary::after { content: "-"; }
.change__confirm-body { padding: 4px 0 2px; }
.change__confirm-body p { margin: 0 0 12px; color: var(--ink-soft); font-size: 15px; }

/* ---------- action journal ---------- */

.log-filter__actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.log { list-style: none; margin: 16px 0 0; padding: 0; border-top: 1px solid var(--line-soft); }
.log__item { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.log__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.log__top b { font-size: 16px; font-weight: 600; line-height: 1.35; }
.log__top time { flex: 0 0 auto; color: var(--muted); font-size: 15px; font-variant-numeric: tabular-nums; }
.log__who { margin: 3px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.log__diff {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-left: 2px solid rgba(199, 154, 85, .4);
  background: rgba(199, 154, 85, .05);
  font-size: 15px;
  line-height: 1.5;
}
.log__row { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 2px 0; }
.log__row dt { flex: 0 0 auto; color: var(--muted); font-size: 15px; padding-top: 1px; }
.log__row dd { margin: 0; overflow-wrap: anywhere; }
.log__old { color: var(--dim); text-decoration: line-through; }
.log__new { color: var(--brass-hi); }
.log__arrow { color: var(--dim); padding: 0 2px; }
.log__meta { margin-top: 6px; }
.log__meta summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}
.log__meta summary::-webkit-details-marker { display: none; }
.log--mini .log__item { padding: 10px 0; }
.log--mini .log__top b { font-size: 15px; }
.log__brief { display: flex; flex-wrap: wrap; gap: 3px 10px; margin: 4px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.log__brief span { overflow-wrap: anywhere; }
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- staff list ---------- */

.staff-new { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.staff-new summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--brass-hi);
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}
.staff-new summary::-webkit-details-marker { display: none; }
.staff-new form { margin-top: 12px; }
.people { list-style: none; margin: 0; padding: 0; }
.person { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.person.is-self { background: rgba(199, 154, 85, .04); }
.person__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.person__head b { display: block; font-size: 16px; font-weight: 600; line-height: 1.35; }
.person__head small { display: block; margin-top: 3px; color: var(--muted); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.person__forms { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 10px; }
.person__form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.person__form .field { margin: 0; min-width: 150px; flex: 1 1 150px; }
.person__pass { flex: 1 1 100%; }
.person__pass summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--brass-hi);
  font-size: 15px;
  cursor: pointer;
  list-style: none;
}
.person__pass summary::-webkit-details-marker { display: none; }
.person__pass form { margin-top: 8px; }
.checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  color: var(--ink-soft);
  font-size: 15px;
}
.checkline input { width: auto; min-height: auto; }

/* ---------- rights matrix ---------- */

.matrix { table-layout: fixed; width: 100%; min-width: 0; }
.matrix th, .matrix td { text-align: center; padding: 8px 4px; }
.matrix th:first-child, .matrix td:first-child { text-align: left; width: 42%; min-width: 0; }
.matrix th { font-size: 15px; line-height: 1.2; white-space: normal; }
.matrix__full { display: none; }
.matrix__short { display: inline; }
.matrix td:first-child { font-size: 15px; line-height: 1.3; }
.matrix__cell { font-size: 15px; }
.matrix__cell.is-yes { color: var(--brass-hi); }
.matrix__cell.is-no { color: var(--dim); }
.matrix .is-me { background: rgba(199, 154, 85, .07); }
.matrix th.is-me { color: var(--brass-hi); }
.rules { list-style: none; margin: 0; padding: 0; }
.rules li { padding: 10px 0; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 15px; line-height: 1.55; }
.rules li:first-child { border-top: 0; padding-top: 0; }
.rules b { color: var(--ink); font-weight: 600; }
.admin-stages__note { color: var(--dim); font-size: 15px; max-width: 100%; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .admin-stages__title { flex: 1 1 100%; min-width: 0; }
  .admin-stages__weight { order: 2; }
  .admin-stages li .pill { order: 3; max-width: 100%; }
  .admin-stages li form { order: 4; }
}

/* ---------- digest and receipts admin ---------- */

.digest-test { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.digest-cron { margin-top: 14px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r); }
.digest-cron b { display: block; color: var(--muted); font-size: 15px; font-weight: 600; }
.digest-cron code { display: block; margin-top: 6px; }
.digest-runs { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid var(--line-soft); }
.digest-runs li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
}
.digest-runs small { flex: 1 1 100%; color: var(--muted); font-size: 15px; }

.receipt-view { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.receipt-view__photo { flex: 0 0 auto; }
.receipt-view__photo img {
  width: 180px;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
}
.receipt-view__fields { flex: 1 1 260px; min-width: 0; margin: 0; }
.receipt-view__fields div {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  padding: 7px 0;
  border-top: 1px solid var(--line-soft);
}
.receipt-view__fields div:first-child { border-top: 0; padding-top: 0; }
.receipt-view__fields dt { flex: 0 0 110px; color: var(--muted); font-size: 15px; }
.receipt-view__fields dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.qr-raw { display: block; padding: 10px; background: var(--bg-3); font-size: 15px; line-height: 1.5; word-break: break-word; }

/* Honeypot field: hidden from people, visible to simple bots. */
.lead-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- footer ---------- */

.foot {
  max-width: var(--max);
  margin: 44px auto 0;
  padding: 24px var(--pad) 40px;
  border-top: 1px solid var(--line-soft);
}
body.has-tabbar .foot { padding-bottom: 24px; }
.foot__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.foot__in p { margin: 6px 0 0; color: var(--dim); font-size: 15px; }
.foot__links { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.foot__links a { color: var(--brass-hi); }
.foot__links span { color: var(--muted); }
.foot__note { margin: 16px 0 0; color: var(--dim); font-size: 15px; line-height: 1.5; max-width: 62ch; }

/* ---------- larger screens ---------- */

@media (min-width: 560px) {
  .grid2 { grid-template-columns: 1fr 1fr; gap: 0 12px; }
  .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .money__sums, .sums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .money__sums > div:last-child, .sums > div:last-child { grid-column: auto; }
  .status { padding: 20px; }
  .status__grid, .meta-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin__totals { display: flex; flex-wrap: wrap; gap: 16px 24px; }
  .warranty { grid-template-columns: 160px minmax(0, 1fr); align-items: center; }
  .change__actions { flex-direction: row; }
  .change__actions .btn { width: auto; flex: 1 1 180px; }
  .attention .btn, .statecard .btn { width: auto; min-width: 240px; }
  .matrix__full { display: inline; }
  .matrix__short { display: none; }
}

@media (min-width: 720px) {
  .admin__grid { grid-template-columns: 1fr 1fr; }
  .lead-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .lead-card + .lead-card { margin-top: 0; }
  .objgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .objcard + .objcard { margin-top: 0; }
  .stat-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .day__note, .daynote { font-size: 16px; }
}

@media (max-width: 640px) {
  .table-wrap { overflow-x: visible; }
  .table:not(.matrix) thead { display: none; }
  .table:not(.matrix),
  .table:not(.matrix) tbody,
  .table:not(.matrix) tr,
  .table:not(.matrix) td { display: block; width: 100%; }
  .table:not(.matrix) tr { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
  .table:not(.matrix) td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 0;
    border: 0;
    font-size: 15px;
    text-align: right;
  }
  .table:not(.matrix) td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    padding-top: 1px;
    color: var(--muted);
    font-size: 15px;
    text-align: left;
  }
  .table:not(.matrix) td[data-label="Фото"],
  .table:not(.matrix) td[data-label="Действие"] { justify-content: flex-end; }
  .table:not(.matrix) td[data-label="Фото"]::before,
  .table:not(.matrix) td[data-label="Действие"]::before { margin-right: auto; }
  .admin { padding-top: 16px; }
}

@media (max-width: 420px) {
  .topbar__tag { display: none; }
  .topbar__in { gap: 8px; }
}

@media (max-width: 380px) {
  :root { --pad: 14px; }
  body { font-size: 15px; }
  .admin-stages__title { flex: 1 1 100%; min-width: 0; }
  .admin-stages__weight { order: 2; }
  .admin-stages li .pill { order: 3; }
  .status__pct, .pct { font-size: 26px; }
  .tabbar a { font-size: 15px; padding: 6px 2px; }
  .tabbar__ico { font-size: 18px; }
  .btn { font-size: 16px; padding: 12px 14px; }
  .lead-card__who b, .objcard__top b, .status__stage, .statuscard__stage { font-size: 18px; }
  .chips { gap: 6px; }
  .chips a, .chips__button { padding: 8px 12px; }
  .money__sums b, .sums b { font-size: 16px; }
  .deal__money { margin-left: 0; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .skel i { animation: none; }
}
