/* Copyright (c) Beyond Central. All rights reserved. */
/* The Groups app's styles. */

:root {
  --accent: #1f5fbf;
  --bg: #ffffff;
  --fg: #1b1b1b;
  --muted: #5f6368;
  --line: #dadce0;
  --soft: #f4f5f7;
  --error: #b3261e;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #8ab4f8;
    --bg: #131416;
    --fg: #e8eaed;
    --muted: #9aa0a6;
    --line: #3c4043;
    --soft: #24262a;
    --error: #f2b8b5;
  }
}
* { box-sizing: border-box; }
/* Android draws the status bar over the page, edge to edge: a strip of
   the page's background under it, so that what scrolls doesn't show
   through it. */
body::before {
  content: ""; position: fixed; z-index: 10; top: 0; left: 0; right: 0;
  height: env(safe-area-inset-top, 0px); background: var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main {
  max-width: 40rem; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
}
h1 { font-size: 1.35em; margin: 8px 0 12px; }
h2 { font-size: 1.15em; margin: 24px 0 8px; }
[hidden] { display: none !important; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
textarea, input, select {
  width: 100%; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px;
}
button {
  font: inherit; font-weight: 600; border: 0; border-radius: 20px;
  padding: 10px 22px; margin: 8px 8px 8px 0; background: var(--accent); color: var(--bg); cursor: pointer;
}
button.quiet { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button:disabled { opacity: .6; }
.note { background: var(--soft); border-radius: 8px; padding: 10px 14px; }
.small { font-size: .875em; color: var(--muted); }
.error { color: var(--error); }
.link-code { font-family: ui-monospace, monospace; font-size: 2.4em; font-weight: 700; letter-spacing: .08em; text-align: center; margin: 20px 0; }
.link-url { overflow-wrap: anywhere; }
.link-qr { display: block; width: min(64vw, 240px); height: auto; margin: 0 auto 12px; }
.groups { border-top: 1px solid var(--line); margin-bottom: 12px; }
.group {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  margin: 0; padding: 10px 0; border-radius: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: inherit; font-weight: normal;
}
.group .name { display: block; font-size: 1.1em; }
.group .small { display: block; }
.badge {
  flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.1em;
}
.badge img { width: 100%; height: 100%; display: block; }
/* A group's screens: its color, from groupd, dark enough for white on it, in both schemes. */
main.themed button:not(.quiet):not(.group):not(.thread):not(.link) { background: var(--group); color: #fff; }
main.themed .you { background: color-mix(in srgb, var(--group) 18%, var(--bg)); }
main.themed .busy::before { border-top-color: var(--group); }
.group-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 4px; }
.group-head .badge { width: 56px; height: 56px; font-size: 1.5em; }
.group-head h1 { margin: 0; }
.group-head .small { margin: 2px 0 0; }
main.themed .group-head { border-bottom: 3px solid var(--group); padding-bottom: 10px; }
.compose { margin: 12px 0 8px; }
.compose .picked { display: flex; align-items: baseline; gap: 8px; overflow-wrap: anywhere; }
button.link {
  background: none; border: 0; padding: 0; margin: 0; color: var(--muted);
  font-weight: normal; text-decoration: underline; border-radius: 0;
}
.threads { border-top: 1px solid var(--line); margin-bottom: 12px; }
.thread {
  display: block; width: 100%; text-align: left; margin: 0; padding: 10px 0; border-radius: 0;
  border-bottom: 1px solid var(--line); background: transparent; color: inherit; font-weight: normal;
}
.thread .name { display: block; font-size: 1.05em; overflow-wrap: anywhere; }
.thread .small { display: block; }
.thread.failed .small { color: var(--error); }
/* Answers not yet seen: a group's count, and a thread's dot and weight. */
.group .label { flex: 1; min-width: 0; }
.count {
  flex: none; min-width: 1.6em; padding: 0 .45em; border-radius: .8em; text-align: center;
  background: var(--accent); color: var(--bg); font-weight: 700; font-size: .85em; line-height: 1.6em;
}
.thread.unread .name { font-weight: 700; }
.thread.unread .name::before {
  content: ""; display: inline-block; width: .55em; height: .55em; border-radius: 50%;
  margin-right: .45em; vertical-align: .1em; background: var(--group, var(--accent));
}
.call { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.call .you .small { margin: 0 0 4px; }
.attachments li { margin: 8px 0; }
.attachments img { cursor: pointer; }
.files .file { display: flex; align-items: center; gap: 6px; }
.files .file .fname { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.files .file .small { flex: none; }
.asset.attached { border-top: 1px solid var(--line); margin: 8px 0; }
.publish { margin-top: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.assets { border-top: 1px solid var(--line); margin-bottom: 12px; }
.asset { border-bottom: 1px solid var(--line); padding: 10px 0; overflow-wrap: anywhere; }
.asset .name { font-size: 1.05em; }
.asset .small { margin: 2px 0 0; }
.asset .files { margin: 4px 0; }
.outcomes { padding-left: 1em; }
.invite code, .calendar code {
  display: block; padding: 8px; border-radius: 6px; background: var(--soft);
  overflow-wrap: anywhere; font-family: ui-monospace, monospace; font-size: .875em;
}
.shared { border-left: 3px solid var(--line); padding: 2px 12px; margin: 10px 0; overflow-wrap: anywhere; }
.shared .title { font-weight: 600; }
.shared .url { color: var(--muted); }
blockquote.text { margin: 6px 0; white-space: pre-wrap; }
blockquote.message { margin: 8px 0; padding-left: 10px; border-left: 3px solid var(--group, currentColor); white-space: pre-wrap; overflow-wrap: anywhere; }
.files { list-style: none; padding: 0; }
.files img { max-width: 100%; max-height: 240px; border-radius: 6px; display: block; margin: 6px 0; }
.sums { padding-left: 1em; overflow-wrap: anywhere; font-family: ui-monospace, monospace; }
.reply { white-space: pre-wrap; overflow-wrap: anywhere; }
/* What the agent wrote, rendered from its markdown (views.ts agentText). */
.md { white-space: normal; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md pre, .md table, .md blockquote { margin: .5em 0; }
.md ul, .md ol { padding-left: 1.4em; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { font-size: 1em; margin: .8em 0 .3em; }
.md h1, .md h2 { font-size: 1.1em; }
.md blockquote { padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.md code { font-family: ui-monospace, monospace; font-size: .875em; background: var(--soft); padding: 1px 4px; border-radius: 4px; }
.md pre { background: var(--soft); padding: 8px; border-radius: 6px; overflow-x: auto; }
.md pre code { padding: 0; background: none; }
.md table { border-collapse: collapse; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 3px 8px; text-align: left; }
.md hr { border: 0; border-top: 1px solid var(--line); }
.md li:has(> input[type=checkbox]) { list-style: none; }
.md li > input[type=checkbox] { display: inline; width: auto; margin: 0 .4em 0 -1.2em; padding: 0; vertical-align: -1px; }
.you {
  margin: 8px 0 12px 2rem; padding: 8px 12px; border-radius: 14px 14px 4px 14px;
  background: var(--soft); background: color-mix(in srgb, var(--accent) 16%, var(--bg));
}
.you .remark { margin: 0; white-space: pre-wrap; }
details { margin-top: 24px; }
/* Something under way, as an upload or a send: a spinner before its words. */
.busy::before {
  content: ""; display: inline-block; width: .9em; height: .9em; margin-right: .5em; vertical-align: -.1em;
  border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy::before { animation-duration: 2.4s; } }
.asset .earlier { margin-top: 8px; }
.asset .version { margin: 8px 0 0 12px; }
.asset .link { margin: 4px 0; overflow-wrap: anywhere; }
.asset .head { display: flex; align-items: center; gap: 4px; }
.asset .head.folds { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.asset .what { flex: 1; min-width: 0; }
.asset .share { display: flex; align-items: center; gap: 4px; }
.asset .tip:empty { display: none; }
.asset .more { margin-top: 6px; }
button.icon, a.icon {
  flex: none; color: var(--muted); width: 36px; height: 36px; padding: 0; margin: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center;
}
button.icon svg { transition: transform .15s; }
button.icon.open svg { transform: rotate(180deg); }
button.icon.done { color: var(--accent); }
.assets .removed { margin-top: 8px; }
.asset .responses { margin: 4px 0 0 12px; }
.asset .response { border-top: 1px solid var(--line); padding: 6px 0; }
.asset .response .head { display: flex; align-items: center; gap: 4px; }
.asset .response dl { margin: 2px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; }
.asset .response dt { color: var(--muted); }
.asset .response dd { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
