/* Easeo tools: shared styles. Brand colours taken from easeo.co.uk. */
:root {
  --navy: #011e5c;
  --navy-2: #0b2f7a;
  --orange: #f4a432;
  --orange-dark: #d9871a;
  --ink: #222222;
  --ink-soft: #4a4f5c;
  --muted: #6b7280;
  --line: #dde2ec;
  --panel: #f4f5f9;
  --panel-blue: #eff5fe;
  --white: #ffffff;
  --good: #1f7a4d;
  --warn: #a15c00;
  --bad: #b42318;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(1, 30, 92, 0.06), 0 4px 16px rgba(1, 30, 92, 0.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--panel);
  color: var(--ink);
  font-family: 'Mulish', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-2); }
button, input, textarea { font: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.app { display: flex; flex-direction: column; min-height: 100%; height: 100dvh; }
.topbar {
  flex: none;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
}
.topbar-inner { max-width: 980px; margin: 0 auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--navy); min-width: 0; }
.brand img { height: 30px; width: auto; display: block; }
.brand .wordmark { font-weight: 800; font-size: 22px; letter-spacing: -0.02em; color: var(--navy); }
.tool-name { font-weight: 700; color: var(--navy); font-size: 15px; line-height: 1.25; border-left: 1px solid var(--line); padding-left: 12px; }
.topbar .spacer { flex: 1; }
.linkbtn { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; cursor: pointer; padding: 4px; font-size: 14px; }
.linkbtn:hover { color: var(--navy); }

.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.steps li { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: var(--panel); }
.steps li .n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--line); color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.steps li.active { color: var(--navy); background: var(--panel-blue); font-weight: 700; }
.steps li.active .n { background: var(--navy); color: var(--white); }
.steps li.done .n { background: var(--orange); color: var(--white); }

.scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.content { max-width: 820px; margin: 0 auto; padding: 22px 16px 28px; }

/* ---------- chat ---------- */
.msg { display: flex; margin: 0 0 14px; }
.msg .bubble { max-width: 88%; padding: 12px 16px; border-radius: 14px; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.msg.assistant .bubble { background: var(--white); border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.user { justify-content: flex-end; }
.msg.user .bubble { background: var(--navy); color: var(--white); border-top-right-radius: 4px; white-space: pre-wrap; }
.msg.user .bubble.attachment { background: var(--panel-blue); color: var(--navy); border: 1px dashed #9db4e3; font-size: 14px; }
.bubble p { margin: 0 0 10px; }
.bubble p:last-child, .bubble ul:last-child, .bubble ol:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 0 0 10px; padding-left: 22px; }
.bubble li { margin: 2px 0; }
.bubble strong { color: inherit; font-weight: 800; }
.msg.assistant .bubble strong { color: var(--navy); }
.typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa6c2; animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.composer { flex: none; background: var(--white); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.composer-inner { max-width: 820px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; min-height: 48px; max-height: 200px;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--white); color: var(--ink);
  outline: none; line-height: 1.45;
}
.composer textarea:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(11, 47, 122, 0.12); }
.composer .hint { max-width: 820px; margin: 6px auto 0; font-size: 12.5px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 6px; padding: 12px 20px; cursor: pointer; text-decoration: none;
  font-weight: 700; font-size: 15px; line-height: 1.2; transition: background 0.15s, opacity 0.15s;
}
.btn-primary { background: var(--orange); color: var(--white); }
.btn-primary:hover { background: var(--orange-dark); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: var(--navy-2); }
.btn-ghost { background: var(--white); color: var(--navy); border: 1px solid #c4cde0; }
.btn-ghost:hover { background: var(--panel-blue); }
.btn[disabled], .btn.busy { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.send-btn { height: 48px; padding: 0 20px; }

/* ---------- cards ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 20px 22px; margin: 6px 0 18px; }
.card h2 { margin: 0 0 6px; font-size: 21px; color: var(--navy); line-height: 1.25; }
.card h3 { margin: 18px 0 6px; font-size: 16.5px; color: var(--navy); }
.card .sub { margin: 0 0 14px; color: var(--ink-soft); }
.card.highlight { border-color: #f6c983; background: #fffaf2; }
.card.quiet { background: var(--panel-blue); border-color: #d6e3fb; box-shadow: none; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 11.5px; font-weight: 800; color: var(--orange-dark); margin: 0 0 4px; }

table.data { width: 100%; border-collapse: collapse; margin: 8px 0 4px; font-size: 15px; }
table.data th { text-align: left; background: var(--navy); color: var(--white); padding: 9px 12px; font-weight: 700; }
table.data th:first-child { border-top-left-radius: 8px; }
table.data th:last-child { border-top-right-radius: 8px; }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:nth-child(even) td { background: #fafbfd; }
table.data td.k { font-weight: 800; color: var(--navy); width: 30%; }

.vp-box { border-left: 4px solid var(--orange); background: #fffaf2; padding: 12px 16px; border-radius: 6px; font-size: 17px; font-weight: 700; color: var(--navy); margin: 8px 0 14px; }

.field { margin: 0 0 14px; }
.field label { display: block; font-weight: 700; color: var(--navy); margin-bottom: 4px; font-size: 15px; }
.field .help { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.field input[type=text], .field input[type=url], .field input[type=email], .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--white); color: var(--ink);
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(11, 47, 122, 0.12); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-soft); }
.check input { margin-top: 4px; }

.dropzone { border: 2px dashed #b9c6e2; border-radius: 12px; padding: 18px; text-align: center; background: var(--panel-blue); color: var(--navy); cursor: pointer; }
.dropzone.drag { border-color: var(--orange); background: #fffaf2; }
.dropzone input { display: none; }
.filelist { list-style: none; padding: 0; margin: 10px 0 0; }
.filelist li { display: flex; justify-content: space-between; gap: 10px; background: var(--panel); padding: 8px 12px; border-radius: 8px; margin-top: 6px; font-size: 14px; }

.status-list { list-style: none; padding: 0; margin: 10px 0 0; }
.status-list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; }
.status-list .dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--line); margin-top: 7px; }
.status-list .ok .dot { background: var(--good); }
.status-list .fail .dot { background: var(--bad); }
.status-list .busy .dot { background: var(--orange); animation: blink 1.2s infinite; }

.score { display: inline-flex; align-items: baseline; gap: 2px; font-weight: 800; border-radius: 8px; padding: 4px 10px; font-size: 18px; }
.score small { font-size: 12px; font-weight: 700; opacity: 0.8; }
.score.hi { background: #e3f4ea; color: var(--good); }
.score.mid { background: #fff1db; color: var(--warn); }
.score.lo { background: #fde7e5; color: var(--bad); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .url { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
blockquote.quote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid #b9c6e2; background: var(--panel); border-radius: 4px; font-style: italic; }
.obs { margin: 4px 0 12px 15px; font-size: 14.5px; color: var(--ink-soft); }

.notice { font-size: 13.5px; color: var(--muted); margin: 12px 0 0; }
.error { background: #fdecea; border: 1px solid #f5c2bd; color: #7a1c13; padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: 14.5px; }
.footer-note { text-align: center; font-size: 12px; color: var(--muted); padding: 12px 16px 18px; }
.footer-note a { color: var(--muted); }
.hidden { display: none !important; }
#turnstile-box { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 50; }

@media (max-width: 640px) {
  .topbar { padding: 8px 12px; }
  .topbar-inner { gap: 8px 10px; }
  .brand img { height: 24px; }
  .tool-name { font-size: 13px; padding-left: 10px; flex: 1 1 55%; min-width: 0; }
  .composer .hint { display: none; }
  .topbar .spacer { display: none; }
  .steps li:not(.active) .lbl { display: none; }
  .steps li { padding: 3px 7px; }
  #afresh-top { font-size: 13px; margin-left: auto; }
  .msg .bubble { max-width: 94%; }
  .card { padding: 16px; }
  table.data td.k { width: 36%; }
  .send-btn { padding: 0 14px; }
}
@media print {
  .topbar, .composer, .btn-row, .footer-note { display: none !important; }
  .app { height: auto; }
  .scroll { overflow: visible; }
}
