/* Usage guide — the same tokens as the extension popup and the privacy page,
   so the three read as one product. Shared by every language under /guide. */

:root {
  --bg: #0e1017;
  --surface: #151824;
  --surface-2: #1b1f2d;
  --border: #262b3a;
  --text: #e8eaf0;
  --muted: #8b90a3;
  --accent: #7c5cff;
  --accent-soft: #a78bfa;
  --accent-ghost: rgba(124, 92, 255, 0.14);
  --green: #22c55e;
  --radius: 14px;
}

[data-theme='light'] {
  --bg: #f5f6fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e1e5f0;
  --text: #171a26;
  --muted: #6a7085;
  --accent: #6d4aff;
  --accent-soft: #6d4aff;
  --accent-ghost: rgba(109, 74, 255, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Noto Sans Arabic', sans-serif;
  -webkit-font-smoothing: antialiased;
}

header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.bar,
main,
footer .inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.bar {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Logo and name together are the way back to the front page. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand:hover .wordmark {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bar nav {
  margin-inline-start: auto;
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.bar nav a {
  color: var(--muted);
  text-decoration: none;
}

.bar nav a:hover {
  color: var(--accent);
}

/* The language menu: a <details> so it works without script. */
.lang {
  position: relative;
}

.lang summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  user-select: none;
}

.lang summary::-webkit-details-marker {
  display: none;
}

.lang .caret {
  transition: transform 0.15s ease;
}

.lang[open] .caret {
  transform: rotate(180deg);
}

.lang summary:hover,
.lang[open] summary {
  color: var(--accent);
}

.lang ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 10px);
  min-width: 170px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

.lang li {
  margin: 0;
}

.lang li a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--text);
}

.lang li a:hover {
  background: var(--accent-ghost);
  color: var(--accent);
}

.lang li a[aria-current] {
  color: var(--accent);
  font-weight: 650;
}

.logo {
  width: 26px;
  height: 26px;
  border-radius: 8px;
}

.wordmark {
  font-weight: 700;
  font-size: 17px;
  color: var(--accent);
}

main {
  padding-top: 44px;
  padding-bottom: 56px;
}

h1 {
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.updated {
  color: var(--muted);
  font-size: 13.5px;
  margin-bottom: 30px;
}

h2 {
  font-size: 20px;
  margin: 44px 0 12px;
  letter-spacing: -0.005em;
  scroll-margin-top: 76px;
}

p {
  margin-bottom: 14px;
}

a {
  color: var(--accent);
}

strong {
  font-weight: 650;
}

ul,
ol {
  margin: 0 0 14px 22px;
}

[dir='rtl'] ul,
[dir='rtl'] ol {
  margin: 0 22px 14px 0;
}

li {
  margin-bottom: 8px;
}

.lede {
  background: var(--accent-ghost);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
}

.lede p:last-child {
  margin-bottom: 0;
}

.toc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14px;
}

.toc a {
  text-decoration: none;
  color: var(--text);
}

.toc a:hover {
  color: var(--accent);
}

@media (max-width: 560px) {
  .toc {
    grid-template-columns: 1fr;
  }
}

figure {
  margin: 18px 0 22px;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

dl {
  margin-bottom: 14px;
}

dt {
  font-weight: 650;
  margin-top: 14px;
}

dd {
  margin: 4px 0 0;
  color: var(--text);
}

.tip {
  border-inline-start: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 10px 10px 0;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 14px;
}

[dir='rtl'] .tip {
  border-radius: 10px 0 0 10px;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 5px;
  direction: ltr;
  unicode-bidi: isolate;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

th,
td {
  text-align: start;
  vertical-align: top;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface-2);
  font-weight: 650;
  white-space: nowrap;
}

tr:last-child td {
  border-bottom: 0;
}

.closing {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13.5px;
}

footer .inner {
  padding-top: 24px;
  padding-bottom: 32px;
  text-align: center;
}
