/* In-House Guest AI: design system.
   Monochrome brand (black / white, like the logo) + one "AI" accent (violet → cyan).
   Self-contained: no external fonts, libraries or CDNs. */

:root {
  --bg: #f5f5f3;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #ecebff 0%, transparent 60%),
             radial-gradient(900px 500px at -10% 110%, #e8fbff 0%, transparent 55%);
  --surface: #ffffff;
  --surface-2: #f3f3f1;
  --surface-3: #eaeae7;
  --glass: rgba(255, 255, 255, .72);
  --text: #0b0b0c;
  --text-2: #3d3d42;
  --muted: #76767d;
  --line: #e6e5e1;
  --line-strong: #d5d4cf;
  --ink: #0b0b0c;          /* brand black: primary buttons */
  --on-ink: #ffffff;
  --ai-1: #6d5dfc;         /* AI accent */
  --ai-2: #22c3ee;
  --ai-grad: linear-gradient(135deg, var(--ai-1), var(--ai-2));
  --ai-soft: #efedff;
  --ai-text: #4b3fd6;
  --team: #2563eb;
  --team-soft: #e8f0ff;
  --warn: #b45309;
  --warn-soft: #fff4e0;
  --ok: #047857;
  --ok-soft: #e3f7ee;
  --err: #c2262e;
  --err-soft: #fdecec;
  --guest-bubble: #ffffff;
  --ai-bubble: #f1efff;
  --team-bubble: #eaf1ff;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 1px 2px rgba(16, 16, 20, .04), 0 4px 16px rgba(16, 16, 20, .05);
  --shadow-lg: 0 10px 40px rgba(16, 16, 20, .10);
  --font: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI Variable",
          "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  --sidebar: 248px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0c;
    --bg-grad: radial-gradient(1100px 600px at 100% -10%, rgba(109, 93, 252, .16) 0%, transparent 60%),
               radial-gradient(900px 500px at -10% 110%, rgba(34, 195, 238, .10) 0%, transparent 55%);
    --surface: #131316; --surface-2: #1a1a1e; --surface-3: #232328;
    --glass: rgba(19, 19, 22, .72);
    --text: #f4f4f5; --text-2: #d4d4d8; --muted: #9a9aa3;
    --line: #26262c; --line-strong: #34343b;
    --ink: #f4f4f5; --on-ink: #0b0b0c;
    --ai-soft: rgba(109, 93, 252, .16); --ai-text: #b3abff;
    --team-soft: rgba(37, 99, 235, .18); --team: #7aa7ff;
    --warn-soft: rgba(245, 158, 11, .14); --warn: #fbbf24;
    --ok-soft: rgba(16, 185, 129, .14); --ok: #34d399;
    --err-soft: rgba(239, 68, 68, .14); --err: #f87171;
    --guest-bubble: #1c1c21; --ai-bubble: #221f3d; --team-bubble: #172238;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0c;
  --bg-grad: radial-gradient(1100px 600px at 100% -10%, rgba(109, 93, 252, .16) 0%, transparent 60%),
             radial-gradient(900px 500px at -10% 110%, rgba(34, 195, 238, .10) 0%, transparent 55%);
  --surface: #131316; --surface-2: #1a1a1e; --surface-3: #232328;
  --glass: rgba(19, 19, 22, .72);
  --text: #f4f4f5; --text-2: #d4d4d8; --muted: #9a9aa3;
  --line: #26262c; --line-strong: #34343b;
  --ink: #f4f4f5; --on-ink: #0b0b0c;
  --ai-soft: rgba(109, 93, 252, .16); --ai-text: #b3abff;
  --team-soft: rgba(37, 99, 235, .18); --team: #7aa7ff;
  --warn-soft: rgba(245, 158, 11, .14); --warn: #fbbf24;
  --ok-soft: rgba(16, 185, 129, .14); --ok: #34d399;
  --err-soft: rgba(239, 68, 68, .14); --err: #f87171;
  --guest-bubble: #1c1c21; --ai-bubble: #221f3d; --team-bubble: #172238;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font: 14.5px/1.5 var(--font); color: var(--text);
  background: var(--bg-grad), var(--bg); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; letter-spacing: -.005em;
}
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--ai-text); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 1.6rem; font-weight: 650; }
h2 { font-size: 1.02rem; font-weight: 620; }
h3 { font-size: .92rem; font-weight: 600; }
p { margin: 0 0 .6rem; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .85em; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------------ app shell */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  align-self: start;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 14px; border-right: 1px solid var(--line);
  background: var(--glass); backdrop-filter: saturate(160%) blur(18px);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; }
.brand img { height: 26px; width: auto; }
.brand .tag { font-size: .68rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 7px; border-radius: 999px; color: #fff; background: var(--ai-grad); }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: inline; } }
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px;
  color: var(--text-2); font-weight: 520; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.nav a.active svg { color: var(--ai-1); }
.nav .count { margin-left: auto; min-width: 22px; text-align: center; font-size: .75rem;
  font-weight: 650; padding: 1px 7px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.nav-label { font-size: .7rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); padding: 14px 11px 4px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.status-pill { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 11px;
  background: var(--surface-2); font-size: .82rem; color: var(--text-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.live { background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, .18); animation: pulse 2.4s infinite; }
.dot.off { background: var(--err); }
.dot.test { background: #f59e0b; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); } }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 6px 2px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 650; font-size: .8rem; color: var(--on-ink); background: var(--ink); flex: none; }
.avatar.ai { background: var(--ai-grad); color: #fff; }
.avatar.lg { width: 44px; height: 44px; font-size: 1rem; }
.me .who { line-height: 1.2; min-width: 0; }
.me .who b { display: block; font-size: .88rem; }
.me .who span { font-size: .75rem; color: var(--muted); }
.icon-btn { margin-left: auto; display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn + .icon-btn { margin-left: 0; }

.main { min-width: 0; padding: 26px 32px 40px; }
.main.flush { padding: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.eyebrow { font-size: .74rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px; }

/* ------------------------------------------------------------------ components */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 16px 20px 0; }
.card-head + .card-body { padding-top: 10px; }
.card-body { padding: 16px 20px 18px; }
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.two { grid-template-columns: 1.4fr 1fr; align-items: start; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

.kpi { padding: 16px 18px; position: relative; overflow: hidden; }
.kpi .label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .8rem; font-weight: 550; }
.kpi .value { font-size: 1.9rem; font-weight: 680; letter-spacing: -.03em; margin-top: 6px; }
.kpi .sub { font-size: .78rem; color: var(--muted); }
.kpi.ai::after { content: ""; position: absolute; inset: auto -30px -40px auto; width: 120px; height: 120px;
  border-radius: 50%; background: var(--ai-grad); opacity: .12; filter: blur(4px); }
.kpi.warn .value { color: var(--warn); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font: inherit;
  font-weight: 560; font-size: .88rem; padding: 8px 14px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  transition: transform .06s, background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn.primary:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .15); }
.btn.ai { background: var(--ai-grad); color: #fff; border: 0; padding: 9px 15px; }
.btn.ai:hover { box-shadow: 0 8px 24px rgba(109, 93, 252, .35); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--err); }
.btn.sm { padding: 5px 10px; font-size: .8rem; border-radius: 9px; }
.btn.block { width: 100%; padding: 11px 14px; }
button.link-danger { background: none; border: 0; color: var(--err); cursor: pointer; font: inherit;
  font-size: .82rem; padding: 6px 0 0; text-decoration: underline; text-underline-offset: 2px; }
form.inline { display: inline; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 620;
  padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.ai { background: var(--ai-soft); color: var(--ai-text); }
.badge.staff, .badge.team { background: var(--team-soft); color: var(--team); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.airbnb { background: rgba(255, 56, 92, .12); color: #e31c5f; }
.badge.booking { background: rgba(0, 53, 128, .10); color: #1d5bbf; }
.badge.direct { background: var(--ok-soft); color: var(--ok); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: .84rem;
  font-weight: 540; cursor: pointer; white-space: nowrap; font-family: inherit; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-weight: 650;
  box-shadow: 0 0 0 1.5px var(--ink); }  /* "you are here": colour + weight + ring (rule) */
.chip .n { font-size: .74rem; opacity: .7; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }

label { display: block; font-weight: 580; font-size: .88rem; margin-bottom: 14px; }
label .hint { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 2px; }
input, textarea, select {
  width: 100%; font: inherit; font-size: .92rem; font-weight: 400; color: var(--text); margin-top: 6px;
  padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-strong);
  background: var(--surface); transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ai-1);
  box-shadow: 0 0 0 4px rgba(109, 93, 252, .14); }
input[type=checkbox] { width: auto; margin: 0; accent-color: var(--ai-1); }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { margin: 0; padding-left: 36px; }
.switch { display: flex; align-items: center; gap: 12px; font-weight: 560; cursor: pointer; margin: 0; }
.switch input { appearance: none; flex: none; width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3);
  position: relative; cursor: pointer; transition: background .2s; border: 0; padding: 0; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked { background: var(--ai-grad); }
.switch input:checked::after { transform: translateX(18px); }

.flash { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px;
  margin-bottom: 14px; background: var(--ok-soft); color: var(--ok); font-weight: 520; }
.flash.error { background: var(--err-soft); color: var(--err); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.empty .art { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; display: grid;
  place-items: center; background: var(--surface-2); color: var(--muted); }

table.list { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
table.list th { text-align: left; font-size: .74rem; font-weight: 620; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--surface); }
table.list td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr { transition: background .12s; }
table.list tbody tr:hover { background: var(--surface-2); }
tr.cancelled td { color: var(--muted); }
tr.cancelled td .name { text-decoration: line-through; }
.table-wrap { overflow-x: auto; }
.cell-main { font-weight: 580; }
.cell-sub { font-size: .8rem; color: var(--muted); }

.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; }
.list-plain .grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2);
  width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 18px; }
.tabs a, .tabs button { padding: 7px 14px; border-radius: 10px; font-weight: 560; font-size: .87rem;
  color: var(--text-2); border: 0; background: none; cursor: pointer; font-family: inherit; white-space: nowrap; }
.tabs .active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; font-size: .88rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 520; word-break: break-word; }

/* ------------------------------------------------------------------ login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { position: relative; overflow: hidden; background: #09090b; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; padding: 44px; }
.auth-art img { height: 34px; width: auto; align-self: flex-start; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; animation: float 14s ease-in-out infinite; }
.orb.a { width: 420px; height: 420px; background: #6d5dfc; top: -80px; right: -120px; }
.orb.b { width: 360px; height: 360px; background: #22c3ee; bottom: -120px; left: -80px; animation-delay: -5s; }
.orb.c { width: 220px; height: 220px; background: #a855f7; top: 45%; left: 40%; opacity: .35; animation-delay: -9s; }
@keyframes float { 50% { transform: translate(30px, -26px) scale(1.06); } }
.auth-art .copy { position: relative; max-width: 440px; }
.auth-art h2 { font-size: 2.3rem; line-height: 1.08; font-weight: 680; letter-spacing: -.035em; margin-bottom: 14px; }
.auth-art p { color: rgba(255, 255, 255, .72); font-size: 1rem; }
.auth-art .feature { display: flex; align-items: center; gap: 10px; color: rgba(255, 255, 255, .85);
  font-size: .9rem; margin-top: 10px; }
.auth-art .feature svg { color: #9f95ff; }
.auth-art .legal { position: relative; font-size: .78rem; color: rgba(255, 255, 255, .45); }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 26px; }
.auth-card .mobile-logo { display: none; height: 28px; margin-bottom: 28px; }

/* ------------------------------------------------------------------ inbox */
.inbox { display: grid; grid-template-columns: 360px 1fr 320px; height: 100vh; overflow: hidden; }
.inbox > * { min-height: 0; }  /* each pane scrolls on its own; the page never scrolls */
.inbox.no-side { grid-template-columns: 360px 1fr; }
.pane { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.pane:last-child { border-right: 0; }
.pane-head { padding: 18px 18px 12px; display: flex; flex-direction: column; gap: 12px;
  border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(16px); }
.pane-scroll { flex: 1; overflow-y: auto; }
.list-pane { background: var(--glass); }
.conv-item { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line);
  transition: background .12s; position: relative; }
.conv-item:hover { background: var(--surface-2); }
.conv-item.selected { background: var(--surface); }
.conv-item.selected::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--ai-grad); }
.conv-item .body { flex: 1; min-width: 0; }
.conv-item .top { display: flex; align-items: center; gap: 6px; }
.conv-item .top b { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-item time { margin-left: auto; font-size: .74rem; color: var(--muted); flex: none; }
.conv-item .preview { font-size: .84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; margin-top: 2px; }
.conv-item .reason { font-size: .8rem; color: var(--warn); margin-top: 3px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.conv-item .meta { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.conv-item.attention .avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #f59e0b; }

.chat { display: flex; flex-direction: column; min-width: 0; height: 100vh; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line);
  background: var(--glass); backdrop-filter: blur(16px); }
.chat-head .who { min-width: 0; }
.chat-head .who b { display: block; font-size: 1rem; font-weight: 640; }
.chat-head .who span { font-size: .8rem; color: var(--muted); }
.chat-head .actions { margin-left: auto; display: flex; gap: 8px; }
.alert-bar { display: flex; align-items: center; gap: 12px; margin: 12px 20px 0; padding: 11px 14px;
  border-radius: 13px; background: var(--warn-soft); color: var(--warn); font-size: .88rem; font-weight: 520; }
.alert-bar .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.thread { flex: 1; overflow-y: auto; padding: 22px 24px 10px; display: flex; flex-direction: column; gap: 4px; }
.day-sep { align-self: center; font-size: .72rem; font-weight: 600; color: var(--muted); padding: 3px 10px;
  border-radius: 999px; background: var(--surface-2); margin: 10px 0; }
.msg { max-width: min(680px, 78%); padding: 10px 14px 8px; border-radius: 16px; position: relative;
  box-shadow: var(--shadow); border: 1px solid var(--line); margin-top: 6px; }
.msg.in { background: var(--guest-bubble); border-bottom-left-radius: 6px; align-self: flex-start; }
.msg.out { align-self: flex-end; border-bottom-right-radius: 6px; }
.msg.ai { background: var(--ai-bubble); border-color: transparent; }
.msg.staff, .msg.whatsapp_app { background: var(--team-bubble); border-color: transparent; }
.msg .who { display: flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 620;
  color: var(--muted); margin-bottom: 3px; }
.msg.ai .who { color: var(--ai-text); }
.msg.staff .who, .msg.whatsapp_app .who { color: var(--team); }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .93rem; }
.msg .body a { color: var(--ai-text); }
.msg .foot { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 4px;
  font-size: .7rem; color: var(--muted); }
.msg .tick { font-weight: 700; letter-spacing: -.2em; }
/* the chat's ✓ / ✓✓ share the class name with the cleaning checklist button (.tick, a 34 px
   circle): keep them plain text marks (bug 16.11: empty circles next to the time) */
.msg .foot .tick { width: auto; height: auto; border: 0; border-radius: 0; background: none; display: inline; padding: 0;
  color: inherit; transform: none; }
.msg .foot .tick.read { color: var(--ai-2); }
.msg .foot .tick.failed { color: var(--err); }
.msg .tick.read { color: var(--ai-2); }
.msg .tick.failed { color: var(--err); letter-spacing: 0; }
.msg .media { margin: 2px 0 4px; }
.msg .media img { display: block; max-width: min(320px, 100%); max-height: 360px; border-radius: 12px; object-fit: cover; }
.msg .media.sticker img { max-width: 140px; background: transparent; }
.msg .media audio { width: min(300px, 70vw); height: 40px; display: block; }
.msg .media video { max-width: min(340px, 100%); max-height: 360px; border-radius: 12px; display: block; }
.msg .media .doc { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px;
  background: var(--surface-2); color: var(--text); text-decoration: none; font-size: .88rem; max-width: 100%; }
.msg .media .doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg .media .doc small { color: var(--muted); }
.msg .media-gone { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); font-style: italic; }
.msg .error { font-size: .78rem; color: var(--err); margin-top: 4px; }
.note { align-self: center; display: inline-flex; align-items: center; gap: 6px; max-width: 80%;
  text-align: center; font-size: .76rem; color: var(--muted); margin: 8px 0; }
.note svg { flex: none; }
.composer { padding: 12px 20px 18px; }
.composer form { display: flex; align-items: flex-end; gap: 10px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 18px; padding: 8px 8px 8px 14px; box-shadow: var(--shadow); }
.composer form:focus-within { border-color: var(--ai-1); box-shadow: 0 0 0 4px rgba(109, 93, 252, .12); }
.composer textarea { border: 0; box-shadow: none; padding: 7px 0; margin: 0; min-height: 22px; max-height: 180px;
  resize: none; background: transparent; }
.composer textarea:focus { box-shadow: none; }
.composer .send { width: 40px; height: 40px; border-radius: 13px; border: 0; cursor: pointer; display: grid;
  place-items: center; background: var(--ink); color: var(--on-ink); flex: none; }
.composer .tool { width: 36px; height: 40px; border: 0; background: none; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; border-radius: 12px; flex: none; }
.composer .tool:hover { color: var(--text); background: var(--surface-2); }
.composer .attach-bar, .composer .rec-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 8px;
  border-radius: 14px; background: var(--surface-2); font-size: .86rem; }
.composer .attach-bar[hidden], .composer .rec-bar[hidden] { display: none; }
.composer .attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer .rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--err); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.composer.busy { opacity: .6; pointer-events: none; }
.composer .hint { font-size: .74rem; color: var(--muted); margin: 7px 4px 0; }
.composer .warn { color: var(--warn); }
.side-pane { overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: var(--glass); }
.side-pane .card { box-shadow: none; }
.prop-photo { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; display: block; background: var(--surface-2); }
.mode-card { padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.mode-card.ai { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box,
  var(--ai-grad) border-box; border: 1.5px solid transparent; }
.chat-empty { flex: 1; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 30px; }
.chat-empty .glow { width: 74px; height: 74px; border-radius: 24px; margin: 0 auto 16px; display: grid;
  place-items: center; color: #fff; background: var(--ai-grad); box-shadow: 0 16px 40px rgba(109, 93, 252, .35); }
.back { display: none; }

/* ------------------------------------------------------------------ property cards */
.prop-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s; }
.prop-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.prop-card .photo { aspect-ratio: 16/10; background: var(--surface-2) center/cover no-repeat; position: relative; }
.prop-card .photo .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; }
.prop-card .photo .badge { background: rgba(255, 255, 255, .92); color: #111; backdrop-filter: blur(6px); }
.prop-card .info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.prop-card .title { font-weight: 620; line-height: 1.3; }
.checks { display: flex; gap: 6px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 560;
  padding: 3px 8px; border-radius: 999px; }
.check.yes { background: var(--ok-soft); color: var(--ok); }
.check.no { background: var(--warn-soft); color: var(--warn); }

.listing { white-space: pre-wrap; font-size: .87rem; color: var(--text-2); max-height: 520px; overflow-y: auto;
  padding: 14px 16px; border-radius: 12px; background: var(--surface-2); }

/* ------------------------------------------------------------------ mobile */
.mobile-bar { display: none; }
@media (max-width: 1180px) {
  .inbox { grid-template-columns: 320px 1fr; }
  .inbox .side-pane { display: none; }
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 18px 16px 96px; }
  .main.flush { padding-bottom: 72px; }
  .mobile-bar { display: flex; position: fixed; z-index: 50; left: 10px; right: 10px; bottom: 10px;
    justify-content: space-around; padding: 7px; border-radius: 20px; background: var(--glass);
    backdrop-filter: saturate(160%) blur(18px); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }
  .mobile-bar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .66rem;
    font-weight: 600; color: var(--muted); padding: 6px 10px; border-radius: 13px; position: relative; }
  .mobile-bar a.active { color: var(--text); background: var(--surface); }
  .mobile-bar .count { position: absolute; top: 2px; right: 6px; min-width: 17px; height: 17px; border-radius: 9px;
    font-size: .64rem; display: grid; place-items: center; background: #f59e0b; color: #fff; padding: 0 4px; }
  .inbox, .inbox.no-side { grid-template-columns: 1fr; height: calc(100vh - 72px); }
  .inbox.has-chat .list-pane { display: none; }
  .inbox:not(.has-chat) .chat { display: none; }
  .chat { height: calc(100vh - 72px); }
  .back { display: inline-grid; }
  .chat-head .actions .btn span { display: none; }
  .msg { max-width: 88%; }
  .composer .hint:not(.warn) { display: none; }
  .auth { grid-template-columns: 1fr; }
  h1 { font-size: 1.35rem; }
  table.list .hide-sm { display: none; }
}

/* ------------------------------------------------------------------ project notes (markdown) */
.prose { font-size: .92rem; line-height: 1.6; overflow-x: auto; }
.prose h1 { font-size: 1.35rem; margin: 0 0 12px; }
.prose h2 { font-size: 1.1rem; margin: 26px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.prose h3 { margin: 18px 0 8px; }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 12px; }
.prose li { margin: 3px 0; }
.prose code { font-family: var(--mono); font-size: .84em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); }
.prose pre { background: var(--surface-2); padding: 12px 14px; border-radius: 10px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: .86rem; }
.prose th, .prose td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--muted); font-weight: 620; }
.prose blockquote { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--ai-1); background: var(--ai-soft); border-radius: 0 10px 10px 0; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

/* ------------------------------------------------------------------ installed app (iPhone notch / home bar) */
@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 820px) {
    .main { padding-top: calc(18px + env(safe-area-inset-top)); }
    .main.flush { padding-top: 0; }
    .pane-head, .chat-head { padding-top: calc(14px + env(safe-area-inset-top)); }
    .mobile-bar { bottom: calc(10px + env(safe-area-inset-bottom)); }
    .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  }
}

/* ------------------------------------------------------------------ bookings as cards on phones */
@media (max-width: 820px) {
  #bookings-table thead { display: none; }
  #bookings-table, #bookings-table tbody { display: block; }
  #bookings-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
    padding: 12px 16px; border-bottom: 1px solid var(--line); }
  #bookings-table tr.hidden { display: none; }
  #bookings-table td { padding: 0; border: 0; }
  #bookings-table td.prop { grid-column: 1 / -1; order: 3; color: var(--text-2); font-size: .86rem; }
  #bookings-table td.prop .ellipsis { max-width: none !important; white-space: normal; }
  #bookings-table td:nth-child(3) { order: 4; font-size: .84rem; }
  #bookings-table td:nth-child(5) { order: 2; text-align: right; }
  #bookings-table td:first-child { order: 1; }
  .table-wrap { overflow-x: visible; }
}

/* ------------------------------------------------------------------ "More" menu */
.menu-list li { padding: 0; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 18px;
  background: none; border: 0; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.menu-list form { width: 100%; }
.menu-list .grow { display: flex; flex-direction: column; }
.mi { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); flex: none; }

@media (max-width: 820px) {
  #users-table thead { display: none; }
  #users-table, #users-table tbody, #users-table tr, #users-table td { display: block; }
  #users-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  #users-table td { padding: 4px 0; border: 0; }
  #users-table td .row { justify-content: flex-start !important; }
  #users-table input[type=password] { width: 100% !important; }
}

/* overview layout */
/* Jorge 24.11: the middle row = three equal columns of the same height (no lonely gap) */
.grid.overview-top { grid-template-columns: 1.25fr 1fr 1fr; align-items: stretch; }
.ov-card { display: flex; flex-direction: column; min-height: 0; }
.ov-card .card-body { flex: 1; display: flex; flex-direction: column; }
.ov-card .list-plain li:last-child { border-bottom: 0; }
.ov-card .empty { margin: auto 0; }
.ai-state { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.today-kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
.today-kpis .kpi { padding: 14px; border-radius: 12px; background: var(--surface-2); }
.today-kpis .kpi .value { font-size: 1.6rem; }
.ov-settings { margin-top: auto; align-self: flex-start; }
.ov-card .card-body > .btn.ov-settings { margin-top: 14px; }
.grid.overview-days { grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 1280px) { .grid.overview-top { grid-template-columns: 1fr 1fr; } .grid.overview-top .ov-card:first-child { grid-column: 1 / -1; } }
@media (max-width: 1180px) { .grid.overview-days { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .grid.overview-top { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ bookings: calendar + list */
.bookings-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.bookings-layout > * { min-width: 0; }
.bookings-layout .table-wrap { overflow-x: auto; }
@media (max-width: 1560px) { .bookings-layout .hide-sm { display: none; } }
.cal { position: sticky; top: 16px; }
.cal-head { margin-bottom: 12px; flex-wrap: nowrap; }
.cal-head .icon-btn { margin: 0; }
.cal-kind { width: 100%; margin-bottom: 12px; }
.cal-kind a { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }  /* 7 days always fit the card */
.cal-dow { text-align: center; font-size: .7rem; font-weight: 650; color: var(--muted); padding: 4px 0; }
.cal-day { aspect-ratio: 1; border-radius: 11px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 1px; font-size: .86rem; color: var(--text-2); transition: background .12s; position: relative; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.out { opacity: .35; }
.cal-day .c { font-size: .66rem; font-weight: 700; min-width: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--ai-soft); color: var(--ai-text); line-height: 16px; text-align: center; }
.cal-day.has .n { font-weight: 650; color: var(--text); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.cal-day.sel { background: var(--ink); color: var(--on-ink); box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.cal-day.sel .n { color: var(--on-ink); font-weight: 700; }
/* selected day (Jorge 16.11): a clean ink square, the count inside it in a soft tone that
   matches (it no longer touches the edge); today + selected = ring around the outside */
.cal-day.sel .c { background: color-mix(in srgb, var(--on-ink) 18%, transparent); color: var(--on-ink); }
.cal-day.sel.today { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--line-strong), 0 6px 16px rgba(0, 0, 0, .18); }
.cal-day { min-width: 0; }
.wa-btn { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; padding: 4px 10px;
  border-radius: 999px; border: 1px solid rgba(37, 211, 102, .35); color: #16a34a; white-space: nowrap; }
.wa-btn.on { background: #25d366; border-color: #25d366; color: #fff; }
.wa-btn:hover { box-shadow: 0 4px 14px rgba(37, 211, 102, .3); }
@media (max-width: 1180px) {
  .bookings-layout { grid-template-columns: 1fr; }
  .cal { position: static; max-width: 420px; }
}
@media (max-width: 820px) {
  .cal { max-width: none; padding: 14px; }
  .cal-day { aspect-ratio: auto; height: 42px; border-radius: 10px; font-size: .82rem; }
  .cal-grid { gap: 2px; }
  #bookings-table td:nth-child(6) { order: 5; grid-column: 1 / -1; }
}

/* bookings table: always fits its card, no sideways scrolling */
@media (min-width: 821px) {
  .bookings-layout .table-wrap { overflow-x: visible; }
  #bookings-table { table-layout: fixed; width: 100%; }
  #bookings-table td, #bookings-table th { padding-left: 12px; padding-right: 12px; overflow-wrap: anywhere; }
  #bookings-table th:first-child, #bookings-table td:first-child { padding-left: 20px; }
  #bookings-table col.c-guest { width: 22%; }
  #bookings-table col.c-prop { width: auto; }
  #bookings-table col.c-stay { width: 150px; }
  #bookings-table col.c-n { width: 70px; }
  #bookings-table col.c-src { width: 118px; }
  #bookings-table col.c-wa { width: 104px; }
  #bookings-table col.c-status { width: 104px; }
}
@media (min-width: 821px) and (max-width: 1560px) {
  #bookings-table col.hide-sm { display: none; width: 0; }
}

/* ---- cases (forgotten items, guest reports) */
.nav .count.soft { background: var(--surface-2); color: var(--text-2); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.pick { position: relative; display: block; border-radius: 12px; overflow: hidden; background: var(--surface-2);
  aspect-ratio: 1; margin: 0; cursor: pointer; }
.pick img, .pick video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pick .doc { display: flex; align-items: center; justify-content: center; gap: 6px; height: 100%; padding: 8px;
  font-size: .75rem; text-align: center; word-break: break-word; color: var(--text-2); text-decoration: none; }
.pick input[type=checkbox] { position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; margin: 0; z-index: 1; }
.pick:has(input:checked) { outline: 3px solid var(--ai-1); outline-offset: -3px; }
.pick form { position: absolute; top: 4px; right: 4px; margin: 0; }
.pick .remove { width: 26px; height: 26px; border-radius: 8px; border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(0, 0, 0, .55); color: #fff; }
.case-actions { gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.case-line { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: .88rem; }
.case-line .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint-box { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 0; padding: 10px 12px; border-radius: 12px;
  background: var(--warn-soft); color: var(--text); font-size: .85rem; }
.sol[hidden] { display: none; }

/* ================================================================== phone layout v2 (15.11)
   - nothing may make the page wider than the screen (grid / flex children shrink)
   - status bar area and bottom menu are solid: content never shows through
   - the chat uses the whole screen (no bottom menu), booking + cases in a panel */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.grid > *, .stack > *, .row > .grow, .list-plain .grow { min-width: 0; }
.info-btn { display: none; position: relative; }
.dot-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  font-style: normal; font-size: .66rem; font-weight: 700; display: grid; place-items: center; background: #f59e0b; color: #fff; }
.sheet-head { display: none; }
.alert-bar .reason { flex: 1; min-width: 0; }

@media (max-width: 1180px) {
  .info-btn { display: inline-flex; }
  .inbox .side-pane { display: flex; position: fixed; inset: 0; z-index: 80; background: var(--bg);
    padding: calc(12px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto; transform: translateX(100%); visibility: hidden; transition: transform .22s ease, visibility .22s; }
  .inbox.show-side .side-pane { transform: none; visibility: visible; }
  .sheet-head { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; padding: 4px 2px 6px; }
  .sheet-head .icon-btn { width: 40px; height: 40px; }
}

@media (max-width: 820px) {
  :root { --bar-h: 64px; }
  /* solid strip behind the iPhone status bar */
  body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top);
    background: var(--bg); z-index: 70; }
  .main { padding: calc(16px + env(safe-area-inset-top)) 16px calc(var(--bar-h) + 28px + env(safe-area-inset-bottom)); }
  .main.flush { padding: 0; }

  /* bottom menu: docked, solid, always on top */
  .mobile-bar { left: 0; right: 0; bottom: 0; border-radius: 0; border: 0; border-top: 1px solid var(--line);
    background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, .08); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 60; }
  .mobile-bar a { flex: 1; padding: 6px 0; font-size: .66rem; border-radius: 12px; }
  .mobile-bar a.active { background: var(--surface-2); }
  .mobile-bar .count { right: calc(50% - 22px); }

  /* page head, cards, numbers: one consistent scale */
  h1 { font-size: 1.35rem; }
  .page-head { margin-bottom: 16px; gap: 12px; align-items: flex-start; }
  .page-head p { font-size: .88rem; }
  .grid { gap: 12px; }
  .grid.kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 12px 14px; }
  .kpi .label { font-size: .74rem; }
  .kpi .value { font-size: 1.55rem; }
  .kpi .sub { font-size: .72rem; }
  .card-head { padding: 14px 16px 0; }
  .card-body { padding: 10px 16px 14px; }
  .card-pad { padding: 14px 16px; }
  .list-plain li { padding: 10px 0; gap: 10px; }
  .cell-main { font-size: .92rem; }
  .cell-sub { font-size: .78rem; }

  /* inbox and chat */
  .inbox, .inbox.no-side { height: calc(100dvh - var(--bar-h) - env(safe-area-inset-bottom)); }
  body.chat-open .mobile-bar { display: none; }
  body.chat-open .inbox { height: 100dvh; }
  /* WhatsApp-like keyboard: the chat is pinned to the visible screen (app.js sets --vvh) */
  body.chat-open { overflow: hidden; overscroll-behavior: none; }
  body.chat-open .inbox { position: fixed; left: 0; right: 0; top: var(--vvtop, 0px);
    height: var(--vvh, 100dvh); }
  body.chat-open .thread { overscroll-behavior: contain; }
  body.kb-open .composer { padding-bottom: 6px; }
  body.kb-open .composer .hint { display: none; }
  .chat { height: 100%; }
  .chat-head { padding: calc(10px + env(safe-area-inset-top)) 12px 10px; gap: 10px; }
  .chat-head .avatar.lg { width: 38px; height: 38px; font-size: .9rem; }
  .chat-head .who { flex: 1; }
  .chat-head .who b { font-size: .96rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-head .who span { display: block; font-size: .74rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-head .actions { gap: 6px; flex: none; }
  .chat-head .actions .btn { padding: 9px 10px; }
  .chat-head .back { width: 36px; height: 36px; margin: 0; }
  .alert-bar { flex-wrap: wrap; margin: 8px 10px 0; padding: 10px 12px; gap: 8px; font-size: .84rem; }
  .alert-bar .reason { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    flex: 1 1 calc(100% - 30px); cursor: pointer; }
  .alert-bar .reason.open { display: block; }
  .alert-bar .actions { margin-left: 0; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .alert-bar .actions .btn { white-space: normal; padding: 8px; line-height: 1.2; }
  .alert-bar .actions .btn:only-of-type { grid-column: 1 / -1; }
  .thread { padding: 12px 10px 8px; }
  .msg { max-width: 86%; padding: 9px 12px 7px; }
  .msg .body { font-size: .92rem; }
  .note { max-width: 92%; font-size: .72rem; }
  .composer { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); }
  .composer form { padding: 6px 6px 6px 8px; gap: 4px; border-radius: 16px; }
  .composer textarea { font-size: 1rem; } /* 16px: iPhone does not zoom when typing */
  .composer .tool { width: 34px; }

  /* forms: 16px fields so iPhone never zooms in */
  input, textarea, select { font-size: 1rem; }
}

/* cases: filters, cards on phones, reason picker */
.tabs.seg { margin-bottom: 14px; }
.case-filters { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.status-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.status-chips::-webkit-scrollbar { display: none; }
.more-filters summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 560;
  font-size: .86rem; color: var(--text-2); list-style: none; }
.more-filters summary::-webkit-details-marker { display: none; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 12px; margin-top: 12px; }
.choice-grid { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.choice-grid legend { font-weight: 580; font-size: .88rem; margin-bottom: 8px; padding: 0; }
.choice { display: flex; align-items: center; gap: 10px; margin: 0; padding: 12px; border-radius: 14px; cursor: pointer;
  border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 560; transition: border-color .15s, background .15s; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; }
.choice .em { font-size: 1.2rem; line-height: 1; }
.choice:has(input:checked) { border-color: var(--ai-1); background: var(--ai-soft); color: var(--ai-text); }
.choice:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(109, 93, 252, .14); }
@media (max-width: 820px) {
  .hide-phone { display: none; }
  .tabs.seg { width: 100%; }
  .tabs.seg a { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 8px; font-size: .84rem; }
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .filter-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filter-grid label, .filter-grid select, .filter-grid input { min-width: 0; max-width: 100%; }
  .filter-grid input[type=date] { width: 100%; }
  .filter-grid label { font-size: .8rem; }
  #cases-table thead { display: none; }
  #cases-table, #cases-table tbody { display: block; }
  #cases-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 13px 16px;
    border-bottom: 1px solid var(--line); }
  #cases-table td { padding: 0; border: 0; }
  #cases-table td:nth-child(1) { order: 1; }
  #cases-table td:nth-child(5) { order: 2; text-align: right; }
  #cases-table td:nth-child(2) { order: 3; grid-column: 1 / -1; }
  #cases-table td:nth-child(4) { order: 4; grid-column: 1 / -1; font-size: .8rem; color: var(--muted); }
  #cases-table td.hide-sm { display: none; }
}
.case-actions .btn { flex: 1; }
@media (max-width: 1180px) {
  .side-pane .prop-photo { aspect-ratio: 21/9; }
  .case-actions .btn { padding: 11px 10px; font-size: .9rem; }
}
/* alert in the chat: text on its own line (max 3 lines, tap to read all), buttons below */
.alert-bar { flex-wrap: wrap; }
.alert-bar .reason { flex: 1 1 calc(100% - 30px); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; cursor: pointer; }
.alert-bar .reason.open { display: block; }
.alert-bar .actions { margin-left: auto; }

/* ================================================================== case page (15.11, v2)
   Same language as the rest: cards, soft badges, segmented controls, AI accent for focus. */
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; }
.back-link:hover { color: var(--text); }
.case-hero { padding: 20px 22px 16px; margin-bottom: 16px; position: relative; overflow: hidden; }
.case-hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%;
  background: var(--ai-grad); opacity: .10; filter: blur(10px); pointer-events: none; }
.case-hero.report::after { background: linear-gradient(135deg, #f43f5e, #f59e0b); }
.hero-top { display: flex; align-items: flex-start; gap: 16px; position: relative; z-index: 1; }
.hero-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; flex: none;
  background: var(--ai-soft); color: var(--ai-text); font-size: 1.7rem; }
.case-hero.report .hero-icon { background: var(--err-soft); color: var(--err); }
.hero-title { flex: 1; min-width: 0; }
.hero-kicker { font-size: .74rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.hero-title h1 { margin: 2px 0 8px; font-size: 1.5rem; overflow-wrap: anywhere; }
.hero-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hero-chat { flex: none; }

.steps { display: flex; gap: 6px; margin-top: 18px; position: relative; z-index: 1; overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.step { flex: 1; min-width: 92px; margin: 0; }
.step button { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); color: var(--muted); cursor: pointer;
  font: inherit; font-size: .76rem; font-weight: 600; transition: border-color .15s, background .15s, color .15s; }
.step button:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); }
.step-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .74rem; font-weight: 700;
  background: var(--surface-3); color: var(--text-2); }
.step.done button { color: var(--text-2); }
.step.done .step-dot { background: var(--ok-soft); color: var(--ok); }
.step.current button { background: var(--surface); color: var(--text); cursor: default;
  border: 1.5px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--ai-grad) border-box; }
.step.current .step-dot { background: var(--ai-grad); color: #fff; }
.step-label { text-align: center; line-height: 1.2; }

.case-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
.case-layout > * { min-width: 0; }
.field { margin-bottom: 16px; }
.field-label { display: block; font-weight: 580; font-size: .88rem; margin-bottom: 8px; }
.seg-control { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 13px;
  background: var(--surface-2); }
.seg { position: relative; margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 8px;
  border-radius: 10px; font-weight: 560; font-size: .86rem; color: var(--text-2); cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.seg:has(input:checked) { background: var(--surface); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow); }
.seg.yes:has(input:checked) { color: var(--ok); }
.seg.no:has(input:checked) { color: var(--err); }
.seg:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(109, 93, 252, .3); }
.sub-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 2px; margin-bottom: 16px; background: var(--surface-2); }
.sub-card[hidden] { display: none; }
.sub-card input, .sub-card textarea { background: var(--surface); }
.sub-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 620; margin-bottom: 12px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.input-group { display: flex; align-items: stretch; margin-top: 6px; border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.input-group:focus-within { border-color: var(--ai-1); box-shadow: 0 0 0 4px rgba(109, 93, 252, .14); }
.input-group span { display: grid; place-items: center; padding: 0 12px; font-size: .82rem; font-weight: 620; color: var(--muted);
  background: var(--surface-2); border-right: 1px solid var(--line); }
.input-group input { border: 0; margin: 0; border-radius: 0; box-shadow: none !important; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 14px; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); position: relative; flex: none; transition: background .2s; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.toggle input:checked + .toggle-ui { background: #10b981; }
.toggle input:checked + .toggle-ui::after { transform: translateX(18px); }
.inline-warn { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; font-size: .84rem;
  background: var(--warn-soft); color: var(--warn); margin: 0 0 14px; }
.inline-warn svg { margin-top: 2px; }
.day-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.day-chip { flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 62px; padding: 8px 10px;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; }
.day-chip b { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.day-chip span { font-weight: 650; }
.day-chip.active { border-color: var(--ai-1); background: var(--ai-soft); color: var(--ai-text); }
.choice-grid.compact { grid-template-columns: repeat(3, 1fr); margin: 0 0 16px; }
.choice-grid.compact .choice { padding: 10px 12px; font-size: .86rem; }
.case-form .card-body { padding-bottom: 4px; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px;
  border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

/* photos */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shot { position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.shot img, .shot video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.shot-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.shot-open img { transition: transform .25s ease; }
.shot-open:hover img { transform: scale(1.04); }
.shot figcaption { font-size: .72rem; color: var(--muted); padding: 6px 10px 7px; }
.shot-doc { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; font-size: .78rem; text-align: center; color: var(--text-2); text-decoration: none; word-break: break-word; }
.shot form { position: absolute; top: 8px; right: 8px; margin: 0; }
.shot-remove { width: 30px; height: 30px; border-radius: 10px; border: 0; cursor: pointer; display: grid; place-items: center;
  background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(6px); opacity: .85; }
.shot-remove:hover { opacity: 1; background: var(--err); }
.empty.slim { padding: 22px 12px; }
.add-photos { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.dropzone { display: flex; align-items: center; gap: 14px; margin: 0; padding: 16px; border-radius: 14px; cursor: pointer;
  border: 1.5px dashed var(--line-strong); background: var(--surface-2); transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.has-files { border-color: var(--ai-1); background: var(--ai-soft); }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.dz-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); color: var(--ai-text); flex: none; }
.gallery.pickable { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.shot.choose { cursor: pointer; margin: 0; }
.shot.choose img, .shot.choose .shot-doc { aspect-ratio: 1; }
.shot.choose input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.shot.choose .tick { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid #fff; background: rgba(0, 0, 0, .25); color: transparent; }
.shot.choose:has(input:checked) { outline: 3px solid var(--ai-1); outline-offset: -3px; }
.shot.choose:has(input:checked) .tick { background: var(--ai-1); border-color: var(--ai-1); color: #fff; }

/* side cards */
.date-tile { width: 46px; height: 48px; border-radius: 12px; flex: none; display: flex; flex-direction: column; align-items: center;
  justify-content: center; background: var(--surface-2); line-height: 1.1; }
.date-tile b { font-size: 1.05rem; }
.date-tile span { font-size: .66rem; text-transform: uppercase; color: var(--muted); font-weight: 650; }
.day-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.day-row:first-of-type { border-top: 0; }
.day-row.chosen .date-tile { background: var(--ai-grad); color: #fff; }
.day-row.chosen .date-tile span { color: rgba(255, 255, 255, .85); }
.note-box { display: flex; align-items: flex-end; gap: 8px; margin: 12px 0 16px; padding: 6px 6px 6px 12px;
  border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); }
.note-box:focus-within { border-color: var(--ai-1); box-shadow: 0 0 0 4px rgba(109, 93, 252, .12); }
.note-box textarea { border: 0; margin: 0; padding: 6px 0; box-shadow: none !important; resize: none; min-height: 22px; background: transparent; }
.note-box .btn { width: 36px; height: 36px; padding: 0; flex: none; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.t-item { position: relative; display: flex; gap: 12px; padding: 0 0 14px; }
.t-dot { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; z-index: 1;
  font-size: .72rem; font-weight: 700; background: var(--ink); color: var(--on-ink); box-shadow: 0 0 0 4px var(--surface); }
.t-item.n-event .t-dot { width: 12px; height: 12px; margin: 6px 8px 0; background: var(--line-strong); box-shadow: 0 0 0 4px var(--surface); }
.t-content { min-width: 0; flex: 1; }
.t-head { font-size: .74rem; color: var(--muted); margin-bottom: 3px; }
.t-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .88rem; }
.t-item.n-note .t-body { padding: 9px 12px; border-radius: 4px 14px 14px 14px; background: var(--surface-2); }
.t-item.n-event .t-body { color: var(--text-2); font-size: .84rem; }

/* photo viewer */
.lightbox { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, .86); backdrop-filter: blur(6px); }
.lightbox[hidden] { display: none; }
.lightbox img { width: auto; height: auto; max-width: calc(100vw - 40px); max-height: calc(100dvh - 40px); object-fit: contain;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
html.in-modal .lightbox img { max-width: calc(100vw - 40px); max-height: calc(100vh - 40px); }
/* previous / next (Jorge 23.11): arrows on the computer, swipe on the phone, "2 / 5" */
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0;
  display: grid; place-items: center; cursor: pointer; background: rgba(255, 255, 255, .15); color: #fff; z-index: 1; }
.lb-nav:hover { background: rgba(255, 255, 255, .3); }
.lb-prev { left: 14px; } .lb-next { right: 14px; }
.lightbox.one .lb-nav, .lightbox.one .lb-count { display: none; }
.lb-count { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .15); color: #fff; font-size: .82rem; font-weight: 600; }
@media (max-width: 820px) { .lb-nav { display: none; } }
.lb-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; display: grid; place-items: center; cursor: pointer; background: rgba(255, 255, 255, .15); color: #fff; }

@media (max-width: 1180px) { .case-layout { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .case-hero { padding: 16px; }
  .hero-top { gap: 12px; flex-wrap: wrap; }
  .hero-icon { width: 46px; height: 46px; border-radius: 14px; font-size: 1.35rem; }
  .hero-title h1 { font-size: 1.25rem; }
  .hero-chat { width: 100%; }
  .step { min-width: 84px; }
  .two-cols { grid-template-columns: 1fr; }
  .choice-grid.compact { grid-template-columns: 1fr 1fr; }
  .seg { font-size: .8rem; padding: 9px 4px; gap: 4px; }
  .seg svg { display: none; }
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .gallery.pickable { grid-template-columns: repeat(3, 1fr); }
  .form-foot { padding: 12px 16px; }
  .form-foot .muted { display: none; }
  .form-foot .btn { width: 100%; }
}
@media (max-width: 820px) {
  .step { min-width: 76px; }
  .step button { padding: 8px 4px 7px; font-size: .7rem; }
  .step-dot { width: 22px; height: 22px; font-size: .68rem; }
}
/* language switch */
.lang-switch { max-width: 340px; }
.lang-switch .seg { text-decoration: none; }
.lang-switch .seg.on { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow); }
.auth-card .lang-switch { margin-bottom: 22px; }
.menu-list .lang-row { padding: 15px 18px; gap: 14px; }
.menu-list .lang-row .grow { gap: 8px; }
/* longer words in French / Spanish: segmented tabs may use two lines on small phones */
@media (max-width: 820px) {
  .tabs.seg a { white-space: normal; text-align: center; line-height: 1.2; }
  .mobile-bar a { min-width: 0; max-width: 20%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.show-more { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; border-top: 1px solid var(--line); }

/* smooth change between pages (browsers that support it: Chrome, Safari 18+) */
@media (min-width: 821px) and (prefers-reduced-motion: no-preference) { @view-transition { navigation: auto; } }  /* computers only (phones: instant) */
/* Jorge 24.11 ("a little shaking when I change menu"): the old page does not fade out
   while the new one fades in (that overlap looked like a wobble); only the new page
   fades in, and the side menu / tab bar do not move at all */
::view-transition-old(root) { animation: none; opacity: 0; }
::view-transition-new(root) { animation: soft-in .14s ease-out; }
@keyframes soft-in { from { opacity: 0; } }
::view-transition-group(sidebar), ::view-transition-group(tabbar) { animation: none; }
::view-transition-old(sidebar), ::view-transition-old(tabbar) { animation: none; opacity: 0; }
::view-transition-new(sidebar), ::view-transition-new(tabbar) { animation: none; }

.sidebar { view-transition-name: sidebar; }
.mobile-bar { view-transition-name: tabbar; }

/* Airbnb / Booking.com messages (through Lodgify) */
.msg .via, .preview .via { font-size: .66rem; font-weight: 650; padding: 1px 7px; border-radius: 999px; margin-right: 6px;
  background: var(--surface-3); color: var(--text-2); }
.msg.via-airbnb .via { background: rgba(255, 56, 92, .12); color: #e31c5f; }
.msg.via-booking .via { background: rgba(0, 53, 128, .10); color: #1d5bbf; }
.msg.platform { background: var(--team-bubble); border-color: transparent; }
.msg.platform .who { color: var(--team); }
.msg .original { margin-top: 6px; font-size: .78rem; color: var(--muted); }
.msg .original summary { cursor: pointer; display: inline-flex; align-items: center; gap: 5px; list-style: none; }
.msg .original summary::-webkit-details-marker { display: none; }
.msg .original .body { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line-strong); color: var(--text-2); font-size: .88rem; }
.composer .channel-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  background: var(--surface-2); color: var(--text-2); font-size: .86rem; }
/* composer: which channel the reply goes through */
.composer .channel-pick { max-width: 360px; margin-bottom: 8px; }
.composer .channel-pick .seg { padding: 7px 8px; font-size: .82rem; min-width: 0; }
@media (max-width: 820px) {
  /* channel picker: one slim full-width row, both choices always fit */
  .composer .channel-pick { max-width: none; width: 100%; margin-bottom: 6px; padding: 3px; border-radius: 11px; }
  .composer .channel-pick .seg { padding: 6px 6px; font-size: .8rem; border-radius: 8px; overflow: hidden; text-overflow: ellipsis; }
  .composer .channel-pick .seg svg { width: 14px; height: 14px; }
}
.composer[data-channel="channel"] .wa-only { display: none; }
.composer:not([data-channel="channel"]) .channel-only { display: none; }
.composer[data-channel="channel"] form { border-color: rgba(255, 56, 92, .35); }

/* ================================================================== cleaning & tasks (plan L, 15.11)
   Board of check-outs (day strip + ticket cards), task page (checklist with photos), editor. */
.cleaning-tabs { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.cleaning-tabs::-webkit-scrollbar { display: none; }
.cleaning-tabs a { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 22px 0 10px; font-size: 1.02rem; }
.avatar.sm { width: 26px; height: 26px; font-size: .74rem; flex: none; }
.avatar.none { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line-strong); }
.price { font-weight: 680; letter-spacing: -.01em; white-space: nowrap; }
.price small { font-size: .7rem; color: var(--muted); font-weight: 600; }
.inline-warn.slim { padding: 7px 10px; font-size: .78rem; margin: 0; }

/* day strip */
.day-strip-card { padding: 12px 12px 10px; margin-bottom: 12px; }
.day-strip-head { display: flex; align-items: center; gap: 10px; padding: 0 2px 10px; }
.day-strip-head b { flex: 1; min-width: 0; font-size: .95rem; }
.day-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(52px, 1fr); gap: 6px; overflow-x: auto;
  scrollbar-width: none; scroll-snap-type: x proximity; }
.day-strip::-webkit-scrollbar { display: none; }
.day-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text); scroll-snap-align: start;
  transition: border-color .15s, background .15s, transform .15s; }
.day-cell:hover { border-color: var(--line-strong); }
.day-cell .dow { font-size: .68rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.day-cell .num { font-size: 1.1rem; font-weight: 680; }
.day-cell .cnt { font-size: .74rem; font-weight: 650; color: var(--text-2); display: inline-flex; align-items: center; gap: 3px; }
.day-cell.none .cnt { color: var(--muted); }
.day-cell.is-today .num { color: var(--ai-text); }
.day-cell.active { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--ai-grad) border-box;
  border: 1.5px solid transparent; box-shadow: var(--shadow); }
.dot-free { width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; display: inline-block; }
.board-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.board-chips::-webkit-scrollbar { display: none; }
.board-chips .chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

/* ticket cards */
.grid.tickets { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.ticket { display: flex; flex-direction: column; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.ticket:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ticket-photo { position: relative; display: block; aspect-ratio: 16 / 7; background: var(--surface-2) center/cover no-repeat; }
.ticket-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.25), transparent 45%); }
.ticket-photo .badge { position: absolute; top: 10px; z-index: 1; background: rgba(255, 255, 255, .92); color: #111; backdrop-filter: blur(6px); }
.ticket-photo .code { left: 10px; font-weight: 700; }
.ticket-photo .state { right: 10px; }
.ticket-photo .state.ok { background: #10b981; color: #fff; }
.ticket-photo .state.ai { background: var(--ai-grad); color: #fff; }
.ticket.s-done .ticket-photo { filter: saturate(.4); }
.ticket-body { padding: 12px 16px 12px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ticket-title { font-weight: 640; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ticket-title + .cell-sub { margin-top: -6px; }
.ticket-desc { font-size: .84rem; color: var(--text-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.stays { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stays.vertical { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
.stay { display: flex; gap: 9px; align-items: flex-start; min-width: 0; padding: 9px 10px; border-radius: 12px; background: var(--surface-2); }
.stays.vertical .stay { background: none; padding: 0; }
.stay-ico { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.stay-ico.out { background: var(--warn-soft); color: var(--warn); }
.stay-ico.in { background: var(--ok-soft); color: var(--ok); }
.stay-txt { display: flex; flex-direction: column; min-width: 0; font-size: .82rem; line-height: 1.3; }
.stay-label { font-size: .66rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stay-txt b { font-weight: 620; }
.progress-row { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.progress { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--ai-grad); transition: width .3s; }
.ticket.s-done .progress span { background: #10b981; }
.ticket-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px;
  border-top: 1px solid var(--line); background: var(--surface-2); min-width: 0; }
.assign { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; flex: 1; }
.assign select { margin: 0; padding: 6px 30px 6px 10px; font-size: .86rem; min-width: 0; flex: 1; max-width: 220px; }
.assign select.unassigned { border-color: #f59e0b; color: var(--warn); }

/* task page */
.hero-icon.photo { background-size: cover; background-position: center; }
.task-desc { white-space: pre-wrap; margin: 0; }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-item { display: flex; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.check-item:first-child { border-top: 0; }
.tick-form { margin: 0; }
.tick { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: transparent; transition: background .15s, border-color .15s, transform .1s; }
.tick:hover:not(:disabled) { border-color: #10b981; color: #10b981; }
.tick:active:not(:disabled) { transform: scale(.92); }
.tick:disabled { opacity: .45; cursor: not-allowed; }
.check-item.is-done .tick { background: #10b981; border-color: #10b981; color: #fff; opacity: 1; }
.ci-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ci-text { font-weight: 560; line-height: 1.35; padding-top: 6px; overflow-wrap: anywhere; }
.check-item.is-done .ci-text { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.ci-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ci-tags .badge { display: inline-flex; align-items: center; gap: 4px; }
.ci-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.shot.mini img, .shot.mini video { aspect-ratio: 1; }
.shot.mini form { top: 5px; right: 5px; }
.shot.mini .shot-remove { width: 26px; height: 26px; }
.ci-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.ci-upload label.btn { margin: 0; cursor: pointer; }
.finish-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; margin: 0;
  border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.finish-bar.done { color: var(--ok); font-weight: 600; }
.finish-bar.done > span { display: inline-flex; align-items: center; gap: 6px; }

/* checklist editor */
.checklist-editor { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.cl-rows { display: flex; flex-direction: column; gap: 8px; }
.cl-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px;
  padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.cl-row > input[name="item_text"] { margin: 0; background: var(--surface); }
.cl-grip { color: var(--muted); display: grid; }
.cl-flags { display: flex; gap: 4px; }
.flag { margin: 0; position: relative; cursor: pointer; }
.flag input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.flag span { display: inline-flex; align-items: center; gap: 4px; padding: 6px 9px; border-radius: 9px; font-size: .76rem; font-weight: 600;
  color: var(--muted); border: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.flag input:checked + span { color: var(--ai-text); border-color: var(--ai-1); background: var(--ai-soft); }
.flag input:focus-visible + span { box-shadow: 0 0 0 3px rgba(109, 93, 252, .3); }
.checklist-editor > [data-add-row] { align-self: flex-start; }

/* templates, prices, earnings */
.tpl-card { display: flex; flex-direction: column; gap: 8px; transition: transform .15s, box-shadow .15s; }
.tpl-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.tpl-card.off { opacity: .6; }
.tpl-card .title { font-weight: 640; }
.tpl-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--ai-soft); color: var(--ai-text); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto; padding: 2px; }
.prop-pick { position: relative; margin: 0; cursor: pointer; }
.prop-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.prop-pick > span { display: flex; flex-direction: column; min-width: 0; padding: 9px 11px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); transition: border-color .15s, background .15s; }
.prop-pick small { color: var(--muted); font-size: .74rem; }
.prop-pick input:checked + span { border-color: var(--ai-1); background: var(--ai-soft); }
.prop-pick input:checked + span b { color: var(--ai-text); }
.price-list li, .pay-list li { padding: 10px 20px; }
.price-list .input-group { width: 150px; margin: 0; flex: none; }
.pay-list a { display: flex; align-items: center; gap: 12px; width: 100%; color: inherit; }
.pay-list .grow { display: flex; flex-direction: column; }
.mini-seg { margin: 0 !important; width: auto !important; }
.mini-seg a { padding: 5px 11px !important; font-size: .8rem !important; }
td.num, th.num { text-align: right; }
.narrow-form { max-width: 760px; }
.is-busy { opacity: .6; pointer-events: none; }
.my-kpis { margin-bottom: 4px; }

@media (max-width: 820px) {
  .tabs.seg.cleaning-tabs { justify-content: flex-start; }
  .tabs.seg.cleaning-tabs a { flex: 1 0 auto; white-space: nowrap; padding: 9px 12px; }
  .grid.tickets { grid-template-columns: 1fr; }
  .ticket-photo { aspect-ratio: 16 / 6; }
  .check-item { padding: 14px 16px; gap: 12px; }
  .finish-bar:not(.done) { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 70px); z-index: 5; padding: 10px 14px;
    box-shadow: 0 -6px 20px rgba(0,0,0,.08); }
  .finish-bar .btn { flex: none; }
  .cl-row { grid-template-columns: minmax(0, 1fr) auto; padding: 10px; }
  .cl-grip { display: none; }
  .cl-flags { grid-column: 1 / -1; order: 3; flex-wrap: wrap; }
  .cl-row [data-remove-row] { grid-row: 1; grid-column: 2; }
  .price-list li, .pay-list li { padding: 10px 16px; }
  .price-list .input-group { width: 130px; }
  .pick-grid { grid-template-columns: 1fr 1fr; }
  .card-head .mini-seg { flex: none; }
  #earnings-table thead { display: none; }
  #earnings-table, #earnings-table tbody { display: block; }
  #earnings-table tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  #earnings-table td { padding: 0; border: 0; }
  #earnings-table td:nth-child(2) { order: 1; }
  #earnings-table td.num { order: 2; }
  #earnings-table td:nth-child(1) { order: 3; font-size: .8rem; color: var(--muted); }
  #earnings-table td:nth-child(3):not(.num) { order: 4; font-size: .8rem; color: var(--muted); text-align: right; }
}
.ci-upload .icon-only { padding: 6px 9px; color: var(--muted); }

/* ================================================================== channels everywhere (16.11)
   WhatsApp guests are recognisable in the inbox and in the chat (Jorge's rule). */
.badge.whatsapp { background: rgba(37, 211, 102, .14); color: #12a150; display: inline-flex; align-items: center; gap: 4px; }
.badge.whatsapp svg { width: 12px; height: 12px; }
.preview .via.wa, .msg.via-whatsapp .via { background: rgba(37, 211, 102, .14); color: #12a150; }
.msg .via { display: inline-flex; align-items: center; gap: 3px; }
.msg .via svg { width: 11px; height: 11px; }
.channel-chips { margin-top: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; }
/* Jorge 25.11: the small Upsells chip and the day filter (Check-in / Check-out / Staying + our calendar) */
.list-pane .pane-head .chips .chip { padding: 5px 10px; font-size: .84rem; }
.chip-upsells { padding: 5px 8px !important; }
.day-chips { margin-top: 8px; align-items: center; }  /* wraps: the calendar must never be clipped */
.day-chips .chip { white-space: nowrap; padding: 5px 10px; font-size: .8rem; }
.list-pane .pane-head .chips.day-chips { position: relative; z-index: 70; overflow: visible; flex-wrap: wrap; }  /* the calendar opens under the row, never clipped */
.list-pane .pane-head { position: relative; z-index: 3; }
.dp.dp-chip { display: inline-block; width: auto; position: static; }
.dp.dp-chip .dp-btn { width: auto; margin: 0; padding: 5px 11px; font-size: .8rem; border-radius: 999px; gap: 6px; }
.dp.dp-chip .dp-btn .i { color: inherit; }
.dp.dp-chip .dp-pop { left: 0; right: auto; top: calc(100% + 4px); }
.channel-chips::-webkit-scrollbar { display: none; }
.channel-chips .chip { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 5px 11px; font-size: .8rem; }
.channel-chips .chip.ch-whatsapp.active { background: #12a150; border-color: #12a150; color: #fff; box-shadow: 0 0 0 1.5px #12a150; }
.channel-chips .chip.ch-airbnb.active { background: #e31c5f; border-color: #e31c5f; color: #fff; box-shadow: 0 0 0 1.5px #e31c5f; }
.channel-chips .chip.ch-booking.active { background: #1d5bbf; border-color: #1d5bbf; color: #fff; box-shadow: 0 0 0 1.5px #1d5bbf; }
/* Logos only (Jorge 16.11): WhatsApp, Airbnb, Booking.com as their logo in their colour;
   selected = filled with that colour, white logo. Small, so more channels fit later. */
.channel-chips .chip.logo { justify-content: center; width: 46px; height: 34px; padding: 0; }
.channel-chips .chip.logo .i { width: 19px; height: 19px; }
.channel-chips .chip.logo.ch-whatsapp { color: #12a150; }
.channel-chips .chip.logo.ch-airbnb { color: #e31c5f; }
.channel-chips .chip.logo.ch-booking { color: #1d5bbf; }
.channel-chips .chip.logo.active { color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .channel-chips .chip.logo.ch-booking:not(.active) { color: #6b9cf0; } }
:root[data-theme="dark"] .channel-chips .chip.logo.ch-booking:not(.active) { color: #6b9cf0; }

/* search bars: results while typing + ✕ to clear (rule, every search bar) */
.search input { padding-right: 38px; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search .search-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px;
  border: 0; border-radius: 50%; background: var(--surface-3); color: var(--text-2); display: grid; place-items: center;
  cursor: pointer; padding: 0; }
.search .search-clear svg { position: static; transform: none; width: 13px; height: 13px; color: inherit; }
.search .search-clear[hidden] { display: none; }
.search.loading::after { content: ""; position: absolute; right: 42px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--ai-1); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Enso boarding pass button in the bookings list (Enso Connect blue) */
.prop-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.prop-line .prop-name { flex: 1; min-width: 0; }
.enso-btn { flex: none; display: inline-flex; align-items: center; font-size: .74rem; font-weight: 650; letter-spacing: .01em;
  padding: 3px 10px; border-radius: 999px; border: 1px solid #2f6bff; color: #2f6bff; background: transparent;
  transition: box-shadow .15s, background .15s; }
.enso-btn.on { background: #2f6bff; color: #fff; }
.enso-btn:hover { box-shadow: 0 4px 14px rgba(47, 107, 255, .35); }
:root[data-theme="dark"] .enso-btn:not(.on) { color: #7aa2ff; border-color: #4c7dff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .enso-btn:not(.on) { color: #7aa2ff; border-color: #4c7dff; } }

/* the guest's language next to the name in every chat (Jorge's rule) */
.chat-head .who-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-head .who-name .ellipsis { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-tag { flex: none; font-size: .68rem; font-weight: 750; letter-spacing: .06em; padding: 2px 7px; border-radius: 6px;
  background: var(--ai-soft); color: var(--ai-text); border: 1px solid rgba(109, 93, 252, .35); line-height: 1.3; }
.chat-head .who .who-name .ellipsis { display: block; font-size: inherit; color: inherit; font-weight: inherit; }
.chat-head .who .who-name .lang-tag { display: inline-block; font-size: .68rem; color: var(--ai-text); }
.chat-head .who b.who-name { display: flex; align-items: center; gap: 8px; }

/* extra work on a cleaning ticket (paid on top) */
.extra-line { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: .8rem; padding: 6px 10px; border-radius: 10px;
  background: var(--ok-soft); color: var(--ok); }
.extra-line .ellipsis { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.extra-line b { flex: none; }
.extra-card { border-color: rgba(16, 185, 129, .35); }

/* background form sending (checklist): toast messages, busy line */
.toast-zone { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 90px);
  display: flex; flex-direction: column; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast-zone .flash { margin: 0; box-shadow: var(--shadow-lg); pointer-events: auto; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.check-item.is-busy { opacity: .6; transition: opacity .15s; }

/* ================================================================== phone form fixes (16.11)
   iPhone draws date / time fields wider than their box (they stuck out of the card):
   always as wide as the box, text on the left like the other fields. */
input[type="date"], input[type="time"], input[type="datetime-local"] {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; max-width: 100%; min-width: 0; text-align: left; }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; }
.two-cols > * { min-width: 0; }
/* apartment picker: cards never wider than the screen, long names cut with … */
.pick-grid { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); overflow-x: hidden; }
.prop-pick, .prop-pick > span { min-width: 0; }
.prop-pick b, .prop-pick small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) {
  .pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* camera / gallery buttons on a checklist line (Jorge 19.11: many photos in one go) */
.ci-upload { gap: 8px; }
.cam-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer;
  padding: 9px 14px 9px 10px; border-radius: 14px; font-weight: 620; font-size: .86rem;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  transition: transform .1s, box-shadow .15s, border-color .15s; }
.cam-btn[hidden] { display: none; }
.cam-btn:active { transform: scale(.97); }
.cam-btn:hover { border-color: var(--ai-1); }
.cam-btn .cam-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center;
  background: var(--ai-grad); color: #fff; flex: none; }
.cam-btn.video .cam-ico { background: linear-gradient(135deg, #f43f5e, #f59e0b); }
.cam-btn.need { border-color: transparent; box-shadow: 0 6px 18px rgba(109, 93, 252, .28);
  background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--ai-grad) border-box; border: 1.5px solid transparent; }
.cam-btn.small { padding: 6px 10px 6px 6px; font-size: .78rem; color: var(--muted); }
.cam-btn.small .cam-ico { width: 24px; height: 24px; border-radius: 8px; background: var(--surface-3); color: var(--text-2); }
/* the app's own camera (Jorge 19.11): many photos in one go, then Save */
html.livecam-open, html.livecam-open body { overflow: hidden; }
.livecam { position: fixed; inset: 0; z-index: 1000; background: #000; color: #fff; display: flex; flex-direction: column; }
.livecam video { flex: 1; min-height: 0; width: 100%; object-fit: cover; background: #000; }
.livecam.flash video { opacity: .35; }
.livecam-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.livecam-close { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 1.1rem; cursor: pointer; }
.livecam-count { font-weight: 700; font-size: .9rem; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.18); }
.livecam-msg { position: absolute; top: 40%; left: 16px; right: 16px; text-align: center; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.12); }
.livecam-strip { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; min-height: 72px; background: #000; }
.livecam-strip button { position: relative; flex: none; width: 56px; height: 56px; padding: 0; border: 2px solid rgba(255,255,255,.6); border-radius: 10px; overflow: hidden; background: #222; cursor: pointer; }
.livecam-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.livecam-strip span { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.7); font-size: .65rem; display: grid; place-items: center; color: #fff; }
.livecam-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 16px calc(env(safe-area-inset-bottom) + 16px); background: #000; }
.livecam-shoot { width: 72px; height: 72px; border-radius: 50%; border: 4px solid #fff; background: #fff; box-shadow: inset 0 0 0 4px #000; cursor: pointer; }
.livecam-shoot:active { transform: scale(.93); }
.livecam-shoot:disabled { opacity: .35; }
.livecam .livecam-save { justify-self: end; background: #fff; color: #000; border-color: #fff; }
.livecam-save:disabled { opacity: .45; }
/* when a photo was taken, on every cleaning photo */
.shot-time { position: absolute; left: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 8px;
  background: rgba(0,0,0,.62); color: #fff; font-size: .66rem; font-weight: 650; font-variant-numeric: tabular-nums; pointer-events: none; }
.shot-time svg { width: 11px; height: 11px; }
.shot-time.unknown { background: rgba(217, 119, 6, .9); }
.cam-count { font-size: .76rem; font-weight: 650; color: var(--muted); padding: 3px 8px; border-radius: 999px; background: var(--surface-2); }

/* ================================================================== payouts (16.11)
   Period (day / week / month / year / dates) with arrows, workers, money per worker. */
.period-card { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.period-seg { grid-auto-columns: minmax(0, 1fr); }
.period-seg .seg { text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg.on { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow); font-weight: 650; }
.period-nav { display: flex; align-items: center; gap: 12px; }
.period-label { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.period-label b { font-size: 1.12rem; letter-spacing: -.01em; }
.today-chip { align-self: center; }
.period-dates { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; margin: 0; }
.period-dates label { margin: 0; }
.worker-pick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.worker-pick .worker-chip { cursor: pointer; }
.apt-pick { margin: 0; }
.apt-pick select { margin: 0; max-width: 260px; }
.grid.pay-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.kpi.ok .value { color: var(--ok); }
.worker-pay li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 20px; }
.wp-name { display: flex; flex-direction: column; min-width: 0; }
.wp-nums { display: flex; gap: 18px; }
.wp-nums span { display: flex; flex-direction: column; align-items: flex-end; min-width: 64px; }
.wp-nums small { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; }
.wp-nums b { font-size: .98rem; }
.wp-nums .ok b { color: var(--ok); }
.wp-nums .warn b { color: var(--warn); }
.wp-pay { margin: 0; justify-self: end; }
.pay-list li { gap: 10px; }
@media (max-width: 820px) {
  .period-seg .seg { padding: 8px 4px; font-size: .78rem; }
  .period-dates { grid-template-columns: 1fr 1fr; }
  .period-dates .btn { grid-column: 1 / -1; justify-content: center; }
  .grid.pay-kpis { grid-template-columns: 1fr 1fr; }
  .worker-pay li { grid-template-columns: auto minmax(0, 1fr); padding: 12px 16px; row-gap: 10px; }
  .wp-nums { grid-column: 1 / -1; justify-content: space-between; gap: 8px; }
  .wp-nums span { align-items: flex-start; min-width: 0; }
  .wp-pay { grid-column: 1 / -1; justify-self: stretch; }
  .wp-pay .btn { width: 100%; justify-content: center; }
  .apt-pick select { max-width: none; }
}
.worker-pick { align-items: center; }
.worker-pick .chip, .worker-pick label.chip { display: inline-flex; flex-direction: row; align-items: center; gap: 6px;
  width: auto; height: auto; margin: 0; padding: 6px 12px; font-size: .84rem; font-weight: 560; line-height: 1.3; white-space: nowrap; }
.worker-pick label.chip.active { font-weight: 650; }

/* ================================================================== login on phones (16.11)
   Jorge: "more life, more style". Computer login unchanged (rule 0). The glowing art
   becomes a hero at the top, the form a sheet sliding over it, language switch full width. */
.field-ico { display: block; position: relative; }
.field-ico > svg { display: none; }
.login-btn svg { display: none; }
@media (max-width: 820px) {
  .auth { min-height: 100dvh; display: flex; flex-direction: column; background: #09090b; }
  .auth-art { display: flex; flex-direction: column; justify-content: flex-end; gap: 12px;
    padding: calc(env(safe-area-inset-top) + 22px) 22px 50px; }
  .auth-art > img { height: 26px; }
  .auth-art .copy { max-width: none; }
  .auth-art h2 { font-size: 1.5rem; margin-bottom: 10px; }
  .auth-art .copy p, .auth-art .legal { display: none; }
  .auth-art .feature { display: inline-flex; margin: 0 6px 6px 0; padding: 6px 11px; border-radius: 999px; font-size: .78rem;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(8px); }
  .auth-art .feature:nth-of-type(n+2) { display: none; }
  .orb.a { width: 300px; height: 300px; top: -90px; right: -110px; }
  .orb.b { width: 260px; height: 260px; bottom: -110px; left: -90px; }
  .orb.c { width: 160px; height: 160px; top: 35%; left: 45%; }
  .auth-form { flex: 1; display: block; position: relative; z-index: 1; margin-top: -28px; padding: 26px 22px
    calc(env(safe-area-inset-bottom) + 28px); background: var(--bg); border-radius: 28px 28px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .35); }
  .auth-form::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 999px; background: var(--line-strong);
    margin: -10px auto 18px; }
  .auth-card { max-width: none; }
  .auth-card .mobile-logo { display: none !important; }
  .auth-card .lang-switch { max-width: none; width: 100%; margin-bottom: 18px; }
  .auth-card .lang-switch .seg { padding: 10px 6px; }
  .auth-card h1 { font-size: 1.45rem; letter-spacing: -.02em; }
  .auth-card .lead { margin-bottom: 16px; }
  .auth-card label { margin-bottom: 12px; }
  .field-ico > svg { display: block; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted);
    pointer-events: none; z-index: 1; margin-top: 3px; }
  .field-ico input { padding-left: 42px; height: 52px; border-radius: 14px; }
  .field-ico:focus-within > svg { color: var(--ai-1); }
  .btn.primary.login-btn { height: 54px; border-radius: 16px; font-size: 1.02rem; margin-top: 6px; justify-content: center; gap: 8px;
    background: var(--ai-grad); color: #fff; border: 0; box-shadow: 0 10px 28px rgba(109, 93, 252, .35); }
  .login-btn svg { display: block; }
  .login-btn:active { transform: scale(.98); }
}
@media (max-width: 820px) and (max-height: 700px) {  /* small phones: the button stays on screen */
  .auth-art .feature { display: none !important; }
  .auth-art h2 { font-size: 1.3rem; margin-bottom: 0; }
  .auth-art { padding-bottom: 44px; }
  .auth-card .lead { display: none; }
}

/* a checklist line without its photo (rule: a photo per line before finishing) */
.photo-missing { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; font-size: .82rem;
  background: var(--warn-soft); color: var(--warn); border: 1px solid rgba(245, 158, 11, .3); }
.photo-missing b { font-weight: 650; }
.photo-left { display: inline-flex; align-items: center; gap: 4px; color: var(--warn); font-weight: 600; }
/* bottom menu: long words (FR "Réservations") fit on small phones */
.mobile-bar a { min-width: 0; }
@media (max-width: 360px) { .mobile-bar a { font-size: .6rem; letter-spacing: -.01em; padding-left: 2px; padding-right: 2px; } }
/* worker home: reminder of unfinished tasks from earlier days */
.late-warn { margin-bottom: 12px; text-decoration: none; align-items: center; }
.late-warn span { flex: 1; font-weight: 600; }
.day-cell .cnt svg { width: 12px; height: 12px; color: var(--ok); }
.error-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.error-page .card { max-width: 440px; width: 100%; text-align: center; }
.error-page h1 { margin: 6px 0; }

/* ================================================================== modals (computer, 16.11)
   Detail pages open in a window over the list; inside, the page has no menus. */
.modal-back { position: fixed; inset: 0; z-index: 200; background: rgba(5, 5, 8, .55); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 28px; animation: modal-fade .15s ease-out; }
@keyframes modal-fade { from { opacity: 0; } }
.modal-win { width: min(1180px, 100%); height: min(88vh, 1000px); display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: 0 30px 90px rgba(0, 0, 0, .45);
  animation: modal-up .18s ease-out; }
.modal-win.external { width: min(560px, 100%); }
@keyframes modal-up { from { transform: translateY(12px) scale(.985); opacity: 0; } }
.modal-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); }
.modal-title { flex: 1; min-width: 0; font-weight: 640; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-win iframe { flex: 1; width: 100%; border: 0; background: var(--bg); }
body.modal-open { overflow: hidden; }
/* the page shown inside a modal: no menus, no "back" links */
html.in-modal .sidebar, html.in-modal .mobile-bar, html.in-modal .back-link { display: none !important; }
html.in-modal .app { display: block; }
html.in-modal .main { padding-top: 22px; }

/* ================================================================== small side menu (computer, 16.11)
   Button next to the logo: the menu shrinks to icons; hovering an icon shows its name. */
.nav-toggle { position: absolute; top: 20px; right: 12px; }
.brand .logo-mark { display: none; height: 30px; width: 30px; border-radius: 9px; }
.nav a { position: relative; }
@media (min-width: 821px) {
  html.nav-mini { --sidebar: 76px; }
  html.nav-mini .sidebar { padding: 18px 10px; align-items: center; overflow: visible; z-index: 60; }
  html.nav-mini .brand { padding: 6px 0 12px; }
  html.nav-mini .brand img:not(.logo-mark), html.nav-mini .brand .tag { display: none !important; }
  html.nav-mini .brand .logo-mark { display: block; }
  html.nav-mini .nav-toggle { position: static; margin-bottom: 10px; }
  html.nav-mini .nav { align-items: center; width: 100%; }
  html.nav-mini .nav a { width: 46px; height: 44px; padding: 0; justify-content: center; font-size: 0; gap: 0; }
  html.nav-mini .nav a svg { width: 20px; height: 20px; }
  html.nav-mini .nav a .count { position: absolute; top: 3px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px;
    font-size: .62rem; line-height: 17px; margin: 0; }
  html.nav-mini .nav-label { font-size: 0; height: 1px; background: var(--line); width: 32px; margin: 10px 0; padding: 0; }
  /* the name appears next to the icon on hover / keyboard focus */
  html.nav-mini .nav a::after { content: attr(aria-label); position: absolute; left: calc(100% + 12px); top: 50%;
    transform: translate(-4px, -50%); opacity: 0; pointer-events: none; white-space: nowrap; font-size: .82rem; font-weight: 600;
    padding: 7px 11px; border-radius: 10px; background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-lg);
    transition: opacity .12s, transform .12s; z-index: 70; }
  html.nav-mini .nav a:hover::after, html.nav-mini .nav a:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
  html.nav-mini .status-pill { font-size: 0; padding: 10px; justify-content: center; gap: 0; }
  html.nav-mini .me { flex-direction: column; padding: 6px 0 0; }
  html.nav-mini .me .who { display: none; }
  .app { transition: grid-template-columns .2s ease; }
}
@media (max-width: 820px) { .nav-toggle { display: none; } }

/* modal polish (16.11): form pages in a window that fits them, centred */
.modal-win.narrow { width: min(860px, 100%); }
html.in-modal body.narrow-page .main > * { max-width: none !important; }
html.in-modal body.narrow-page .main { padding: 22px 28px 32px; }
html.in-modal body.narrow-page .page-head { margin-bottom: 14px; }
.modal-win { transition: width .2s ease; }
/* small side menu: every icon on the same centre line */
@media (min-width: 821px) {
  html.nav-mini .nav-toggle, html.nav-mini .me .icon-btn { margin: 0 auto; }
  html.nav-mini .nav-toggle { width: 46px; height: 40px; margin-bottom: 10px; }
  html.nav-mini .me { align-items: center; gap: 8px; width: 100%; }
  html.nav-mini .me form { margin: 0 auto; }
  html.nav-mini .status-pill { width: 46px; }
}

/* ================================================================== STYLE S (plan S, 16.11)
   Inspired by the "Vision" kit Jorge chose: dark hero cards, big numbers, progress rings,
   glass surfaces, ink pill for the menu item you are on, glossy avatars, gentle motion. */
:root { --hero-bg: #0b0b0e; --hero-text: #f5f5f7; --glass-tile: rgba(255, 255, 255, .07); --glass-line: rgba(255, 255, 255, .12); }

/* S5 numbers: big, tight, aligned */
.kpi .value, .gt-value, .ring-in b, .price, .ring-stats b { font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.kpi .value { font-size: 2.05rem; font-weight: 700; }
h1 { letter-spacing: -.03em; }

/* S1 hero */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; margin-bottom: 16px; }
.hero-card { position: relative; overflow: hidden; border-radius: 24px; padding: 26px 28px; color: var(--hero-text);
  background: radial-gradient(600px 300px at 85% 20%, rgba(109, 93, 252, .30), transparent 60%),
              radial-gradient(500px 260px at 0% 120%, rgba(34, 195, 238, .20), transparent 60%), var(--hero-bg);
  border: 1px solid rgba(255, 255, 255, .06); box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text btn" "tiles tiles"; gap: 18px 16px; }
.hero-text { grid-area: text; position: relative; z-index: 1; min-width: 0; }
.hero-text .eyebrow { color: rgba(255, 255, 255, .55); }
.hero-text h1 { font-size: 2.3rem; margin: 4px 0 6px; color: #fff; }
.hero-text p { color: rgba(255, 255, 255, .7); margin: 0; }
.hero-btn { grid-area: btn; align-self: start; position: relative; z-index: 1; background: #fff; color: #0b0b0c; border-color: #fff; }
.hero-orb { position: absolute; width: 260px; height: 260px; right: -40px; top: -70px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .55), rgba(255, 255, 255, .08) 22%, transparent 42%),
              radial-gradient(circle at 60% 65%, #2b2b33, #0d0d10 70%);
  box-shadow: inset -20px -30px 60px rgba(0, 0, 0, .6), 0 30px 60px rgba(0, 0, 0, .4); opacity: .9; animation: orb 9s ease-in-out infinite; }
@keyframes orb { 50% { transform: translate(-10px, 12px) rotate(8deg); } }
.hero-tiles { grid-area: tiles; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; position: relative; z-index: 1; }
.glass-tile { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ico label" "value value" "sub sub"; gap: 6px 10px;
  align-items: center; padding: 16px 18px; border-radius: 18px; color: #fff; text-decoration: none;
  background: var(--glass-tile); border: 1px solid var(--glass-line); backdrop-filter: blur(14px) saturate(140%);
  transition: transform .15s, background .15s; }
.glass-tile:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .1); }
.gt-ico { grid-area: ico; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); }
.gt-label { grid-area: label; font-size: .74rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.gt-value { grid-area: value; font-size: 2.4rem; font-weight: 700; line-height: 1.05; }
.gt-sub { grid-area: sub; font-size: .78rem; color: rgba(255, 255, 255, .6); }
.glass-tile.warn .gt-value { color: #fbbf24; }
.ring-card { border-radius: 24px; padding: 22px; color: var(--hero-text); display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: radial-gradient(300px 200px at 50% 0%, rgba(109, 93, 252, .25), transparent 70%), var(--hero-bg);
  border: 1px solid rgba(255, 255, 255, .06); box-shadow: 0 20px 50px rgba(0, 0, 0, .25); }
.ring-head { align-self: stretch; font-weight: 640; display: flex; align-items: center; gap: 8px; color: #fff; }
.ring { --p: 0; --size: 150px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .14) 0); animation: ring-in .9s cubic-bezier(.2, .8, .2, 1); }
@keyframes ring-in { from { transform: rotate(-90deg) scale(.85); opacity: 0; } }
.ring-in { width: calc(var(--size) - 30px); height: calc(var(--size) - 30px); border-radius: 50%; background: var(--hero-bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring-in b { font-size: 2.1rem; font-weight: 700; color: #fff; }
.ring-in span { font-size: .72rem; color: rgba(255, 255, 255, .6); }
.ring-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.ring-stats div { display: flex; flex-direction: column; align-items: center; padding: 10px; border-radius: 14px; background: var(--glass-tile); border: 1px solid var(--glass-line); }
.ring-stats b { font-size: 1.3rem; color: #fff; }
.ring-stats span { font-size: .7rem; color: rgba(255, 255, 255, .6); text-align: center; }
.ring-note { font-size: .78rem; color: rgba(255, 255, 255, .55); margin: 0; }
/* small rings inside normal KPI cards (Payouts, cleaner home) */
.kpi-ring { padding-right: 96px; }
.ring.mini { --size: 64px; position: absolute; right: 16px; top: 50%; margin-top: -32px;
  background: conic-gradient(var(--ok) calc(var(--p) * 1%), var(--surface-3) 0); }
.ring.mini .ring-in { background: var(--surface); width: calc(var(--size) - 12px); height: calc(var(--size) - 12px); }  /* thin ring, numbers readable at any % (Jorge 17.11) */
.ring.mini .ring-in b { font-size: .8rem; color: var(--text); letter-spacing: -.01em; }
@media (max-width: 1100px) { .hero-grid { grid-template-columns: 1fr; } .ring-card { flex-direction: row; flex-wrap: wrap; justify-content: center; } }
@media (max-width: 820px) {
  .hero-card { padding: 20px; border-radius: 22px; grid-template-areas: "text" "tiles" "btn"; grid-template-columns: 1fr; }
  .hero-btn { justify-self: stretch; justify-content: center; }
  .hero-text h1 { font-size: 1.7rem; }
  .hero-orb { width: 170px; height: 170px; right: -50px; top: -60px; }
  .hero-tiles { gap: 10px; }
  .glass-tile { padding: 13px 14px; }
  .gt-value { font-size: 1.9rem; }
  .gt-label { font-size: .64rem; }
  .ring { --size: 128px; }
  .ring-card { flex-direction: column; }
  .kpi-ring { padding-right: 84px; }
  .ring.mini { --size: 56px; margin-top: -28px; right: 12px; }
}

/* S3 "you are here" in the side menu: ink pill like Vision (colour + weight + ring rule kept) */
.nav a.active { background: var(--ink); color: var(--on-ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); font-weight: 650; }
.nav a.active svg { color: var(--on-ink); stroke-width: 2.1; }
.nav a.active .count.soft { background: rgba(127, 127, 127, .3); color: inherit; }
/* glossy avatars (3D feel) */
.avatar { background-image: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .45), transparent 48%); }

/* S2 glass bars */
.mobile-bar { background: color-mix(in srgb, var(--surface) 72%, transparent); backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%); }
.modal-bar { background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(16px); }

/* S4 motion: cards rise in, ticks pop; nothing moves for people who turned motion off */
.card, .hero-card, .ring-card { animation: rise .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.soft-nav .card, .soft-nav .hero-card, .soft-nav .ring-card, .soft-nav .ring { animation: none; }  /* no blink on menu changes (Jorge 17.11) */
.check-item.is-done .tick { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 40% { transform: scale(1.18); } }
.btn:active, .chip:active, .seg:active { transform: scale(.97); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 300; }
.invite-card { max-width: 420px; width: 100%; display: flex; flex-direction: column; gap: 4px; } .invite-card h1 { margin: 14px 0 4px; }

/* ================================================================== team & security (16.11) */
.team-grid { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); align-items: start; }
.people li.person { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 14px 20px; }
.person.off { opacity: .6; }
.person-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.person-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-top form { margin: 0; }
.person-top select { margin: 0; min-width: 120px; }
.person > .badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; }
.perm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding-left: 44px; }
.person-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-left: 44px; }
.person-actions form { margin: 0; }
.pw-form { display: flex; gap: 6px; }
.pw-form input { margin: 0; width: 170px; }
.invite-box { margin-bottom: 16px; border-color: var(--ai-1); background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--ai-grad) border-box; border: 1.5px solid transparent; }
.invite-link { display: flex; gap: 8px; margin-top: 12px; }
.invite-link input { margin: 0; font-family: var(--mono); font-size: .82rem; }
.btn.copied { background: var(--ok); border-color: var(--ok); color: #fff; }
.last-change { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin: -6px 0 14px; }
.audit-list { padding: 4px 20px 16px; }
.audit-detail summary { cursor: pointer; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.audit-detail pre { white-space: pre-wrap; font-size: .76rem; max-height: 260px; overflow: auto; background: var(--surface-2);
  padding: 10px 12px; border-radius: 10px; margin: 6px 0 0; }
@media (max-width: 1000px) { .team-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) {
  .perm-row, .person-actions { padding-left: 0; }
  .pw-form { flex: 1 1 100%; } .pw-form input { flex: 1; width: auto; }
  .people li.person { padding: 14px 16px; }
}
.phone-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding-left: 44px; }
.phone-row input { margin: 0; width: 190px; }
.phone-row .muted { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 820px) { .phone-row { padding-left: 0; } .phone-row input { flex: 1; width: auto; } }

/* ================================================================== workers' WhatsApp (plan H) */
.workers-grid { grid-template-columns: minmax(260px, .8fr) minmax(0, 1.6fr); align-items: start; }
.worker-people li { display: block; padding: 0; }
.worker-people .person-link { width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: inherit; text-decoration: none; }
.worker-people .person-link:hover { background: var(--surface-2); }
.worker-people .person-link.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ink, var(--text)); }
.worker-thread { max-height: 60vh; overflow-y: auto; padding: 12px 20px; display: flex; flex-direction: column; gap: 8px; }
.worker-composer { display: flex; gap: 8px; align-items: flex-end; padding: 12px 20px 16px; border-top: 1px solid var(--line); margin: 0; }
.worker-composer textarea { margin: 0; flex: 1; resize: vertical; }
@media (max-width: 1000px) { .workers-grid { grid-template-columns: 1fr; } }
.wt-link { margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; text-decoration: none; }

/* ================================================================== tickets (plan H2) */
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.work-ticket { display: flex; gap: 12px; padding: 12px; color: inherit; text-decoration: none; align-items: stretch; min-width: 0; }
.work-ticket:hover { box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.08)); }
.work-ticket.urgent { box-shadow: inset 3px 0 0 var(--err); }
.wt-photo { position: relative; flex: 0 0 88px; height: 88px; border-radius: 12px; overflow: hidden; background: var(--surface-2);
  display: grid; place-items: center; color: var(--muted); }
.wt-photo img { width: 100%; height: 100%; object-fit: cover; }
.wt-count { position: absolute; right: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 2px; font-size: .7rem;
  background: rgba(0,0,0,.6); color: #fff; padding: 1px 6px; border-radius: 999px; }
.wt-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.wt-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wt-top .badge { display: inline-flex; align-items: center; gap: 3px; }
.wt-title { font-size: .95rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.wt-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; }
.wt-messages li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.wt-messages li:last-child { border-bottom: 0; }
.check-box { margin: 8px 0 0; display: flex; flex-direction: column; gap: 10px; }
.check-box textarea { margin: 0; width: 100%; }
@media (max-width: 640px) { .ticket-grid { grid-template-columns: 1fr; } }

/* ================================================================== live check 16.11 */
/* Tickets: the empty state spans the whole row like on the other pages */
.ticket-grid > .empty { grid-column: 1 / -1; }
/* Payouts / cleaner home on phones: the small ring moves to the top-right corner so the
   amount and its unit stay on one line ("0.00 CHF" broke onto two lines) */
@media (max-width: 820px) {
  .kpi-ring { padding-right: 14px; }
  .kpi-ring .ring.mini { --size: 48px; top: 10px; right: 10px; margin-top: 0; }
  .kpi-ring .ring.mini .ring-in b { font-size: .66rem; }
  .kpi-ring .value { white-space: nowrap; }
}
/* Dark mode: channel badges readable on the dark background (same colours, lighter tone;
   Booking.com dark blue and Airbnb dark red were hard to read) */
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) .badge.airbnb, :root:not([data-theme="light"]) .msg.via-airbnb .via { background: rgba(255, 56, 92, .18); color: #ff7a9a; }
:root:not([data-theme="light"]) .badge.booking, :root:not([data-theme="light"]) .msg.via-booking .via { background: rgba(77, 124, 255, .18); color: #8fb0ff; }
:root:not([data-theme="light"]) .badge.whatsapp { background: rgba(37, 211, 102, .16); color: #3ddc84; }
}
:root[data-theme="dark"] .badge.airbnb, :root[data-theme="dark"] .msg.via-airbnb .via { background: rgba(255, 56, 92, .18); color: #ff7a9a; }
:root[data-theme="dark"] .badge.booking, :root[data-theme="dark"] .msg.via-booking .via { background: rgba(77, 124, 255, .18); color: #8fb0ff; }
:root[data-theme="dark"] .badge.whatsapp { background: rgba(37, 211, 102, .16); color: #3ddc84; }


/* ================================================================== inbox speed (16.11) */
/* the list stays still when switching guests (seamless page change, computer) */
@media (min-width: 821px) { .list-pane { view-transition-name: inbox-list; } }
/* a message being sent shows at once, a little lighter, with a clock */
.msg.sending { opacity: .7; }
.msg.not-sent { box-shadow: inset 0 0 0 1.5px var(--err); }
.msg.not-sent .foot { color: var(--err); }
/* filter change: the list dims for the fraction of a second it takes */
.list-pane.is-loading #convlist { opacity: .55; transition: opacity .12s; }

/* ================================================================== bookings (16.11) */
/* Source = logo only (Airbnb, Booking.com, Lodgify for Direct), name as tooltip */
/* Jorge 23.11: the real logos, no coloured pill behind them */
.badge.src-logo { display: inline-flex; align-items: center; justify-content: center; padding: 0; background: transparent; }
.badge.src-logo .i { width: 22px; height: 22px; }
/* Enso boarding pass = Enso logo, same button (outline = search, filled = found) */
.enso-btn { gap: 0; padding: 4px 8px; }
.enso-btn .i { width: 15px; height: 15px; }
/* instant date change: the list dims for the fraction of a second it takes */
.bookings-layout.is-loading #results .table-wrap, .bookings-layout.is-loading .cal-grid { opacity: .55; transition: opacity .12s; }

/* ================================================================== smooth navigation (16.11) */
/* while the next page loads (a fraction of a second): a thin line on top, nothing jumps */
.soft-loading main.main::before { content: ""; position: fixed; left: 0; top: 0; height: 2px; width: 100%; z-index: 999;
  background: var(--ai-grad); transform-origin: left; animation: soft-bar 1s ease-out infinite; }
@keyframes soft-bar { from { transform: scaleX(0); opacity: 1; } to { transform: scaleX(1); opacity: .2; } }
@media (prefers-reduced-motion: reduce) { .soft-loading main.main::before { animation: none; } }

/* ================================================================== tickets money & days (17.11) */
.wt-due { display: inline-flex; align-items: center; gap: 4px; }
.wt-due.late { color: var(--err); font-weight: 600; }
.money-card .money-line { font-size: 1.15rem; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.money-card.paid .money-line b { color: var(--ok); }
.ticket-pay li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }
.ticket-pay li:first-child { border-top: 0; }
.tp-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.tp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tp-amount { flex: none; font-variant-numeric: tabular-nums; }
.ticket-pay .badge { flex: none; }

/* ---- Jorge 17.11: long lists and histories scroll inside their card (the page never
   grows "until the end of the ocean"); invite page logo keeps its shape */
.scroll-list { max-height: min(560px, 64vh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.history-scroll { max-height: min(420px, 56vh); }
#history .history-scroll { max-height: min(560px, 64vh); }
.worker-people.scroll-list { max-height: calc(60vh + 140px); }
.invite-card > img { align-self: center; width: auto; max-width: 100%; height: 28px; object-fit: contain; margin-bottom: 6px; }

/* ---- ticket photos (Jorge 17.11): problem photos, the technician's work photos per round */
.wt-upload { margin-top: 14px; }
.work-round + .work-round { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.work-round-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.work-round-head .muted { margin-left: auto; }
#work-photos .inline-warn { margin: 0 0 12px; }

/* ---- Jorge 17.11: pages in harmony on computers — cards side by side have the same
   height, long content scrolls inside its card, the page fits the screen */
@media (min-width: 1001px) {
  .grid.workers-grid { align-items: stretch; height: clamp(460px, calc(100dvh - 245px), 920px); }
  .workers-grid > .card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .workers-grid .worker-people.scroll-list { max-height: none; flex: 1; min-height: 0; }
  .workers-grid .worker-thread { max-height: none; flex: 1; min-height: 0; }
  .grid.team-grid { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); align-items: stretch;
    height: clamp(460px, calc(100dvh - 245px), 940px); }
  .team-grid > .card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .team-grid .people.scroll-list, .team-grid .history-scroll { max-height: none; flex: 1; min-height: 0; }
  .team-grid #history .card-head { flex-wrap: wrap; row-gap: 2px; }
  .team-grid #history .card-head h2 { white-space: nowrap; }
  .grid.project-grid { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); align-items: start; }
  .project-grid > .prose { max-height: calc(100dvh - 170px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .project-grid > #ideas { position: sticky; top: 20px; max-height: calc(100dvh - 170px); overflow-y: auto; scrollbar-width: thin; }
}

/* ---- our day picker (Jorge 17.11): looks like our fields; calendar like Bookings
   (selected day = ink square, today = outline) */
.dp { position: relative; display: block; }
.dp-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px;
  padding: 10px 14px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  color: var(--text); font: inherit; font-weight: 500; text-align: left; cursor: pointer; }
.dp-btn:hover, .dp.open .dp-btn { border-color: var(--ai-1); }
.dp.open .dp-btn { box-shadow: 0 0 0 4px color-mix(in srgb, var(--ai-1) 16%, transparent); }
.dp-btn .i { color: var(--muted); flex: none; }
.dp-text.dp-none { color: var(--muted); font-weight: 400; }
.dp-pop { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; width: 296px; max-width: calc(100vw - 32px);
  padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); animation: modal-up .14s ease-out; }
.dp-pop.up { top: auto; bottom: calc(100% + 6px); }
.dp-pop { scroll-margin: 16px 0 96px; }  /* not under the phone's bottom menu */
.dp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.dp-head b { font-size: .95rem; }
.dp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.dp-dow { text-align: center; font-size: .7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; padding: 4px 0; }
.dp-day { aspect-ratio: 1; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit;
  font-size: .86rem; font-variant-numeric: tabular-nums; cursor: pointer; }
.dp-day:hover { background: var(--surface-2); }
.dp-day.out { color: var(--muted); opacity: .55; }
.dp-day.today { box-shadow: inset 0 0 0 1.5px var(--line-strong); font-weight: 650; }
.dp-day.on { background: var(--ink); color: var(--on-ink, #fff); font-weight: 650; box-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* ---- ticket messages (Jorge 17.11): comments of reopen / notes / done in one clear box;
   the technician sees why a job was reopened at the top; a button shows it is sending */
.talk-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; max-height: min(360px, 48vh); }
.talk { align-self: flex-start; max-width: 92%; padding: 9px 12px; border-radius: 14px 14px 14px 4px;
  background: var(--surface-2); border: 1px solid var(--line); }
.talk.mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: color-mix(in srgb, var(--ai-1) 9%, var(--surface)); }
.talk.reopen { border-color: color-mix(in srgb, var(--warn, #d97706) 45%, transparent); background: color-mix(in srgb, var(--warn, #d97706) 9%, var(--surface)); }
.talk-head { font-size: .72rem; color: var(--muted); margin-bottom: 3px; }
.talk-head b { color: var(--text-2); }
.talk-body { white-space: pre-wrap; font-size: .9rem; }
.reopen-note { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 16px; padding: 14px 16px; border-radius: 16px;
  background: color-mix(in srgb, var(--warn, #d97706) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn, #d97706) 40%, transparent); }
.reopen-note > .i { color: var(--warn, #d97706); flex: none; margin-top: 2px; }
.reopen-note p { margin: 4px 0 0; white-space: pre-wrap; font-size: .95rem; }
.btn.is-sending { opacity: .65; pointer-events: none; }
.btn.is-sending .i { animation: spin .8s linear infinite; }
.dp-raise { position: relative; z-index: 50; }

/* ================================================================== stock (H6 S1, 17.11)
   Places on the left like Workers' WhatsApp (rule 33), the chosen place's stock on the right */
.stock-layout { display: grid; grid-template-columns: minmax(220px, .55fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.stock-places { overflow: hidden; }
.stock-places .place-list.scroll-list { max-height: calc(100dvh - 230px); }
.place-link { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: inherit; text-decoration: none; }
.place-link:hover { background: var(--surface-2); }
.place-link.active { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--ink); }
.place-link.main { border-bottom: 1px solid var(--line); }
.place-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.place-link.main .place-ico { background: var(--ai-grad); color: #fff; }
.place-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* apartments with rooms (19.11): the apartment, its rooms indented under it */
.place-link.room { padding-left: 34px; }
.place-link.room .place-ico { width: 24px; height: 24px; }
.place-link.group .place-ico { background: color-mix(in srgb, var(--ai-1) 14%, var(--surface)); color: var(--ai-1); }
.place-check.room { opacity: .8; font-weight: 500; }
.fill-row.room .fill-place { padding-left: 18px; }
.groups-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 16px; }
.group-rooms li { display: flex; align-items: center; gap: 8px; padding: 8px 20px; border-top: 1px solid var(--line); }
.group-rooms li form { margin: 0; }
.group-more { padding: 10px 20px 14px; border-top: 1px solid var(--line); }
.group-more summary { cursor: pointer; font-weight: 600; font-size: .86rem; display: inline-flex; align-items: center; gap: 6px; }
.group-form { display: flex; gap: 8px; margin: 10px 0 0; }
.group-form input, .group-form select { margin: 0; flex: 1; min-width: 0; }
.group-more .danger-row { margin-top: 12px; }
.stock-place-pick { padding: 0 16px 14px; margin: 0; }
.stock-place-pick select { margin: 0; }
.show-phone { display: none; }
.stock-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.stock-place-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.stock-kpis { margin: 0; }
a.card.kpi { color: inherit; text-decoration: none; }
.stock-cats { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
.stock-cats a { white-space: nowrap; }
.stock-card .card-head .search { margin: 0; }
.stock-list > li { border-top: 1px solid var(--line); }
.stock-row { padding: 12px 20px; display: flex; flex-direction: column; gap: 8px; }
.stock-line { display: flex; align-items: center; gap: 12px; min-width: 0; }
.stock-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.stock-row.low .stock-ico { background: var(--warn-soft); color: var(--warn); }
.stock-name { flex: 1; min-width: 0; display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.stock-qty { display: flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; }
.stock-qty b { font-size: 1.35rem; letter-spacing: -.02em; }
.stock-qty .unit { font-size: .74rem; color: var(--muted); margin-left: 2px; }
.stock-row.empty .stock-qty b { color: var(--err); }
.stock-bar { height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-left: 46px; }
.stock-bar span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.stock-row.low .stock-bar span { background: var(--warn); }
.stock-act { margin-left: 46px; }
.stock-act summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.stock-act summary::-webkit-details-marker { display: none; }
.stock-act[open] summary { color: var(--text); }
.stock-forms { display: grid; gap: 8px; margin-top: 10px; }
.stock-form, .stock-add-here { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.stock-form > b, .stock-add-here > b { display: inline-flex; align-items: center; gap: 6px; min-width: 104px; }
.stock-form input, .stock-form select, .stock-add-here input, .stock-add-here select { margin: 0; width: auto; flex: 1 1 120px; min-width: 0; }
.stock-form input[name=qty] { flex: 0 1 110px; }
.stock-form label.mini { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .78rem; font-weight: 500; flex: 1 1 150px; }
.stock-form label.mini input { flex: 1; }
.stock-add-here { margin: 0; border-radius: 0; border-top: 1px solid var(--line); }
.stock-where li, .shopping-list li, .stock-moves li { display: flex; align-items: center; gap: 10px; padding: 10px 20px; border-top: 1px solid var(--line); }
.stock-where li:first-child, .shopping-list li:first-child, .stock-moves li:first-child { border-top: 0; }
.stock-where li.low b { color: var(--warn); }
.move-delta { flex: none; min-width: 44px; text-align: center; padding: 3px 8px; border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .85rem; }
.move-delta.plus { background: var(--ok-soft); color: var(--ok); }
.move-delta.minus { background: var(--err-soft, #fde8e8); color: var(--err); }
.stock-moves .grow, .shopping-list .grow { display: flex; flex-direction: column; min-width: 0; }
.stock-note { font-style: italic; }
.shop-buy { font-variant-numeric: tabular-nums; white-space: nowrap; }
.shop-buy b { font-size: 1.2rem; }
.stock-history-filter { margin-bottom: 14px; } .stock-history-filter select { margin: 0; max-width: 280px; }
@media (max-width: 1000px) {
  .stock-layout { grid-template-columns: 1fr; }
  .stock-places .card-head { display: none; }
  .show-phone { display: block; } .stock-places .hide-phone { display: none; }
  .stock-place-pick { padding: 14px; }
}
@media (max-width: 820px) {
  .stock-row { padding: 12px 14px; }
  .stock-bar, .stock-act { margin-left: 0; }
  .stock-form > b, .stock-add-here > b { flex: 1 1 100%; }
}
.stock-list > li.stock-row { align-items: stretch; }
.place-list li { display: block; padding: 0; }
.place-list .place-link { width: 100%; box-sizing: border-box; }
.tabs.seg.stock-cats { display: flex; flex-wrap: nowrap; max-width: 100%; }
.tabs.seg.stock-cats a { white-space: nowrap; flex: none; }
.stock-list > li.stock-row { padding: 12px 20px; }
@media (min-width: 1001px) {  /* rule 30/33: the list scrolls in its card, the page fits the screen */
  .stock-list { max-height: calc(100dvh - 610px); min-height: 300px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
@media (max-width: 820px) { .stock-list > li.stock-row { padding: 12px 14px; } }

/* ---- our "Are you sure?" window (fixed rule 37): every delete / cancel / remove asks first */
.confirm-back { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 20px;
  background: rgba(10, 10, 12, .45); backdrop-filter: blur(4px); animation: modal-fade .12s ease-out; }
.confirm-box { width: 100%; max-width: 380px; padding: 22px; border-radius: 20px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); text-align: center; animation: modal-up .16s ease-out; }
.confirm-ico { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 14px; display: grid; place-items: center;
  background: var(--err-soft); color: var(--err); }
.confirm-text { margin: 0 0 18px; font-size: 1rem; font-weight: 560; line-height: 1.4; }
.confirm-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.confirm-btns .btn { justify-content: center; }
.btn.danger-solid { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger-solid:hover { filter: brightness(1.08); }
/* the one dangerous action of a card sits apart, under a line, never mixed with the others */
.danger-row { display: flex; justify-content: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.btn.danger-outline { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); background: transparent; }
.btn.danger-outline:hover { background: var(--err-soft); }

.push-help { margin-top: 12px; font-size: .86rem; } .push-help ol { margin: 8px 0; padding-left: 20px; } .push-help li { margin: 4px 0; }

/* ---- reply language (Jorge 18.11): write in your language, the guest gets theirs */
/* our small choice menu (data-pick): a pill button + a card menu in the dashboard style */
.cmenu { position: relative; display: inline-block; }
.cmenu-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); font: inherit; font-size: .76rem; font-weight: 600; color: var(--muted); }
.cmenu-btn:hover, .cmenu.open .cmenu-btn { border-color: var(--line-strong); color: var(--text); }
.cmenu-value { color: var(--text); font-weight: 650; }
.cmenu-chev .i { transform: rotate(90deg); transition: transform .15s ease; }
.cmenu.open .cmenu-chev .i { transform: rotate(-90deg); }
.cmenu-menu { position: absolute; z-index: 70; left: 0; bottom: calc(100% + 6px); min-width: 210px; padding: 6px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: modal-up .12s ease-out; }
.cmenu-menu [data-value] { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px;
  background: none; color: var(--text); font: inherit; font-size: .88rem; font-weight: 500; text-align: left; cursor: pointer; }
.cmenu-menu [data-value]:hover { background: var(--surface-2); }
.cmenu-menu [data-value].on { font-weight: 650; }
.cmenu-check { width: 16px; display: inline-grid; place-items: center; color: var(--ai-1); visibility: hidden; }
.cmenu-menu [data-value].on .cmenu-check { visibility: visible; }
.send-lang { margin: 0 0 6px; }
.cmenu-raise { position: relative; z-index: 50; }

/* ---- stock S2 on the check-out ticket: "did you put a new one?" (mandatory) */
.stock-checks { margin: 14px 20px 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.stock-checks-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.shared-answer { display: flex; align-items: center; gap: 4px; color: var(--ok); }
.stock-check { display: flex; align-items: center; gap: 10px; margin: 0; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.stock-check:first-of-type { border-top: 0; }
.stock-check.need .grow { font-weight: 650; }
.stock-check.need .grow::after { content: " •"; color: var(--warn); }
.yes-no { flex: none; }
.yes-no .seg { padding: 6px 12px; font-size: .82rem; display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 820px) { .stock-checks { margin: 12px 14px 0; } .yes-no { width: 100%; } .yes-no .seg { flex: 1; justify-content: center; } }

.usage-choices { display: grid; gap: 6px; margin-bottom: 14px; }
.usage-choice { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 500; cursor: pointer; }
.usage-choice:has(input:checked) { border-color: var(--ai-1); background: color-mix(in srgb, var(--ai-1) 6%, var(--surface)); font-weight: 650; }
.usage-choice input { width: auto; margin: 0; flex: none; }
.stock-loss { color: var(--err); font-weight: 600; }
.import-result p { margin: 0 0 6px; }

/* ---- stock page, round 2 (Jorge 18.11: things moved, rows centred, unclear how to change) */
.chips.stock-cats { flex-wrap: wrap; }
.stock-list { max-height: none !important; overflow: visible !important; }  /* the page scrolls, not a small box */
@media (min-width: 1001px) {
  .stock-places { position: sticky; top: 16px; }
  .stock-places .place-list.scroll-list { max-height: calc(100dvh - 120px); }
}
.place-link.main .place-ico { background: var(--surface-2); color: var(--text); }
.stock-name { align-items: flex-start; text-align: left; }
.stock-line { flex-wrap: wrap; }
.qty-step { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.qty-step input { width: 64px; margin: 0; padding: 6px 4px; min-height: 36px; text-align: center; font-weight: 700; font-size: 1.05rem;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.qty-step input::-webkit-outer-spin-button, .qty-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step-btn { width: 34px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); font-size: 1.15rem; font-weight: 600; cursor: pointer; line-height: 1; }
.step-btn:hover { background: var(--surface-2); }
.step-save { display: none; }
.qty-step.changed .step-save { display: inline-flex; }
.stock-goal { min-width: 46px; }
.stock-row.empty .qty-step input { color: var(--err); }
@media (max-width: 820px) {
  .stock-line .stock-name { flex: 1 1 calc(100% - 50px); }
  .qty-step { margin-left: 46px; }
}
.places-pick { border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 4px 0 14px; }
.places-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.places-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; }
.place-check { display: flex; align-items: center; gap: 6px; margin: 0; padding: 6px 8px; border-radius: 10px; background: var(--surface-2);
  font-size: .82rem; font-weight: 600; cursor: pointer; }
.place-check input { width: auto; margin: 0; }
.place-check:has(input:checked) { background: color-mix(in srgb, var(--ai-1) 12%, var(--surface)); }
.places-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.places-values label { margin: 0; font-size: .8rem; }

/* Inventory + Fill in (Jorge 18.11): totals of every product; one product into many places */
.inv-head, .inv-row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; }
.inv-head { border-top: 1px solid var(--line); font-size: .74rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.inv-list .inv-row { border-top: 1px solid var(--line); padding: 10px 20px; }
.inv-head .grow, .inv-row .inv-name { flex: 1 1 auto; min-width: 0; }
.inv-name { display: flex; flex-direction: column; }
.inv-head > span:not(.grow):not(.inv-act), .inv-num { flex: none; width: 92px; text-align: right; font-variant-numeric: tabular-nums; }
.inv-total b { font-size: 1.1rem; }
.inv-act { flex: none; width: 96px; justify-content: center; }
.fill-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.fill-same { display: flex; gap: 6px; align-items: center; flex: 1 1 240px; }
.fill-same input { margin: 0; width: 110px; flex: none; }
.fill-list { border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; }
.fill-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); }
.fill-row:first-child { border-top: 0; }
.fill-row:has(.fill-tick:checked) { background: color-mix(in srgb, var(--ai-1) 6%, var(--surface)); }
.fill-place { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; margin: 0; font-weight: 500; cursor: pointer; }
.fill-place input { width: auto; margin: 0; flex: none; }
.fill-place .grow { display: flex; flex-direction: column; min-width: 0; }
.fill-row > input { margin: 0; width: 88px; flex: none; text-align: center; font-weight: 700; }
.fill-form:has(input[name=source][value=main]:checked) .fill-main { display: none; }
.inv-num .show-phone { display: none; }
@media (max-width: 820px) {  /* phone: the name on its own line, then the 3 numbers + Fill in */
  .inv-head.hide-phone { display: none; }
  .inv-list .inv-row { flex-wrap: wrap; padding: 10px 16px; gap: 6px 12px; }
  .inv-row .inv-name.grow { flex: 1 1 100%; }
  .inv-row .inv-num { width: auto; flex: 1 1 0; text-align: left; display: flex; flex-direction: column; line-height: 1.25; }
  .inv-row .inv-num .show-phone { display: block; font-size: .72rem; }
  .inv-row .inv-act { width: auto; }
}

.cmenu-down .cmenu-menu { bottom: auto; top: calc(100% + 6px); }
.cmenu-wide, .cmenu-wide .cmenu-btn { width: 100%; }
.cmenu-wide .cmenu-btn { padding: 10px 14px; font-size: .9rem; justify-content: flex-start; }
.cmenu-wide .cmenu-chev { margin-left: auto; }
.cmenu-wide .cmenu-menu { right: 0; max-height: 60vh; overflow-y: auto; }
.cmenu-link { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: .9rem; }
.cmenu-link:hover { background: var(--surface-2); }
.cmenu-link.on { font-weight: 650; }
.cmenu-link.on .cmenu-check { visibility: visible; }
@media (max-width: 820px) {  /* the 4 numbers stay small on phones: the products come first */
  .grid.stock-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .stock-kpis .kpi { padding: 10px 8px; min-height: 0; border-radius: 14px; }
  .stock-kpis .kpi .label { font-size: .66rem; gap: 3px; }
  .stock-kpis .kpi .value { font-size: 1.35rem; }
  .stock-kpis .kpi .sub { display: none; }
  .stock-kpis .kpi::after { display: none; }
}

/* ---- Jorge 19.11: Stock in harmony on computers — places and products have the same
   height, each scrolls inside its own card (the screen stays still); search bars and
   headers never touch the list under them */
.stock-places .card-head, .stock-card > .card-head, .inv-card > .card-head { padding-bottom: 14px; }
.stock-places .card-head { border-bottom: 1px solid var(--line); }
.stock-places .place-list { padding: 6px 0; }
@media (min-width: 1001px) {
  .stock-layout { align-items: stretch; height: clamp(520px, calc(100dvh - 226px), 1100px); }
  .stock-places { position: static; display: flex; flex-direction: column; min-height: 0; }
  .stock-places .place-list.scroll-list { max-height: none; flex: 1; min-height: 0; }
  .stock-main { min-height: 0; }
  .stock-main > .stock-card { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .stock-card .stock-list { flex: 1; min-height: 0; max-height: none !important; overflow-y: auto !important;
    overscroll-behavior: contain; scrollbar-width: thin; border-top: 1px solid var(--line); }
  .stock-card .stock-list > li:first-child { border-top: 0; }
}
/* product window, "Where it is" (Jorge 19.11): tiles, not links; scrolls inside */
.where-list { padding: 6px 10px 10px; max-height: min(360px, 46vh); }
.where-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: inherit; text-decoration: none; }
.where-row:hover { background: var(--surface-2); }
.where-row .place-ico.group { background: color-mix(in srgb, var(--ai-1) 14%, var(--surface)); color: var(--ai-1); }
.where-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.where-qty { font-variant-numeric: tabular-nums; white-space: nowrap; }
.where-row.low .where-qty b { color: var(--warn); }
.where-chev { color: var(--muted); display: grid; }
.where-none { padding: 10px; }
.where-list li { padding: 0; border: 0; display: block; }
/* Fill in window (Jorge 19.11): rows never touch the frame; our own tick boxes */
.fill-list .fill-row { padding: 10px 14px; gap: 12px; }
.fill-list .fill-row.room .fill-place { padding-left: 22px; }
.fill-list .fill-row > input[type=number] { width: 92px; }
.fill-tools .place-check { padding: 8px 12px; }
.fill-form input[type=checkbox], .places-pick input[type=checkbox], .group-new input[type=checkbox] {
  appearance: none; -webkit-appearance: none; flex: none; width: 20px; height: 20px; margin: 0; padding: 0; min-height: 0;
  border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--surface) center / 14px no-repeat;
  cursor: pointer; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.fill-form input[type=checkbox]:checked, .places-pick input[type=checkbox]:checked, .group-new input[type=checkbox]:checked {
  border-color: transparent; background-color: var(--ai-1);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.fill-form input[type=checkbox]:focus-visible, .places-pick input[type=checkbox]:focus-visible, .group-new input[type=checkbox]:focus-visible {
  box-shadow: 0 0 0 3px rgba(109, 93, 252, .3); outline: none; }
.fill-form input[type=checkbox]:disabled, .places-pick input[type=checkbox]:disabled { opacity: .55; cursor: default; }
/* cleaning ticket, "Stock · Did you put a new one?" (Jorge 19.11): dashboard style */
.stock-checks { padding: 14px 16px 6px; background: var(--surface); border-radius: 16px; border: 1px solid var(--line); }
.stock-checks-head { gap: 10px; margin-bottom: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.stock-checks-head .grow { display: flex; flex-direction: column; min-width: 0; }
.stock-checks-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ai-grad); color: #fff; flex: none; }
.stock-check { padding: 12px 0; gap: 12px; }
.stock-check:first-of-type { border-top: 0; }
.stock-check.need .grow { font-weight: inherit; }
.stock-check.need .grow::after { content: none; }
.stock-check-name { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 3px; }
.stock-check-title { font-weight: 620; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.yes-no.seg-control { flex: 0 0 auto; width: 240px; }
.yes-no .seg { border: 0; background: transparent; font: inherit; font-size: .84rem; font-weight: 600; padding: 8px 10px;
  color: var(--text-2); cursor: pointer; justify-content: center; }
.yes-no .seg:hover:not(:disabled) { color: var(--text); }
.yes-no .seg.active { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow); }
.yes-no .seg.yes.active { color: var(--ok); }
.yes-no .seg.no.active { color: var(--err); }
.yes-no .seg:disabled { cursor: default; opacity: .7; }
.yes-no .seg:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(109, 93, 252, .3); }
@media (max-width: 820px) { .yes-no.seg-control { width: 100%; } }
/* Shopping list (Jorge 19.11): a window, grouped by type, PDF / WhatsApp / copy */
.shop-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
.shop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.shop-group { margin-bottom: 14px; }
.shop-group > .card-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.shop-lines .shop-line { display: block; padding: 12px 20px; }
.shop-main { display: flex; align-items: center; gap: 12px; }
.shop-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shop-buy { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 70px; text-align: right; }
.shop-buy b { font-size: 1.15rem; }
.shop-price { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 92px; text-align: right; font-weight: 600; }
.shop-places { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.shop-place { font-size: .76rem; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.shop-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); font-size: 1.05rem; }
.print-only { display: none; }
@media (max-width: 820px) {
  .shop-lines .shop-line { padding: 12px 16px; }
  .shop-price { min-width: 0; }
}
@media print {
  .sidebar, .mobile-bar, .no-print, .flashes, .toast-zone, .modal-bar { display: none !important; }
  .print-only { display: block; }
  body, .main, .content { background: #fff !important; }
  .card { box-shadow: none !important; break-inside: avoid; }
  .shop-place { border: 1px solid #ddd; }
}
.shop-date { margin: 0 0 2px; font-weight: 600; }
/* phones (Jorge 19.11): the place menu opens OVER the page, never cut inside the Places box */
@media (max-width: 1000px) {
  .stock-places { overflow: visible; }
  .stock-places.cmenu-raise { z-index: 60; }
}
/* phone place menu (Jorge 19.11): the same look as the places list on the computer */
.stock-place-pick .cmenu-menu { padding: 6px; max-height: min(64vh, 520px); }
.place-opt { gap: 10px; padding: 8px 10px; min-height: 52px; }
.place-opt + .place-opt { margin-top: 2px; }
.place-opt.main { border-bottom: 1px solid var(--line); border-radius: 10px 10px 0 0; margin-bottom: 4px; padding-bottom: 10px; }
.place-opt .place-ico { width: 32px; height: 32px; }
.place-opt.main .place-ico { background: var(--surface-2); color: var(--text); }
.place-opt.group .place-ico { background: color-mix(in srgb, var(--ai-1) 14%, var(--surface)); color: var(--ai-1); }
.place-opt.room { padding-left: 30px; min-height: 46px; }
.place-opt.room .place-ico { width: 26px; height: 26px; }
.place-opt .place-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.place-opt .place-name b { font-weight: 620; }
.place-opt .cell-sub { font-size: .74rem; }
.place-opt.on { background: color-mix(in srgb, var(--ai-1) 9%, var(--surface)); box-shadow: inset 3px 0 0 var(--ai-1); }
.place-opt .place-on { color: var(--ai-1); display: grid; flex: none; }
.place-opt.on .cell-sub { font-weight: 400; }
/* S2b (Jorge 19.11): "Something to report?" on the check-out ticket */
.stock-report { margin: 14px 20px 0; padding: 14px 16px; background: var(--surface); border-radius: 16px; border: 1px solid var(--line); }
.stock-checks-ico.warn { background: linear-gradient(135deg, #f59e0b, #f43f5e); }
.report-list li { padding: 10px 0; gap: 10px; }
.report-list .grow { display: flex; flex-direction: column; min-width: 0; }
.report-list li form { margin: 0; }
.move-delta.zero { background: var(--surface-2); color: var(--text-2); }
.report-new { margin-top: 10px; }
.report-new > summary { list-style: none; display: inline-flex; }
.report-new > summary::-webkit-details-marker { display: none; }
.report-new[open] > summary { display: none; }
.report-form { display: grid; gap: 4px; margin: 0; }
.report-form .field-label { margin: 8px 0 6px; }
.report-form .cmenu-menu { max-height: 50vh; overflow-y: auto; }
.report-kinds { grid-auto-columns: 1fr; }
.report-kinds .seg:has(input[value=broken]:checked) { color: var(--err); }
.report-form:has(input[name=kind][value=none]:checked) .report-qty-field { display: none; }
.report-qty .step-save { display: none !important; }
.report-form label { margin-top: 8px; }
.report-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
@media (max-width: 820px) { .stock-report { margin: 12px 14px 0; } .report-foot .btn { width: 100%; justify-content: center; } }
.report-form .report-qty { margin-left: 0; }
/* S3 stock checks (Jorge 19.11) */
.check-new-body { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check-new-body .cmenu { flex: 1 1 260px; }
.check-new .card-head { padding-bottom: 0; }
.check-new { margin-bottom: 16px; }
.checks-list li { padding: 0; border: 0; display: block; }
.checks-list { padding: 6px 10px 10px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; color: inherit; text-decoration: none; }
.check-row:hover { background: var(--surface-2); }
.check-row .grow { display: flex; flex-direction: column; min-width: 0; }
.check-row .place-ico.group { background: color-mix(in srgb, var(--ai-1) 14%, var(--surface)); color: var(--ai-1); }
.check-card > .card-head { padding-bottom: 10px; }
.check-help { margin: 0; padding: 0 20px 10px; }
.check-lines .check-line { display: block; padding: 12px 20px; border-top: 1px solid var(--line); border-bottom: 0; }
.check-line-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.check-name { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; }
.check-qty input::placeholder { color: var(--muted); font-weight: 500; }
.check-line-more { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.check-line-more input { margin: 0; flex: 1 1 180px; min-width: 0; }
.check-line-more label.mini { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .8rem; font-weight: 600; flex: 0 1 auto; }
.check-line-more label.mini input { width: 70px; flex: none; }
.check-finish { margin-top: 16px; }
.check-refill { display: inline-flex; margin-bottom: 12px; padding: 8px 12px; }
.check-form .form-foot { flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.check-kpis { margin-bottom: 16px; }
.check-result { padding: 0 20px 6px; }
.check-result .grow { display: flex; flex-direction: column; }
.check-note { padding: 0 20px 16px; margin: 0; }
.who-list { padding: 4px 20px 14px; }
.who-head { display: flex; align-items: center; gap: 6px; font-weight: 650; font-size: .82rem; color: var(--muted); margin: 10px 0 2px; }
.who-list li .grow { display: flex; flex-direction: column; }
.who-none { margin: 10px 0; }
#check-photos { margin-top: 16px; }
@media (max-width: 820px) {
  .check-lines .check-line { padding: 12px 16px; }
  .check-line-main .qty-step { margin-left: 0; }
  .check-form .form-foot .btn { flex: 1 1 100%; justify-content: center; }
}
.stock-place-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; } .count-here { margin: 0; }
.check-line-more input { min-height: 36px; padding: 6px 10px; font-size: .85rem; }
/* Jorge 19.11: a card title never touches what scrolls under it — a line + space, and
   the list starts below it (product window, stock history) */
.item-card > .card-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.item-card > .where-list { padding-top: 8px; }
.item-card > .history-scroll { padding-top: 4px; }
.item-card .stock-moves li:first-child { border-top: 0; }
.history-card .card-head { flex-wrap: wrap; }
.history-pick { min-width: 0; }
.history-pick .cmenu-menu { right: 0; left: auto; max-height: 60vh; overflow-y: auto; min-width: 240px; }
.history-pick .cmenu-btn { padding: 7px 12px; }
.history-card .stock-moves .stock-move { padding: 12px 20px; }
@media (max-width: 820px) {
  .history-card .stock-moves .stock-move { padding: 12px 16px; flex-wrap: wrap; }
  .history-card .stock-move > .nowrap { flex: 1 1 100%; padding-left: 54px; }
}
.item-status { margin-bottom: 4px; } .item-status .seg { white-space: normal; text-align: center; }
.item-type .cmenu { display: block; width: 100%; margin-bottom: 14px; }
.item-type .cmenu-btn { width: 100%; min-height: 44px; border-radius: 12px; padding: 9px 14px; font-size: .92rem; }
/* rule 47: a list that scrolls fades out at its bottom edge (more below), never a hard cut */
.item-card > .where-list, .item-card > .history-scroll {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 28px), transparent); padding-bottom: 18px; }
/* one look for every place menu (Jorge 19.11: Checks, History, Stock on phones) */
.place-menu .cmenu-menu { padding: 6px; max-height: min(64vh, 520px); overflow-y: auto; }
.cmenu-menu .place-opt, .cmenu-menu .place-opt[data-value] { display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; min-height: 52px; border: 0; border-radius: 10px; background: none; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.cmenu-menu .place-opt:hover { background: var(--surface-2); }
.cmenu-menu .place-opt.room { padding-left: 30px; min-height: 46px; }
.cmenu-menu .place-opt.on { background: color-mix(in srgb, var(--ai-1) 9%, var(--surface)); box-shadow: inset 3px 0 0 var(--ai-1); font-weight: inherit; }
.place-opt .place-on { display: none; }
.place-opt.on .place-on { display: grid; color: var(--ai-1); flex: none; }
.history-pick.place-menu .cmenu-menu { min-width: 300px; }
/* S3 counting: live progress (rule 47 review) */
.check-progress { display: flex; align-items: center; gap: 12px; padding: 0 20px 10px; font-size: .86rem; }
.check-progress b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.check-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.check-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--ai-grad); transition: width .2s; }
@media (max-width: 820px) { .check-progress { padding: 0 16px 10px; } }
/* S4 equipment (Jorge 19.11) */
.eq-place { margin-bottom: 16px; }
.eq-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.eq-card > .card-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.eq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; padding: 16px 20px; }
.eq-item { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.eq-item:hover { border-color: var(--ai-1); box-shadow: var(--shadow); }
.eq-item.cond-repair { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.eq-item.cond-broken { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.eq-photo { width: 64px; height: 64px; flex: none; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); }
.eq-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eq-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.eq-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.eq-qty { font-weight: 700; font-size: .82rem; font-variant-numeric: tabular-nums; }
.eq-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius); }
.eq-add > b { display: inline-flex; align-items: center; gap: 6px; min-width: 150px; }
.eq-add > input[name=name] { margin: 0; flex: 1 1 200px; min-width: 0; }
.eq-add .qty-step { margin-left: 0; }
.eq-cat { flex: 0 1 220px; }
.eq-cat .cmenu-menu { bottom: calc(100% + 6px); top: auto; }
.eq-cond .seg.cond-ok:has(input:checked) { color: var(--ok); }
.eq-cond .seg.cond-repair:has(input:checked) { color: var(--warn); }
.eq-cond .seg.cond-broken:has(input:checked) { color: var(--err); }
.eq-cond { margin-bottom: 14px; }
.eq-ticket { margin-top: 4px; }
#equipment-photos { margin-bottom: 16px; }
@media (max-width: 820px) {
  .eq-grid { grid-template-columns: 1fr; padding: 12px 14px; }
  .eq-add { padding: 12px 16px; }
  .eq-add > b, .eq-add > input[name=name], .eq-cat, .eq-add > .btn { flex: 1 1 100%; }
  .eq-add > .btn { justify-content: center; }
}
/* ================================================================== S5 apartment board
   (Jorge 19.11, stage 1 of the CRM 3D): a small isometric city, colour = state */
:root { --st-inside: #7c6cf6; --st-inside-d: #5b4bd6; --st-arriving: #22b07d; --st-arriving-d: #168a60;
  --st-leaving: #f59e0b; --st-leaving-d: #c27806; --st-turnover: #f43f5e; --st-turnover-d: #c81e40;
  --st-free: #e7e5e4; --st-free-d: #cfccc9; --win-off: rgba(255,255,255,.55); --win-on: #ffe08a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --st-free: #3a3a40; --st-free-d: #2a2a2f; --win-off: rgba(255,255,255,.18); } }
:root[data-theme="dark"] { --st-free: #3a3a40; --st-free-d: #2a2a2f; --win-off: rgba(255,255,255,.18); }
.sdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--st-free-d); }
.sdot.st-inside { background: var(--st-inside); } .sdot.st-arriving { background: var(--st-arriving); }
.sdot.st-leaving { background: var(--st-leaving); } .sdot.st-turnover { background: var(--st-turnover); }
.board-kpis { margin-bottom: 14px; }
.board-kpis .label { display: flex; align-items: center; gap: 6px; }
.board-filter { margin-bottom: 16px; flex-wrap: wrap; }
.board-filter .chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: inherit; }
.board-city { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.bcell { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 12px 12px 14px; border-radius: 18px; text-decoration: none;
  color: inherit; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0;
  transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, border-color .2s; }
.bcell:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(20, 20, 40, .12); border-color: var(--line-strong); }
.bcell[hidden] { display: none; }
.bcell-text { display: flex; flex-direction: column; min-width: 0; }
.bcell-rooms { display: flex; flex-wrap: wrap; gap: 4px; }
.room-pill { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; font-weight: 650; padding: 2px 7px 2px 5px; border-radius: 999px; background: var(--surface-2); }
.room-pill .sdot { width: 8px; height: 8px; }
.bld { width: 100%; height: auto; display: block; overflow: visible; }
.bld .shadow { fill: rgba(0, 0, 0, .08); }
.bld .slab { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1; }
.bld .cube { transition: transform .3s; }
.cube .f-top { fill: color-mix(in srgb, var(--c) 72%, white); }
.cube .f-left { fill: var(--c); }
.cube .f-right { fill: var(--cd); }
.cube.st-inside { --c: var(--st-inside); --cd: var(--st-inside-d); }
.cube.st-arriving { --c: var(--st-arriving); --cd: var(--st-arriving-d); }
.cube.st-leaving { --c: var(--st-leaving); --cd: var(--st-leaving-d); }
.cube.st-turnover { --c: var(--st-turnover); --cd: var(--st-turnover-d); }
.cube.st-free { --c: var(--st-free); --cd: var(--st-free-d); }
.cube .win { fill: var(--win-off); }
.cube.lit .win { fill: var(--win-on); filter: drop-shadow(0 0 3px rgba(255, 210, 90, .9)); }
.cube .door { fill: rgba(0, 0, 0, .28); }
.cube.clean-done .f-top { fill: color-mix(in srgb, var(--c) 55%, white); }
.badge-clean circle { fill: #0ea5e9; } .badge-clean path { stroke: #fff; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.badge-clean { animation: clean-bob 1.6s ease-in-out infinite; transform-origin: 118px 16px; }
@keyframes clean-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.badge-alert circle { fill: var(--err); } .badge-alert text { fill: #fff; font-size: 11px; font-weight: 800; text-anchor: middle; font-family: inherit; }
@media (prefers-reduced-motion: reduce) { .badge-clean { animation: none; } .bcell { transition: none; } }
.unit-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.unit-hero .bld { width: 120px; flex: none; }
.unit-hero h1 { margin: 0; }
.unit-card { margin-bottom: 14px; }
.unit-card .card-head h2 { display: flex; align-items: center; gap: 8px; }
.unit-facts { padding: 4px 20px 8px; }
.unit-facts li { gap: 10px; }
.unit-facts .grow { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 820px) {
  .board-city { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .bcell { padding: 10px; }
  .board-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unit-facts { padding: 4px 16px 8px; }
}
@media (max-width: 820px) { .board-kpis > .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; } }
/* Jorge 19.11: payouts — long lists scroll inside their card (about 5 rows) */
.pay-card > .card-head { padding-bottom: 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; row-gap: 8px; }
.pay-card > .list-plain, .pay-card > .table-wrap { max-height: 420px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.pay-card > .table-wrap thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
@media (max-width: 820px) { .pay-card > .list-plain, .pay-card > .table-wrap { max-height: min(62vh, 560px); } }
/* a menu used as a form field (the cleaner's product, Type on the product page):
   the same shape as the other fields, the empty choice looks like a placeholder */
.cmenu-field .cmenu-btn, .item-type .cmenu-btn { width: 100%; min-height: 46px; border-radius: 12px; padding: 9px 14px;
  font-size: .95rem; background: var(--surface); border: 1px solid var(--line-strong); }
.cmenu-field .cmenu-value.is-empty { font-weight: 500; color: var(--muted); }
.report-form .seg-control.report-kinds { border-radius: 12px; }
.report-form .report-kinds .seg { min-height: 40px; }
.report-form .report-qty .step-btn, .report-form .report-qty input { min-height: 44px; }
/* the "what is left" line next to Finish the task: dots between items on computers, one
   item per line on phones (never a lonely "· 2", Jorge 19.11) */
.left-list .left-item + .left-item::before { content: " · "; }
.left-list .photo-left { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 820px) {
  .left-list { display: flex; flex-direction: column; gap: 2px; }
  .left-list .left-item + .left-item::before { content: none; }
}
/* ================================================================== S5 stage 2: plans */
:root { --k-living: #fde68a; --k-kitchen: #fdba74; --k-bedroom: #c4b5fd; --k-bathroom: #93c5fd; --k-wc: #a5f3fc;
  --k-hall: #e7e5e4; --k-balcony: #bbf7d0; --k-storage: #d6d3d1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --k-living: #a1832e; --k-kitchen: #b0693a; --k-bedroom: #6d5bd0;
  --k-bathroom: #3b74c4; --k-wc: #2b8ea0; --k-hall: #4a4a52; --k-balcony: #2f8a55; --k-storage: #5a5651; } }
:root[data-theme="dark"] { --k-living: #a1832e; --k-kitchen: #b0693a; --k-bedroom: #6d5bd0; --k-bathroom: #3b74c4; --k-wc: #2b8ea0;
  --k-hall: #4a4a52; --k-balcony: #2f8a55; --k-storage: #5a5651; }
.kdot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.k-living { --k: var(--k-living); } .k-kitchen { --k: var(--k-kitchen); } .k-bedroom { --k: var(--k-bedroom); }
.k-bathroom { --k: var(--k-bathroom); } .k-wc { --k: var(--k-wc); } .k-hall { --k: var(--k-hall); }
.k-balcony { --k: var(--k-balcony); } .k-storage { --k: var(--k-storage); }
.kdot { background: var(--k); }
.plan-editor { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.plan-canvas-card { padding: 12px; overflow: hidden; }
.plan-canvas { overflow: auto; max-height: calc(100dvh - 220px); border-radius: 12px; background: var(--surface-2); }
.plan-svg { display: block; width: 100%; min-width: 420px; height: auto; touch-action: none; user-select: none; }
.plan-grid { stroke: var(--line); stroke-width: 1; }
.plan-room { cursor: grab; }
.plan-room .plan-rect { fill: var(--k); stroke: color-mix(in srgb, var(--k) 60%, #000); stroke-width: 2; }
.plan-room.on .plan-rect { stroke: var(--ai-1); stroke-width: 3; }
.plan-label { font: 650 13px/1 Inter, system-ui, sans-serif; fill: #1c1917; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.plan-sub { font: 700 11px/1 Inter, system-ui, sans-serif; fill: #1c1917; opacity: .7; text-anchor: middle; pointer-events: none; }
.plan-handle { fill: var(--ai-1); stroke: #fff; stroke-width: 3; cursor: nwse-resize; }
.plan-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.plan-side .card { margin: 0; }
.plan-add, .plan-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-kinds { margin-bottom: 12px; }
.kind-chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font: inherit; }
.plan-size { margin: 0; }
.plan-hint { margin: 0; padding: 0 4px; }
.plan-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 1000px) {
  .plan-editor { grid-template-columns: 1fr; }
  .plan-side { position: static; }
  .plan-canvas { max-height: 62vh; }
  .plan-actions .btn { flex: 1 1 auto; justify-content: center; }
}
/* the plan in 2.5D (board window) */
.iso-plan { padding: 8px 14px 4px; }
.iso-svg { display: block; width: 100%; max-height: 360px; height: auto; overflow: visible; }
.iso-room .iso-top { fill: var(--k); stroke: color-mix(in srgb, var(--k) 55%, #000); stroke-width: .8; }
.iso-room .iso-right { fill: color-mix(in srgb, var(--k) 70%, #000); }
.iso-room .iso-front { fill: color-mix(in srgb, var(--k) 82%, #000); }
.iso-room.st-inside { --k: color-mix(in srgb, var(--st-inside) 55%, white); }
.iso-room.st-arriving { --k: color-mix(in srgb, var(--st-arriving) 55%, white); }
.iso-room.st-leaving { --k: color-mix(in srgb, var(--st-leaving) 55%, white); }
.iso-room.st-turnover { --k: color-mix(in srgb, var(--st-turnover) 55%, white); }
.iso-room.lit .iso-top { filter: drop-shadow(0 0 4px rgba(255, 210, 90, .8)); }
.iso-label { font: 700 7px/1 Inter, system-ui, sans-serif; fill: #1c1917; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.iso-count { font: 600 5.5px/1 Inter, system-ui, sans-serif; fill: #1c1917; opacity: .75; text-anchor: middle; pointer-events: none; }
.plan-rooms .grow { gap: 2px; }
.plan-things { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.eq-room { margin-bottom: 14px; }
.place-ico .kdot { width: 14px; height: 14px; border-radius: 4px; }
.plan-room.overlap .plan-rect { stroke: var(--err); stroke-dasharray: 6 4; stroke-width: 2.5; }
/* ================================================================== S5 stage 3: the In-House map
   (Jorge 20.11): one screen for the office (22"–32"), the landscape day or night */
:root { --sky-a: #bfe3ff; --sky-b: #eef7ff; --alp-far: #b7c7d9; --alp-near: #8fa7bf; --lake-a: #7cc4f0; --lake-b: #b9e2fa;
  --meadow-a: #d9f2c4; --meadow-b: #bfe3a3; --town: rgba(255,255,255,.55); --block: #c9b79a; --star: transparent; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sky-a: #0b1026; --sky-b: #1d2550; --alp-far: #2a3358;
  --alp-near: #1d2444; --lake-a: #17306a; --lake-b: #10224d; --meadow-a: #1b2a22; --meadow-b: #142019; --town: rgba(255,255,255,.05);
  --block: #3a3326; --star: #fff; } }
:root[data-theme="dark"] { --sky-a: #0b1026; --sky-b: #1d2550; --alp-far: #2a3358; --alp-near: #1d2444; --lake-a: #17306a;
  --lake-b: #10224d; --meadow-a: #1b2a22; --meadow-b: #142019; --town: rgba(255,255,255,.05); --block: #3a3326; --star: #fff; }
.map-page .main { max-width: none; padding: 18px 22px; }
.map-wrap { display: flex; flex-direction: column; gap: 12px; height: calc(100dvh - 36px); min-height: 560px; }
.map-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.map-title { display: flex; align-items: baseline; gap: 10px; }
.map-title h1 { margin: 0; font-size: 1.5rem; }
.map-kpis { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.map-kpi { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); font-size: .82rem; color: var(--text-2); white-space: nowrap; }
.map-kpi b { font-size: 1.05rem; color: var(--text); font-variant-numeric: tabular-nums; }
.map-kpi.warn b { color: var(--warn); }
.map-actions { display: flex; gap: 8px; }
.map-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
.map-stage { position: relative; min-height: 0; border-radius: 22px; overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(var(--meadow-a), var(--meadow-b)); box-shadow: var(--shadow); }
.map-sky { position: absolute; left: 0; top: 0; width: 100%; height: 30%; display: block; }
.map-sky .sky-a { stop-color: var(--sky-a); } .map-sky .sky-b { stop-color: var(--sky-b); }
.map-sky .lake-a { stop-color: var(--lake-a); } .map-sky .lake-b { stop-color: var(--lake-b); }
.map-sky .alp.far { fill: var(--alp-far); } .map-sky .alp.near { fill: var(--alp-near); }
.map-sky .snow { fill: #fff; opacity: .92; }
.map-sky .stars circle { fill: var(--star); }
.map-scene { position: absolute; left: 1.5%; right: 1.5%; bottom: 7%; top: 20%; width: 97%; height: 73%; overflow: visible; }
/* Jorge 21.11: a real little town — roads, pavements, parks, trees, fields, people, cars */
.map-stage { --pave: #f3efe6; --asphalt: #8b9099; --lane: #b5b8bd; --park: #b4dc92; --park-path: #eadfc6; --pond: #7cc4f0;
  --tree: #4c9a48; --tree-sh: rgba(20,40,10,.16); --wheat: #ead27c; --field: #a8d488; --town-ground: #e6efd9; }
:root[data-theme="dark"] .map-stage { --pave: #343a42; --asphalt: #22262c; --lane: #2c3138; --park: #1f3a27; --park-path: #3b3a30;
  --pond: #1d3f73; --tree: #2f6a33; --tree-sh: rgba(0,0,0,.35); --wheat: #4a4228; --field: #24382a; --town-ground: #1a241d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .map-stage { --pave: #343a42; --asphalt: #22262c; --lane: #2c3138;
  --park: #1f3a27; --park-path: #3b3a30; --pond: #1d3f73; --tree: #2f6a33; --tree-sh: rgba(0,0,0,.35); --wheat: #4a4228;
  --field: #24382a; --town-ground: #1a241d; } }
.town-ground { fill: var(--town-ground); filter: drop-shadow(0 8px 18px rgba(0,0,0,.10)); }
.road-side, .road, .road-line, .lane-side, .lane, .park-path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.road-side { stroke: var(--pave); stroke-width: 44; }
.road { stroke: var(--asphalt); stroke-width: 28; }
.road-line { stroke: #fff; stroke-width: 2; stroke-dasharray: 10 12; opacity: .75; }
.lane-side { stroke: var(--pave); stroke-width: 22; }
.lane { stroke: var(--lane); stroke-width: 10; }
.park rect { fill: var(--park); }
.park-path { stroke: var(--park-path); stroke-width: 6; }
.pond { fill: var(--pond); stroke: rgba(255,255,255,.55); stroke-width: 2; }
.field { stroke: rgba(255,255,255,.35); stroke-width: 2; }
.field.wheat { fill: var(--wheat); } .field.green { fill: var(--field); }
.tree .t-shadow { fill: var(--tree-sh); } .tree .t-top { fill: var(--tree); } .tree .t-light { fill: rgba(255,255,255,.18); }
.mover { pointer-events: none; }
.mover .p-head { fill: #f1d3b8; } .mover .p-shadow { fill: rgba(0,0,0,.16); }
.mover .car-glass { fill: rgba(15,23,42,.55); }
.town-sign { cursor: pointer; outline: none; }
.town-sign rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; filter: drop-shadow(0 4px 10px rgba(0,0,0,.12)); transition: fill .2s; }
.town-sign:hover rect, .town-sign:focus-visible rect { fill: var(--surface-2); stroke: var(--ai-1); }
.town-name { font: 800 22px/1 Inter, system-ui, sans-serif; fill: var(--text); }
.town-count { font: 600 13px/1 Inter, system-ui, sans-serif; fill: var(--text-2); }
.map-legend { position: absolute; left: 14px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 28px); pointer-events: none; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: .74rem; font-weight: 600;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line); }
.map-legend .sdot { width: 9px; height: 9px; }
.block-ground { fill: var(--block); opacity: .55; }
.street { font: 600 10px/1 Inter, system-ui, sans-serif; fill: var(--text-2); text-anchor: middle; }
.house-code { font: 800 15px/1 Inter, system-ui, sans-serif; fill: var(--text); text-anchor: middle; paint-order: stroke;
  stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.map-house { cursor: pointer; outline: none; }
.map-house > svg { overflow: visible; transition: transform .25s cubic-bezier(.2,.8,.2,1); transform-box: fill-box; transform-origin: 50% 100%; }
.map-house:hover > svg, .map-house:focus-visible > svg { transform: translateY(-6px) scale(1.04); }
.map-house .bld { width: 100%; height: 100%; }
.walker circle, .walker rect { fill: #1f2937; }
.walker.in circle, .walker.in rect:not(.case) { fill: var(--st-arriving-d); }
.walker.out circle, .walker.out rect:not(.case) { fill: var(--st-leaving-d); }
.walker .case { fill: #6b4f2e; }
.walker.in { animation: walk-in 4.5s ease-in-out infinite; }
.walker.out { animation: walk-out 4.5s ease-in-out infinite; }
@keyframes walk-in { 0% { transform: translate(128px, 128px); opacity: 0; } 15% { opacity: 1; } 80% { transform: translate(72px, 112px); opacity: 1; } 100% { transform: translate(68px, 110px); opacity: 0; } }
@keyframes walk-out { 0% { transform: translate(68px, 112px); opacity: 0; } 15% { opacity: 1; } 85% { transform: translate(10px, 130px); opacity: 1; } 100% { transform: translate(4px, 132px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .walker { animation: none; transform: translate(100px, 124px); } }
:root[data-theme="dark"] .cube.lit .win, .map-page .cube.lit .win { filter: drop-shadow(0 0 4px rgba(255, 210, 90, 1)); }
.map-side { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.map-list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; }
.map-list h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .9rem; }
.map-list h3 b { margin-left: auto; font-variant-numeric: tabular-nums; }
.map-list ul { list-style: none; margin: 0; padding: 0; max-height: 210px; overflow-y: auto; scrollbar-width: thin; }
.map-list li { display: flex; flex-direction: column; padding: 7px 8px; border-radius: 10px; cursor: pointer; font-size: .84rem; }
.map-list li:hover { background: var(--surface-2); }
.map-list li span { color: var(--text-2); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-list li.muted { cursor: default; }
.map-tip { position: fixed; z-index: 90; width: 290px; padding: 12px 14px; border-radius: 14px; background: var(--surface);
  border: 1px solid var(--line-strong); box-shadow: 0 18px 40px rgba(0,0,0,.2); pointer-events: none; font-size: .84rem; }
.map-tip[hidden] { display: none; }
.tip-head { display: flex; align-items: center; gap: 8px; }
.tip-head b { font-size: 1.05rem; }
.tip-kind { margin-left: auto; color: var(--text-2); font-size: .74rem; text-align: right; }
.tip-sub { color: var(--text-2); font-size: .76rem; margin-top: 2px; }
.tip-state { font-weight: 700; margin: 8px 0 4px; }
.tip-line { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.tip-rooms { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 4px; }
.tip-rooms li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tip-alerts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tip-addr { margin-top: 8px; color: var(--muted); font-size: .74rem; }
/* full screen on the office screen: only the map */
html.map-full .sidebar, html.map-full .mobile-bar, html.map-full .flashes { display: none !important; }
html.map-full .map-wrap { height: calc(100dvh - 24px); }
html.map-full .main { padding: 12px !important; margin: 0 !important; }
html.map-full .app { display: block; }
@media (max-width: 1300px) { .map-body { grid-template-columns: 1fr; } .map-side { display: none; } }
@media (max-width: 820px) {
  .map-wrap { height: auto; }
  .map-stage { height: 70vh; }
  .map-kpi { padding: 5px 9px; font-size: .74rem; }
}

/* cleaning checklist (Jorge 20.11): a rounded square next to the line's text, never on its
   own line; "Photo missing" only after "Finish the task" was pressed, then the page goes
   to the first line that is not ready */
.check-list > .check-item { display: flex; align-items: flex-start; gap: 12px; }
.check-list .tick { width: 30px; height: 30px; border-radius: 9px; flex: none; margin-top: 1px; }
.check-list .ci-text { padding-top: 4px; }
.check-list .photo-missing { display: none; }
#checklist.show-missing .check-item.needs-photo .photo-missing { display: flex; }
#checklist.show-missing .check-item.needs-tick:not(.needs-photo) .ci-text { color: var(--warn); }
#checklist.show-missing .check-item.needs-photo, #checklist.show-missing .check-item.needs-tick { background: color-mix(in srgb, var(--warn) 6%, transparent); }
.check-item.attention { animation: attention 1.2s ease-out; }
@keyframes attention { 0% { box-shadow: inset 0 0 0 2px var(--warn); } 100% { box-shadow: inset 0 0 0 2px transparent; } }
.check-list .ci-upload { margin-top: 2px; }
.finish-bar .btn[data-blocked] { opacity: .75; }
.check-list .ci-need { display: none; } #checklist.show-missing .ci-need { display: inline; }
/* Jorge 21.11: search an apartment in Stock (computer list + phone menu) */
.stock-places > .place-search { margin: 12px 14px 4px; }
.place-menu .place-search { margin: 2px 2px 8px; position: sticky; top: -6px; z-index: 1; background: var(--surface); padding-top: 4px; }
.place-search input { margin: 0; min-height: 40px; }
.place-list > li.hidden, .place-opt.hidden { display: none !important; }

/* ================================================================== languages (Jorge 21.11)
   French and Spanish words are longer: layouts must stay tidy in every language */
.nowrap { white-space: nowrap; }
/* a card title keeps its line; the button next to it goes below when there is no room */
.card-head { flex-wrap: wrap; row-gap: 8px; }
.card-head > h2 { flex: 1 1 11rem; min-width: 0; }
.places-pick-head { flex-wrap: wrap; row-gap: 6px; }
.places-pick-head .place-check { white-space: nowrap; }
.stock-places .card-head > h2 { flex: 1 1 auto; white-space: nowrap; }
@media (max-width: 820px) {
  /* Stock buttons on phones: a tidy grid, every button framed the same, New item full width */
  .stock-actions { display: grid !important; grid-template-columns: 1fr 1fr; width: 100%; }
  .stock-actions .btn { justify-content: center; white-space: nowrap; min-width: 0; }
  .stock-actions .btn.ghost { border: 1px solid var(--line-strong); background: var(--surface); }
  .stock-actions .btn.primary { grid-column: 1 / -1; }
  .stock-kpis .label svg { display: none; }
  .stock-kpis .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.item-type .cmenu-value, .cmenu-field .cmenu-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* apartment photos (Jorge 21.11) */
.place-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 12px; max-height: 330px; overflow-y: auto; }
.place-upload.is-busy .cam-btn { opacity: .6; pointer-events: none; }
/* System health (21.11) */
.health-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.health-list { padding: 4px 20px 8px; }
.health-list li { gap: 10px; }
.health-list .grow { display: flex; flex-direction: column; min-width: 0; }
.health-list form { margin: 0; }
@media (max-width: 820px) {
  .health-kpis { gap: 8px; }
  .health-kpis .label svg { display: none; }
  .health-kpis .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .health-list { padding: 4px 16px 8px; }
  .health-list li { flex-wrap: wrap; }
  .health-list .grow { order: 3; flex: 1 1 100%; }
}

/* S5 stage 4 (21.11): the apartment in real 3D — board_3d.html + board3d.js (fixed rule 57) */
.plan-head-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.x3d-days { margin-bottom: 14px; }
.x3d-days .day-cell { border: 0; font: inherit; cursor: pointer; }
.x3d-days .cnt .sdot { width: 8px; height: 8px; }
.x3d { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.x3d-stage-card { padding: 0; overflow: hidden; }
.x3d-stage { position: relative; height: min(72dvh, 760px); min-height: 380px; border-radius: inherit; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 20%, color-mix(in srgb, var(--surface) 92%, #fff) 0%, var(--surface-2) 100%); touch-action: none; }
.x3d-canvas { display: block; width: 100%; height: 100%; outline: none; }
.x3d-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.x3d-label { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 5px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font: 650 12px/1.1 Inter, system-ui, sans-serif; color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.10); cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s; will-change: transform; }
.x3d-label:hover { box-shadow: 0 4px 16px rgba(0,0,0,.16); }
.x3d-label.on { background: var(--ai-1); color: #fff; border-color: transparent; }
.x3d-label-n { font-weight: 700; font-size: 11px; padding: 1px 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.x3d-label.on .x3d-label-n { background: rgba(255,255,255,.25); color: #fff; }
.x3d-tools { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 6px; }
.x3d-tools .icon-btn { background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.x3d-loading, .x3d-fail { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); font-weight: 600; }
.x3d-loading[hidden], .x3d-fail[hidden] { display: none; }
.x3d .x3d-canvas { opacity: 0; transition: opacity .5s ease; }
.x3d.ready .x3d-canvas { opacity: 1; }
.x3d-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 16px; }
.x3d-side .card { margin: 0; }
.x3d-subhead { border-top: 1px solid var(--line); }
.x3d-rooms li { padding: 0; }
.x3d-room-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 10px; }
.x3d-room-btn:hover { background: var(--surface-2); }
.x3d-room-btn .grow { display: flex; flex-direction: column; min-width: 0; }
.x3d-count { display: inline-flex; align-items: center; gap: 4px; }
.x3d-meta { margin: 0 0 12px; }
.x3d-gallery { margin-bottom: 8px; }
.x3d-none { margin: 0 0 10px; }
.x3d-none[hidden] { display: none; }
.x3d-add { margin-bottom: 14px; }
.x3d-equip { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.x3d-equip .plan-things:empty { display: none; }
.room-pill.bad { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.x3d-gallery.is-pool .x3d-out { display: none; }
.x3d-gallery.is-pool .shot-open { cursor: copy; }
@media (max-width: 1000px) {
  .x3d { grid-template-columns: 1fr; }
  .x3d-side { position: static; }
  .x3d-stage { height: 62dvh; min-height: 340px; }
  .x3d-label { padding: 4px 8px; font-size: 11px; }
}
.x3d-unplaced { display: flex; align-items: center; gap: 10px; margin: 4px 14px 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.x3d-unplaced[hidden] { display: none; }
.x3d-unplaced .grow { display: flex; flex-direction: column; min-width: 0; }
.x3d-gallery .shot { position: relative; }
.x3d-gallery .x3d-out { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; }
[data-map-all][hidden] { display: none; }
@media (max-width: 820px) { .map-sky { height: 20%; } .map-scene { top: 12%; bottom: 12%; height: 76%; } .map-legend span:last-child { display: none; } }

/* Stock places (Jorge 21.11): add own places, remove places — stock_places.html */
.place-new-body { display: flex; flex-direction: column; gap: 10px; }
.place-new-body > label, .place-new-where label { margin: 0; }
.place-kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.kind-pick { cursor: pointer; position: relative; }
.kind-pick[hidden] { display: none; }
.chips-tools { gap: 6px; margin-bottom: 8px; }
.chips-tools .chips-find { flex: 1; min-width: 0; padding: 7px 10px; font-size: .88rem; }
.pass-rule-dot.wait { background: var(--warn-soft, #fff4dc); color: var(--warn); }
.kind-pick input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.kind-pick:has(input:checked) { background: var(--text); color: var(--surface); border-color: var(--text); }
.kind-pick:has(input:focus-visible) { outline: 2px solid var(--ai-1); outline-offset: 2px; }
.place-new-where { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.place-new-hint { margin: 0; }
.places-card { margin-top: 16px; }
.places-search-wrap { padding-bottom: 4px; }
.places-list li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--line); }
.places-list li.room { padding-left: 40px; }
.places-list li .grow { display: flex; flex-direction: column; min-width: 0; }
.places-list li .grow b, .places-list li .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.places-list li form { margin: 0; }
.places-list .place-act-gap { width: 34px; }
@media (max-width: 640px) {
  .place-new-where { grid-template-columns: 1fr; }
  .places-list li { flex-wrap: wrap; }
  .places-list li .grow { flex: 1 1 60%; }
  .places-list li > .muted { order: 5; flex-basis: 100%; padding-left: 38px; }
  .places-list li.room > .muted { padding-left: 0; }
}

/* S5 stage 5 (21.11): the didactic finish of the 3D — visit, legend, room card, guide */
.x3d-top { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; align-items: center; z-index: 3; }
.x3d-visit { box-shadow: 0 6px 18px rgba(0,0,0,.16); }
.x3d-visit.on { background: var(--surface); color: var(--text); border-color: var(--line); }
.x3d-help, .x3d-rc-tour .icon-btn { background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid var(--line); }
.x3d-legend { position: absolute; right: 12px; top: 12px; z-index: 3; max-width: 270px; border-radius: 14px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0,0,0,.08); font-size: .78rem; }
.x3d-legend summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 8px 12px; font-weight: 700; }
.x3d-legend summary::-webkit-details-marker { display: none; }
.x3d-legend ul { list-style: none; margin: 0; padding: 0 12px 10px; display: flex; flex-direction: column; gap: 7px; }
.x3d-legend li { display: flex; align-items: center; gap: 9px; line-height: 1.25; }
.x3d-legend li > span:last-child { display: flex; flex-direction: column; }
.x3d-lg-base { flex: none; width: 22px; height: 10px; border-radius: 3px; background: #e2ded8; box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.x3d-lg-person { flex: none; position: relative; width: 22px; height: 16px; }
.x3d-lg-person::before { content: ""; position: absolute; left: 7px; top: 6px; width: 8px; height: 10px; border-radius: 4px 4px 2px 2px; background: #3f6fd8; }
.x3d-lg-person::after { content: ""; position: absolute; left: 8px; top: 0; width: 6px; height: 6px; border-radius: 50%; background: #e8c4a0; }
.x3d-lg-person.case::before { box-shadow: 7px 3px 0 -1px #1f2937; }
.x3d-lg-person.cleaner::before { background: #14b8a6; box-shadow: -5px 0 0 -3px #b98a57; }
.x3d-lg-frame { flex: none; width: 22px; height: 14px; border-radius: 3px; border: 2.5px solid var(--ai-1); }
.x3d-roomcard { position: absolute; left: 12px; bottom: 12px; z-index: 3; display: flex; align-items: center; gap: 12px; max-width: min(440px, calc(100% - 200px));
  padding: 8px; padding-right: 12px; border-radius: 18px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 10px 30px rgba(0,0,0,.14); }
.x3d-roomcard[hidden] { display: none; }
.x3d-roomcard.in { animation: x3d-rise .35s cubic-bezier(.2,.8,.2,1); }
@keyframes x3d-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.x3d-rc-photo { position: relative; flex: none; width: 128px; height: 96px; border: 0; padding: 0; border-radius: 12px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.x3d-rc-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.x3d-rc-photo img.on { opacity: 1; }
.x3d-roomcard.no-photo .x3d-rc-photo { display: none; }
.x3d-rc-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.x3d-rc-text b { font-size: 1rem; }
.x3d-rc-dots { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.x3d-rc-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background .3s, transform .3s; }
.x3d-rc-dots i.on { background: var(--ai-1); transform: scale(1.25); }
.x3d-rc-tour { display: flex; gap: 4px; margin-left: auto; }
.x3d-rc-tour[hidden] { display: none; }
.x3d-roomcard.touring { max-width: min(560px, calc(100% - 200px)); }
.x3d-guide { position: absolute; left: 50%; top: 64px; z-index: 4; transform: translateX(-50%); width: min(380px, calc(100% - 24px));
  padding: 14px 16px; border-radius: 16px; background: var(--text); color: var(--surface); box-shadow: 0 16px 40px rgba(0,0,0,.25); }
.x3d-guide[hidden] { display: none; }
.x3d-guide.in { animation: x3d-pop .3s cubic-bezier(.2,.8,.2,1); }
@keyframes x3d-pop { from { opacity: 0; transform: translate(-50%, 8px) scale(.97); } to { opacity: 1; transform: translateX(-50%); } }
.x3d-guide p { margin: 4px 0 12px; font-size: .92rem; line-height: 1.45; }
.x3d-guide-step { font-size: .72rem; font-weight: 700; opacity: .65; text-transform: uppercase; letter-spacing: .04em; }
.x3d-guide-foot { display: flex; justify-content: flex-end; gap: 8px; }
.x3d-guide .btn.ghost { color: var(--surface); border-color: transparent; }
.x3d-guide .btn.primary { background: var(--surface); color: var(--text); }
.x3d-spot { position: relative; z-index: 2; box-shadow: 0 0 0 3px var(--ai-1), 0 0 0 8px color-mix(in srgb, var(--ai-1) 25%, transparent) !important; border-radius: 14px; transition: box-shadow .3s; }
.x3d-labels.x3d-spot { box-shadow: none !important; }
.x3d-labels.x3d-spot .x3d-label { animation: x3d-glow 1.2s ease-in-out infinite alternate; }
@keyframes x3d-glow { to { box-shadow: 0 0 0 3px var(--ai-1); } }
.x3d-panel:not([hidden]) { animation: x3d-fade .28s ease; }
@keyframes x3d-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .x3d-roomcard.in, .x3d-guide.in, .x3d-panel:not([hidden]), .x3d-labels.x3d-spot .x3d-label { animation: none; } .x3d-rc-photo img { transition: none; } }
@media (max-width: 1000px) {
  .x3d-tools { bottom: auto; top: 56px; right: 12px; flex-direction: column; }
  .x3d-legend { top: auto; bottom: 12px; right: 12px; max-width: 220px; }
  .x3d-legend[open] { z-index: 5; }
  .x3d-roomcard, .x3d-roomcard.touring { left: 8px; right: 8px; bottom: 56px; max-width: none; }
  .x3d-rc-photo { width: 96px; height: 72px; }
  .x3d-visit span { display: inline; }
}
.x3d-rc-tour [hidden] { display: none; }
@media (max-width: 1000px) {
  .x3d-roomcard { flex-wrap: wrap; row-gap: 8px; }
  .x3d-rc-text { flex: 1 1 0; }
  .x3d-rc-tour { flex-basis: 100%; justify-content: center; margin-left: 0; }
}

/* Repeating tickets (Jorge 21.11): the checklist of a regular check — _ticket_steps.html */
.tk-steps { list-style: none; margin: 0; padding: 4px 0; }
.tk-step { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.tk-step:first-child { border-top: 0; }
.tk-mark { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: .8rem;
  background: var(--surface-2); color: var(--muted); }
.tk-step.is-ok .tk-mark { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.tk-step.is-problem .tk-mark { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.tk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tk-note { color: var(--err); font-size: .86rem; }
.tk-repair { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 600; }
.tk-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.tk-actions form { margin: 0; }
.tk-problem { flex: 1 1 auto; }
.tk-problem summary { list-style: none; display: inline-flex; }
.tk-problem summary::-webkit-details-marker { display: none; }
.tk-problem-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.btn.ok-on { background: color-mix(in srgb, var(--ok) 16%, var(--surface)); color: var(--ok); border-color: transparent; }
.btn.problem-on { background: color-mix(in srgb, var(--err) 14%, var(--surface)); color: var(--err); border-color: transparent; }
.tk-hint { margin: 0; padding: 0 16px 14px; }
.ticket-kind-seg { margin-bottom: 14px; }
.plan-places { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; max-height: 320px; overflow-y: auto; padding: 2px; }
.plan-places .place-check { font-size: .86rem; }
.plan-places-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.plan-every { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.plan-card.paused { opacity: .7; }
.plan-card .plan-facts { list-style: none; margin: 0; padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 7px; font-size: .88rem; }
.plan-card .plan-facts li { display: flex; gap: 8px; align-items: center; }
.plan-card .plan-progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 2px 16px 12px; }
.plan-card .plan-progress span { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.plan-card .plan-chips { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 16px 12px; }
.plan-card .form-foot { gap: 6px; flex-wrap: wrap; }
.plan-card .form-foot form { margin: 0; }

/* Inbox: read Airbnb / Booking.com now (Jorge 21.11) — the round button right of the
   channel chips, same height and margins as the chips */
.channel-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.channel-row .channel-chips { margin-top: 0; flex: 0 1 auto; min-width: 0; }
.refresh-btn { flex: none; margin-left: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));
  transition: background .2s, color .2s, transform .15s; }
.refresh-btn:hover { background: var(--surface-2); color: var(--text); }
.refresh-btn:active { transform: scale(.94); }
.refresh-btn .i { width: 17px; height: 17px; }
.refresh-btn.spinning { color: var(--ai-1); pointer-events: none; }
.refresh-btn.spinning .i { animation: refresh-spin .9s linear infinite; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .refresh-btn.spinning .i { animation-duration: 2.5s; } }
.refresh-note { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; margin-left: auto;
  opacity: 0; transition: opacity .25s; }
.refresh-note.on { opacity: 1; }
.refresh-note + .refresh-btn { margin-left: 0; }

/* System health: Lodgify instant messages (Jorge 21.11) */
.hook-card { margin-bottom: 16px; }
.hook-body { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
.hook-body p { margin: 0; flex: 1 1 320px; }
.hook-body form { margin: 0; }
.hook-actions { display: flex; gap: 6px; }

/* Conversation: the AI waits so the team can answer first (Jorge 21.11) */
.ai-wait { display: flex; align-items: center; gap: 8px; align-self: center; margin: 6px auto 2px; padding: 6px 12px; border-radius: 999px;
  font-size: .78rem; color: var(--ai-1); background: color-mix(in srgb, var(--ai-1) 10%, var(--surface)); width: fit-content; max-width: 92%; }

/* Inbox: what is new (Jorge 23.11) — a guest wrote and nobody of the team opened it since */
.conv-item .new-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--ai-1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ai-1) 20%, transparent); }
.conv-item.is-new .top b { font-weight: 760; color: var(--text); }
.conv-item.is-new time { color: var(--ai-1); font-weight: 700; }
.conv-item.is-new .preview { color: var(--text-2); }

/* ---------- Guest Pass (plan G, 23.11): the guest's page `/p/<token>` + the booking card */
.pass-body { background: var(--bg); background-image: var(--bg-grad); min-height: 100dvh; }
/* Jorge 25.11: the colour of the pass, chosen in the settings (white = the clearest) */
:root[data-pass-theme="white"] { --bg: #ffffff; --bg-grad: none; --surface: #ffffff; --surface-2: #f4f4f2; --surface-3: #ebebe8; --line: #e8e7e3; }
:root[data-pass-theme="white"] .pass-page .card { border: 1px solid var(--line); box-shadow: none; }
:root[data-pass-theme="sand"] { --bg: #f5efe4; --bg-grad: radial-gradient(900px 500px at 100% -10%, #fff7e8 0%, transparent 60%); --surface: #fffdf9; --surface-2: #f4ede1; --surface-3: #eadfcc; --line: #e6dcc9; --line-strong: #d6c9b0; }
:root[data-pass-theme="sky"] { --bg: #eef4fa; --bg-grad: radial-gradient(900px 500px at 100% -10%, #e2eefc 0%, transparent 60%); --surface: #ffffff; --surface-2: #eff4f9; --surface-3: #e1eaf3; --line: #dbe5ef; --line-strong: #c6d5e4; }
:root[data-pass-theme="mint"] { --bg: #eef6f1; --bg-grad: radial-gradient(900px 500px at 100% -10%, #e3f5ea 0%, transparent 60%); --surface: #ffffff; --surface-2: #eef5f0; --surface-3: #dfece4; --line: #d9e8de; --line-strong: #c3d9cb; }
:root[data-pass-theme="lavender"] { --bg: #f3f0fa; --bg-grad: radial-gradient(900px 500px at 100% -10%, #ebe6fb 0%, transparent 60%); --surface: #ffffff; --surface-2: #f2effa; --surface-3: #e6e1f3; --line: #e1dcee; --line-strong: #cec6e4; }
.theme-pick { display: flex; flex-wrap: wrap; gap: 10px; }
.theme-swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; margin: 0; font-size: .8rem; font-weight: 560; }
.theme-swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.theme-dot { width: 64px; height: 44px; border-radius: 12px; border: 2px solid var(--line-strong); display: grid; place-items: center; background: #fff; transition: border-color .15s, box-shadow .15s; }
.theme-card { width: 36px; height: 22px; border-radius: 6px; background: #fff; border: 1px solid rgba(0,0,0,.1); }
.theme-swatch input:checked + .theme-dot { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ai-soft); }
.theme-swatch input:focus-visible + .theme-dot { outline: 2px solid var(--ai-1); outline-offset: 2px; }
.theme-white .theme-dot { background: #ffffff; } .theme-white .theme-card { background: #f4f4f2; }
.theme-black .theme-dot { background: #0a0a0c; } .theme-black .theme-card { background: #1a1a1e; border-color: #34343b; }
.theme-sand .theme-dot { background: #f5efe4; } .theme-sand .theme-card { background: #fffdf9; }
.theme-sky .theme-dot { background: #eef4fa; } .theme-sky .theme-card { background: #ffffff; }
.theme-mint .theme-dot { background: #eef6f1; } .theme-mint .theme-card { background: #ffffff; }
.theme-lavender .theme-dot { background: #f3f0fa; } .theme-lavender .theme-card { background: #ffffff; }
.pass-page { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.pass-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px; }
.pass-top img { height: 24px; }
.pass-langs { display: flex; gap: 6px; }
.pass-langs .chip { padding: 4px 10px; font-size: .78rem; }
.pass-hero { overflow: hidden; }
.pass-photo { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.pass-hero h1 { margin: 2px 0 12px; font-size: 1.45rem; }
.pass-dates { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pass-dates > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.pass-dates .k { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pass-dates b { font-size: .92rem; }
.pass-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pass-list li a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); color: inherit; text-decoration: none; }
.pass-list li.current a { border: 2px solid var(--ai-1); }
.pass-list li.done a { color: var(--text-2); }
.pass-step-name { flex: 1; font-weight: 580; }
.pass-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 700; background: var(--surface-3); color: var(--muted); flex: none; }
.pass-list li.done .pass-dot, .pass-status li.done .pass-dot { background: var(--ok-soft); color: var(--ok); }
.pass-list li.current .pass-dot { background: var(--ai-grad); color: #fff; }
.pass-do h2, .pass-page section h2 { margin-top: 0; display: flex; align-items: center; gap: 8px; }
.pass-do label { display: block; margin: 10px 0; font-size: .88rem; font-weight: 560; }
.pass-do label input, .pass-do label select, .pass-do label textarea, .pass-review textarea { margin-top: 6px; }
.pass-do .btn.block, .pass-page .btn.block { width: 100%; justify-content: center; margin-top: 10px; }
.pass-id { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pass-id .btn { grid-column: 1 / -1; }
.pass-shot { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: 12px; border: 1px dashed var(--line-strong); cursor: pointer; text-align: center; margin: 0; }
.pass-shot input { display: none; }
.pass-shot-art { width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.pass-shot-art img { width: 100%; height: 100%; object-fit: cover; }
.pass-shot.done { border-style: solid; border-color: var(--ok); }
.pass-shot.done .pass-shot-state { color: var(--ok); }
.pass-terms, .pass-text { white-space: pre-line; line-height: 1.5; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.pass-sign-box { position: relative; margin: 12px 0; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); overflow: hidden; }
.pass-sign-box canvas { width: 100%; height: auto; display: block; touch-action: none; }
.pass-sign-box canvas.shake { animation: pass-shake .4s; }
@keyframes pass-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pass-sign-hint { position: absolute; left: 0; right: 0; top: 45%; text-align: center; pointer-events: none; }
.pass-sign-clear { position: absolute; right: 8px; top: 8px; }
.pass-amount { font-size: 2rem; text-align: center; margin: 14px 0; }
.pass-twint, .pass-paypal { border-color: var(--ink); }
.pass-other-pay { display: grid; grid-template-columns: 1fr; gap: 8px; }
/* Jorge 25.11: the rules as a tidy list, the Wi-Fi tile, no jump to the top */
.pass-page #do, .pass-page #ready, .pass-page #checkin { scroll-margin-top: 12px; }
.pass-page html, html:has(.pass-page) { scroll-behavior: smooth; }
.pass-rules-list { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pass-rules-list li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); line-height: 1.45; }
.pass-rule-dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); flex: none; margin-top: 1px; }
.pass-rule-dot svg { width: 13px; height: 13px; }
/* two fields side by side whose hints differ in length: the inputs stay level (25.11) */
.two-cols.align-end > label:not(.check-row) { display: flex; flex-direction: column; }
.two-cols.align-end > label > input, .two-cols.align-end > label > select { margin-top: auto; }
.two-cols.align-end > .check-row { align-self: end; margin-bottom: 10px; }
.pass-extras { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.pass-extra { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.pass-extra p { margin: 2px 0 0; line-height: 1.4; }
.pass-extra .btn, .pass-extra .badge { flex: none; }
.pass-orders { margin-bottom: 10px; }
.pass-orders-team { margin: 10px 0; }
.pass-order { gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.pass-order:last-child { border-bottom: 0; }
.pass-checkout-list .pass-step-dot { background: var(--surface-3); color: var(--text-2); font-size: .74rem; font-weight: 700; }
.pass-list-more a { border-style: dashed; color: var(--text-2); }
.pass-page #checkout { scroll-margin-top: 12px; }
.pass-fixed { display: flex; align-items: center; gap: 6px; margin: 8px 0 0; }
.pass-wifi { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); margin: 0 0 14px; }
.pass-wifi .k { display: flex; align-items: center; gap: 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); flex: none; }
.pass-wifi > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.pass-wifi-pw { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; user-select: all; }
.pass-offline[hidden] { display: none; }
main.pass-page.soft-loading { opacity: .72; transition: opacity .15s; }
.pass-offline { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--warn-soft, #fff4d6); color: var(--warn, #8a5a00); margin-bottom: 12px; font-size: .9rem; }
@media print {  /* Save as PDF (Jorge 25.11): the instructions and the address only */
  .pass-page .pass-top nav, .pass-page form, .pass-page .btn, .pass-page .pass-map, .pass-page .pass-help, .pass-page .flash, .pass-page .pass-wait,
  .pass-page #steps, .pass-page #do, .pass-page #ready, .pass-page #shop, .pass-page #review, .pass-page .pass-offline { display: none !important; }
  .pass-page { max-width: none; padding: 0; gap: 10px; }
  .pass-page .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .pass-page .pass-video iframe { display: none; }
  /* Jorge's reference PDF (25.11): no browser date / link lines, no empty first page,
     one step after the other with a modest picture, like a small In-House brochure */
  @page { size: A4; margin: 0; }
  body:has(.pass-page) { padding: 12mm 14mm; }
  .pass-page .card { break-inside: auto; border: 0; padding-left: 0; padding-right: 0; }
  .pass-page .pass-hero { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid #ddd; border-radius: 0; padding-bottom: 10px; }
  .pass-page .pass-hero .pass-photo { width: 150px; height: 100px; max-height: none; border-radius: 10px; flex: none; }
  .pass-page .pass-hero h1 { font-size: 1.25rem; margin: 0 0 6px; }
  .pass-page .pass-facts { gap: 6px; }
  .pass-page .pass-steps-list > li { break-inside: avoid; padding: 10px 0; }
  .pass-page .pass-steps-list img { width: auto; max-width: 100%; max-height: 72mm; aspect-ratio: auto; }
  .pass-page .pass-wifi { border: 1px solid #ddd; }
  .pass-page .pass-where { border-top: 1px solid #ddd; border-radius: 0; }
  .pass-page .pass-help, .pass-page .lang-pick { display: none !important; }
  .pass-page .print-head { display: block; font-size: .8rem; color: #555; letter-spacing: .04em; text-transform: uppercase; padding: 0 0 4px; border-bottom: 1px solid #ddd; }
  .pass-page .pass-steps-list img { max-height: 150px; }
}
.pass-welcome textarea { font-size: .9rem; }
@media (min-width: 1100px) { .pass-welcome { grid-template-columns: 1fr 1fr 1fr; } }
/* Jorge 25.11: amounts per apartment in a window; automation card; message cards */
.pass-amounts-row { gap: 10px; flex-wrap: wrap; }
.pass-dialog { border: 0; padding: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg, 0 20px 60px rgba(0,0,0,.3)); width: min(640px, calc(100vw - 32px)); max-height: min(86vh, 900px); }
.pass-dialog::backdrop { background: rgba(5, 5, 8, .55); backdrop-filter: blur(6px); }
.pass-dialog-bar { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.pass-dialog-body { padding: 14px; overflow: auto; max-height: calc(min(86vh, 900px) - 56px); }
.pass-dialog-body .hint { display: block; color: var(--muted); font-size: .8rem; margin: 0 0 10px; }
.pass-src-tabs { margin-bottom: 10px; }
.subtab-panel { display: none; }
.subtab-panel.active { display: block; }
.pass-amounts-all { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); margin-bottom: 8px; font-size: .88rem; font-weight: 560; }
.pass-amounts-all input { width: 5.4rem; margin: 0; padding: 6px 8px; height: auto; text-align: center; border-radius: 8px; }
.pass-dialog .pass-amounts { width: 100%; }
.pass-dialog .pass-amounts th:first-child { text-align: left; font-weight: 500; white-space: normal; }
.auto-card { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); margin: 4px 0 16px; }
.auto-card .switch { font-weight: 620; }
.auto-card p { grid-column: 1 / -1; margin: 2px 0 0; line-height: 1.45; }
.wa-tpl-names { grid-column: 1 / -1; gap: 8px 12px; flex-wrap: wrap; }
.wa-tpl-names label { display: flex; align-items: center; gap: 6px; margin: 0; }
.wa-tpl-names input { margin: 0; width: 12rem; padding: 6px 8px; height: auto; font-size: .85rem; }
.msg-name { margin: 0; padding: 4px 8px; height: auto; font-weight: 620; width: 14rem; max-width: 100%; }
.msg-when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; font-size: .85rem; color: var(--text-2); }
.msg-when label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; }
.msg-when select, .msg-when input { margin: 0; height: auto; padding: 5px 8px; font-size: .85rem; }
.msg-when input[type="number"] { width: 4.2rem; text-align: center; }
.msg-when input[type="time"] { width: 7.6rem; }
.msg-foot { margin-top: 8px; }
.msg-add { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; justify-content: center; border-style: dashed; }
.msg-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.msg-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); min-width: 0; }
.msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.msg-head .switch { font-weight: 620; }
.lang-tabs { display: inline-flex; margin-bottom: 8px; }
.lang-tabs button { padding: 5px 11px; font-size: .78rem; }
.msg-card textarea { width: 100%; margin: 0; font-size: .9rem; }
@media (max-width: 900px) { .msg-cards { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .pass-amounts-all { grid-template-columns: 1fr 1fr; } .pass-amounts-all span { grid-column: 1 / -1; } .pass-amounts-all input { width: 100%; } .auto-card { grid-template-columns: 1fr; } .auto-card .badge { justify-self: start; } }
.pass-amounts-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.pass-amounts th:first-child { text-align: left; font-weight: 560; }
@media (min-width: 641px) { .pass-amounts th:first-child { white-space: nowrap; } }
.pass-amounts input[type="number"] { width: 4.6rem; height: auto; margin: 0; padding: 6px 6px; text-align: center; border-radius: 8px; }
.pass-amounts td, .pass-amounts th { padding: 4px 5px; }
@media (max-width: 640px) {  /* phone: the names stay while the amounts scroll sideways */
  .pass-amounts tbody th, .pass-amounts thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); width: 7.5rem; min-width: 7.5rem; max-width: 7.5rem; white-space: normal; overflow-wrap: anywhere; font-size: .8rem; line-height: 1.25; box-shadow: 2px 0 0 var(--line); }
}
.pass-other-pay .btn.block { margin-top: 10px; }
.pass-page .center { text-align: center; }
.pass-ready { text-align: center; }
.pass-ready-art { width: 56px; height: 56px; margin: 4px auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.pass-instructions { border: 2px solid var(--ai-1); }
.pass-address { font-size: 1.05rem; line-height: 1.4; }
/* the map on the pass (Jorge 25.11): a small Google map, then the coloured Maps button */
.pass-where { display: flex; gap: 14px; align-items: center; }
.pass-map { flex: none; width: 128px; height: 128px; border-radius: 14px; overflow: hidden; background: var(--surface-2, #eee); }
.pass-map iframe { display: block; width: 100%; height: 100%; border: 0; }
.pass-where-text { min-width: 0; flex: 1; }
.pass-where-text h2 { margin: 0 0 4px; }
.pass-where-text .pass-address { margin: 0 0 8px; font-size: .98rem; }
.pass-maps { gap: 8px; }
svg.i .c-red { fill: #ea4335; stroke: none; }
svg.i .c-blue { fill: #4285f4; stroke: none; }
svg.i .c-green { fill: #34a853; stroke: none; }
svg.i .c-yellow { fill: #fbbc04; stroke: none; }
svg.i .c-white { fill: #fff; stroke: none; }
.pass-stars { display: flex; gap: 6px; justify-content: center; margin: 8px 0 12px; }
.pass-stars label { cursor: pointer; font-size: 2rem; color: var(--line-strong); }
.pass-stars input { display: none; }
.pass-stars label:has(input:checked), .pass-stars label:has(~ label input:checked) { color: #f5b301; }
.pass-foot { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; }
/* the booking page card */
.pass-card .card-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pass-card .card-head-row h2 { margin: 0; }
/* Jorge 24.11: tighter, in two columns on computers, the same spacing everywhere */
.pass-status { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2px 20px; }
.pass-status li { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: .88rem; border-bottom: 1px solid var(--line); min-width: 0; }
.pass-status li .pass-dot { width: 20px; height: 20px; font-size: .7rem; }
.pass-status li .muted { margin-left: auto; white-space: nowrap; }
.pass-status li .skip { margin-left: 6px; }
.pass-card .facts { margin-top: 12px; }
.pass-card .hint-box { margin-top: 12px; }
.pass-card .row.pass-actions { margin-top: 12px; gap: 8px; flex-wrap: wrap; }
.pass-files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pass-file { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px; color: inherit; text-decoration: none; }
.pass-file img { width: 92px; height: 68px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); }
.pass-history { margin-top: 12px; }
.pass-history ul { margin: 6px 0 0; padding-left: 18px; }
@media (max-width: 480px) { .pass-dates { grid-template-columns: 1fr 1fr; } .pass-id { grid-template-columns: 1fr 1fr; } }

/* ---------- Locks (plan G, 23.11, redone same day): Nuki locks page + the door code on the pass */
.locks-tools { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.locks-tools .search { max-width: 420px; }
.locks-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.locks-count { margin-left: auto; }
.chip.chip-warn:not(.active) { color: var(--warn); } .chip.chip-err:not(.active) { color: var(--err); }
.locks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.lock-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lock-card.hidden { display: none; }
.lock-card.low { border-color: var(--warn); } .lock-card.off { border-color: var(--err); }
.lock-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lock-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.lock-ico.warn { background: var(--warn-soft); color: var(--warn); } .lock-ico.err { background: var(--err-soft); color: var(--err); }
.lock-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lock-who h2 { margin: 0; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lock-top .badge { flex: none; }
.lock-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .82rem; }
.lock-fact { display: inline-flex; align-items: center; gap: 5px; }
.lock-opens { display: flex; flex-wrap: wrap; gap: 6px; min-height: 26px; }
.lock-opens .chip { padding: 3px 10px; font-size: .78rem; background: var(--ai-soft); color: var(--ai-text); border-color: transparent; }
.lock-place summary { cursor: pointer; font-size: .84rem; display: flex; align-items: center; gap: 6px; list-style: none; }
.lock-place summary::-webkit-details-marker { display: none; }
.lock-place[open] summary { margin-bottom: 8px; }
.lock-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; max-height: 200px; overflow: auto; padding: 2px; }
.pick-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); font-size: .78rem; font-weight: 560; cursor: pointer; user-select: none; }
.pick-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.pick-chip span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; border: 1.5px solid var(--line-strong); vertical-align: middle; }
.pick-chip:has(input:checked) { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.pick-chip:has(input:checked) span::before { background: var(--ai-grad); border-color: transparent; }
.lock-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line); }
.warn-text { color: var(--warn); } .err-text { color: var(--err); }
.pass-code { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px; margin-bottom: 12px; border-radius: 12px; background: var(--ai-soft); }
.pass-code .k { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ai-text); }
.pass-code b { font-size: 2.2rem; letter-spacing: .18em; font-family: var(--mono); }
/* the technician: Nuki batteries box on My tickets */
.battery-box { margin-bottom: 14px; }
.battery-box ul { list-style: none; margin: 0; padding: 0; }
.battery-box li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.battery-box li:last-child { border-bottom: 0; }
.battery-box .grow { flex: 1; min-width: 0; }
@media (max-width: 720px) { .locks-grid { grid-template-columns: 1fr; } .locks-count { width: 100%; margin-left: 0; } .locks-tools .search { max-width: none; } }

/* Overview: locks to look at (Jorge 23.11) */
.locks-today .list-plain li { padding: 8px 0; }
.locks-today .small-empty { padding: 10px 0; display: flex; align-items: center; gap: 8px; color: var(--muted); }

/* ---------- Check-in steps (plan G stage 3, 24.11): editor + the steps on the pass */
.grid.checkin-grid { grid-template-columns: minmax(0, 1fr) minmax(360px, 460px); align-items: start; }
.checkin-side { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; padding-right: 2px; }  /* 25.11: the panel scrolls, the page stays */
.checkin-list li[draggable] { cursor: grab; }
.checkin-list li.dragging { opacity: .45; }
.drag-grip { color: var(--muted); display: inline-flex; align-items: center; padding: 6px 2px 0 0; cursor: grab; flex: none; }
.sort-arrows { display: none; gap: 2px; }
.sort-arrows [data-sort-up] svg { transform: rotate(-90deg); }
.sort-arrows [data-sort-down] svg { transform: rotate(90deg); }
@media (max-width: 1100px) { .sort-arrows { display: inline-flex; } .drag-grip { display: none; } }
.checkin-preview .phone-frame { max-height: 64vh; overflow: auto; padding: 14px; border-radius: 22px; border: 6px solid var(--line-strong); background: var(--bg); scrollbar-width: thin; }
.checkin-preview .pass-steps-list img { aspect-ratio: 4 / 3; max-height: none; }
.pass-video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.pass-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.checkin-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.checkin-tools .checkin-pick { margin: 0; flex: none; } .checkin-tools select { margin: 0; min-width: 240px; height: 44px; }
.checkin-tools .search { flex: 1; min-width: 220px; max-width: 420px; }
.checkin-tools .search input { height: 44px; }
.checkin-tools .btn { height: 44px; }
.checkin-form .hint { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; margin-top: 4px; }
.checkin-list li.hidden { display: none; }
.checkin-list li { align-items: flex-start; }
.checkin-list li.off { opacity: .55; }
.step-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .78rem; font-weight: 700; background: var(--ai-grad); color: #fff; }
/* Jorge 25.11: on the pass the numbers are quiet (ink on a light disc), each step has its
   own space with a thin line between, smaller pictures, calmer text */
.pass-page .pass-steps-list { gap: 0; }
.pass-page .pass-steps-list > li { padding: 14px 0; border-top: 1px solid var(--line); }
.pass-page .pass-steps-list > li:first-child { border-top: 0; padding-top: 4px; }
.pass-page .pass-steps-list .step-no { width: 30px; height: 30px; background: var(--surface-3); color: var(--text); font-size: .82rem; font-weight: 640; letter-spacing: .01em; }
.pass-page .pass-steps-list b { font-size: 1.02rem; font-weight: 640; letter-spacing: -.01em; }
.pass-page .pass-steps-list p { color: var(--text-2); font-size: .95rem; line-height: 1.55; }
.pass-page .pass-steps-list img { aspect-ratio: 3 / 2; max-height: 220px; border-radius: 14px; }
.print-head { display: none; }
.step-thumb { width: 56px; height: 42px; border-radius: 8px; overflow: hidden; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.step-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.step-actions { flex: none; gap: 6px; }
.level-seg { grid-auto-flow: row; grid-template-columns: 1fr 1fr; margin-bottom: 10px; }
.level-seg .seg { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: .84rem; cursor: pointer; }
.level-seg .seg input { margin: 0; }
.level-pick[hidden] { display: none; }
.checkin-form label { display: block; margin: 10px 0; font-size: .88rem; font-weight: 560; }
.checkin-form label input, .checkin-form label select, .checkin-form label textarea { margin-top: 6px; }
.checkin-form .check-row { font-weight: 500; }
.step-preview { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; }
.dropzone.small { padding: 12px; }
.pass-steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.pass-steps-list li { display: flex; gap: 12px; align-items: flex-start; }
.pass-steps-list li > .grow { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
/* Jorge 24.11: every photo the same size (4:3, the middle kept) */
.pass-steps-list img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; display: block; background: var(--surface-2); }
.pass-steps-list p { margin: 0; line-height: 1.5; white-space: pre-line; }
.pass-steps-list b { font-size: 1rem; }
.pass-code.small { margin: 0; padding: 10px; } .pass-code.small b { font-size: 1.6rem; }
.pass-code.fixed { background: var(--surface-2); } .pass-code.fixed .k { color: var(--muted); }
.pass-code.pass-later { border: 1px dashed var(--line-strong); } .pass-code.pass-later .k { display: inline-flex; gap: 4px; align-items: center; }
.pass-wait { margin: 0 0 4px; }
.checkin-langs { margin: 10px 0; } .checkin-langs summary { cursor: pointer; display: flex; align-items: center; gap: 4px; }
.checkin-import h2 { margin-top: 0; }
.checkin-preview select { margin-bottom: 12px; }
@media (max-width: 1100px) { .grid.checkin-grid { grid-template-columns: 1fr; } .checkin-side { position: static; } .checkin-preview .phone-frame { max-height: none; border: 0; padding: 0; background: transparent; } }
@media (max-width: 640px) { .checkin-list li { flex-wrap: wrap; } .step-actions { width: 100%; justify-content: flex-end; } .level-seg { grid-template-columns: 1fr; } }

/* settings: Guest Pass rules table (24.11) */
.pass-rules { border-collapse: collapse; margin: 6px 0 14px; font-size: .9rem; }
.pass-rules th, .pass-rules td { padding: 8px 14px; text-align: center; border-bottom: 1px solid var(--line); }
.pass-rules tbody th { text-align: left; font-weight: 560; }
.pass-rules input { width: 18px; height: 18px; margin: 0; }
