/* The consent of the site chat (domain/site_consent.py): a page of text in the look of the chat,
   its colours, its font, its ticket mark and its radius, light like the chat in both themes, with
   nothing loaded from outside (the policy of the chat host is style-src 'self'). */

:root {
  color-scheme: light;
  --surface: #ffffff;
  --page: #f1f2f4;
  --ink: #1a1a1a;
  --ink-2: #5f646b;
  --line: #e3e5e8;
  --accent: #5e7a20;
  --accent-ink: #ffffff;
  --ticket: #4dc57c;
  --link: #3f5a12;
  --shadow: 0 2px 6px rgba(26, 26, 26, 0.1), 0 12px 30px rgba(26, 26, 26, 0.16);
  --font: "Fira Sans", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 680px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 20px 32px;
  background: var(--surface);
}

a {
  color: var(--link);
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* the way back to the chat, at the top (a tab the chat opened has no Back on a phone) */
.back {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  color: var(--link);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.back .ic {
  width: 18px;
  height: 18px;
  flex: none;
}

/* the head of the chat: the ticket mark of etema.ru on its green square, and the name */
.head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0 13px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--ticket);
  color: #ffffff;
}

.avatar .ic {
  width: 26px;
  height: 26px;
}

.name {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.2;
}

h1 {
  margin: 28px 0 8px;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: break-word;
}

p {
  margin: 0 0 14px;
  padding-left: 1.75rem;
  overflow-wrap: break-word;
}

/* the edition: the paragraph that follows the title, smaller and muted */
h1 + p {
  margin-bottom: 24px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
}

/* the number of a paragraph hangs in the margin */
.num {
  float: left;
  width: 1.5rem;
  margin-left: -1.75rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.foot {
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
}

.foot a {
  color: inherit;
}

/* on a wide screen the column is a card on the grey page, like the page of the link in a mail */
@media (min-width: 700px) {
  main {
    min-height: 0;
    margin: 24px auto;
    padding: 0 32px 32px;
    border-radius: 16px;
    box-shadow: var(--shadow);
  }

  .head {
    padding-top: 22px;
  }
}

@media print {
  body,
  main {
    background: #fff;
    box-shadow: none;
  }

  body,
  h1,
  p,
  h1 + p,
  .name,
  .num,
  .foot,
  a {
    color: #000;
  }

  main {
    max-width: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
  }

  .avatar,
  .back {
    display: none;
  }

  .head {
    padding-top: 0;
    border-bottom-color: #000;
  }

  p {
    break-inside: avoid;
  }
}
