/* Same look as the GSN Help site (support.getsafenow.app): compact, 14px, clean. */
:root {
  --bg: #ffffff; --side: #f6f7f9; --line: #e3e6ea; --text: #1d2330; --muted: #5d6675;
  --brand: #1f5fd1; --brand-soft: #eaf1fd; --error: #a32d2d; --note: #fdf6e7; --note-line: #ecd6a4;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

header { display: flex; align-items: center; gap: 16px; height: 52px; padding: 0 20px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; }
.logo { font-weight: 700; font-size: 15px; color: var(--text); white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo span { color: var(--muted); font-weight: 500; }
.help-link { font-size: 13px; white-space: nowrap; margin-left: auto; }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; }
.me-name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

main { padding: 28px 20px 60px; max-width: 680px; margin: 0 auto; min-width: 0; }
h1 { font-size: 22px; line-height: 1.3; margin: 0 0 6px; }
h2 { font-size: 15px; margin: 26px 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.crumbs { font-size: 12px; margin-bottom: 6px; }
.e2ee { margin-top: 4px; }

.card { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: var(--bg); margin: 14px 0; }
label { display: block; font-weight: 600; font-size: 13px; margin: 10px 0 4px; }
label:first-child { margin-top: 0; }
input[type=text], input[type=password], textarea {
  width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px;
  font: inherit; background: var(--side); color: var(--text); }
input:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); background: var(--bg); }
textarea { resize: vertical; min-height: 64px; }
button { font: inherit; cursor: pointer; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); padding: 6px 14px; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
button.primary:disabled { opacity: .6; cursor: default; }
button.link { border: 0; background: none; color: var(--brand); padding: 2px 0; }
#signin-btn { margin-top: 14px; width: 100%; height: 36px; }
.error { color: var(--error); min-height: 1em; margin: 8px 0 0; font-size: 13px; }
.error:empty { margin: 0; min-height: 0; }
.notice { background: var(--note); border: 1px solid var(--note-line); border-radius: 6px; padding: 10px 12px; margin: 10px 0 0; }
.notice p:last-child { margin: 0; }

.chat { padding: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--side); border-radius: 8px 8px 0 0;
  min-height: 38px; }
.empty { padding: 18px 14px 4px; margin: 0; }
.messages { list-style: none; margin: 0; padding: 14px; display: flex; flex-direction: column; gap: 8px;
  max-height: 60vh; overflow-y: auto; }
.messages:empty { display: none; }
.msg { max-width: 85%; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--side); align-self: flex-start; }
.msg.you { align-self: flex-end; background: var(--brand-soft); border-color: #c9dbf7; }
.msg .who { font-size: 11px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .time { font-size: 11px; color: var(--muted); margin-top: 3px; }
.msg img { display: block; max-width: 100%; max-height: 240px; border-radius: 6px; margin-top: 4px; }
.compose { border-top: 1px solid var(--line); padding: 12px 14px; }
.compose-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.file-btn { margin: 0; font-weight: 400; font-size: 13px; color: var(--brand); cursor: pointer; position: relative; }
.file-btn input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.chat > .notice { margin: 0 14px 14px; }

.past { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 8px; }
.past li { border-bottom: 1px solid var(--line); }
.past li:last-child { border-bottom: 0; }
.past a { display: block; padding: 9px 14px; color: var(--text); }
.past a:hover { background: var(--side); text-decoration: none; }
.past .preview { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.past .meta { display: block; font-size: 12px; color: var(--muted); }

@media (max-width: 760px) {
  header { padding: 0 16px; gap: 12px; }
  main { padding: 20px 16px 48px; }
  .help-link { display: none; }
  .me { margin-left: auto; }
  .me-name { max-width: 150px; }
  .msg { max-width: 92%; }
}

/* Asking before ending a chat, on the page (browsers may block confirm() boxes). */
.confirm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0;
  padding: 10px 12px; border: 1px solid var(--brand); border-radius: 8px; background: var(--bg); }
.confirm-bar[hidden] { display: none; }
.confirm-bar span { flex: 1 1 220px; }
