/* savecontent.app
   Layout: a ledger. Every section is a row — its heading in a narrow column at
   the start, its matter beside it — and the one drawn thing on the site is a
   Telegram thread, because a chat is where all of this happens.
   No scripts. Logical properties only, so the same rules serve RTL. */
:root {
  --page: #ffffff;
  --band: #f1f4f6;          /* the alternate row: a grey leaning to the ink's blue */
  --ink: #17212b;           /* Telegram's own night colour, used as the text */
  --mute: #5d6b78;
  --rule: #d9e0e6;
  --link: #8436c4;
  --go: #9a4bd8;            /* the one accent, taken from the bot's logo */
  --go-ink: #ffffff;
  --gone: #c9423a;          /* a deleted message */
  --chat: #d5e2cb;          /* the thread's wallpaper */
  --dot: #c3d3b7;
  --in: #ffffff;            /* a received bubble */
  --out: #e6f8cf;           /* a sent bubble */
  --bubble-ink: #17212b;
  --bubble-mute: #6f7f6a;
  --display: "Bricolage Grotesque", "IBM Plex Sans Arabic", "IBM Plex Sans", system-ui, "Segoe UI", sans-serif;
  --text: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, "Segoe UI", "Noto Sans", Tahoma, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0e1621; --band: #131d29; --ink: #e7edf2; --mute: #93a3b3; --rule: #243342;
    --link: #c9a0f5; --go: #a35ce0; --go-ink: #ffffff; --gone: #ec6a61;
    --chat: #0b121b; --dot: #111b27; --in: #182533; --out: #2b5278;
    --bubble-ink: #eef3f7; --bubble-mute: #8fa6bb;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 17px/1.7 var(--text); }
[dir="rtl"] body { font-size: 18px; line-height: 1.9; }
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--go); outline-offset: 3px; }
img, svg { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 22px; }

/* ── the top line ─────────────────────────────────────────────────────────── */
.top { border-bottom: 1px solid var(--rule); }
.bar { display: flex; align-items: center; gap: 8px 26px; flex-wrap: wrap; padding-block: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 20px/1 var(--display); letter-spacing: -.01em; }
.logo img { border-radius: 50%; }
.nav { display: flex; gap: 4px 20px; flex-wrap: wrap; flex: 1; font-size: 15px; }
.nav a, .langs a { color: var(--mute); text-decoration: none; padding-block: 3px; }
.nav a:hover, .langs a:hover { color: var(--ink); }
.nav a.on { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 7px; }
.langs { position: relative; font-size: 14.5px; }
.langs summary { cursor: pointer; list-style: none; color: var(--mute); border: 1px solid var(--rule); border-radius: 6px; padding: 4px 10px; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: " ▾"; font-size: .8em; }
.langs .list {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); z-index: 4; background: var(--page);
  border: 1px solid var(--rule); border-radius: 8px; padding: 8px; min-width: 190px; max-height: 60vh; overflow: auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; box-shadow: 0 10px 30px rgba(10, 20, 30, .14);
}
.langs .list a { padding: 5px 6px; border-radius: 5px; white-space: nowrap; }
.langs .list a.on { color: var(--ink); font-weight: 600; background: var(--band); }

/* ── the opening ──────────────────────────────────────────────────────────── */
.hero { padding-block: 52px 44px; border-bottom: 1px solid var(--rule); }
.hero .wrap { display: grid; gap: 40px; align-items: center; }
.hero.home .wrap { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); }
.hero h1 { margin: 0 0 18px; font: 800 clamp(31px, 5.2vw, 56px)/1.08 var(--display); letter-spacing: -.025em; text-wrap: balance; }
[dir="rtl"] .hero h1 { line-height: 1.35; letter-spacing: 0; font-weight: 700; }
.hero:not(.home) h1 { font-size: clamp(29px, 4.3vw, 44px); max-width: 21ch; }
.hero .lead { margin: 0 0 26px; max-width: 60ch; font-size: 1.1em; color: var(--mute); }
.hero .lead b { color: var(--ink); font-weight: 600; }
.kicker { margin: 0 0 14px; font: 500 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
[dir="rtl"] .kicker { font-family: var(--text); letter-spacing: 0; font-size: 14.5px; }
.cta { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin: 0; }
.btn { display: inline-block; background: var(--go); color: var(--go-ink); text-decoration: none; font-weight: 600; padding: 13px 22px; border-radius: 8px; }
.btn:hover { filter: brightness(1.07); }
.note { color: var(--mute); font-size: .92em; }

/* ── the thread ───────────────────────────────────────────────────────────── */
.thread {
  background: var(--chat); background-image: radial-gradient(var(--dot) 1.2px, transparent 1.3px); background-size: 18px 18px;
  border-radius: 14px; padding: 0 0 16px; overflow: hidden; color: var(--bubble-ink); font-size: 15px; line-height: 1.5;
  border: 1px solid var(--rule);
}
.thread .who { display: flex; align-items: center; gap: 10px; background: var(--in); padding: 10px 14px; margin-bottom: 14px; border-bottom: 1px solid var(--rule); }
.thread .who img { border-radius: 50%; }
.thread .who b { display: block; font-size: 15px; line-height: 1.2; }
.thread .who span { font-size: 12.5px; color: var(--bubble-mute); }
.msg { display: flex; padding-inline: 12px; margin-bottom: 8px; }
.msg.me { justify-content: flex-end; }
.bub { max-width: 86%; background: var(--in); border-radius: 14px; border-end-start-radius: 4px; padding: 7px 11px 6px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.msg.me .bub { background: var(--out); border-radius: 14px; border-end-end-radius: 4px; }
.bub .t { display: block; text-align: end; font-size: 11.5px; color: var(--bubble-mute); margin-top: 2px; font-variant-numeric: tabular-nums; }
.bub .url { font-family: var(--mono); font-size: 14px; direction: ltr; unicode-bidi: isolate; color: var(--link); }
.file { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; direction: ltr; }
.file i { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--go); display: grid; place-items: center; }
.file i::before { content: ""; border-inline-start: 13px solid #fff; border-block: 8px solid transparent; margin-inline-start: 4px; }
.file b { display: block; font-weight: 600; font-size: 14.5px; }
.file span { font-size: 12.5px; color: var(--bubble-mute); }
.bub .tag { display: block; font-size: 12.5px; font-weight: 600; color: var(--link); margin-bottom: 2px; }
.bub .tag.gone { color: var(--gone); }
.bub s { text-decoration-color: var(--gone); text-decoration-thickness: 1.5px; }
.bub .was { display: block; font-size: 13px; color: var(--bubble-mute); margin-top: 3px; }

/* ── the ledger rows ──────────────────────────────────────────────────────── */
.sec { padding-block: 44px; border-bottom: 1px solid var(--rule); }
.sec.alt { background: var(--band); }
.sec > .wrap { display: grid; grid-template-columns: minmax(0, 250px) minmax(0, 1fr); gap: 14px 46px; }
.sec > .wrap > h2 { grid-column: 1; margin: 0; font: 700 clamp(21px, 2.5vw, 26px)/1.25 var(--display); letter-spacing: -.01em; text-wrap: balance; }
[dir="rtl"] .sec > .wrap > h2 { line-height: 1.5; letter-spacing: 0; }
.sec > .wrap > .body { grid-column: 2; min-width: 0; }
.sec > .wrap > .body > :first-child { margin-top: 0; }
.sec > .wrap > .body > :last-child { margin-bottom: 0; }
.sec.end { border-bottom: 0; }
h3 { margin: 26px 0 6px; font: 600 1.06em/1.35 var(--text); }
p { margin: 0 0 14px; max-width: 68ch; }
ul, ol { margin: 0 0 16px; padding-inline-start: 22px; max-width: 68ch; }
li { margin-bottom: 7px; }
code { font: 400 .9em var(--mono); background: var(--band); border: 1px solid var(--rule); border-radius: 5px; padding: 1px 6px; direction: ltr; unicode-bidi: isolate; }
.sec.alt code { background: var(--page); }

/* A set of things side by side: lines between them, no boxes. */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 0 34px; }
.card { padding-block: 16px; border-top: 1px solid var(--rule); min-width: 0; }
.card h3 { margin: 0 0 4px; }
.card p { margin: 0; color: var(--mute); font-size: .97em; }
.card a.more { display: inline-block; margin-top: 8px; font-weight: 600; text-decoration: none; }
.card a.more:hover { text-decoration: underline; }

/* Steps are a real sequence, so they are numbered. */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; max-width: 68ch; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 2.4em minmax(0, 1fr); column-gap: 8px; padding-block: 13px; border-top: 1px solid var(--rule); margin: 0; }
.steps li:first-child { border-top: 0; padding-top: 0; }
.steps li::before { content: counter(s); font: 500 1.5em/1.15 var(--mono); color: var(--go); grid-row: 1 / span 2; }
.steps li > b { grid-column: 2; font-weight: 600; }
.steps li > span { grid-column: 2; color: var(--mute); }

.tbl { overflow-x: auto; margin-bottom: 14px; }
table { border-collapse: collapse; width: 100%; min-width: 600px; font-size: .95em; }
th, td { padding: 11px 14px 11px 0; padding-inline: 0 16px; text-align: start; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font: 500 12.5px/1.4 var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--mute); border-bottom-color: var(--ink); }
[dir="rtl"] th { font-family: var(--text); letter-spacing: 0; font-size: 14px; }
tr:last-child td { border-bottom: 0; }
td.us { font-weight: 700; }
.y { font-weight: 600; }
.n { font-weight: 600; color: var(--gone); }

.callout { background: var(--band); padding: 15px 18px; border-radius: 4px; margin: 6px 0 16px; max-width: 68ch; font-size: .97em; }
.sec.alt .callout { background: var(--page); }

.faq { max-width: 74ch; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding-block: 15px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 1.2em/1 var(--mono); color: var(--mute); }
.faq details[open] summary::after { content: "−"; }
.faq .a { padding-bottom: 14px; color: var(--mute); }
.faq .a p:last-child { margin-bottom: 0; }

.foot { padding-block: 30px 40px; font-size: 14.5px; color: var(--mute); }
.foot .fl { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 14px; }
.foot a { color: var(--ink); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot p { margin: 0 0 6px; max-width: 80ch; }
.foot .small { font-size: 13px; }

@media (max-width: 820px) {
  .hero.home .wrap { grid-template-columns: minmax(0, 1fr); }
  .sec > .wrap { grid-template-columns: minmax(0, 1fr); }
  .sec > .wrap > h2, .sec > .wrap > .body { grid-column: 1; }
  .hero { padding-block: 36px 34px; }
  .sec { padding-block: 34px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; padding-bottom: 2px; }
  .langs { margin-inline-start: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: filter .15s; }
}
