/* BRUTMAN App. The site's look (Archivo + Inter, the cold whites and greys, blue #1F5FA8), made for a phone first:
   one column, a tab bar at the bottom; on a computer the tabs move to a side bar. */
/* the brand fonts live with the app (variable: Archivo width 62-125 and weight 100-900, Inter weight 100-900), so it looks
   the same without internet */
@font-face { font-family: 'Archivo'; src: url(/fonts/Archivo.ttf) format('truetype'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Inter'; src: url(/fonts/Inter.ttf) format('truetype'); font-weight: 100 900; font-display: swap; }
:root {
  --canvas: #F2F4F6; --panel: #FFFFFF; --panel-2: #F7F9FA; --line: #D9DFE5; --line-strong: #AEB8C2;
  --ink: #12171D; --ink-2: #3F4852; --mute: #55616D; --faint: #8794A0;
  --accent: #1F5FA8; --accent-hover: #184C87; --accent-soft: #E4EDF8; --accent-muted: #C9D8EA;
  --ok: #2F7D6D; --ok-soft: #E1F0EC; --warn: #9A6A12; --warn-soft: #F7EFDC; --danger: #B4233A; --danger-soft: #F8E4E7;
  --r: 14px; --r-s: 10px; --shadow: 0 1px 2px rgba(18, 23, 29, .06), 0 4px 16px rgba(18, 23, 29, .05);
  --head: 'Archivo', 'Inter', system-ui, sans-serif; --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 64px; --top-h: 56px;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.45 var(--body); }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, video { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--head); font-stretch: 112%; font-weight: 700; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 22px; line-height: 1.2; }
h2 { font-size: 17px; line-height: 1.25; }
h3 { font-size: 15px; }
.mute { color: var(--mute); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.top {
  position: sticky; top: 0; z-index: 20; height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0 16px;
  display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.top .back { margin-left: -8px; }
.top-title { flex: 1; min-width: 0; font: 700 17px/1.2 var(--head); font-stretch: 112%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { display: flex; align-items: center; min-width: 0; }
.brand { display: block; width: auto; max-width: 100%; }
.nav .nav-brand { display: none; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { background: var(--panel-2); }
.icon-btn svg { width: 22px; height: 22px; }
.dot-badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font: 600 11px/18px var(--body); text-align: center; }
main { padding: 16px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 980px; margin: 0 auto; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.nav a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--mute); font-size: 11px; font-weight: 500; }
.nav a svg { width: 23px; height: 23px; }
.nav a.on { color: var(--accent); }
.nav a .dot-badge { top: 6px; right: calc(50% - 22px); }
.nav .side-only { display: none; }

@media (min-width: 900px) {
  body { padding-left: 232px; }
  .nav { top: 0; right: auto; width: 232px; height: auto; flex-direction: column; justify-content: flex-start; gap: 2px; padding: 18px 12px; border-top: 0; border-right: 1px solid var(--line); background: var(--panel); }
  .nav .nav-brand { display: block; padding: 8px 12px 26px; background: none; }
  .nav .nav-brand:hover { background: none; }
  .nav a { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; color: var(--ink-2); }
  .nav a:hover { background: var(--panel-2); }
  .nav a.on { background: var(--accent-soft); color: var(--accent); }
  .nav a svg { width: 20px; height: 20px; }
  .nav a .dot-badge { position: static; margin-left: auto; }
  .nav .side-only { display: flex; }
  .nav .bar-only { display: none; }
  .top .logo { display: none; }
  main { padding: 24px 28px 48px; max-width: 1240px; }
}

/* ---------- blocks ---------- */
.stack > * + * { margin-top: 12px; }
.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 10px; }
.section-head h2 { font-size: 15px; }
.section-head .count { color: var(--mute); font-weight: 500; font-family: var(--body); font-stretch: 100%; margin-left: 6px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card.pad { padding: 14px 16px; }
.card + .card { margin-top: 10px; }
.banner { padding: 12px 14px; border-radius: var(--r-s); background: var(--accent-soft); color: var(--accent-hover); font-size: 14px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner b { font-weight: 600; }
.empty { padding: 28px 16px; text-align: center; color: var(--mute); font-size: 14px; }

.list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; color: inherit; border-bottom: 1px solid var(--line); background: none; width: 100%; text-align: left; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; }
.row:last-child { border-bottom: 0; }
a.row:hover, button.row:hover { background: var(--panel-2); }
.row-main { flex: 1; min-width: 0; }
.row-title, .row-sub { display: block; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--mute); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.row-side { text-align: right; flex: none; font-size: 13px; color: var(--mute); }
.row-side b { display: block; color: var(--ink); font-weight: 600; font-size: 14px; }
.chev { width: 16px; height: 16px; color: var(--faint); flex: none; }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--panel-2); flex: none; border: 1px solid var(--line); }
.thumb.ph { display: grid; place-items: center; color: var(--faint); }
.thumb.ph svg { width: 22px; height: 22px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px; }

.kv { display: grid; grid-template-columns: minmax(96px, 38%) 1fr; gap: 8px 14px; margin: 0; }
.kv dt { color: var(--mute); font-size: 13px; padding-top: 1px; }
.kv dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.kv dd.empty-v { color: var(--faint); font-weight: 400; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: block; padding: 14px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; }
.tile small { display: block; color: var(--mute); font-size: 12px; }
.tile b { display: block; margin-top: 6px; font: 700 26px/1 var(--head); font-stretch: 112%; font-variant-numeric: tabular-nums; }
.tile.hot b { color: var(--accent); }
.tile.alert b { color: var(--danger); }

/* chips and statuses */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.chip.demo { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.chip.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.chip.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.chip.blue { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.st { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-accepted { background: var(--accent-soft); color: var(--accent); }
.st-received { background: #D7E4F3; color: #184C87; }
.st-in_work { background: var(--accent); color: #fff; }
.st-finishing { background: #184C87; color: #fff; }
.st-done { background: var(--ok-soft); color: var(--ok); }
.st-ready { background: var(--ok); color: #fff; }
.st-delivered, .st-shipped { background: var(--ink); color: #fff; }
.st-cancelled { background: var(--panel-2); color: var(--faint); text-decoration: line-through; }
.st-new { background: var(--accent); color: #fff; }
.st-confirmed { background: var(--ok-soft); color: var(--ok); }
.st-rejected { background: var(--panel-2); color: var(--mute); }

/* picker chips (services, masters, categories) */
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 13px; border-radius: 18px; border: 1px solid var(--line-strong); background: var(--panel); font-size: 14px; cursor: pointer; user-select: none; }
.pick input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.danger { background: var(--panel); color: var(--danger); border-color: #E6B9C1; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ok { background: var(--ok); }
.btn.dark { background: var(--ink); }
.btn.wa { background: #1F8B4D; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.block { width: 100%; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btns.end { justify-content: flex-end; }
.btns > .btn.grow { flex: 1; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 500; cursor: pointer; font-size: 14px; }
.fab { position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 25; width: 56px; height: 56px; border-radius: 18px; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(31, 95, 168, .35); cursor: pointer; }
.fab svg { width: 26px; height: 26px; }
@media (min-width: 900px) { .fab { bottom: 28px; right: 28px; } }

/* forms */
.form > * + * { margin-top: 14px; }
.field label, .field .label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .hint { margin-top: 6px; font-size: 12.5px; color: var(--mute); }
.input, select.input, textarea.input { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel); font-size: 16px; outline: none; }
textarea.input { min-height: 92px; resize: vertical; line-height: 1.4; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.grid2 > *, .grid3 > * { margin-top: 0 !important; min-width: 0; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* segmented tabs */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #E6EAEE; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button, .seg a { flex: 1 0 auto; min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg .on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(18, 23, 29, .12); font-weight: 600; }
.seg .n { font-size: 12px; color: var(--mute); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 12px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 12px 10px; color: var(--mute); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a.on { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.tabs a .n { font-size: 12px; color: var(--faint); margin-left: 3px; }
@media (min-width: 900px) { .tabs { margin: 0; padding: 0; } }

/* the project header and status steps */
.p-head { display: flex; gap: 14px; align-items: flex-start; }
.p-head .thumb { width: 64px; height: 64px; border-radius: 12px; }
.p-head h1 { font-size: 20px; }
.p-meta { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.steps { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.steps::-webkit-scrollbar { display: none; }
.step { flex: 1 0 auto; min-width: 74px; padding: 8px 8px 7px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); text-align: left; cursor: pointer; font-size: 11.5px; line-height: 1.25; color: var(--mute); }
.step i { display: block; height: 4px; border-radius: 2px; background: var(--line); margin-bottom: 7px; }
.step.past i { background: var(--accent-muted); }
.step.now { border-color: var(--accent); color: var(--ink); font-weight: 600; background: var(--accent-soft); }
.step.now i { background: var(--accent); }
.step:disabled { cursor: default; }

/* the board */
.board { display: flex; gap: 12px; overflow-x: auto; padding: 2px 16px 12px; margin: 0 -16px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.col { flex: 0 0 82%; max-width: 320px; scroll-snap-align: start; }
@media (min-width: 900px) { .board { margin: 0; padding: 2px 0 12px; } .col { flex-basis: 260px; } }
.col-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.col-head .n { color: var(--mute); font-size: 13px; }
.pcard { display: block; padding: 10px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); color: inherit; }
.pcard + .pcard { margin-top: 8px; }
.pcard .pc-top { display: flex; gap: 10px; }
.pcard .pc-num { font-size: 12px; color: var(--mute); font-weight: 600; }
.pcard .pc-car { font-weight: 600; line-height: 1.25; }
.pcard .pc-dates { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.pcard .chips { margin-top: 8px; }

/* photos */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
@media (min-width: 700px) { .photos { grid-template-columns: repeat(5, 1fr); } }
.ph-tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--panel-2); border: 0; padding: 0; cursor: pointer; }
.ph-tile img { width: 100%; height: 100%; object-fit: cover; }
.ph-tile .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(18, 23, 29, .25); color: #fff; }
.ph-tile .play svg { width: 34px; height: 34px; }
.ph-tile .vid-name { position: absolute; left: 6px; right: 6px; bottom: 6px; color: #fff; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph-tile.pdf { display: grid; place-items: center; color: var(--danger); font-weight: 700; font-size: 13px; border: 1px solid var(--line); }
.ph-tile .stage-tag { position: absolute; left: 6px; top: 6px; padding: 2px 6px; border-radius: 6px; background: rgba(18, 23, 29, .6); color: #fff; font-size: 10.5px; font-weight: 600; }
.ph-add { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; border: 1.5px dashed var(--line-strong); color: var(--accent); background: var(--panel); cursor: pointer; }
.ph-add svg { width: 26px; height: 26px; }
.uploading { position: relative; aspect-ratio: 1; border-radius: 10px; background: var(--panel-2); display: grid; place-items: center; font-size: 12px; color: var(--mute); border: 1px solid var(--line); }
.uploading::after { content: ''; position: absolute; left: 0; bottom: 0; height: 4px; width: var(--p, 0%); background: var(--accent); transition: width .2s; }

/* the viewer */
.viewer { position: fixed; inset: 0; z-index: 80; background: rgba(8, 10, 13, .96); display: flex; flex-direction: column; }
.viewer-top { display: flex; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top)) 8px 8px 16px; color: #fff; }
.viewer-top .icon-btn { color: #fff; }
.viewer-top .icon-btn:hover { background: rgba(255, 255, 255, .1); }
.viewer-top span { flex: 1; font-size: 13px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-body { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 0 calc(12px + env(safe-area-inset-bottom)); }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 64px; border: 0; background: transparent; color: #fff; cursor: pointer; opacity: .8; }
.viewer-nav.prev { left: 0; } .viewer-nav.next { right: 0; }
.viewer-nav svg { width: 28px; height: 28px; }

/* the sheet (a form sliding up from the bottom; a dialog on a computer) */
.sheet-back { position: fixed; inset: 0; z-index: 60; background: rgba(18, 23, 29, .42); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease; }
.sheet { width: 100%; max-width: 560px; max-height: calc(100% - 24px); display: flex; flex-direction: column; background: var(--panel); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(18, 23, 29, .18); animation: up .2s ease; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 14px 10px 10px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; }
.sheet-body { padding: 16px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-foot { padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 8px; }
.sheet-foot .btn { flex: 1; }
@media (min-width: 700px) { .sheet-back { align-items: center; } .sheet { border-radius: 18px; max-height: 88vh; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); animation: up .2s ease; }
.toast.err { background: var(--danger); }

/* tasks */
.task { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.task:last-child { border-bottom: 0; }
.task .tick { flex: none; width: 28px; height: 28px; margin-top: 1px; border-radius: 9px; border: 2px solid var(--line-strong); background: var(--panel); display: grid; place-items: center; cursor: pointer; color: #fff; padding: 0; }
.task .tick svg { width: 16px; height: 16px; opacity: 0; }
.task.done .tick { background: var(--ok); border-color: var(--ok); }
.task.done .tick svg { opacity: 1; }
.task .tick:disabled { cursor: default; opacity: .6; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; }
.task.done .task-title { color: var(--mute); text-decoration: line-through; }
.task-meta { margin-top: 3px; font-size: 12.5px; color: var(--mute); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.task-meta .late { color: var(--danger); font-weight: 600; }
.task-details { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); white-space: pre-wrap; }
.task-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; }
.msg { max-width: 86%; align-self: flex-start; }
.msg.me { align-self: flex-end; }
.msg-who { font-size: 11.5px; color: var(--mute); margin: 0 4px 3px; }
.msg.me .msg-who { text-align: right; }
.bubble { padding: 9px 12px; border-radius: 16px 16px 16px 6px; background: var(--panel); border: 1px solid var(--line); overflow-wrap: anywhere; }
.msg-text { white-space: pre-wrap; }
.msg.me .bubble { border-radius: 16px 16px 6px 16px; background: var(--accent-soft); border-color: transparent; }
.msg.issue .bubble { background: var(--danger-soft); border: 1px solid #E6B9C1; }
.msg.issue.resolved .bubble { background: var(--panel); border-color: var(--line); }
.issue-tag { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--danger); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.msg.resolved .issue-tag { color: var(--ok); }
.msg .photos { grid-template-columns: repeat(3, 72px); margin-top: 6px; }
.msg-sys { align-self: center; font-size: 12px; color: var(--mute); background: #E6EAEE; padding: 4px 10px; border-radius: 10px; text-align: center; max-width: 92%; }
.composer { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); margin: 8px -16px 0; padding: 10px 12px; background: rgba(242, 244, 246, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
@media (min-width: 900px) { .composer { bottom: 0; margin: 8px 0 0; border-radius: 14px; border: 1px solid var(--line); } }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--panel); font-size: 16px; outline: none; line-height: 1.35; }
.composer .icon-btn { flex: none; width: 44px; height: 44px; background: var(--panel); border: 1px solid var(--line-strong); }
.composer .send { background: var(--accent); color: #fff; border-color: var(--accent); }
.composer .send:hover { background: var(--accent-hover); }
.composer-files { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.composer-files .chip { height: 30px; }
.composer .check { margin-top: 8px; font-size: 13px; }

/* the calendar */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head h2 { flex: 1; text-align: center; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .wd { text-align: center; font-size: 11px; color: var(--mute); padding: 2px 0 4px; font-weight: 600; }
.cal .day { position: relative; min-height: 64px; padding: 5px 5px 6px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.cal .day.out { opacity: .4; }
.cal .day.off { background: transparent; border-style: dashed; }
.cal .day.closed { background: repeating-linear-gradient(135deg, #EEF0F2 0 6px, #E4E7EA 6px 12px); }
.cal .day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal .day.sel { background: var(--accent-soft); border-color: var(--accent); }
.cal .day .dn { font-weight: 600; font-size: 13px; }
.cal .bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.cal .bar i { display: block; height: 100%; background: var(--accent); }
.cal .bar.full i { background: var(--ink); width: 100% !important; }
.cal .marks { display: flex; gap: 3px; flex-wrap: wrap; }
.mk { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.mk.in { background: var(--accent); }
.mk.rd { background: var(--ok); }
.cal .cl { font-size: 10px; color: var(--mute); line-height: 1.1; }
@media (min-width: 700px) { .cal .day { min-height: 84px; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--mute); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* bars in the report */
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-row .track { height: 12px; }
.bar-row .track i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
.bar-row .v { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 44px; text-align: right; }
.trend { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; height: 150px; padding-top: 8px; }
.trend .m { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend .pair { display: flex; gap: 2px; align-items: flex-end; height: 110px; border-bottom: 1px solid var(--line); }
.trend .pair i { display: block; width: 14px; border-radius: 4px 4px 0 0; min-height: 2px; }
.trend .pair .rev { background: var(--accent); }
.trend .pair .exp { background: #A5562A; } /* blue + copper: checked for colour-blind readers */
.trend small { font-size: 11px; color: var(--mute); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 6px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table th { color: var(--mute); font-weight: 500; }

/* signature */
.sign { position: relative; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: #fff; touch-action: none; }
.sign canvas { display: block; width: 100%; height: 190px; border-radius: 12px; }
.sign .sign-line { position: absolute; left: 18px; right: 18px; bottom: 44px; border-bottom: 1px solid var(--line-strong); pointer-events: none; }
.sign .sign-x { position: absolute; left: 18px; bottom: 48px; color: var(--faint); font-size: 18px; pointer-events: none; }
.sign .clear { position: absolute; right: 8px; top: 8px; }

/* login */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 32px 22px; max-width: 420px; margin: 0 auto; }
.login-brand svg { width: 100%; height: auto; max-width: 360px; }
.login h1 { margin-top: 34px; }
.login .form { margin-top: 18px; }
.code-box { padding: 14px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.code-box b { display: block; margin-top: 6px; font: 700 30px/1 var(--head); letter-spacing: .18em; color: var(--ink); }
.code-input { letter-spacing: .4em; font-size: 22px !important; text-align: center; font-variant-numeric: tabular-nums; }
.lang-switch { display: flex; gap: 6px; margin-top: 26px; justify-content: center; }

.menu-list .row { min-height: 54px; }
.menu-list .row svg.ic { width: 22px; height: 22px; color: var(--accent); flex: none; }
.notif-row.unread { background: #F5F8FC; }
.notif-row.unread .row-title::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 2px; }
.loading { padding: 48px 0; text-align: center; color: var(--mute); }
.contact-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.money-big { font: 700 24px/1.1 var(--head); font-stretch: 112%; font-variant-numeric: tabular-nums; }
.plan-ok { color: var(--ok); font-weight: 600; }
.plan-no { color: var(--danger); font-weight: 600; }
.date-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-top: 8px; scrollbar-width: none; }
.date-chips button { flex: none; padding: 7px 11px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--panel); font-size: 13px; cursor: pointer; text-align: left; line-height: 1.25; }
.date-chips button small { display: block; color: var(--mute); font-size: 11px; }
.date-chips button.on { border-color: var(--accent); background: var(--accent-soft); }
.hist { font-size: 13px; }
.hist .row { min-height: 0; padding: 10px 14px; cursor: default; align-items: flex-start; }
.split { display: grid; gap: 12px; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; align-items: start; } }
