/* ClearLedger website calls + staff page */
:root {
  --ink: #12302a;
  --accent: #1d6b53;
  --accent-soft: #e6f2ec;
  --line: #d6e0db;
  --muted: #5b6b66;
  --paper: #ffffff;
  --bg: #f4f8f6;
  --dark: #0d1f1b;
  --dark-2: #163029;
  --dark-3: #21443a;
  --danger: #c93b3f;
  --rec: #e5484d;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: "Source Serif 4", Georgia, serif; line-height: 1.2; }
a { color: var(--accent); }

.cl-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 600 15px/1 Manrope, sans-serif; padding: 13px 22px; text-decoration: none; cursor: pointer; }
.cl-btn:hover { filter: brightness(1.08); }
.cl-btn:disabled { opacity: .6; cursor: default; }
.cl-btn-wide { width: 100%; }
.cl-btn-sm { padding: 8px 14px; font-size: 14px; }
.cl-btn-ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cl-btn-danger { background: var(--danger); }
.cl-muted { color: var(--muted); }
.cl-error { color: var(--danger); background: #fdecec; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.cl-fine { color: var(--muted); font-size: 13px; line-height: 1.5; }

/* ---------- lobby & messages ---------- */
.cl-center { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.cl-card { width: 100%; max-width: 480px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: 0 10px 40px rgba(18, 48, 42, .08); }
.cl-card h1 { font-size: 26px; margin: 14px 0 6px; }
.cl-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); text-decoration: none; }
.cl-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 15px; }
.cl-host-badge { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 13px; padding: 5px 10px; border-radius: 999px; margin: 4px 0 0; }
.cl-preview { position: relative; margin: 16px 0; aspect-ratio: 16 / 9; background: var(--dark); border-radius: 12px; overflow: hidden; }
.cl-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.cl-preview-off { position: absolute; inset: 0; display: grid; place-items: center; color: #cfe3dc; font-size: 14px; }
#join-form label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
#join-form input[type=text], #join-form input[type=email] { width: 100%; font: 16px Manrope, sans-serif; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; }
#join-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.cl-checks { display: flex; gap: 18px; flex-wrap: wrap; margin: 14px 0; }
.cl-checks label { display: flex !important; align-items: center; gap: 6px; font-weight: 500 !important; margin: 0 !important; }

/* ---------- in call ---------- */
.cl-room { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--dark); color: #eaf3ef; }
.cl-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); font-size: 14px; }
.cl-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-rec { background: var(--rec); color: #fff; font-weight: 700; padding: 4px 10px; border-radius: 999px; font-size: 12px; animation: pulse 1.6s infinite; }
.cl-txb { background: var(--dark-3); padding: 4px 10px; border-radius: 999px; font-size: 12px; }
.cl-timer { margin-left: auto; font-variant-numeric: tabular-nums; color: #a9c4bb; }
@keyframes pulse { 50% { opacity: .65; } }

.cl-stage { flex: 1; display: flex; min-height: 0; gap: 10px; padding: 0 10px; }
.cl-grid { flex: 1; display: grid; gap: 10px; min-height: 0; grid-template-columns: 1fr; grid-auto-rows: 1fr; }
.cl-grid[data-count="2"] { grid-template-columns: 1fr 1fr; }
.cl-grid[data-count="3"], .cl-grid[data-count="4"] { grid-template-columns: 1fr 1fr; }
.cl-tile { position: relative; background: var(--dark-2); border-radius: 14px; overflow: hidden; min-height: 0; }
.cl-tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.cl-tile.is-me:not(.is-screen) video { transform: scaleX(-1); }
.cl-tile.is-screen video { object-fit: contain; }
.cl-avatar { position: absolute; inset: 0; margin: auto; width: 96px; height: 96px; border-radius: 50%; background: #2f6b5a; display: none; place-items: center; font-size: 34px; font-weight: 700; color: #fff; }
.cl-tile.no-video video { visibility: hidden; }
.cl-tile.no-video .cl-avatar { display: grid; }
.cl-label { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; align-items: center; background: rgba(0, 0, 0, .55); padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; max-width: calc(100% - 20px); }
.cl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-mic-off { display: none; }
.cl-tile.muted .cl-mic-off { display: inline; }
.cl-status { position: absolute; top: 10px; left: 10px; font-size: 12px; color: #ffd98a; }
.cl-status:empty { display: none; }

.cl-panel { width: 340px; flex-shrink: 0; background: var(--paper); color: var(--ink); border-radius: 14px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cl-tabs { display: flex; border-bottom: 1px solid var(--line); }
.cl-tabs button { flex: 1; border: 0; background: none; font: 600 13px Manrope, sans-serif; padding: 12px 6px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.cl-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.cl-tabs .cl-close { flex: 0 0 40px; }
.cl-tab { flex: 1; overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.cl-people { list-style: none; margin: 0; padding: 0; }
.cl-people li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.cl-invite p { margin: 14px 0 6px; font-size: 13px; }
.cl-copy { display: flex; gap: 6px; }
.cl-copy input { flex: 1; min-width: 0; font: 13px Manrope, sans-serif; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
.cl-transcript { flex: 1; overflow: auto; font-size: 14px; line-height: 1.5; min-height: 120px; }
.cl-line { margin: 0 0 8px; }
.cl-time { color: var(--muted); font-size: 12px; }
.cl-interim { color: var(--muted); font-style: italic; font-size: 13px; min-height: 1em; margin: 0; }
.cl-script h3 { font-size: 16px; margin: 14px 0 6px; color: var(--accent); }
.cl-script h3:first-child { margin-top: 0; }
.cl-script ul { list-style: none; padding: 0; margin: 0; }
.cl-script li { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.cl-script label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.cl-script input { margin-top: 3px; accent-color: var(--accent); }
.cl-script input:checked + * , .cl-script label:has(input:checked) { color: var(--muted); text-decoration: line-through; }
.cl-script p { font-size: 14px; margin: 0 0 8px; }

.cl-bar { display: flex; justify-content: center; gap: 8px; padding: 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); flex-wrap: wrap; }
.cl-ctl { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 76px; border: 0; border-radius: 12px; background: var(--dark-3); color: #fff; font: 600 12px Manrope, sans-serif; padding: 9px 10px; cursor: pointer; }
.cl-ctl .i { font-size: 18px; line-height: 1; }
.cl-ctl:hover { background: #2c574b; }
.cl-ctl.off { background: #4a2a2c; }
.cl-ctl.active { background: var(--accent); }
.cl-ctl:disabled { opacity: .45; cursor: default; }
#btn-rec.active { background: var(--rec); }
.cl-leave { background: var(--danger); }
.cl-leave:hover { background: #b0302f; }

.cl-toasts { position: fixed; top: 56px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 50; pointer-events: none; }
.cl-toast { background: rgba(10, 25, 21, .92); color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 14px; transition: opacity .6s; }
.cl-toast.out { opacity: 0; }

@media (max-width: 760px) {
  .cl-panel { position: fixed; left: 8px; right: 8px; bottom: 84px; top: 52px; width: auto; z-index: 20; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); }
  .cl-grid[data-count="2"] { grid-template-columns: 1fr; }
  .cl-ctl { min-width: 0; flex: 1 1 22%; padding: 8px 4px; font-size: 11px; }
  .cl-avatar { width: 64px; height: 64px; font-size: 24px; }
}

/* ---------- staff page ---------- */
.st-body { background: var(--bg); }
.st-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 60px; }
.st-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.st-head h1 { margin: 0; font-size: 28px; }
.st-head .st-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.st-card { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 18px; }
.st-card h2 { margin: 0 0 12px; font-size: 21px; }
.st-flash { background: var(--accent-soft); border: 1px solid #bcdccc; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.st-flash.err { background: #fdecec; border-color: #f2c3c3; color: #7a1f22; }
.st-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.st-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.st-form input, .st-form select, .st-form textarea { font: 15px Manrope, sans-serif; padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; }
.st-form textarea { width: 100%; }
.st-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.st-table th, .st-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.st-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.st-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #eef1f0; }
.st-pill.requested { background: #fff4d6; color: #7a5a00; }
.st-pill.confirmed { background: var(--accent-soft); color: var(--accent); }
.st-pill.done { background: #e8ecf5; color: #344a7a; }
.st-pill.declined { background: #fdecec; color: #7a1f22; }
.st-links input { width: 100%; font: 12px Manrope, sans-serif; padding: 6px; border: 1px solid var(--line); border-radius: 6px; margin: 2px 0 6px; }
.st-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.st-actions form { margin: 0; }
details.st-more summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.st-msg { white-space: pre-wrap; color: var(--muted); max-width: 320px; }
.st-login { max-width: 380px; margin: 10vh auto; }
.st-transcript p { margin: 0 0 6px; }
@media (max-width: 760px) {
  .st-table thead { display: none; }
  .st-table tr { display: block; border-bottom: 2px solid var(--line); padding: 8px 0; }
  .st-table td { display: block; border: 0; padding: 4px 0; }
}
.st-day { font-size: 16px; margin: 18px 0 4px; color: var(--accent); }
.st-blocks { list-style: none; padding: 0; margin: 14px 0 0; }
.st-blocks li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
