/* Easy Cloud IT Solutions brand: navy #00136B, cloud blue #2988BF */
:root {
  --bg: #f3f6fa;
  --panel: #ffffff;
  --text: #121a30;
  --muted: #5a6478;
  --line: #dbe3ee;
  --accent: #00136b;      /* buttons, links (navy) */
  --accent-ink: #ffffff;
  --highlight: #2988bf;   /* stripes, hover borders (cloud blue) */
  --title: #00136b;
  --user: #e2eff8;
  --warn: #b4451f;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --panel: #131a2d;
    --text: #e6ecf5;
    --muted: #9aa7bd;
    --line: #26314a;
    --accent: #4fa8dc;
    --accent-ink: #061022;
    --highlight: #2988bf;
    --title: #e6ecf5;
    --user: #17304f;
    --warn: #f08a62;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Segoe UI", "Segoe UI Variable", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
}
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 3px solid var(--highlight); background: var(--panel);
}
.brand { display: flex; gap: 12px; align-items: center; }
.brand { min-width: 0; }
.logo { display: block; flex-shrink: 0; background: #fff; border-radius: 8px; padding: 2px 6px; line-height: 0; }
.logo img { display: block; height: 40px; width: auto; }
.brand-text { border-left: 1px solid var(--line); padding-left: 12px; min-width: 0; }
@media (max-width: 520px) {
  .logo img { height: 32px; }
  .brand p { display: none; }
}
.brand h1 { font-size: 18px; margin: 0; color: var(--title); }
.brand p { margin: 0; color: var(--muted); font-size: 13px; }
button { font: inherit; cursor: pointer; }
.ghost { background: none; border: 1px solid var(--line); color: var(--text); padding: 6px 12px; border-radius: 999px; }
.ghost:hover { border-color: var(--highlight); }

.layout { flex: 1; display: grid; grid-template-columns: 1fr 300px; gap: 16px; padding: 16px; min-height: 0; max-width: 1200px; width: 100%; margin: 0 auto; }
.chat { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--line); overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--user); border-color: transparent; white-space: pre-wrap; }
.bubble p:first-child { margin-top: 0; }
.bubble p:last-child { margin-bottom: 0; }
.bubble table { border-collapse: collapse; font-size: 14px; display: block; overflow-x: auto; }
.bubble th, .bubble td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; }
.bubble a { color: var(--accent); }
.bubble code { background: var(--bg); padding: 1px 4px; border-radius: 4px; }
.status { color: var(--muted); font-size: 13px; font-style: italic; margin-top: 6px; }
.sources { margin-top: 8px; font-size: 13px; border-top: 1px dashed var(--line); padding-top: 6px; }
.sources ul { margin: 4px 0 0; padding-left: 18px; }
.ticket-note { margin-top: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--warn); color: var(--warn); font-size: 14px; }
.error { color: var(--warn); }

.starters { padding: 0 16px 12px; }
.starters-label { margin: 6px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.starters-label small { font-weight: 400; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* Cloud blue chips; deep navy text passes contrast at 14px where white wouldn't */
.chips button { background: var(--highlight); border: 0; color: #000a3d; padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chips button:hover { background: #4aa3d6; }
/* Quick fixes: outlined so they read as a different (instant, no-AI) kind of help */
.chips.quick button { background: transparent; color: var(--text); border: 1.5px solid var(--highlight); }
.chips.quick button:hover { background: var(--user); }

.quickfix ol { padding-left: 22px; margin: 8px 0; }
.quickfix li { margin-bottom: 6px; }
.quickfix-badge { display: inline-block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.quickfix-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.quickfix-actions button { border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--highlight); background: transparent; color: var(--text); }
.quickfix-actions button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.quickfix-actions button:disabled { opacity: 0.5; cursor: default; }
.composer textarea:focus { outline: 2px solid var(--highlight); outline-offset: -1px; border-color: transparent; }

.composer { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); max-height: 160px; }
/* Send uses the logo's cloud blue; 19px bold white keeps it readable (large-text contrast) */
.composer .send { background: var(--highlight); color: #ffffff; border: 0; border-radius: 10px; padding: 0 18px; font-size: 19px; font-weight: 700; }
.composer .send:hover:not(:disabled) { background: #1f73a6; }
.composer button:disabled { opacity: .5; cursor: wait; }
.composer .attach { background: none; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font-size: 20px; line-height: 1; color: var(--text); }
.composer .attach:hover:not(:disabled) { border-color: var(--highlight); }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 0; border-top: 1px solid var(--line); }
.attachments[hidden] { display: none; }
.attachments:not([hidden]) + .composer { border-top: 0; }
.thumb { position: relative; }
.thumb img { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.thumb button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--text); color: var(--panel); font-size: 13px; line-height: 22px; padding: 0; }
.msg-images { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.msg-images img { max-width: 160px; max-height: 120px; border-radius: 8px; display: block; }
.disclaimer { margin: 0; padding: 0 16px 12px; color: var(--muted); font-size: 12px; }

.side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; overflow-y: auto; }
.side h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; padding-left: 8px; border-left: 3px solid var(--highlight); }
.side h2:not(:first-child) { margin-top: 20px; }
.profile { margin: 0; font-size: 14px; }
.profile dt { font-weight: 600; }
.profile dd { margin: 0 0 8px; color: var(--muted); }
.tickets { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.tickets li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.muted { color: var(--muted); }

/* Plans, account and "Need a person?" */
.side section { margin-bottom: 20px; font-size: 14px; }
.side section p { margin: 4px 0; }
.btn, button.primary, .ghost.small { display: inline-flex; align-items: center; justify-content: center; gap: 4px; font: inherit; font-size: 14px; font-weight: 600; border-radius: 999px; padding: 7px 12px; cursor: pointer; text-decoration: none; }
.btn { border: 1.5px solid var(--highlight); background: transparent; color: var(--text); }
.btn:hover { background: var(--user); }
button.primary { border: 1.5px solid var(--accent); background: var(--accent); color: var(--accent-ink); }
button.primary:disabled { opacity: .6; cursor: default; }
.ghost.small { padding: 4px 10px; font-weight: 500; }
.person-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.live-buy { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.live-buy label { font-weight: 600; display: block; margin-bottom: 6px; }
.live-row { display: flex; gap: 8px; }
.live-row select { flex: 1; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); }
.meter { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.meter span { display: block; height: 100%; background: var(--highlight); }
.plans { margin-top: 10px; }
.plan-cards { display: grid; gap: 10px; margin: 10px 0; }
.bubble .plan-cards { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.plan-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; background: var(--panel); }
.plan-card h3 { margin: 0; font-size: 15px; color: var(--title); }
.plan-card .plan-price { font-weight: 700; margin: 0; }
.plan-card .plan-price small { font-weight: 400; color: var(--muted); }
.plan-card .muted { font-size: 13px; margin: 2px 0 8px; flex: 1; }
.access { margin-top: 12px; }
.access summary { cursor: pointer; color: var(--muted); }
.access code { display: block; font-size: 12px; word-break: break-all; background: var(--bg); padding: 6px 8px; border-radius: 6px; margin: 6px 0; }
.restore { display: flex; gap: 6px; margin-top: 8px; }
.restore input { flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); }

@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; padding: 8px 16px 16px; }
  .side { order: 2; }
  .chat { min-height: 70vh; }
  .bubble { max-width: 100%; }
}

/* ---------- Inside the website pop-up (widget.js, ?embed=1) ---------- */
/* The pop-up has its own title bar, so the page header shrinks to two buttons:
   "Plans & help" (opens the account panel over the chat) and "New chat".
   The frame itself never scrolls; only the conversation does. */
.embed-only { display: none; }
html.embed, html.embed body { height: 100%; overflow: hidden; }
html.embed .top { justify-content: space-between; gap: 8px; padding: 6px 10px; border-bottom-width: 2px; }
html.embed .top .embed-only { display: inline-flex; }
html.embed .top .ghost { font-size: 14px; padding: 5px 12px; }
html.embed .brand { display: none; }
html.embed .layout { display: block; position: relative; flex: 1; min-height: 0; padding: 8px; }
html.embed .chat { height: 100%; min-height: 0; }
html.embed .log { min-height: 110px; }
html.embed .starters { max-height: 30vh; overflow-y: auto; flex-shrink: 0; padding-top: 4px; }
html.embed .bubble { max-width: 100%; }
/* Plans & help: a full-size panel over the chat, one readable column. */
html.embed .side { display: none; position: absolute; inset: 0; z-index: 5; border: 0; border-radius: 0; padding: 0 16px 24px; overflow-y: auto; font-size: 15px; }
html.embed.side-open .side { display: block; }
html.embed .side-head { display: flex; position: sticky; top: 0; z-index: 1; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -16px 14px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); }
html.embed .side-head strong { font-size: 16px; color: var(--title); }
html.embed .side section { font-size: 15px; }
html.embed .side .plan-cards { grid-template-columns: 1fr; }
html.embed .plan-card { padding: 14px 16px; }
html.embed .plan-card h3 { font-size: 16px; }
html.embed .plan-card .muted { font-size: 14px; line-height: 1.45; }
html.embed .plan-card .primary { padding: 9px 12px; }
.open-side { margin-top: 8px; }

/* ---------- Live technician chat ---------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.dot.on { background: #1f9d55; }
.dot.wait { background: #d79b00; animation: pulse 1.6s ease-in-out infinite; }
.dot.off { background: var(--muted); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot.wait { animation: none; } }
.live-avail { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 8px; }
.live-avail .dot { margin-top: 6px; }
.live-panel { padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--user); border-radius: var(--radius) var(--radius) 0 0; }
.live-head { display: flex; align-items: center; gap: 8px; }
.live-time { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.live-time.over { color: var(--warn); }
.live-panel p { margin: 4px 0 0 17px; }
.live-options { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 17px; }
.live-urgent { margin: 8px 0 0 17px; padding: 8px 10px; border: 1px solid var(--warn); border-radius: 10px; background: var(--panel); font-size: 14px; }
.live-urgent strong { color: var(--warn); }
.live-urgent p { margin: 2px 0 0; }
.live-urgent ul { margin: 4px 0 0; padding-left: 18px; }
.live-urgent a { color: var(--accent); overflow-wrap: anywhere; }
.live-log { display: flex; flex-direction: column; gap: 12px; }
.msg.tech .bubble { border-color: var(--highlight); border-left-width: 3px; white-space: normal; }
.msg.tech .who { display: block; font-size: 12px; font-weight: 600; color: var(--highlight); margin-bottom: 2px; }
.msg.system { justify-content: center; }
.msg.system .bubble { max-width: 92%; border: 0; background: none; color: var(--muted); font-size: 14px; text-align: center; padding: 2px 8px; }
.msg.system .bubble ul { display: inline-block; text-align: left; margin: 0; padding-left: 18px; }

/* Terms agreement (required before buying) and legal links */
.terms-agree { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 12.5px; font-weight: 400 !important; color: var(--text); line-height: 1.4; cursor: pointer; }
.live-buy .terms-agree { display: flex; margin-bottom: 0; }
.terms-agree input { margin: 2px 0 0; flex: none; width: 16px; height: 16px; accent-color: var(--accent); }
.terms-agree a, .legal-links a, .plan-more a, .disclaimer a { color: var(--accent); }
.terms-agree.need { border-color: var(--warn); box-shadow: 0 0 0 2px color-mix(in srgb, var(--warn) 30%, transparent); }
.terms-agree.need::after { content: "Please tick to continue"; display: none; }
.plan-more { margin: 0 0 6px; font-size: 13px; }
.legal-links { margin: 18px 0 4px; font-size: 12.5px; color: var(--muted); }
.live-buy.flash { animation: flashbox 1.6s ease; border-radius: 10px; }
@keyframes flashbox { 0%, 60% { box-shadow: 0 0 0 3px var(--highlight); } 100% { box-shadow: 0 0 0 0 transparent; } }
