/* Otipi: dashboard, admin panel, sign-in pages and documentation.
   Same hand as the landing page: white, black type, one ember accent.
   Written with logical properties, so one sheet serves Hebrew and Arabic
   (right to left) and Russian and English (left to right). */

:root {
  --paper: #ffffff;
  --paper-2: #f5f4f1;
  --ink: #15120f;
  --ink-2: #4f4940;
  --ink-3: #726b5f;
  --line: #e3e1db;
  --line-2: #eeece7;
  --edge: #cfcac0;
  --accent: #f0481c;
  --green: #1e8e4e;
  --red: #c3301a;
  --amber: #c98a00;
  --blue: #2b83f6;
  --night: #15120f;

  --font: "IBM Plex Sans", "IBM Plex Sans Hebrew", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  /* Plex Mono has no Hebrew or Arabic, so those letters inside code fall to Plex Sans, not to a system face */
  --mono: "IBM Plex Mono", "IBM Plex Sans Hebrew", "IBM Plex Sans Arabic", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --side: 248px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
pre,
fieldset {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

fieldset {
  padding: 0;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

.ltr {
  direction: ltr;
  unicode-bidi: isolate;
}

/* A Latin value under a Hebrew label still lines up with the label */
dd.ltr {
  text-align: -webkit-match-parent;
  text-align: match-parent;
}

.mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

/* Browsers give <code> their own monospace face; ours has to be asked for by name */
code,
pre {
  font-family: var(--mono);
}

pre code {
  font: inherit;
}

.nowrap {
  white-space: nowrap;
}

/* ---------- Icons (Phosphor, each loaded as a mask) ---------- */

.ic {
  display: inline-block;
  flex: none;
  inline-size: 1em;
  block-size: 1em;
  background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat;
  mask: var(--ic) center / contain no-repeat;
}

.ic-chat { --ic: url("https://cdn.jsdelivr.net/npm/@phosphor-icons/core@2.1.1/assets/fill/chat-circle-fill.svg"); }
.ic-wa { --ic: url("https://cdn.jsdelivr.net/npm/@phosphor-icons/core@2.1.1/assets/fill/whatsapp-logo-fill.svg"); }
.ic-mail { --ic: url("https://cdn.jsdelivr.net/npm/@phosphor-icons/core@2.1.1/assets/fill/envelope-simple-fill.svg"); }
.ic-globe { --ic: url("https://cdn.jsdelivr.net/npm/@phosphor-icons/core@2.1.1/assets/bold/globe-bold.svg"); }

/* ---------- Wordmark ---------- */

.mark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.13em;
  direction: ltr;
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: -0.035em;
}

.mark::after {
  content: "";
  width: 0.34em;
  height: 0.34em;
  border-radius: 0.07em;
  background: var(--accent);
}

/* ---------- Frame: dark side panel and the page beside it ---------- */

.side {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 20;
  width: var(--side);
  background: var(--night);
  color: #fff;
}

.side__top {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 28px 16px 20px;
}

.side .mark {
  padding-inline: 12px;
  margin-block-end: 30px;
}

.side__burger {
  display: none;
}

.side__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.side__nav {
  flex: 1;
  overflow-y: auto;
}

.side__group + .side__group {
  margin-block-start: 10px;
  padding-block-start: 10px;
  border-block-start: 1px solid rgba(255, 255, 255, 0.1);
}

.side__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.97rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.side__link:hover {
  color: #fff;
}

.side__link.is-active {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
  font-weight: 500;
}

.side__count {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}

.side__foot {
  display: grid;
  gap: 6px;
  padding: 16px 12px 0;
  border-block-start: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.86rem;
}

/* The address is written left to right, but it lines up with the rest of the panel */
.side__user {
  overflow-wrap: anywhere;
  color: rgba(255, 255, 255, 0.6);
  text-align: -webkit-match-parent;
  text-align: match-parent;
}

.side__out {
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-weight: 500;
  text-align: start;
}

.side__out:hover {
  color: var(--accent);
}

/* ---------- Choosing a language ---------- */

/* A menu that opens on a click: the current language, and the others under it */
.langpick {
  position: relative;
}

.langpick summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.langpick summary::-webkit-details-marker {
  display: none;
}

.langpick summary:hover,
.langpick[open] summary {
  color: var(--ink);
}

.langpick .ic {
  font-size: 1.1em;
}

.langpick__menu {
  position: absolute;
  inset-block-start: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 30;
  display: grid;
  gap: 2px;
  min-width: 170px;
  padding: 6px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 20px 40px -20px rgba(21, 18, 15, 0.35);
}

.langpick__menu a,
.langpick__menu span,
.langpick__menu button {
  padding: 8px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink-2);
  text-align: start;
}

.langpick__menu a:hover,
.langpick__menu button:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.langpick__menu [aria-current] {
  color: var(--ink);
  font-weight: 600;
}

/* In the side panel the menu opens in place, on the dark ground */
.langpick--side summary {
  color: rgba(255, 255, 255, 0.6);
}

.langpick--side summary:hover,
.langpick--side[open] summary {
  color: #fff;
}

.langpick--side .langpick__menu {
  position: static;
  min-width: 0;
  margin-block-start: 4px;
  padding: 0;
  background: none;
  box-shadow: none;
}

.langpick--side .langpick__menu button {
  padding: 4px 0;
  padding-inline-start: 24px;
  color: rgba(255, 255, 255, 0.72);
}

.langpick--side .langpick__menu button:hover {
  background: none;
  color: #fff;
}

/* For visitors, under a sign-in page: the four languages side by side */
.langs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  font-size: 0.9rem;
  color: var(--ink-3);
}

.langs a:hover {
  color: var(--ink);
}

.langs [aria-current] {
  color: var(--ink);
  font-weight: 500;
}

.main {
  margin-inline-start: var(--side);
  padding: 44px 48px 96px;
}

.main__in {
  max-width: 980px;
}

.main__in--wide {
  max-width: 1280px;
}

.pagehead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 24px;
  margin-block-end: 28px;
}

.pagehead h1 {
  font-size: clamp(1.6rem, 2.6vw, 2.05rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.pagehead__sub {
  max-width: 46em;
  margin-block-start: 6px;
  color: var(--ink-2);
}

.pagehead__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.98rem;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn--sm {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.btn--block {
  width: 100%;
}

.btn--ink {
  background: var(--ink);
  color: #fff;
}

.btn--ink:hover {
  background: #2c2620;
}

.btn--line {
  background: none;
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.btn--line:hover {
  background: var(--paper-2);
}

.btn--danger {
  background: var(--red);
  color: #fff;
}

.link {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--edge);
  text-underline-offset: 3px;
  cursor: pointer;
}

.link:hover {
  text-decoration-color: var(--ink);
}

/* A quiet action that is a form's button but reads as a link */
button.link {
  padding: 0;
  border: 0;
  background: none;
}

/* ---------- A switch: a button that shows "on" or "off" and flips when pressed ---------- */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 500;
  font-size: 0.95rem;
  text-align: start;
}

.switch__track {
  position: relative;
  flex: none;
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: var(--edge);
  transition: background-color 0.15s ease;
}

.switch__track::after {
  content: "";
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(21, 18, 15, 0.25);
  transition: inset-inline-start 0.15s ease;
}

.switch[aria-checked="true"] .switch__track {
  background: var(--ink);
}

.switch[aria-checked="true"] .switch__track::after {
  inset-inline-start: 21px;
}

/* A switch in the head of a page keeps its place beside the title: the words
   under the title wrap in the room that is left, down to a phone's width. */
.pagehead:has(.switch) > :first-child {
  flex: 1 1 320px;
  min-width: 0;
}

.link--danger {
  color: var(--red);
}

/* ---------- Notices ---------- */

.notice {
  margin-block-end: 24px;
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--paper-2);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.notice--ok {
  background: #e8f5ed;
  color: #14613a;
}

.notice--err {
  background: #fdebe7;
  color: #96220f;
}

/* ---------- Numbers at the top of a page ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px 32px;
  padding-block-end: 30px;
  border-block-end: 1px solid var(--line);
}

.stats--two {
  grid-template-columns: repeat(2, minmax(0, 260px));
}

.stat__n {
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat__l {
  margin-block-start: 2px;
  color: var(--ink-2);
}

.stat__s {
  font-size: 0.86rem;
  color: var(--ink-3);
}

/* ---------- Sections of a page ---------- */

.block {
  margin-block-start: 44px;
}

.block h2 {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.block > h2 {
  margin-block-end: 14px;
}

.block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-block-end: 14px;
}

/* One thing among several of its kind: a domain, a request */
.block--item {
  margin-block-start: 16px;
  padding: 22px 24px;
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--line);
}

.block--new {
  margin-block: 0 28px;
  padding: 22px 24px;
  border-radius: 16px;
  background: var(--paper-2);
}

.hint {
  max-width: 52em;
  margin-block: 10px 0;
  font-size: 0.92rem;
  color: var(--ink-3);
}

.block > h2 + .hint {
  margin-block: -6px 14px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-block-start: 18px;
}

.row--end {
  justify-content: flex-end;
  margin: 0;
}

.total {
  margin-block-start: 16px;
  font-size: 1.05rem;
}

.plain-list {
  display: grid;
  gap: 8px;
}

.plain-list li::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-end: 10px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: middle;
}

/* ---------- Tables ---------- */

.tablewrap {
  overflow-x: auto;
}

.tbl {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.tbl th {
  padding: 0 12px 10px;
  border-block-end: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: start;
  white-space: nowrap;
}

.tbl td {
  padding: 13px 12px;
  border-block-end: 1px solid var(--line-2);
  vertical-align: middle;
  text-align: start;
}

.tbl th:first-child,
.tbl td:first-child {
  padding-inline-start: 0;
}

.tbl th:last-child,
.tbl td:last-child {
  padding-inline-end: 0;
}

.tbl__icon {
  width: 40px;
}

.tbl__main {
  font-weight: 500;
  overflow-wrap: anywhere;
}

a.tbl__main:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Who the message went to: one line, with its "test" tag beside it */
.tbl__to {
  white-space: nowrap;
}

.tbl__to .tbl__main {
  display: inline-block;
  max-width: 17em;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.tbl__muted {
  color: var(--ink-3);
}

/* A second, quieter line inside a cell: the person's name under their address */
.tbl__sub {
  display: block;
  font-size: 0.86rem;
  color: var(--ink-3);
}

/* The person: wide enough for an address of ordinary length to stay on one line */
.tbl__person {
  min-width: 13.5em;
}

/* The name of a thing that is being checked: its words are never broken in the middle */
.tbl__what {
  min-width: 9em;
  overflow-wrap: normal;
}

/* A second table, or a note, right under a table */
.tablewrap + .tablewrap,
.tablewrap + .notice {
  margin-block-start: 22px;
}

/* A column that is only worth its room in a wide window */
@media (max-width: 1199px) {
  .tbl__wide {
    display: none;
  }
}

.tbl__end {
  text-align: end;
}

.tag {
  display: inline-block;
  margin-inline-start: 8px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--paper-2);
  color: var(--ink-3);
  font-size: 0.76rem;
  font-weight: 500;
  vertical-align: middle;
}

/* Something is wrong with this row: the account is blocked */
.tag--alert {
  background: #fdebe7;
  color: #96220f;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  white-space: nowrap;
}

.status::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9b2a5;
}

.status--sent::before { background: var(--amber); }
.status--delivered::before { background: var(--green); }
.status--opened::before { background: var(--blue); }
.status--failed::before,
.status--bounced::before { background: var(--red); }

.chan {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
}

.chan--sms { background: #2fc84a; }
.chan--whatsapp { background: #25d366; font-size: 18px; }
.chan--email { background: var(--blue); }

.empty {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 28px 24px;
  border-radius: 16px;
  background: var(--paper-2);
  color: var(--ink-2);
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-block-start: 20px;
}

/* ---------- Chart ---------- */

.chart {
  display: block;
  width: 100%;
  height: auto;
  max-height: 210px;
  direction: ltr;
}

.chart__bar {
  fill: #dcd8cf;
}

.chart__bar--now {
  fill: var(--accent);
}

.chart__label {
  fill: var(--ink-3);
  font-family: var(--font);
  font-size: 12px;
}

/* ---------- First steps ---------- */

.steps {
  display: grid;
  gap: 10px;
  counter-reset: step;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
}

.steps a {
  font-weight: 500;
}

.steps a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.steps .is-done::before {
  content: "";
  background: var(--ink)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5.5 12.5l4.5 4.5 8.5-9.5'/%3E%3C/svg%3E")
    center / 16px no-repeat;
  box-shadow: none;
}

.steps .is-done a {
  color: var(--ink-3);
  text-decoration: line-through;
}

/* ---------- Forms ---------- */

.form {
  display: grid;
  gap: 16px;
  max-width: 480px;
}

.form--grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 720px;
}

.form--grid .form__actions {
  grid-column: 1 / -1;
}

.form__actions {
  margin-block-start: 4px;
}

.inline,
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.inline .field,
.filters .field {
  flex: 1 1 180px;
  max-width: 320px;
}

.inline--tight {
  gap: 8px;
}

/* A note to the customer: wide enough for its own hint to be read */
.inline--tight .input--sm {
  min-width: min(100%, 320px);
}

.filters {
  margin-block-end: 24px;
}

.tablewrap + .inline,
.tablewrap + .form {
  margin-block-start: 24px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field__label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-2);
}

.field__hint {
  font-size: 0.86rem;
  color: var(--ink-3);
}

.input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--edge);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:hover {
  border-color: #b0aa9e;
}

.input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(240, 72, 28, 0.18);
}

.input[disabled],
.input[readonly] {
  background: var(--paper-2);
  color: var(--ink-3);
}

.input--area {
  min-height: 150px;
  padding-block: 12px;
  line-height: 1.5;
  resize: vertical;
}

.input--sm {
  width: auto;
  min-width: 220px;
  min-height: 36px;
  border-radius: 10px;
  font-size: 0.9rem;
}

select.input {
  padding-inline-end: 34px;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("https://cdn.jsdelivr.net/npm/@phosphor-icons/core@2.1.1/assets/bold/caret-down-bold.svg");
  background-repeat: no-repeat;
  background-size: 13px;
  background-position: left 13px center;
}

[dir="ltr"] select.input {
  background-position: right 13px center;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}

.checks legend {
  margin-block-end: 8px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--ink);
}

/* "Are you sure?": the first click opens the real button */
.confirm {
  position: relative;
  display: inline-block;
}

.confirm summary {
  list-style: none;
}

.confirm summary::-webkit-details-marker {
  display: none;
}

.confirm[open] summary {
  display: none;
}

.confirm__body {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--ink-2);
}

/* ---------- Facts about one thing ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px 28px;
}

.facts dt,
.record dt {
  font-size: 0.82rem;
  color: var(--ink-3);
}

.facts dd {
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* A long value, such as an address, gets the whole row */
.facts__wide {
  grid-column: 1 / -1;
}

.record {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 12px 20px;
  margin-block-start: 14px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--paper-2);
}

/* Several records in a row (a domain's DNS records) sit closer together */
.record + .record {
  margin-block-start: 8px;
}

.record dd {
  overflow-wrap: anywhere;
  user-select: all;
}

/* ---------- Code and message bodies ---------- */

.codeblock {
  position: relative;
  border-radius: 14px;
  background: #1e1a16;
  color: #f3eee3;
}

.codeblock pre {
  padding: 18px 20px;
  padding-inline-end: 96px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.65;
  text-align: left;
  white-space: pre;
}

/* A text to copy rather than code to read: long lines wrap, and the button sits above the first one */
.codeblock--prose pre {
  padding-block-start: 52px;
  padding-inline-end: 20px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.codeblock__copy {
  position: absolute;
  inset-block-start: 10px;
  right: 10px;
  padding: 5px 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background-color 0.15s ease;
}

.codeblock__copy:hover {
  background: rgba(255, 255, 255, 0.18);
}

.codeblock__copy.is-done {
  background: var(--green);
}

.body {
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--paper-2);
  font-family: var(--font);
  font-size: 0.98rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fold {
  margin-block-start: 14px;
}

.fold summary {
  list-style: none;
  cursor: pointer;
}

.fold summary::-webkit-details-marker {
  display: none;
}

.fold--row {
  margin: 0;
  border-block-end: 1px solid var(--line-2);
}

.fold--row summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  padding-block: 14px;
}

.fold--row summary:hover .fold__title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.fold__title {
  font-weight: 500;
}

.fold__body {
  display: grid;
  gap: 14px;
  padding-block-end: 18px;
}

.sample {
  display: grid;
  gap: 6px;
}

.sample__subject {
  font-size: 0.92rem;
  color: var(--ink-2);
}

.mailframe {
  display: block;
  width: 100%;
  height: 420px;
  margin-block-start: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--paper-2);
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
}

.timeline li::before {
  content: "";
  align-self: center;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.timeline span {
  color: var(--ink-3);
  font-size: 0.9rem;
}

.timeline em {
  flex-basis: 100%;
  padding-inline-start: 21px;
  color: var(--ink-2);
  font-size: 0.92rem;
  font-style: normal;
}

/* ---------- Usage ---------- */

.meter {
  max-width: 560px;
}

.meter + .meter {
  margin-block-start: 18px;
}

.meter__top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-block-end: 8px;
  color: var(--ink-2);
}

.meter__top b {
  color: var(--ink);
  font-weight: 600;
}

progress {
  display: block;
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 4px;
  background: var(--line-2);
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
}

progress::-webkit-progress-bar {
  background: var(--line-2);
}

progress::-webkit-progress-value {
  border-radius: 4px;
  background: var(--ink);
}

progress::-moz-progress-bar {
  border-radius: 4px;
  background: var(--ink);
}

/* ---------- Small centred pages: sign in, sign up, errors ---------- */

body.plain {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 32px 20px;
  background: var(--paper-2);
}

/* The box, and the language links under it */
.plain__wrap {
  display: grid;
  gap: 20px;
  width: min(100%, 420px);
}

.plain__box {
  padding: 40px 36px 36px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -36px rgba(21, 18, 15, 0.4);
}

.plain__box h1 {
  margin-block: 28px 20px;
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.plain__text {
  margin-block-end: 22px;
  color: var(--ink-2);
}

.plain__links {
  margin-block-start: 20px;
  text-align: center;
}

.plain .form {
  max-width: none;
}

/* ---------- Documentation ---------- */

.docs__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 48px);
  border-block-end: 1px solid var(--line);
}

.docs__nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.docs__grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  max-width: 1120px;
  margin-inline: auto;
  padding: 44px clamp(20px, 4vw, 48px) 120px;
}

.docs__toc {
  position: sticky;
  inset-block-start: 28px;
  display: grid;
  align-content: start;
  gap: 10px;
  height: max-content;
  color: var(--ink-2);
}

.docs__toc a:hover {
  color: var(--ink);
}

.docs__body {
  min-width: 0;
  max-width: 760px;
}

.docs__body h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.docs__body .lead {
  margin-block: 14px 0;
  font-size: 1.12rem;
  color: var(--ink-2);
}

.docs__body h2 {
  margin-block: 56px 14px;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  scroll-margin-top: 24px;
}

.docs__body p {
  margin-block: 12px;
}

.docs__body .codeblock,
.docs__body .tablewrap {
  margin-block: 16px;
}

.docs__body .tbl {
  min-width: 0;
}

/* ---------- Narrow screens ---------- */

@media (max-width: 900px) {
  /* The side panel becomes a dark capsule at the top that opens into the menu */
  .side {
    inset-block: 10px auto;
    inset-inline: 12px;
    width: auto;
    border-radius: 28px;
    box-shadow: 0 20px 40px -16px rgba(21, 18, 15, 0.5);
  }

  .side__top {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    height: auto;
    padding: 0;
  }

  .side .mark {
    margin: 0;
    padding: 17px 22px;
    font-size: 1.3rem;
  }

  .side__burger {
    display: block;
    margin-inline-end: 8px;
    padding: 9px 18px;
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
  }

  .side__body {
    display: none;
    grid-column: 1 / -1;
    max-height: calc(100dvh - 110px);
    padding: 4px 12px 18px;
    overflow-y: auto;
  }

  .side__toggle:checked ~ .side__body {
    display: block;
  }

  .side__foot {
    margin-block-start: 14px;
  }

  .main {
    margin-inline-start: 0;
    padding: 96px 20px 72px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form--grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .record {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .record > div + div {
    margin-block-start: 10px;
  }

  .docs__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-block-start: 28px;
  }

  .docs__toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
  }
}

@media (max-width: 640px) {
  /* A table that does not fit scrolls sideways in one piece instead of crushing its columns */
  .tbl th,
  .tbl td {
    white-space: nowrap;
  }

  .tbl__main {
    overflow-wrap: normal;
  }

  /* Columns a phone can do without */
  .tbl__opt {
    display: none;
  }

  /* The message log becomes a list: who and status on one line, text and time under it */
  .tbl--stack {
    display: block;
    min-width: 0;
  }

  .tbl--stack thead {
    display: none;
  }

  .tbl--stack tbody {
    display: block;
  }

  .tbl--stack tr {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "icon to st"
      "icon text time"
      "icon who who";
    align-items: center;
    gap: 3px 12px;
    padding-block: 13px;
    border-block-end: 1px solid var(--line-2);
  }

  .tbl--stack td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .tbl--stack .tbl__icon {
    grid-area: icon;
    align-self: start;
    width: auto;
  }

  .tbl--stack .tbl__to {
    grid-area: to;
    display: flex;
    align-items: center;
  }

  .tbl--stack .tbl__to .tbl__main {
    flex: 0 1 auto;
    min-width: 0;
    max-width: none;
  }

  .tbl--stack .tag {
    flex: none;
  }

  .tbl--stack .tbl__st {
    grid-area: st;
  }

  /* The text is short already (cut on the server), so it wraps instead of being clipped:
     clipping a line that mixes Hebrew and Latin eats the wrong end of it */
  .tbl--stack .tbl__text {
    grid-area: text;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .tbl--stack .tbl__time {
    grid-area: time;
    align-self: start;
    font-size: 0.85rem;
  }

  .tbl--stack .tbl__who {
    grid-area: who;
    font-size: 0.9rem;
  }

  /* The copy button gets its own band above the code, so it never covers a line */
  .codeblock pre {
    padding: 52px 16px 16px;
  }
}

@media (max-width: 520px) {
  .plain__box {
    padding: 32px 24px 28px;
  }

  .inline .field,
  .filters .field {
    flex-basis: 100%;
    max-width: none;
  }

  .inline .btn,
  .filters .btn {
    width: 100%;
  }
}

/* ---------- Arabic ---------- */

/* Arabic letters join one another, so they are never spaced out or pulled together.
   The wordmark is Latin and keeps its own spacing. */
:lang(ar):not(.mark) {
  letter-spacing: 0 !important;
}

/* Large Arabic type needs more air between lines */
:lang(ar) .docs__body h1,
:lang(ar) .pagehead h1,
:lang(ar) .plain__box h1 {
  line-height: 1.35;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
