/* Contacts: the studio pages' look (apps/studio-chat src/page.js tokens), desk type 13/11 px. */
:root {
  --atmos: #fdfdfd; --ink: #101210; --hint: #4b544a; --soft: #6b746a;
  --line: rgba(70, 86, 66, 0.16); --card: #e2e6e5; --edge: #d9dbda;
  --chrome: #e7ebea; --chrome-hover: #dde2e0; --white: #fff;
  --hot: #c8462b; --warm: #d98a1e; --cooling: #6f8fa8; --cold: #3d5368; --ok: #3f7a1a;
  --gutter: 22px; --gap: 16px;
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
@media (min-width: 1100px) { :root { --gutter: 40px; --gap: 20px; } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--atmos); color: var(--ink); font: 13px/1.5 var(--sans); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- the top line */
.top { display: flex; align-items: center; gap: 18px; padding: 14px var(--gutter) 10px; }
.mark { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.mark b { font-size: 15px; letter-spacing: -0.01em; }
.mark span { font-size: 11px; color: var(--soft); letter-spacing: 0.04em; }
.tabs { display: flex; gap: 4px; flex: 1; }
.tabs a { padding: 5px 12px; border-radius: 13px; text-decoration: none; color: var(--hint); }
.tabs a:hover { background: var(--chrome); color: var(--ink); }
.tabs a.on { background: var(--ink); color: #fff; }
.as { display: flex; align-items: center; gap: 6px; color: var(--soft); font-size: 11px; white-space: nowrap; }
.burger { display: none; width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--chrome); padding: 0; }
.burger svg { width: 18px; height: 18px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }

select { appearance: none; -webkit-appearance: none; border: 0; border-radius: 12px; padding: 4px 24px 4px 11px; max-width: 190px;
  background: var(--chrome) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b544a' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 7px center / 12px;
  font-size: 12px; line-height: 18px; color: #2f3630; cursor: pointer; text-overflow: ellipsis; }
select:hover { background-color: var(--chrome-hover); }
select.on { background-color: var(--ink); color: #fff; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); }

/* ---------------------------------------------------------------- the board: a list window and a profile window */
#view { flex: 1; min-height: 0; display: flex; gap: var(--gap); padding: 4px var(--gutter) var(--gutter); }
.win { background: var(--card); border: 1px solid var(--edge); border-radius: 22px; min-height: 0; display: flex; flex-direction: column; }
.list-win { flex: 1 1 56%; min-width: 0; padding: 14px; }
.side-win { flex: 1 1 44%; min-width: 0; max-width: 560px; overflow: auto; padding: 18px 20px 24px; }
.side-win.empty { display: grid; place-items: center; color: var(--soft); }

.find { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px; background: var(--white); box-shadow: inset 0 0 0 1px rgba(16, 18, 16, 0.06); }
.find:focus-within { box-shadow: inset 0 0 0 1.5px rgba(16, 18, 16, 0.22); }
.find svg { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--hint); stroke-width: 1.8; stroke-linecap: round; }
.find input { flex: 1; min-width: 0; border: 0; outline: none; background: none; padding: 0; font-size: 14px; }
.find .n { color: var(--soft); font-size: 11px; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; }
.filters .clear { border: 0; background: none; color: var(--hint); font-size: 12px; text-decoration: underline; padding: 4px 6px; }

.rows { flex: 1; min-height: 0; overflow: auto; margin: 4px -6px 0; padding: 0 6px 12px; }
.row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: none;
  padding: 8px 10px; border-radius: 12px; }
.row:hover { background: rgba(255, 255, 255, 0.55); }
.row.on { background: var(--white); }
.row .who { min-width: 0; }
.row .nm { font-weight: 600; }
.row .sub, .row .when { color: var(--soft); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.row .when { text-align: right; }
/* where a relationship stands: in touch → due → overdue → long overdue; never touched is grey */
.dot { width: 8px; height: 8px; border-radius: 50%; background: #b9c0b8; flex: none; }
.dot.fresh { background: var(--ok); } .dot.due { background: #c9a227; } .dot.overdue { background: #d9822b; } .dot.lapsed { background: var(--hot); } .dot.never { background: #b9c0b8; }
.dot.in { background: var(--ok); } .dot.coming { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ok); }
.more { margin: 8px auto; border: 0; border-radius: 12px; background: var(--chrome); padding: 5px 14px; font-size: 12px; display: block; }
.foot { color: var(--soft); font-size: 11px; padding: 8px 4px 0; display: flex; justify-content: space-between; gap: 8px; }
.foot button { border: 0; background: none; padding: 0; color: var(--hint); font-size: 11px; text-decoration: underline; }

/* ---------------------------------------------------------------- a contact */
.back { display: none; border: 0; background: none; padding: 2px 0; margin-bottom: 12px; font-size: 13px; color: var(--hint); }
.p-head h2 { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -0.01em; }
.p-head .sub { color: var(--hint); margin-top: 2px; }
.temp { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 3px 10px 3px 8px; border-radius: 12px; background: var(--white); font-size: 12px; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.act { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 13px; background: var(--ink); color: #fff; padding: 6px 13px; font-size: 12px; text-decoration: none; }
.act svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.act.light { background: var(--chrome); color: var(--ink); }
.sec { margin-top: 20px; }
.sec h3 { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); }
dl { margin: 0; display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 4px 12px; }
dt { color: var(--soft); }
dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.dots { letter-spacing: 2px; color: var(--hint); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { padding: 1px 8px; border-radius: 10px; background: var(--chrome); font-size: 12px; }
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { padding: 8px 0; border-top: 1px solid var(--line); }
.hist li:first-child { border-top: 0; }
.hist .t { display: flex; justify-content: space-between; gap: 10px; }
.hist .t b { font-weight: 600; }
.hist .t span, .hist .by { color: var(--soft); font-size: 11px; white-space: nowrap; }
.hist .body { margin-top: 2px; white-space: pre-line; color: #2f3630; }

/* ---------------------------------------------------------------- keep warm, events, log */
.page-win { flex: 1; min-width: 0; padding: 18px 20px; overflow: auto; }
.page-win h2 { margin: 0 0 4px; font-size: 18px; letter-spacing: -0.01em; }
.lede { color: var(--hint); margin: 0 0 14px; }
.ev { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; border: 0; background: rgba(255, 255, 255, 0.55); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.ev:hover { background: var(--white); }
.ev b { display: block; font-size: 14px; }
.ev span { color: var(--soft); font-size: 11px; }
.counts { display: flex; gap: 18px; text-align: right; }
.counts div b { display: block; font-size: 16px; }
.counts div span { font-size: 11px; color: var(--soft); }
form.new { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: end; background: rgba(255, 255, 255, 0.55); border-radius: 14px; padding: 12px; margin-bottom: 16px; }
form.new label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--soft); }
input.txt, textarea.txt { border: 0; border-radius: 10px; background: var(--white); padding: 6px 10px; box-shadow: inset 0 0 0 1px rgba(16, 18, 16, 0.08); outline: none; }
input.txt:focus { box-shadow: inset 0 0 0 1.5px rgba(16, 18, 16, 0.25); }
.btn { display: inline-block; text-decoration: none; border: 0; border-radius: 13px; background: var(--ink); color: #fff; padding: 6px 14px; font-size: 12px; white-space: nowrap; }
.btn.light { background: var(--chrome); color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: default; }
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 14px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; font-weight: 600; color: var(--soft); padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.small, .small { font-size: 11px; color: var(--soft); }
.st { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 11px; background: var(--chrome); }
.st.yes { background: #dcebd2; } .st.no { background: #f1dcd5; } .st.in { background: var(--ok); color: #fff; }

/* ---------------------------------------------------------------- the door */
.door { flex: 1; max-width: 640px; margin: 0 auto; width: 100%; padding: 18px 20px; overflow: auto; }
.door h2 { margin: 0; font-size: 18px; }
.scan { width: 100%; border: 0; border-radius: 18px; background: var(--ink); color: #fff; padding: 18px; font-size: 16px; margin: 14px 0 10px; }
.cam { position: relative; border-radius: 18px; overflow: hidden; background: #000; margin: 14px 0 10px; aspect-ratio: 1; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam .frame { position: absolute; inset: 18%; border: 2px solid rgba(255, 255, 255, 0.8); border-radius: 18px; }
.cam .stop { position: absolute; right: 10px; top: 10px; }
.verdict { border-radius: 16px; padding: 14px 16px; margin: 10px 0; font-size: 15px; }
.verdict small { display: block; font-size: 12px; opacity: 0.85; margin-top: 2px; }
.verdict.good { background: var(--ok); color: #fff; }
.verdict.warn { background: #f3e2bf; }
.verdict.bad { background: #f1dcd5; }
.verdict button { margin-top: 8px; }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 14px; align-items: center; background: var(--ink); color: #fff;
  padding: 9px 16px; border-radius: 16px; font-size: 13px; box-shadow: 0 18px 40px -20px rgba(30, 36, 30, 0.6); max-width: calc(100vw - 32px); }
.toast button { border: 0; background: none; color: #fff; text-decoration: underline; padding: 0; }

/* ---------------------------------------------------------------- phone */
@media (max-width: 760px) {
  :root { --gutter: 16px; --gap: 12px; }
  .top { gap: 10px; padding-top: 12px; position: relative; flex-wrap: wrap; }
  .burger { display: inline-grid; place-items: center; order: 0; }
  .mark { flex: 1; }
  .tabs { display: none; position: absolute; top: 52px; left: var(--gutter); z-index: 5; flex-direction: column; gap: 2px; padding: 8px; min-width: 200px;
    background: var(--white); border-radius: 16px; box-shadow: 0 18px 40px -16px rgba(30, 36, 30, 0.45); }
  .tabs.open { display: flex; }
  .tabs a { padding: 8px 12px; }
  #view { padding-bottom: 12px; }
  .side-win { position: fixed; inset: 0; z-index: 10; max-width: none; border-radius: 0; border: 0; padding: 16px 16px 40px; }
  .side-win.empty { display: none; }
  .back { display: inline-block; }
  dl { grid-template-columns: 108px minmax(0, 1fr); }
  .counts { gap: 12px; }
  .hide-phone { display: none; }
  table { font-size: 12px; }
}

/* ---------------------------------------------------------------- after the review */
.tabs .as { margin-left: auto; }
.findline { display: flex; gap: 8px; align-items: center; }
.findline .find { flex: 1; min-width: 0; }
.fbtn { display: none; border: 0; border-radius: 12px; background: var(--chrome); padding: 8px 12px; font-size: 12px; white-space: nowrap; }
.fbtn.on { background: var(--ink); color: #fff; }
.nameline { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
a.edit { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--hint); white-space: nowrap; text-decoration: none; }
a.edit:hover { color: var(--ink); text-decoration: underline; }
a.edit svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.side-win { transition: opacity 0.12s; }
.side-win.loading > * { opacity: 0.45; }
.side-win.guestlist h3 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); }
.row.choose { grid-template-columns: 18px minmax(0, 1fr) auto; cursor: pointer; }
.row.choose input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.row.had { opacity: 0.55; cursor: default; }
.bar span { font-weight: 600; }
.icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 10px; background: var(--chrome); padding: 0; }
.icon:hover { background: var(--chrome-hover); }
.icon svg { width: 15px; height: 15px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; }
select.st-sel { font-size: 11px; padding: 2px 22px 2px 9px; }
select.st-sel.yes { background-color: #dcebd2; } select.st-sel.no { background-color: #f1dcd5; }
.counts.left { justify-content: flex-start; text-align: left; flex-wrap: wrap; row-gap: 8px; }
.verdict-slot:empty { display: none; }
.verdict-slot { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; width: min(600px, calc(100vw - 32px)); z-index: 20; }
.verdict-slot .verdict { display: flex; align-items: center; gap: 12px; margin: 0; box-shadow: 0 20px 44px -18px rgba(30, 36, 30, 0.55); }
.verdict-slot .verdict > div { flex: 1; }
.verdict-slot .verdict button { margin: 0; }
.verdict .x { border: 0; background: none; color: inherit; font-size: 20px; line-height: 1; padding: 0 2px; opacity: 0.7; }
.door .row { cursor: default; }
@media (max-width: 760px) {
  .fbtn { display: inline-block; }
  .filters { display: none; }
  .filters.open { display: flex; }
  .tabs .as { margin: 6px 0 0; padding: 8px 12px 4px; border-top: 1px solid var(--line); width: auto; }
  .door { padding-bottom: 120px; }
}

/* second review */
.back { align-self: flex-start; }
form.new select { background-color: var(--white); box-shadow: inset 0 0 0 1px rgba(16, 18, 16, 0.08); padding-top: 6px; padding-bottom: 6px; max-width: none; }
form.new label { justify-content: flex-end; }
@media (max-width: 760px) {
  /* the guest list as rows, not a squeezed table */
  .page-win table thead { display: none; }
  .page-win table, .page-win tbody { display: block; }
  .page-win table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .page-win table td { padding: 0; border: 0; }
  .page-win table td:first-child { grid-column: 1 / -1; }
}
