:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1b1f24;
  --muted: #5b6470;
  --line: #dde1e6;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --grant: #1a7f37;
  --revoke: #b42318;
  --code-bg: #0f1720;
  --code-text: #e6edf3;
  --chip: #eef1f5;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --card: #161b22;
    --text: #e6edf3;
    --muted: #9aa5b1;
    --line: #2b323b;
    --accent: #4493f8;
    --grant: #3fb950;
    --revoke: #f85149;
    --code-bg: #010409;
    --chip: #21262d;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", "Nirmala UI", "Hind Siliguri", sans-serif;
}
[lang="bn"], html[data-lang="bn"] body { line-height: 1.75; }
.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }

/* language: English by default; with JS the toggle switches */
.bn { display: none; }
html[data-lang="bn"] .bn { display: revert; }
html[data-lang="bn"] .en { display: none; }
span.bn { display: none; }
html[data-lang="bn"] span.bn { display: inline; }

.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.brand { font-weight: 600; color: var(--muted); font-size: 14px; }
.lang { display: none; }
.js .lang { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang button {
  border: 0; background: transparent; color: var(--text); padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer;
}
.lang button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

h1 { font-size: clamp(26px, 5vw, 34px); line-height: 1.25; margin: 28px 0 12px; }
h2 { font-size: 22px; margin: 0 0 8px; }
h3 { font-size: 19px; margin: 0 0 10px; }
.intro p { margin: 0 0 12px; }
.detected { color: var(--accent); font-weight: 600; }
.phone { background: var(--chip); padding: 10px 14px; border-radius: var(--radius); }
.muted { color: var(--muted); margin-top: 0; }
.small { font-size: 14.5px; color: var(--muted); margin: 10px 0 6px; }
code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
p code, li code { background: var(--chip); padding: 1px 5px; border-radius: 5px; font-size: 0.9em; word-break: break-all; }
kbd { background: var(--chip); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; font-size: 0.85em; }
a { color: var(--accent); }

/* tabs: only with JS; without JS all OS sections are shown */
.tabs { display: none; }
.js .tabs { display: flex; gap: 6px; margin: 24px 0 0; border-bottom: 1px solid var(--line); }
.tabs button {
  font: inherit; font-weight: 600; background: transparent; color: var(--muted); border: 0; border-bottom: 3px solid transparent;
  padding: 10px 16px; cursor: pointer; margin-bottom: -1px;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabs button:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.os { padding: 20px 0 4px; }
.js .os-title { display: none; }
.os[hidden] { display: none; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 18px;
  border-left: 5px solid var(--grant);
}
.card.revoke { border-left-color: var(--revoke); }
.card.grant h3 { color: var(--grant); }
.card.revoke h3 { color: var(--revoke); }
.how { padding-left: 22px; margin: 0 0 12px; }
.how li { margin: 4px 0; }

.cmd { position: relative; margin: 8px 0; }
.cmd[hidden] { display: none; }
.cmd pre {
  margin: 0; background: var(--code-bg); color: var(--code-text); border-radius: 10px; padding: 14px 92px 14px 14px;
  overflow-x: auto; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-all;
}
.cmd button.copy {
  position: absolute; top: 8px; right: 8px; font: inherit; font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 8px;
  border: 0; background: var(--accent); color: var(--accent-text); cursor: pointer; min-width: 70px;
}
.cmd button.copy.done { background: var(--grant); }
.card > .cmd:first-of-type pre { font-size: 15px; }

details { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 10px; }
summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.distros { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.distros button {
  font: inherit; font-size: 13.5px; border: 1px solid var(--line); background: var(--chip); color: var(--text); padding: 5px 10px;
  border-radius: 999px; cursor: pointer;
}
.distros button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.faq { margin: 10px 0 0; padding: 18px 0; border-top: 1px solid var(--line); }
.faq ul { padding-left: 20px; margin: 0; }
.faq li { margin: 6px 0; }
.foot { color: var(--muted); font-size: 14px; padding-top: 6px; padding-bottom: 40px; }

@media (max-width: 520px) {
  .tabs button { padding: 10px 10px; flex: 1; }
  .card { padding: 14px; }
  .cmd pre { padding-right: 14px; padding-top: 48px; }
}

/* optional Tailscale request (JS only) */
.ts { margin-top: 28px; }
.ts h2 { font-size: 20px; margin: 0 0 8px; }
.ts form { display: grid; gap: 6px; max-width: 520px; margin: 12px 0; }
.ts label { font-weight: 600; font-size: 14px; }
.ts input, .ts textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%;
}
.ts button[type="submit"] {
  justify-self: start; margin-top: 6px; border: 0; border-radius: 8px; padding: 8px 16px; font: inherit; cursor: pointer;
  background: var(--accent); color: var(--accent-text);
}
.ts button[disabled] { opacity: .6; cursor: default; }
.ts .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ts-status { font-weight: 600; }
.ts-status:empty { display: none; }
#ts-result[hidden], .ts[hidden], .ts form[hidden] { display: none; }
