/* Shavua Israeli / Israeli Week — shared styles */
:root {
  --navy: #0b1f3a;
  --navy-2: #12305a;
  --blue: #1666d8;
  --cyan: #39c2e0;
  --grad: linear-gradient(90deg, #39c2e0, #1666d8);
  --ink: #1a2637;
  --muted: #5a6b80;
  --line: #dde5ef;
  --bg: #f2f5f9;
  --ok: #167d3c;
  --err: #c0392b;
  --warn: #b26a00;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "Segoe UI", Arial, "Noto Sans Hebrew", sans-serif;
  font-size: 15px; line-height: 1.55;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--navy); margin: 0 0 12px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
code { background: #eef2f8; padding: 1px 5px; border-radius: 4px; }

.public-bg { background: linear-gradient(180deg, #0b1f3a 0%, #12305a 240px, var(--bg) 240px); min-height: 100vh; }

.brand-logo { font-size: 26px; font-weight: 800; letter-spacing: 1px; color: var(--navy); margin-bottom: 14px; }
.brand-logo span { background: var(--grad); color: #fff; padding: 2px 10px; border-radius: 5px; margin: 0 5px; }
.brand-logo small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.public-bg .brand-logo, .topbar .brand-logo { color: #fff; }
.public-bg .brand-logo small { color: #9fb4d0; }
/* Logos inside a white card (login, installer) stay navy, not white-on-white */
.public-bg .card .brand-logo { color: var(--navy); }
.public-bg .card .brand-logo small { color: var(--muted); }

.card {
  background: #fff; border-radius: 14px; padding: 26px 28px;
  box-shadow: 0 8px 30px rgba(11, 31, 58, .10);
}
.wrap { max-width: 860px; margin: 34px auto; padding: 0 14px; }
.wrap-narrow { max-width: 460px; margin: 60px auto; padding: 0 14px; }

label { display: block; margin: 12px 0 4px; font-weight: 600; color: var(--navy); font-size: 14px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(22, 102, 216, .35); border-color: var(--blue); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.check input { width: auto; }

.btn {
  display: inline-block; background: var(--grad); background-color: var(--blue); color: #fff; border: 0;
  padding: 12px 26px; border-radius: 9px; font-size: 15px; font-weight: 700; cursor: pointer;
  margin-top: 16px; text-decoration: none;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn.small { padding: 6px 14px; font-size: 13px; margin-top: 0; }
.btn.ghost { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn.danger { background: var(--err); }
.btn[disabled] { opacity: .5; cursor: default; }

.ok   { color: var(--ok); }
.err  { color: var(--err); }
.note { color: var(--muted); font-size: 13px; }
.msg  { padding: 11px 14px; border-radius: 9px; margin: 12px 0; }
.msg.ok   { background: #e7f6ec; color: var(--ok); }
.msg.err  { background: #fdeceb; color: var(--err); }
.msg.warn { background: #fff4e0; color: var(--warn); }

table.grid { width: 100%; border-collapse: collapse; margin: 12px 0; }
table.grid th, table.grid td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: start; }
table.grid th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
table.grid tr:hover td { background: #f7fafd; }

.pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.pill.draft, .pill.new { background: #e8edf5; color: var(--muted); }
.pill.sent, .pill.scheduled { background: #e3f0ff; color: var(--blue); }
.pill.signed { background: #fff4e0; color: var(--warn); }
.pill.accepted, .pill.active, .pill.paid, .pill.succeeded, .pill.handled { background: #e7f6ec; color: var(--ok); }
.pill.declined, .pill.failed, .pill.past_due, .pill.canceled { background: #fdeceb; color: var(--err); }
.pill.completed, .pill.expired { background: #eef; color: #4a4a8a; }

/* Admin top bar */
.topbar { background: var(--navy); padding: 12px 0; }
.topbar .inner { max-width: 1080px; margin: 0 auto; padding: 0 14px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.topbar .brand-logo { font-size: 18px; margin: 0; }
.topbar nav a { color: #c8d6ea; margin-inline-end: 16px; font-weight: 600; font-size: 14px; }
.topbar nav a:hover, .topbar nav a.on { color: #fff; text-decoration: none; }
.topbar .who { margin-inline-start: auto; color: #9fb4d0; font-size: 13px; }
.admin-wrap { max-width: 1080px; margin: 26px auto; padding: 0 14px; }

/* Stat tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.tile { background: #fff; border-radius: 12px; padding: 16px 18px; box-shadow: 0 4px 14px rgba(11,31,58,.07); }
a.tile { display: block; color: inherit; text-decoration: none; transition: transform .12s, box-shadow .12s; }
a.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(11,31,58,.14); }
.tile b { display: block; font-size: 24px; color: var(--navy); }
.tile span { color: var(--muted); font-size: 13px; }

/* Quote page steps */
.steps { display: flex; gap: 6px; margin: 18px 0; }
.steps div { flex: 1; text-align: center; font-size: 13px; padding: 8px 4px; background: #e8edf5; color: var(--muted); border-radius: 7px; }
.steps div.on { background: var(--grad); background-color: var(--blue); color: #fff; font-weight: 700; }
.steps div.done { background: #e7f6ec; color: var(--ok); }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; margin: 10px 0; }
.kv dt { color: var(--muted); font-size: 13px; margin: 0; }
.kv dd { margin: 0 0 10px; font-weight: 600; }

.total-line { background: var(--navy); color: #fff; border-radius: 10px; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; font-size: 17px; margin: 14px 0; }
.total-line b { font-size: 24px; }

.terms-box { background: #f7fafd; border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; max-height: 260px; overflow-y: auto; white-space: pre-wrap; font-size: 13px; color: var(--muted); }

#sigpad { border: 2px dashed var(--line); border-radius: 9px; width: 100%; height: 150px; touch-action: none; background: #fff; }

.lang-toggle { position: absolute; top: 14px; left: 16px; z-index: 50; }
.lang-toggle select {
  width: auto; background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.35);
  border-radius: 20px; padding: 7px 14px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.lang-toggle select option { color: var(--ink); background: #fff; }
.lang-toggle a { color: #c8d6ea; font-weight: 700; font-size: 14px; background: rgba(255,255,255,.12); padding: 6px 14px; border-radius: 20px; }

.footer-note { text-align: center; color: var(--muted); font-size: 12px; padding: 22px 0; }

/* Messaging thread */
.msgthread { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 6px 2px; margin: 10px 0; }
.msg-row { display: flex; }
.msg-row.mine { justify-content: flex-end; }
.msg-row.theirs { justify-content: flex-start; }
.bubble { max-width: 78%; padding: 10px 13px; border-radius: 14px; font-size: 14px; }
.msg-row.mine .bubble { background: var(--grad); background-color: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg-row.theirs .bubble { background: #eef2f8; color: var(--ink); border-bottom-left-radius: 4px; }
.bubble .mbody { line-height: 1.5; word-wrap: break-word; }
.bubble .mmeta { font-size: 11px; opacity: .7; margin-top: 5px; }
.mfiles { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { display: inline-block; border-radius: 8px; overflow: hidden; border: 1px solid rgba(0,0,0,.12); background: #fff; }
.thumb img { display: block; width: 84px; height: 84px; object-fit: cover; }
.thumb-file { width: 84px; height: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--muted); }
.thumb-file .ficon { font-size: 30px; line-height: 1; }
.thumb-file .fext { font-size: 10px; font-weight: 700; margin-top: 4px; letter-spacing: .5px; }
.msgcompose { margin-top: 12px; }
.msgcompose textarea { width: 100%; }
.msgcompose .composerow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.msgcompose .composerow input[type=file] { flex: 1; min-width: 180px; }

/* Two-column detail layout (Quoter-style) */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.detail-main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.detail-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.detail-main .card, .detail-side .card { margin: 0; }
.detail-side .card { padding: 16px 18px; }
.detail-side .card h3 { font-size: 15px; }
.side-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.side-head h3 { margin: 0; }
.side-actions { display: flex; flex-direction: column; gap: 8px; }
.side-actions .btn { margin: 0; width: 100%; text-align: center; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.detail-head h1 { margin: 0; }
.copybox { display: flex; gap: 6px; }
.copybox input { font-size: 12px; padding: 7px 9px; }
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { position: static; }
}

/* Internal notes */
.internal-notes { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.inote { background: #fff; border: 1px solid #f0e4b8; border-radius: 8px; padding: 8px 12px; font-size: 14px; }
.inote-meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; }

/* Sortable tables */
table.grid.sortable th { cursor: pointer; user-select: none; white-space: nowrap; }
table.grid.sortable th:hover { color: var(--blue); }
table.grid.sortable th.sorted-asc::after { content: " ▲"; font-size: 9px; }
table.grid.sortable th.sorted-desc::after { content: " ▼"; font-size: 9px; }

.linkbtn-danger { background: none; border: 0; color: var(--err); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.linkbtn-danger:hover { color: #a02012; }
.linkbtn-ok { background: none; border: 0; color: var(--ok); cursor: pointer; padding: 0; font: inherit; font-weight: 600; text-decoration: underline; }
.linkbtn-ok:hover { color: #0f5c2b; }

/* Visual ad-size picker (customer request form) */
.adsize-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin: 6px 0 4px; }
.adsize-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 6px; padding: 12px 6px 10px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff;
  text-align: center; font-size: 13px; font-weight: 600; color: var(--navy); transition: border-color .12s, box-shadow .12s, transform .1s; }
.adsize-card:hover { border-color: var(--cyan); transform: translateY(-1px); }
.adsize-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.adsize-card:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,102,216,.18); }
.adsize-card svg { pointer-events: none; }
.adsize-card .adsize-none { font-size: 40px; line-height: 1.4; }
.adsize-nonecard { justify-content: center; }

/* Emoji picker */
.emoji-panel { position: absolute; z-index: 1200; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(11,31,58,.22); padding: 8px; width: 268px; max-height: 220px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.emoji-panel button { border: 0; background: none; font-size: 20px; line-height: 1; padding: 4px; cursor: pointer; border-radius: 6px; }
.emoji-panel button:hover { background: #eef2f8; }
.thumb img, .thumb { cursor: zoom-in; }

/* Annotation lightbox */
.anno-overlay { position: fixed; inset: 0; z-index: 1300; background: rgba(6,14,28,.92); display: flex; flex-direction: column; align-items: center; }
.anno-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; }
.anno-toolbar button { background: #223651; color: #fff; border: 1px solid #3a5473; border-radius: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.anno-toolbar button.on { background: var(--blue); border-color: var(--blue); }
.anno-toolbar button.primary { background: var(--ok); border-color: var(--ok); }
.anno-toolbar button.rec.on { background: #e53935; border-color: #e53935; }
.anno-toolbar button:hover { filter: brightness(1.1); }
.anno-colors { display: inline-flex; gap: 4px; margin: 0 6px; }
.anno-color { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; padding: 0; cursor: pointer; }
.anno-color.on { outline: 2px solid var(--cyan); outline-offset: 1px; }
.anno-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow: auto; width: 100%; padding: 0 10px 14px; }
.anno-stage canvas { background: #fff; border-radius: 6px; box-shadow: 0 8px 30px rgba(0,0,0,.5); cursor: crosshair; touch-action: none; max-width: 100%; }

/* Annotation how-to (animated) */
.anno-help { position: fixed; inset: 0; z-index: 1400; background: rgba(6,14,28,.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.anno-help-card { background: #fff; border-radius: 16px; padding: 22px 24px; max-width: 640px; width: 100%; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.anno-help-card h3 { margin: 0 0 14px; }
.anno-help-x { position: absolute; top: 12px; inset-inline-end: 14px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.anno-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.anno-step { text-align: center; }
.anno-step b { display: block; margin: 8px 0 4px; color: var(--navy); }
.anno-step span { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.anno-demo { height: 92px; border-radius: 10px; background: #f2f5f9; position: relative; overflow: hidden; border: 1px solid var(--line); }
/* Step 1: cursor drags, arrow draws */
.demo1 .demo-arrow { position: absolute; left: 22px; top: 58px; width: 0; height: 3px; background: #e53935; transform-origin: left center; transform: rotate(-32deg); animation: demoArrow 2.4s ease-in-out infinite; }
.demo1 .demo-arrow::after { content: ''; position: absolute; right: -2px; top: -4px; border-left: 10px solid #e53935; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.demo1 .demo-cursor { position: absolute; left: 22px; top: 58px; width: 12px; height: 12px; border-inline-start: 2px solid var(--navy); border-top: 2px solid var(--navy); transform: rotate(-135deg); animation: demoCursor 2.4s ease-in-out infinite; }
@keyframes demoArrow { 0%,10% { width: 0; } 55%,100% { width: 90px; } }
@keyframes demoCursor { 0%,10% { left: 22px; top: 58px; } 55%,100% { left: 100px; top: 10px; } }
/* Step 2: pulsing record dot + mic */
.demo2 { display: flex; align-items: center; justify-content: center; gap: 10px; }
.demo2 .demo-mic { font-size: 30px; }
.demo2 .demo-rec { width: 16px; height: 16px; border-radius: 50%; background: #e53935; animation: demoPulse 1.1s ease-in-out infinite; }
@keyframes demoPulse { 0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(229,57,53,.5); } 50% { transform: scale(1.15); box-shadow: 0 0 0 10px rgba(229,57,53,0); } }
/* Step 3: clip flies up */
.demo3 { display: flex; align-items: center; justify-content: center; }
.demo3 .demo-clip { font-size: 30px; animation: demoSend 2s ease-in-out infinite; }
@keyframes demoSend { 0%,20% { transform: translateY(20px); opacity: .3; } 60% { transform: translateY(-6px); opacity: 1; } 100% { transform: translateY(-24px); opacity: 0; } }
@media (max-width: 560px) { .anno-steps { grid-template-columns: 1fr; } }

/* Floating chat widget */
.chat-fab { position: fixed; bottom: 22px; inset-inline-end: 22px; width: 56px; height: 56px; border-radius: 50%;
  background: var(--grad); background-color: var(--blue); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(22,102,216,.45); cursor: pointer; z-index: 900; transition: transform .12s; }
.chat-fab:hover { transform: scale(1.06); }
.chat-fab-badge { position: absolute; top: -3px; inset-inline-end: -3px; min-width: 20px; height: 20px; line-height: 20px;
  background: #e53935; color: #fff; border-radius: 10px; font-size: 12px; font-weight: 700; text-align: center; padding: 0 5px; border: 2px solid #fff; }
.chat-panel { position: fixed; bottom: 88px; inset-inline-end: 22px; width: 370px; max-width: calc(100vw - 32px); max-height: 70vh;
  background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(11,31,58,.28); z-index: 900;
  display: none; flex-direction: column; overflow: hidden; }
.chat-panel.open { display: flex; }
.chat-panel-head { background: var(--navy); color: #fff; padding: 12px 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.chat-close { cursor: pointer; font-size: 22px; line-height: 1; opacity: .8; }
.chat-close:hover { opacity: 1; }
.chat-panel-body { padding: 12px 14px; overflow-y: auto; }
.chat-panel-body .msgthread { max-height: 46vh; }
.thumb-video { width: 100%; max-width: 340px; min-width: 220px; height: auto; border-radius: 8px; background: #000; display: block; }
.chat-panel-body .thumb-video, .msg-row .thumb-video { min-width: 0; }
.recstatus { margin-top: 6px; }

/* Nav unread badge */
.navbadge { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; text-align: center;
  background: #e53935; color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 0 5px; margin-inline-start: 4px; vertical-align: top; }

/* ---------------- Responsive / mobile ---------------- */
@media (max-width: 900px) {
  .admin-wrap { padding: 0 12px; }
  /* Admin top bar: horizontal-scrolling nav, compact */
  .topbar .inner { gap: 10px; }
  .topbar nav { order: 3; width: 100%; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .topbar nav a { margin-inline-end: 12px; display: inline-block; }
  .topbar .who { margin-inline-start: auto; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .wrap, .admin-wrap { padding: 0 10px; }
  .wrap { margin: 18px auto; }
  .card { padding: 16px 14px; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }

  /* Stack every multi-column grid, even inline-styled ones */
  .kv { grid-template-columns: 1fr !important; }
  .kv[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  .tiles { grid-template-columns: 1fr 1fr; }

  /* Tables scroll horizontally inside their card */
  table.grid { display: block; overflow-x: auto; white-space: nowrap; }

  /* Buttons & action rows: full-width, easy tap targets */
  .btn { padding: 12px 20px; }
  .btn.small { padding: 9px 14px; }
  form .btn, .side-actions .btn { width: 100%; text-align: center; }
  .detail-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .detail-head .btn { width: 100%; text-align: center; }

  .steps div { font-size: 10.5px; padding: 6px 2px; }

  /* Chat widget: full-width sheet on phones */
  .chat-panel { inset-inline: 8px; width: auto; bottom: 80px; max-height: 74vh; }
  .chat-fab { bottom: 16px; inset-inline-end: 16px; }

  /* Annotation toolbar: compact, wraps */
  .anno-toolbar { gap: 4px; padding: 8px 6px; }
  .anno-toolbar button { padding: 7px 9px; font-size: 12px; }
  .anno-color { width: 22px; height: 22px; }

  /* Language toggle sits above the header on its own line, not over the logo */
  .lang-toggle { top: 10px; }
  .lang-toggle select { padding: 6px 10px; font-size: 13px; }
  .public-bg .brand-logo { margin-top: 46px !important; }

  /* Message bubbles a touch wider on small screens */
  .bubble { max-width: 88%; }

  /* Emoji panel fits the screen */
  .emoji-panel { width: calc(100vw - 24px); grid-template-columns: repeat(7, 1fr); }
}

@media (max-width: 380px) {
  .tiles { grid-template-columns: 1fr; }
  .brand-logo { font-size: 22px; }
}

/* ---------- Co-browse (screen share) ---------- */
.cobrowse-btn { line-height: 1; }
.cb-pill {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 2147483200; background: #12305a; color: #fff; padding: 8px 12px;
  border-radius: 999px; font-size: 13px; box-shadow: 0 6px 20px rgba(0,0,0,.28);
  display: flex; align-items: center; gap: 8px; max-width: 92vw;
}
.cb-pill .cb-pill-stop {
  background: #e23; color: #fff; border: 0; border-radius: 999px;
  padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.cb-live-dot { width: 9px; height: 9px; border-radius: 50%; background: #3ad06a;
  box-shadow: 0 0 0 0 rgba(58,208,106,.7); animation: cbPulse 1.4s infinite; }
@keyframes cbPulse { 0%{box-shadow:0 0 0 0 rgba(58,208,106,.6);} 70%{box-shadow:0 0 0 8px rgba(58,208,106,0);} 100%{box-shadow:0 0 0 0 rgba(58,208,106,0);} }

.cb-banner {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%);
  z-index: 2147483200; background: #fff; color: #12305a; border: 1px solid #d9e0ea;
  padding: 10px 12px; border-radius: 12px; box-shadow: 0 8px 26px rgba(0,0,0,.18);
  display: flex; align-items: center; gap: 10px; font-size: 14px; max-width: 94vw;
}
.cb-banner button { border: 0; border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.cb-banner .cb-banner-view { background: #12305a; color: #fff; }
.cb-banner .cb-banner-x { background: #eef1f6; color: #556; }

.cb-viewer {
  position: fixed; inset: 3vh 3vw; z-index: 2147483200; background: #0f1622;
  border-radius: 14px; box-shadow: 0 24px 80px rgba(0,0,0,.55);
  display: flex; flex-direction: column; overflow: hidden;
}
.cb-vhead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; color: #fff; background: #12305a; font-weight: 600; font-size: 14px;
}
.cb-vhead .cb-end { background: rgba(255,255,255,.15); color: #fff; border: 0;
  border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.cb-stage { position: relative; flex: 1; overflow: auto; background: #1b2636; }
.cb-canvas { position: relative; margin: 0 auto; background: #fff; }
.cb-scaler { transform-origin: top left; overflow: hidden; background: #fff; }
.cb-frame { border: 0; display: block; background: #fff; }
.cb-wait { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: #9fb0c8; font-size: 15px; pointer-events: none; }
.cb-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; background: #ff5a5f; box-shadow: 0 0 0 3px rgba(255,255,255,.85);
  pointer-events: none; z-index: 5; transition: left .12s linear, top .12s linear; }
.cb-toast {
  position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%);
  z-index: 2147483200; background: #222; color: #fff; padding: 10px 16px;
  border-radius: 10px; font-size: 14px; transition: opacity .5s; opacity: 1;
}
@media (max-width: 640px) { .cb-viewer { inset: 0; border-radius: 0; } }

/* ---------- Quote page: action bar + signature ---------- */
.quote-actionbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #e2ecf6; border-radius: 12px;
  padding: 12px 18px; margin-bottom: 14px; box-shadow: 0 4px 16px rgba(11,31,58,.10);
  flex-wrap: wrap;
}
.quote-actionbar .qab-no { font-size: 15px; color: #33465e; }
.quote-actionbar .qab-no b { color: #1666d8; }
.quote-actionbar .qab-actions { display: flex; gap: 8px; }
.btn.ok { background: #1f9d4d; border-color: #1f9d4d; color: #fff; }
.btn.ok:hover { background: #188a42; }
.btn.small.ok { background: #1f9d4d; border-color: #1f9d4d; color: #fff; }

.sigtabs { display: inline-flex; border: 1px solid #cdd9e8; border-radius: 8px; overflow: hidden; margin: 6px 0 8px; }
.sigtab { background: #f3f6fb; color: #445; border: 0; padding: 8px 16px; font-size: 14px; cursor: pointer; }
.sigtab + .sigtab { border-inline-start: 1px solid #cdd9e8; }
.sigtab.on { background: #1666d8; color: #fff; }
#sigpad { width: 100%; height: 150px; border: 2px dashed #cdd9e8; border-radius: 10px; background: #fcfdff; touch-action: none; }
.typed-sig {
  width: 100%; min-height: 150px; border: 2px dashed #cdd9e8; border-radius: 10px; background: #fcfdff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Segoe Script','Brush Script MT','Snell Roundhand',cursive; font-size: 40px; color: #12305a;
}

/* ---------- Accepted / success screen ---------- */
.success-wrap { text-align: center; padding: 24px 0 8px; }
.success-check {
  width: 88px; height: 88px; margin: 0 auto 18px; border-radius: 50%;
  background: #1f9d4d; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(31,157,77,.35); animation: scPop .5s cubic-bezier(.2,.8,.3,1.5);
}
.success-check svg { width: 48px; height: 48px; stroke: #fff; stroke-width: 5;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 60; stroke-dashoffset: 60; animation: scDraw .45s .3s forwards; }
@keyframes scPop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes scDraw { to { stroke-dashoffset: 0; } }
.success-h { font-size: 26px; color: #12305a; margin: 0 0 8px; }
.success-p { color: #556; max-width: 440px; margin: 0 auto 20px; line-height: 1.6; }

/* ---------- Activity timeline ---------- */
.activity { list-style: none; margin: 0; padding: 0; }
.act-item { display: flex; gap: 10px; padding: 9px 0; }
.act-item + .act-item { border-top: 1px solid #f0f3f8; }
.act-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; box-shadow: 0 0 0 3px rgba(18,48,90,.05); }
.act-label { font-weight: 600; color: #12305a; font-size: 14px; }
.act-detail { font-weight: 400; color: #6b7c92; }
.act-time { color: #8fa0b5; font-size: 12px; margin-top: 2px; }
