/*
  Zenlo – website. Light and dark (follows the computer, or the sun/moon button). Built from the app's
  own look: Zalo's neutral colors, one electric violet accent, monospace for data, small corners
  and lines instead of shadows. System fonts only: the site loads no fonts or scripts from anyone else
  (stats.js only sends GoatCounter a count).
*/

:root {
  --bg: #ffffff;
  --bg-2: #f4f5f7;
  --surface: #ffffff;
  --line: #e3e6ea;
  --text: #081c36;
  --muted: #5a6981;
  --faint: #8a94a0;
  --accent: #7c3aed;
  --accent-ink: #ffffff;
  --accent-soft: rgba(124, 58, 237, 0.09);
  --accent-line: rgba(124, 58, 237, 0.32);
  --shadow: none;

  /* The pretend Zalo window */
  --z-bg: #ffffff;
  --z-side: #f5f6f8;
  --z-line: #e3e6ea;
  --z-bubble: #f1f3f5;
  --z-me: #dbeafe;
  --z-text: #1f2329;
  --z-muted: #6b7380;

  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #141619;
  --bg-2: #1b1e22;
  --surface: #1f2328;
  --line: #2c3138;
  --text: #e4e6eb;
  --muted: #a3abb6;
  --faint: #6f7782;
  --accent: #a78bfa;
  --accent-ink: #160f2b;
  --accent-soft: rgba(167, 139, 250, 0.13);
  --accent-line: rgba(167, 139, 250, 0.38);
  --shadow: none;
  --z-bg: #1b1f24;
  --z-side: #15181c;
  --z-line: #2a2f36;
  --z-bubble: #262b31;
  --z-me: #1f4a6b;
  --z-text: #e4e6eb;
  --z-muted: #8a94a0;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141619;
    --bg-2: #1b1e22;
    --surface: #1f2328;
    --line: #2c3138;
    --text: #e4e6eb;
    --muted: #a3abb6;
    --faint: #6f7782;
    --accent: #a78bfa;
    --accent-ink: #160f2b;
    --accent-soft: rgba(167, 139, 250, 0.13);
    --accent-line: rgba(167, 139, 250, 0.38);
    --shadow: none;
    --z-bg: #1b1f24;
    --z-side: #15181c;
    --z-line: #2a2f36;
    --z-bubble: #262b31;
    --z-me: #1f4a6b;
    --z-text: #e4e6eb;
    --z-muted: #8a94a0;
    color-scheme: dark;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

.wrap {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

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

.muted {
  color: var(--muted);
}

.link {
  color: var(--accent);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

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

/* ---------- Top bar ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.top__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-decoration: none;
}

.brand svg {
  color: var(--accent);
}

.brand__by {
  align-self: flex-end;
  margin: 0 0 3px -2px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}

.top__link {
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
}

.top__link:hover {
  color: var(--text);
}

.top__link {
  white-space: nowrap;
}

.top__link[aria-current="page"] {
  color: var(--accent);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
}

.theme-sun,
:root[data-theme="dark"] .theme-moon {
  display: none;
}

:root[data-theme="dark"] .theme-sun {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-moon {
    display: none;
  }

  :root:not([data-theme="light"]) .theme-sun {
    display: block;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn--small {
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.btn[aria-disabled="true"] {
  background: var(--bg-2);
  color: var(--faint);
  cursor: default;
  filter: none;
}

/* ---------- Home: chapters ---------- */

.hero {
  padding: 72px 0 40px;
}

.hero h1 {
  margin: 0;
  max-width: 820px;
  font-family: var(--display);
  font-size: clamp(38px, 6.2vw, 68px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -1.5px;
}

.hero p {
  margin: 18px 0 0;
  max-width: 560px;
  color: var(--muted);
  font-size: 19px;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 18px;
  margin-top: 28px;
}

.hero__meta {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 13px;
}

.chapter {
  padding: 96px 0;
}

.chapter + .chapter {
  border-top: 1px solid var(--line);
}

.chapter__head {
  max-width: 640px;
  margin-bottom: 36px;
}

/* Set like the status line in Zenlo's own panel: a violet dot, then data in monospace */
.chapter__step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
}

.chapter__step::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.chapter h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.8px;
}

.chapter__head p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
}

/* ---------- Why Zenlo exists ---------- */

.why {
  padding: 32px 0 8px;
}

/* Lined up with the hero on the left, not a centered column */
.why .wrap > * {
  max-width: 760px;
}

.why__numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 56px;
}

.why__numbers p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.why__numbers b {
  display: block;
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1.15;
}

.why__source {
  margin: 10px 0 40px;
  color: var(--faint);
  font-size: 13px;
}

.why__flow {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 18px;
}

.why__flow li {
  position: relative;
  padding: 0 0 18px 30px;
  color: var(--muted);
}

/* An arrow leads from one line to the next; the last one is the answer */
.why__flow li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--faint);
  font-family: var(--mono);
}

.why__flow li:first-child::before {
  content: "·";
}

.why__flow li:last-child {
  color: var(--text);
}

.why__flow li:last-child::before {
  color: var(--accent);
}

.why__flow b {
  color: var(--accent);
  font-weight: 650;
}

.why__goal {
  margin: 22px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-family: var(--display);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 650;
  letter-spacing: -0.3px;
}

.why__goal em {
  color: var(--accent);
  font-style: normal;
}

/* ---------- Who it suits ---------- */

/* Two plain columns split by a rule, "+" and "–" in monospace instead of check marks */
.fit {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 900px;
  border-top: 1px solid var(--line);
}

.fit > div {
  padding: 20px 28px 0 0;
}

.fit > div + div {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.fit h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.fit ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fit li {
  position: relative;
  margin: 8px 0;
  padding-left: 22px;
}

.fit li::before {
  content: "+";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
}

.fit--no {
  color: var(--muted);
}

.fit--no li::before {
  content: "–";
  color: var(--faint);
}

/* ---------- The pretend Zalo window ---------- */

.zw {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  overflow: hidden;
  border: 1px solid var(--z-line);
  border-radius: 10px;
  background: var(--z-bg);
  box-shadow: var(--shadow);
  color: var(--z-text);
  font-size: 14px;
}

.zw__chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 520px;
}

.zw__title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--z-line);
}

.zw__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2f6f73;
}

.zw__avatar--trip {
  background: #b86a2e;
}

.zw__title b {
  display: block;
  line-height: 1.2;
}

.zw__title small {
  color: var(--z-muted);
  font-size: 12px;
}

.zw__msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  scroll-behavior: smooth;
}

.zw__day {
  margin: 6px 0 10px;
  color: var(--z-muted);
  font-size: 12px;
  text-align: center;
}

.msg {
  max-width: 88%;
  margin: 0 0 8px;
  padding: 7px 11px;
  border-radius: 8px;
  background: var(--z-bubble);
  line-height: 1.45;
  transition: box-shadow 0.3s, background 0.3s;
}

.msg b {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--z-muted);
  font-size: 11.5px;
  font-weight: 500;
}

.msg--me {
  margin-left: auto;
  background: var(--z-me);
}

.msg--flash {
  box-shadow: 0 0 0 2px var(--accent);
  background: var(--accent-soft);
}

.zw__composer {
  padding: 12px 16px;
  border-top: 1px solid var(--z-line);
  color: var(--z-muted);
  font-size: 13px;
}

/* Zenlo's panel inside the window */

.zp {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 520px;
  border-left: 1px solid var(--z-line);
  background: var(--z-side);
}

.zp__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 0;
  font-weight: 700;
}

.zp__head svg {
  color: var(--accent);
}

.zp__tabs {
  display: flex;
  gap: 16px;
  margin: 8px 16px 0;
  border-bottom: 1px solid var(--z-line);
  color: var(--z-muted);
  font-size: 13px;
  font-weight: 600;
}

.zp__tabs span {
  padding: 6px 0;
}

.zp__tabs .on {
  border-bottom: 2px solid var(--accent);
  color: var(--z-text);
}

.zp__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}

.zp__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.zp__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.zp__btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.zp__hint {
  color: var(--accent);
  font-size: 13px;
}

.zp__range {
  color: var(--z-muted);
  font-family: var(--mono);
  font-size: 11.5px;
}

.seg {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--z-line);
  border-radius: 9px;
}

.seg button {
  padding: 6px 14px;
  border: 0;
  border-left: 1px solid var(--z-line);
  background: transparent;
  color: var(--z-text);
  font-size: 13px;
  cursor: pointer;
}

.seg button:first-child {
  border-left: 0;
}

.seg button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

/* A summary as Zenlo renders it */

.sum {
  line-height: 1.55;
}

.sum h4 {
  margin: 10px 0 4px;
  color: var(--accent);
  font-size: 11.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.sum h4:first-child {
  margin-top: 0;
}

.sum ul {
  margin: 0;
  padding-left: 18px;
}

.sum li {
  margin: 4px 0;
}

.sum li::marker {
  color: var(--accent);
}

.cite {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border: 0;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 18px;
  white-space: nowrap;
  cursor: pointer;
}

.cite:hover {
  text-decoration: underline;
}

.caret {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* The line that shows where the messages went */

.netlog {
  margin-top: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--z-bg);
  color: var(--z-muted);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.4s, transform 0.4s;
}

.netlog.show {
  opacity: 1;
  transform: none;
}

.netlog b {
  color: var(--z-text);
  font-weight: 500;
}

/* ---------- Chapter 2: the digest ---------- */

.digest {
  max-width: 780px;
  padding: 18px;
  border: 1px solid var(--z-line);
  border-radius: 10px;
  background: var(--z-side);
  box-shadow: var(--shadow);
  color: var(--z-text);
  font-size: 14px;
}

.digest__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.digest__count {
  color: var(--z-muted);
  font-family: var(--mono);
  font-size: 12px;
}

.dcard {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--z-line);
  border-radius: 8px;
  background: var(--z-bg);
  transition: opacity 0.2s;
}

.dcard[data-off="true"] {
  opacity: 0.5;
}

.dcard.dragging {
  opacity: 0.35;
}

.dcard.drop-before {
  box-shadow: 0 -2px 0 var(--accent);
}

.dcard.drop-after {
  box-shadow: 0 2px 0 var(--accent);
}

.dcard__handle {
  color: var(--z-muted);
  letter-spacing: -3px;
  cursor: grab;
  user-select: none;
}

.dcard__check {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.dcard__name {
  font-weight: 600;
}

.dcard__meta {
  color: var(--z-muted);
  font-family: var(--mono);
  font-size: 11.5px;
}

.dcard__sum {
  grid-column: 3 / -1;
  color: var(--z-text);
  font-size: 13.5px;
  line-height: 1.5;
}

.dcard__sum:empty {
  display: none;
}

.tag {
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
}

/* ---------- Chapter 3: back to the source ---------- */

.zw--compact .zw__chat,
.zw--compact .zp {
  height: 420px;
}

/* ---------- Chapter 4: your way ---------- */

.yours {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 20px;
}

.panel {
  padding: 18px;
  border: 1px solid var(--z-line);
  border-radius: 10px;
  background: var(--z-side);
  box-shadow: var(--shadow);
  color: var(--z-text);
  font-size: 14px;
}

.panel__label {
  margin: 0 0 8px;
  color: var(--z-muted);
  font-size: 12.5px;
}

.panel .sum {
  min-height: 210px;
  margin-top: 14px;
}

.choice {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.choice button {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--z-line);
  border-radius: 10px;
  background: var(--z-bg);
  color: var(--z-text);
  cursor: pointer;
}

.choice button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid var(--z-line);
  border-radius: 10px;
  background: var(--z-bg);
  font-family: var(--mono);
  font-size: 12.5px;
}

.panel--note {
  margin-top: 20px;
}

.panel--note .choice {
  flex-wrap: wrap;
}

.panel--note .choice button {
  flex: 1 1 160px;
}

.panel--note .sum {
  min-height: 0;
}

.panel .netlog {
  opacity: 1;
  transform: none;
}

/* ---------- Install ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

/* Steps as columns under one rule, not three cards */
.steps li {
  padding-top: 18px;
  border-top: 2px solid var(--text);
}

.steps__n {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
}

.steps h3 {
  margin: 6px 0 14px;
  font-size: 18px;
}

.vis {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  height: 130px;
  padding: 14px;
  border-radius: 8px;
  background: var(--bg-2);
  font-size: 13px;
}

.vis__file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.vis__file small {
  display: block;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
}

.vis__term {
  padding: 10px 12px;
  border-radius: 10px;
  background: #111317;
  color: #d4d8de;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
}

.vis__term em {
  color: #a78bfa;
  font-style: normal;
}

.vis__bar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.vis__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 10px 8px;
  border-radius: 10px;
  background: #16191d;
}

.vis__rail i {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #2c3138;
}

.vis__rail svg {
  color: #a78bfa;
}

.download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}

.download__facts {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  word-break: break-all;
}

.small {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.65;
}

/* Other platforms, not out yet */
.platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn--ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.btn--ghost:hover {
  color: var(--text);
  filter: none;
}

.soon {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 34px;
  border: 1px solid var(--accent-line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 15px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.96);
  transition: opacity 0.2s, transform 0.2s;
}

.soon b {
  color: var(--accent);
  font-family: var(--display);
  font-size: 24px;
}

.soon--show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* ---------- From the author ---------- */

.note {
  max-width: 660px;
  margin: 0 auto;
}

.note__quote {
  position: relative;
  margin: 0;
  padding: 4px 0 4px 28px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 17px;
  font-style: italic;
  line-height: 1.7;
}

.note__quote p {
  margin: 0 0 14px;
}

.note__quote p:last-child {
  margin-bottom: 0;
}

.note__sign {
  margin-top: 16px;
  padding-left: 31px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
}

.aside {
  max-width: 660px;
  margin: 56px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15.5px;
}

.aside p {
  margin: 0 0 8px;
}

/* The same block under the install buttons, aligned with them */
.aside--install {
  max-width: 760px;
  margin: 28px 0 0;
  font-size: 16.5px;
  line-height: 1.65;
}

/* The trust text with a picture of where the data goes */
.trust {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  align-items: center;
  max-width: none;
}

.trust__fig {
  margin: 0;
}

.trust__fig svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--sans);
}

.trust__fig .t-box { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.trust__fig .t-title { fill: var(--text); font-size: 14px; font-weight: 600; text-anchor: middle; }
.trust__fig .t-chip { fill: var(--accent-soft); stroke: var(--accent-line); }
.trust__fig .t-chip-text { fill: var(--accent); font-size: 13px; font-weight: 600; text-anchor: middle; }
.trust__fig .t-db { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.trust__fig .t-small { fill: var(--muted); font-size: 11.5px; }
.trust__fig .t-center { text-anchor: middle; }
.trust__fig .t-keep { fill: var(--accent); font-size: 12.5px; font-weight: 700; }
.trust__fig .t-arrow { stroke: var(--accent); stroke-width: 2; }
.trust__fig .t-accent-fill { fill: var(--accent); }
.trust__fig .t-lock { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.trust__fig .t-mono { fill: var(--accent); font-family: var(--mono); font-size: 10.5px; font-weight: 600; text-anchor: middle; }
.trust__fig .t-pill { fill: var(--bg-2); stroke: var(--line); }
.trust__fig .t-pill-text { fill: var(--text); font-size: 12px; text-anchor: middle; }
.trust__fig .t-tiny { fill: var(--faint); font-size: 10.5px; text-anchor: middle; }
.trust__fig .t-dash { stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 4 4; }
.trust__fig .t-cross circle { fill: var(--bg); stroke: var(--faint); stroke-width: 1.5; }
.trust__fig .t-cross path { stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; }
.trust__fig .t-ghost { fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 6 5; }
.trust__fig .t-ghost-title { fill: var(--faint); font-size: 14px; font-weight: 600; text-anchor: middle; text-decoration: line-through; }

@media (max-width: 860px) {
  .trust {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .trust__fig {
    max-width: 380px;
  }
}

/* One big link to the detailed install guide, under the download buttons */
.guide-link {
  margin: 26px 0 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.5;
}

.guide-link a {
  color: var(--accent);
  text-decoration: none;
}

.guide-link a:hover {
  text-decoration: underline;
}

/* ---------- Footer ---------- */

.foot {
  padding: 36px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.foot__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.foot a {
  text-decoration: none;
}

.foot a:hover {
  color: var(--text);
}

/* ---------- Guide and privacy pages ---------- */

.guide {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  padding-top: 32px;
  padding-bottom: 80px;
}

.toc {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  font-size: 14.5px;
}

.toc__search {
  width: 100%;
  margin-bottom: 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc ol ol {
  margin: 2px 0 8px 12px;
}

.toc a {
  display: block;
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}

.toc a:hover {
  background: var(--bg-2);
  color: var(--text);
}

.toc a.on {
  background: var(--accent-soft);
  color: var(--accent);
}

.toc .group > a {
  color: var(--text);
  font-weight: 600;
}

.toc__empty {
  padding: 4px 10px;
  color: var(--faint);
}

.toc-mobile {
  display: none;
}

.doc {
  max-width: 760px;
}

.doc--page {
  margin: 0 auto;
  padding: 40px 0 80px;
}

.doc h1 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 46px);
  letter-spacing: -0.8px;
}

.doc h2 {
  margin: 56px 0 12px;
  padding-top: 8px;
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: -0.4px;
}

.doc h3 {
  margin: 32px 0 8px;
  font-size: 20px;
}

.doc h4 {
  margin: 20px 0 6px;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.doc p,
.doc li {
  color: var(--muted);
}

.doc b,
.doc strong {
  color: var(--text);
}

.doc ol,
.doc ul {
  padding-left: 22px;
}

.doc li {
  margin: 6px 0;
}

.doc code,
.kbd {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.86em;
}

.doc table {
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  font-size: 15px;
}

.doc th,
.doc td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.doc th {
  background: var(--bg-2);
}

.doc td {
  color: var(--muted);
}

.tip {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 15.5px;
}

/* Tea (donate) page: no longer linked, kept for links in Zenlo v0.1.1 */

.treat__pay {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  margin: 28px 0 12px;
}

.treat__qr {
  margin: 0;
}

.treat__qr img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.treat__qr figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.treat__account {
  margin: 0 0 14px;
}

.treat__account div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.treat__account dt {
  color: var(--muted);
}

.treat__account dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  text-align: right;
  word-break: break-all;
}

.treat__thanks {
  max-width: 660px;
  margin-top: 40px;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--accent);
}

.doc .treat__thanks p {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.75;
}

.doc .treat__thanks p:first-child {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 650;
}

.doc .treat__thanks .treat__sign {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
}

/* Get told about new versions */
.notify {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.notify > div {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.doc .notify h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.doc .notify p {
  margin: 0 0 10px;
  font-size: 15px;
}

/* Versions page: one block per release, newest first */

.release {
  margin: 28px 0;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.release--latest {
  border-color: var(--accent-line);
}

.release__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.doc .release__head h2 {
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 24px;
}

.release__tag {
  padding: 2px 10px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
}

.release__date {
  margin-left: auto;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 13px;
}

.release__get {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: 16px;
}

/* The long SHA-256 wraps instead of widening the page */
.release__get .download__facts {
  flex: 1 1 260px;
  min-width: 0;
}

/* Pictures of the two download warnings (simplified, not screenshots) */

.warn-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0;
}

.warn {
  margin: 0;
}

.warn figcaption {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 15px;
}

.warn > p {
  margin: 10px 0 0;
  font-size: 15px;
}

.warn__box {
  padding: 16px;
  border-radius: 10px;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  line-height: 1.45;
}

.warn__box--edge {
  border: 1px solid #d1d1d1;
  background: #f9f9f9;
  color: #1b1b1b;
}

.warn__box--win {
  background: #0d5fa8;
  color: #ffffff;
}

.doc .warn__box p {
  margin: 0 0 8px;
  color: inherit;
}

.doc .warn__box .warn__title {
  font-size: 15px;
  font-weight: 600;
}

.warn__buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.warn__btn {
  padding: 4px 12px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  background: #ffffff;
  color: #1b1b1b;
}

.warn__box--win .warn__btn {
  border-color: rgba(255, 255, 255, 0.7);
  background: transparent;
  color: #ffffff;
}

.warn__menu {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.warn__menu .warn__pick {
  padding: 5px 12px;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* What to click */
.warn__pick {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.warn__box--win .warn__pick {
  outline-color: #fbbf24;
  text-decoration: underline;
}

.doc .lede {
  color: var(--muted);
  font-size: 19px;
}

.doc [hidden] {
  display: none;
}

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  .zw {
    grid-template-columns: minmax(0, 1fr);
  }

  .zw__chat,
  .zw--compact .zw__chat {
    height: 340px;
  }

  .zp,
  .zw--compact .zp {
    height: auto;
    min-height: 360px;
    border-left: 0;
    border-top: 1px solid var(--z-line);
  }

  .yours,
  .steps,
  .fit,
  .warn-steps,
  .treat__pay,
  .notify {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .toc {
    display: none;
  }

  .toc-mobile {
    display: block;
    margin-bottom: 20px;
  }

  .toc-mobile select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
  }

  .top__link--hide {
    display: none;
  }

  /* Stacked: the second column hangs under a rule instead of beside one */
  .fit > div + div {
    margin-top: 20px;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .steps {
    gap: 28px;
  }
}

@media (max-width: 560px) {
  /* The hero line breaks where the phone wants, not at the desktop break */
  .hero h1 br {
    display: none;
  }

  /* Room in the top bar: the "by stephit" tag goes, links and the button get a little smaller */
  .top__inner {
    gap: 10px;
  }

  .top__link {
    font-size: 14px;
  }

  .top__inner .btn {
    padding-left: 12px;
    padding-right: 12px;
    white-space: nowrap;
  }

  .brand__by {
    display: none;
  }

  /* Long words (domain names, addresses) wrap instead of widening the page */
  .doc td,
  .doc th,
  .doc code {
    overflow-wrap: anywhere;
  }

  .doc table {
    font-size: 14px;
  }

  .doc th,
  .doc td {
    padding: 8px;
  }

  .treat__qr {
    max-width: 320px;
  }

  .chapter {
    padding: 64px 0;
  }

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

  .dcard__meta {
    grid-column: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* "Hoàn toàn miễn phí": people expect AI tools to cost money, so it stands out a little */
.free {
  color: var(--accent);
  font-weight: 650;
}
