/* The pages of the visitors (no login): the list of the projects, the page of one project with the time of its workers, the window of writing and
   reading answers; and the board "Клиенты" of the managers. Colors and sizes are the tokens; one page works on a computer and on a phone. */

/* ---- The page of a visitor ---- */
.pub { height: 100dvh; overflow-y: auto; display: flex; flex-direction: column; background: var(--bg); }
.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; max-width: 960px; width: 100%; margin: 0 auto; }
.pub-body { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 8px 16px 32px; display: grid; gap: 28px; align-content: start; }
.pub-hero { display: grid; gap: 10px; padding-top: 12px; max-width: 640px; }
.pub-hero h1 { font-size: clamp(26px, 5vw, 36px); }
.pub-hero p { color: var(--text-2); font-size: 16px; line-height: 1.5; }
.pub-section { display: grid; gap: 12px; }
.pub-section.hidden { display: none; }
.pub-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pub-head h2 { font-size: 18px; }
.pub-head.hidden { display: none; }
.pub-search { max-width: 260px; }

.pub-projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 10px; }
.pub-project {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 64px; padding: 12px 14px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.pub-project:hover { border-color: var(--line); background: var(--raised); }
.pub-project:active { transform: scale(.995); }
.pub-project .avatar { width: 40px; height: 40px; font-size: 14px; }
.pub-project > svg { width: 16px; height: 16px; color: var(--text-3); }
.pub-project-text { display: grid; gap: 2px; min-width: 0; }
.pub-project-name { font-size: 16px; font-weight: 600; }
.pub-project-about { font-size: var(--fs-caption); color: var(--text-2); line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pub-project.is-skeleton { min-height: 64px; background: linear-gradient(100deg, var(--raised) 30%, var(--raised-hover) 50%, var(--raised) 70%) 0 0 / 300% 100%; animation: vin-shine 1.2s linear infinite; border-color: transparent; }
.pub-thread-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--raised); color: var(--text-2); }
.pub-thread-icon svg { width: 18px; height: 18px; }
.pub-answer { background: var(--primary); color: var(--on-primary); }
.pub-empty { padding: 40px 16px; grid-column: 1 / -1; }
.pub-empty-line { padding: 12px 2px; }

/* the button at the bottom stays in view */
.pub-bar { position: sticky; bottom: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line-soft);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.pub-bar:empty { display: none; }
.pub-bar-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pub-bar-text { color: var(--text-2); font-size: var(--fs-caption); }
.pp .pub-bar-inner { justify-content: stretch; }
.pp .pub-bar-inner .btn { flex: 1; }
.pp .pub-bar-inner .btn:first-child { flex: 0 0 auto; }

/* ---- The page of one project ---- */
.pp-head { display: grid; gap: 4px; padding-top: 4px; }
.pp-title { font-size: clamp(24px, 5vw, 32px); }
.pp-about { color: var(--text-2); }
.pp-about:empty { display: none; }
.pp-mine:empty { display: none; }
.pp-mine-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; text-align: left; background: var(--raised); border-radius: var(--r-lg); font-weight: 500; }
.pp-mine-btn svg { width: 18px; height: 18px; color: var(--text-2); }
.pp-mine-btn span:first-of-type { flex: 1; }

.pp-days { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.pp-days::-webkit-scrollbar { display: none; }
.pp-day { flex: none; display: grid; justify-items: center; gap: 1px; min-width: 52px; padding: 8px 6px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-soft); color: var(--text-2); }
.pp-day:hover { background: var(--raised); }
.pp-day-wd { font-size: 11px; text-transform: lowercase; }
.pp-day-n { font-size: 18px; font-weight: 600; color: var(--text); line-height: 1.1; }
.pp-day.is-weekend .pp-day-wd { color: var(--danger); }
.pp-day.is-active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pp-day.is-active .pp-day-n, .pp-day.is-active .pp-day-wd { color: var(--on-primary); }

.pp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-chip { min-width: 64px; height: 40px; padding: 0 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 550; font-variant-numeric: tabular-nums; }
.pp-chip:hover { background: var(--raised); }
.pp-chip.is-picked { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pp-none { padding: 14px 16px; background: var(--raised); border-radius: var(--r-lg); color: var(--text-2); line-height: 1.45; }

/* ---- When the workers are taken ---- */
.tl { display: grid; gap: 6px; padding: 14px 14px 16px; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); --name-w: 74px; }
.tl-axis, .tl-row { display: grid; grid-template-columns: var(--name-w) minmax(0, 1fr); gap: 10px; align-items: center; }
.tl-ticks { position: relative; height: 14px; }
.tl-ticks span { position: absolute; top: 0; transform: translateX(-50%); font-size: 11px; line-height: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-ticks span:first-child { transform: none; }
.tl-ticks span:last-child { transform: translateX(-100%); }
.tl-name { font-size: 13px; font-weight: 500; color: var(--text-2); }
.tl-track { position: relative; height: 32px; border-radius: 8px; background: var(--raised); overflow: hidden; }
.tl-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-soft); }
.tl-bar { position: absolute; top: 3px; bottom: 3px; border-radius: 6px; background: color-mix(in srgb, var(--text) 34%, var(--raised)); }
.tl-bar.is-off { background: repeating-linear-gradient(135deg, var(--line) 0 5px, transparent 5px 10px); box-shadow: none; opacity: .8; }
.tl-pick { position: absolute; top: 2px; bottom: 2px; border-radius: 6px; background: color-mix(in srgb, var(--primary) 26%, transparent); box-shadow: 0 0 0 2px var(--primary); }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); }
.tl-row.is-skeleton { height: 32px; border-radius: 8px; background: linear-gradient(100deg, var(--raised) 30%, var(--raised-hover) 50%, var(--raised) 70%) 0 0 / 300% 100%; animation: vin-shine 1.2s linear infinite; grid-template-columns: 1fr; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 12px; }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-key { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }
.tl-key.is-free { background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); }
.tl-key.is-busy { background: color-mix(in srgb, var(--text) 34%, var(--raised)); }
.tl-key.is-off { background: repeating-linear-gradient(135deg, var(--line) 0 3px, transparent 3px 6px); }

/* ---- The window of writing and reading ---- */
.client-kind { width: 100%; }
.client-when { display: grid; gap: 10px; }
.client-understood:empty { display: none; }
.client-understood { color: var(--text); padding: 8px 10px; background: var(--raised); border-radius: var(--r-md); }
.client-text-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.client-text-head label { margin: 0; }
.client-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mic { height: var(--h-md); }
.mic.is-listening { background: var(--danger-soft); color: var(--danger); }
.mic.is-listening svg { animation: vin-pulse 1.1s ease-in-out infinite; }

.chat-list { display: grid; gap: 8px; max-height: min(52dvh, 420px); overflow-y: auto; align-content: start; padding: 2px; }
.chat-row { display: flex; }
.chat-row.is-mine { justify-content: flex-end; }
.chat-bubble { max-width: 86%; padding: 8px 12px 6px; border-radius: 14px; background: var(--raised); display: grid; gap: 2px; }
.chat-row.is-mine .chat-bubble { background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 4px; }
.chat-row.is-theirs .chat-bubble { border-bottom-left-radius: 4px; }
.chat-author { font-size: 11px; font-weight: 600; opacity: .7; }
.chat-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.chat-time { font-size: 10px; opacity: .6; text-align: right; }
.chat-status { min-height: 16px; padding: 2px 2px 0; }
.chat-status:empty { display: none; }
.chat-compose { display: grid; gap: 8px; width: 100%; }
.chat-actions { display: flex; justify-content: flex-end; gap: 8px; }
.chat-input { min-height: 56px; }
.dialog-foot:has(.chat-compose) { padding-top: 8px; }

/* ---- The board of the managers ---- */
.content[data-board="clients"] { padding: 0; overflow: hidden; }
.cl { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); height: 100%; min-height: 0; }
.cl-list { border-right: 1px solid var(--line-soft); overflow-y: auto; min-height: 0; padding: 8px; }
.cl-items { display: grid; gap: 4px; align-content: start; }
.cl-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 10px; border-radius: var(--r-md); text-align: left; align-items: start; }
.cl-item:hover { background: var(--raised); }
.cl-item.is-active { background: var(--selected); color: var(--on-selected); }
.cl-item.is-done { opacity: .6; }
.cl-item .avatar { width: 34px; height: 34px; font-size: 12px; }
.cl-item-text { display: grid; gap: 2px; min-width: 0; }
.cl-item-top { display: flex; align-items: baseline; gap: 8px; }
.cl-item-name { font-weight: 600; flex: 1; }
.cl-item.is-unread .cl-item-name { color: var(--text); }
.cl-item-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.cl-item-last { font-size: var(--fs-caption); color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cl-item.is-active .cl-item-last, .cl-item.is-active .cl-item-time { color: inherit; opacity: .75; }
.cl-item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 2px; }
.cl-car { font-size: 11px; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.cl-car svg { width: 12px; height: 12px; flex: none; }
.cl-dot { width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.cl-empty { padding: 28px 14px; text-align: center; }
.cl-done-toggle { display: flex; align-items: center; gap: 6px; padding: 10px 8px 6px; font-size: var(--fs-caption); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.cl-done-toggle svg { width: 12px; height: 12px; }

.cl-pane { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; min-height: 0; min-width: 0; }
.cl-pane-empty, .cl-loading { grid-row: 1 / -1; align-self: center; }
.cl-loading { text-align: center; }
.cl-head { display: flex; align-items: flex-start; gap: 8px; padding: 14px 18px 6px; }
.cl-back { display: none; }
.cl-who { display: grid; gap: 6px; min-width: 0; }
.cl-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 18px; font-weight: 600; }
.cl-contact { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; color: var(--text-2); }
.cl-phone, .cl-wanted { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 500; }
.cl-phone svg, .cl-wanted svg, .cl-contact .cl-car svg { width: 14px; height: 14px; color: var(--text-3); }
.cl-contact .cl-car { font-size: var(--fs-body); color: var(--text-2); }
.cl-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 18px 10px; }
.cl-messages { overflow-y: auto; min-height: 0; padding: 8px 18px; display: grid; gap: 8px; align-content: start; border-top: 1px solid var(--line-soft); }
.cl-compose { display: grid; gap: 8px; padding: 10px 18px 14px; border-top: 1px solid var(--line-soft); }
.cl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-chips:empty { display: none; }
.cl-compose-bar { display: flex; justify-content: flex-end; }

@media (max-width: 899px) {
  .cl { grid-template-columns: minmax(0, 1fr); }
  .cl .cl-pane { display: none; }
  .cl.has-open .cl-list { display: none; }
  .cl.has-open .cl-pane { display: grid; }
  .cl-back { display: inline-flex; }
}
@media (max-width: 640px) {
  .pub-bar-text { display: none; }
  .pub-bar-inner { justify-content: stretch; }
  .pub-bar-inner .btn { flex: 1; }
  .tl { --name-w: 58px; padding: 12px 10px 14px; }
  .chat-bubble { max-width: 92%; }
}
