/* ============================================================
   CleverTap Android Docs — Brazilian Portuguese
   Inspired by Dortania OpenCore Install Guide
   ============================================================ */

:root {
  --sidebar-width: 280px;
  --toc-width: 220px;
  --topbar-height: 52px;

  /* Light theme */
  --bg: #ffffff;
  --bg-secondary: #f7f8fa;
  --bg-code: #f3f4f6;
  --sidebar-bg: #1c2333;
  --sidebar-text: #c9d1d9;
  --sidebar-heading: #8b949e;
  --sidebar-active-bg: #2d3a4a;
  --sidebar-active-text: #ffffff;
  --sidebar-hover-bg: #243040;
  --sidebar-border: #30363d;
  --text: #1a1a2e;
  --text-muted: #57606a;
  --border: #e1e4e8;
  --accent: #e8572a;
  --accent-light: #fff2ef;
  --link: #0969da;
  --code-text: #24292f;
  --tip-bg: #dafbe1;
  --tip-border: #2da44e;
  --warn-bg: #fff8c5;
  --warn-border: #d4a72c;
  --info-bg: #ddf4ff;
  --info-border: #0969da;
  --table-header: #f6f8fa;
  --table-border: #d0d7de;
  --shadow: 0 1px 3px rgba(0,0,0,0.12);
  --topbar-bg: #ffffff;
  --topbar-border: #e1e4e8;
  --scrollbar-thumb: #c1c7d0;
}

[data-theme="dark"] {
  --bg: #0d1117;
  --bg-secondary: #161b22;
  --bg-code: #1e2939;
  --sidebar-bg: #161b22;
  --sidebar-text: #c9d1d9;
  --sidebar-heading: #8b949e;
  --sidebar-active-bg: #2d3a4a;
  --sidebar-active-text: #ffffff;
  --sidebar-hover-bg: #1f2937;
  --sidebar-border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --border: #30363d;
  --accent: #f47a55;
  --accent-light: #3a1a10;
  --link: #58a6ff;
  --code-text: #e6edf3;
  --tip-bg: #12261e;
  --tip-border: #2da44e;
  --warn-bg: #272115;
  --warn-border: #d4a72c;
  --info-bg: #0c2a3e;
  --info-border: #1f6feb;
  --table-header: #161b22;
  --table-border: #30363d;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --topbar-bg: #161b22;
  --topbar-border: #30363d;
  --scrollbar-thumb: #4a5568;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

/* === Overlay (mobile) === */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 90;
}
.overlay.active { display: block; }

/* === Sidebar === */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 100;
  border-right: 1px solid var(--sidebar-border);
  transition: transform 0.25s ease;
}

.sidebar-header {
  padding: 18px 16px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.logo-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.logo-subtitle {
  font-size: 11px;
  color: var(--sidebar-heading);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* === Sidebar Nav === */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0 24px;
}

.nav-section { margin-bottom: 4px; }

.nav-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 16px;
  cursor: pointer;
  user-select: none;
  color: var(--sidebar-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.15s;
}

.nav-section-header:hover { color: var(--sidebar-text); }

.nav-section-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.nav-section.collapsed .nav-section-arrow { transform: rotate(-90deg); }

.nav-section-items {
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.nav-section.collapsed .nav-section-items { max-height: 0 !important; }

.nav-item {
  display: block;
  padding: 6px 16px 6px 28px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  border-left: 2px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--sidebar-hover-bg);
  color: #ffffff;
}

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left: 2px solid var(--accent);
  font-weight: 500;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
  font-size: 11px;
  color: var(--sidebar-heading);
  flex-shrink: 0;
}

/* === Layout === */
.layout {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Topbar === */
.topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s;
}

.topbar-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.topbar-right { margin-left: auto; }

/* Day/night switch — a fixed dark track regardless of the active theme
   (matches the sun/moon toggle convention) with a sliding white knob.
   The knob sits over whichever icon is "active"; the icon on the other
   side stays visible as a hint for what clicking will switch to. */
.theme-switch {
  position: relative;
  width: 44px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #1a1f2c;
  cursor: pointer;
  flex-shrink: 0;
}

.theme-switch-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  line-height: 1;
  transition: opacity 0.15s;
}
.theme-switch-icon-sun  { left: 5px; }
.theme-switch-icon-moon { right: 5px; }

.theme-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.theme-switch[data-active="dark"] .theme-switch-knob {
  transform: translateX(22px);
}

/* Hide the icon the knob is currently sitting over; show the one on
   the other side as the "switch to this" hint. */
.theme-switch[data-active="light"] .theme-switch-icon-sun  { opacity: 0; }
.theme-switch[data-active="light"] .theme-switch-icon-moon { opacity: 1; }
.theme-switch[data-active="dark"]  .theme-switch-icon-sun  { opacity: 1; }
.theme-switch[data-active="dark"]  .theme-switch-icon-moon { opacity: 0; }

/* === Main content === */
.main {
  flex: 1;
  display: flex;
  gap: 0;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
}

.content-wrapper {
  flex: 1;
  min-width: 0;
  padding: 36px 24px 48px 0;
}

/* === Article (rendered markdown) === */
.article h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  line-height: 1.3;
}

.article h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 0.75rem;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.article h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 1.5rem 0 0.5rem;
}

.article h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 1.2rem 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.85rem;
}

.article p { margin-bottom: 1rem; }

.article a {
  color: var(--link);
  text-decoration: none;
}
.article a:hover { text-decoration: underline; }

.article ul, .article ol {
  margin: 0.5rem 0 1rem 1.5rem;
}

.article li { margin-bottom: 0.3rem; }

.article li > ul, .article li > ol { margin: 0.3rem 0 0.3rem 1.2rem; }

.article strong { font-weight: 600; }

.article em { font-style: italic; }

.article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* === Code — inline === */
.article code {
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.85em;
  background: var(--bg-code);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* === Code blocks — always use Dracula regardless of page theme === */
.article pre {
  margin: 1rem 0 1.5rem;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  position: relative;
  background: #282a36;
  border: 1px solid #44475a;
}

.article pre code {
  background: none;
  color: inherit;
  padding: 0;
  border: none;
  border-radius: 0;
  line-height: 1.65;
}

/* Base Dracula theme (Android Studio "Dracula" editor scheme) */
.article pre > code.hljs {
  display: block;
  padding: 20px 22px;
  border-radius: 0;
  background: #282a36;
  color: #babccf;
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.865rem;
  overflow-x: auto;
}

/* ── Dracula token colors ──────────────────────────────────────────────────
   Source: official Dracula theme spec (https://spec.draculatheme.com/),
   cross-checked against Android Studio's built-in "Dracula" editor scheme
   for call/property/punctuation colors.
   Background #282a36 · Foreground(grey) #babccf · Comment #6272a4
   Cyan #8be9fd · Green #50fa7b · Orange #ffb86c · Pink #ff79c6
   Purple #bd93f9 · Red #ff5555 · Yellow #f1fa8c
   Method calls: Green · Properties/fields: Purple
   Parentheses: Gold #fef953 · Braces: Blue #757ff7
   Punctuation/symbols (. ? ! : = ,): #f8f8f3
   ──────────────────────────────────────────────────────────────────────── */

/* Keywords — val, var, fun, class, if, when, return, for, while,
              public, private, static, void, final, extends, implements … */
.hljs-keyword,
.hljs-literal { color: #ff79c6; font-weight: normal; }

/* String literals — "text", 'c', """triple""" */
.hljs-string,
.hljs-regexp { color: #f1fa8c; }

/* String escape sequences — \n, \t, \uXXXX */
.hljs-string .hljs-subst,
.hljs-string .hljs-meta { color: #ff79c6; font-weight: normal; }

/* Numeric literals — 42, 3.14f, 0xFF, 1_000_000 */
.hljs-number { color: #bd93f9; }

/* Comments — // single-line and /* block */
.hljs-comment,
.hljs-quote { color: #6272a4; font-style: italic; }

/* Javadoc / KDoc tags — @param, @return, @throws */
.hljs-doctag { color: #6272a4; font-style: italic; font-weight: bold; }

/* Annotations — @Override, @NonNull, @Composable, @SuppressWarnings */
.hljs-meta,
.hljs-meta .hljs-string { color: #50fa7b; font-style: italic; font-weight: normal; }

/* Function / method names at declaration site */
.hljs-title,
.hljs-title.function_ { color: #50fa7b; font-weight: normal; }
.hljs-title.class_ { color: #8be9fd; font-style: italic; font-weight: normal; }

/* Built-in functions — println, listOf, mapOf, require, etc. */
.hljs-built_in { color: #8be9fd; }

/* Type names used as parameters / generics — String, Int, Boolean, List<> */
.hljs-type { color: #8be9fd; font-style: italic; }

/* Function / method params in signature */
.hljs-params { color: #babccf; }

/* Operators and punctuation — +, -, =, ->, :: , . */
.hljs-operator { color: #babccf; }

/* Symbols/punctuation — . ? ! : = , (bright white, distinct from grey fg) */
.hljs-punct { color: #f8f8f3; }

/* Method / function calls — register(), getInstance(), onCreate(), w(), d()… */
.hljs-call { color: #50fa7b; }

/* Property / field access — applicationContext, .token, .isSuccessful, .exception, .result */
.hljs-property { color: #bd93f9; }

/* Parentheses — ( ) */
.hljs-paren { color: #fef953; }

/* Braces — { } */
.hljs-brace { color: #757ff7; }

/* XML / HTML tags — <application>, <uses-permission> */
.hljs-tag    { color: #ff79c6; }
.hljs-name   { color: #ff79c6; }

/* XML attributes — android:name, android:value */
.hljs-attr  { color: #50fa7b; font-style: italic; }

/* XML attribute values — "com.clevertap…" */
.hljs-tag .hljs-string { color: #f1fa8c; }

/* Symbols / labels */
.hljs-symbol,
.hljs-bullet { color: #bd93f9; }

/* Section headings (Markdown / others) */
.hljs-section { color: #50fa7b; font-weight: bold; }

/* Diff additions / deletions */
.hljs-addition { color: #50fa7b; background: #223324; }
.hljs-deletion  { color: #ff5555; background: #3a2020; }

/* Variable names */
.hljs-variable      { color: #babccf; }
.hljs-template-variable { color: #babccf; }

/* Emphasised / strong inside comments */
.hljs-emphasis { font-style: italic; }
.hljs-strong   { font-weight: bold; }

/* Code block language label */
.article pre::before {
  content: attr(data-lang);
  position: absolute;
  top: 9px;
  right: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: #6272a4;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  pointer-events: none;
}

/* Plain, non-code fenced blocks (e.g. illustrative ASCII flow diagrams) —
   keep the Dracula background/foreground for visual consistency with real
   code blocks, but skip all token-level coloring (keywords, calls, etc.). */
.article pre.pre-plain {
  background: #282a36;
  border: 1px solid #44475a;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}
.article pre.pre-plain code {
  display: block;
  padding: 20px 22px;
  color: #f8f8f3;
  font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
  font-size: 0.865rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
}
.article pre.pre-plain::before { display: none; }

/* === Tables === */
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--table-border);
}

.article th {
  background: var(--table-header);
  color: var(--text);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--table-border);
}

.article td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--table-border);
  vertical-align: top;
}

.article tr:last-child td { border-bottom: none; }
.article tr:nth-child(even) td { background: var(--bg-secondary); }

/* === Blockquotes (callouts) === */
.article blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent-light);
  padding: 12px 16px;
  margin: 1rem 0;
  border-radius: 0 6px 6px 0;
  color: var(--text);
}

.article blockquote p { margin-bottom: 0; }
.article blockquote strong { color: var(--accent); }

/* Custom callout classes injected via JS */
.callout {
  padding: 14px 16px;
  border-radius: 8px;
  margin: 1rem 0;
  border: 1px solid transparent;
  font-size: 0.9rem;
}
.callout-tip { background: var(--tip-bg); border-color: var(--tip-border); }
.callout-warn { background: var(--warn-bg); border-color: var(--warn-border); }
.callout-info { background: var(--info-bg); border-color: var(--info-border); }
.callout-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.callout-tip .callout-label { color: var(--tip-border); }
.callout-warn .callout-label { color: var(--warn-border); }
.callout-info .callout-label { color: var(--info-border); }

/* === Page navigation === */
.page-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  gap: 16px;
}

.page-nav-btn {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  transition: all 0.15s;
  min-width: 120px;
}

.page-nav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.page-nav-btn.hidden { visibility: hidden; }

/* === TOC === */
.toc-panel {
  width: var(--toc-width);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--topbar-height) + 24px);
  align-self: flex-start;
  max-height: calc(100vh - var(--topbar-height) - 48px);
  overflow-y: auto;
  padding: 16px 0;
}

.toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 4px;
}

#toc-list {
  list-style: none;
  padding: 0;
}

#toc-list li a {
  display: block;
  padding: 4px 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all 0.1s;
  line-height: 1.4;
}

#toc-list li a:hover {
  color: var(--text);
  border-left-color: var(--border);
}

#toc-list li a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-light);
}

#toc-list li.toc-h3 a { padding-left: 20px; font-size: 12px; }

/* === Loading === */
.loading {
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
  padding: 60px 0;
}

/* === Badge === */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent);
  margin-left: 6px;
  vertical-align: middle;
}

/* === Steps === */
.step-list { counter-reset: step-counter; list-style: none; margin-left: 0; }
.step-list li {
  position: relative;
  padding-left: 44px;
  margin-bottom: 1.2rem;
  counter-increment: step-counter;
}
.step-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 1px;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

/* === Hero / Page intro === */
.page-hero {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 2rem;
}

.page-hero h1 { border-bottom: none; padding-bottom: 0; margin-bottom: 8px; }
.page-hero p { color: var(--text-muted); margin-bottom: 0; }

/* === Responsive === */
@media (max-width: 1100px) {
  .toc-panel { display: none; }
}

@media (max-width: 768px) {
  .layout { margin-left: 0; }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open { transform: translateX(0); }

  .menu-toggle { display: flex; }

  .main { padding: 0 16px; }

  .content-wrapper { padding: 24px 0 40px; }

  .article h1 { font-size: 1.6rem; }
  .article h2 { font-size: 1.2rem; }
}

/* === Platform Toggle === */
.platform-toggle {
  display: flex;
  margin-top: 12px;
  background: rgba(0,0,0,0.25);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.platform-btn {
  flex: 1;
  padding: 5px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--sidebar-heading);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-align: center;
}

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

.platform-btn.active {
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

/* === Language Toggle === */
.lang-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
}

.lang-btn {
  padding: 3px 8px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-transform: uppercase;
}

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

.lang-btn.active {
  background: var(--accent);
  color: #ffffff;
}

/* === Utility === */
.hidden { display: none !important; }

/* === Admin passcode gate === */
.login-gate {
  position: fixed;
  inset: 0;
  background: #151a26;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.login-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.login-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.login-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#login-passcode {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 14px;
}
#login-passcode:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

#login-form button[type="submit"] {
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.15s;
}
#login-form button[type="submit"]:hover { opacity: 0.9; }
#login-form button[type="submit"]:disabled { opacity: 0.6; cursor: default; }

.login-error {
  margin-top: 14px;
  color: var(--accent);
  font-size: 0.82rem;
}

/* === Share / logout controls === */
.share-btn,
.logout-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.15s;
}
.share-btn:hover,
.logout-btn:hover { background: var(--bg-secondary); }

.logout-btn {
  margin-top: 8px;
  width: 100%;
  color: var(--sidebar-text);
  border-color: var(--sidebar-border);
  background: transparent;
}
.logout-btn:hover { background: var(--sidebar-hover-bg); }

.sidebar-footer { display: flex; flex-direction: column; }

/* Only relevant once logged in / share button only useful once there's
   something to browse — hide both until the admin app has booted. */
.share-btn { display: none; }
body.is-admin .share-btn { display: inline-block; }

/* === Reader platform toggle (public view) ===
   Same visual idea as .lang-toggle, but for switching platform on a
   shared doc link. Deliberately not reusing .platform-btn — that class
   is styled for the dark sidebar background. */
.reader-platform-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
}

.reader-platform-btn {
  padding: 3px 10px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

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

.reader-platform-btn.active {
  background: var(--accent);
  color: #ffffff;
}

/* === Public single-doc reader mode ===
   A shared doc link never shows the sidebar or prev/next paging — just
   the one page the admin shared. The language toggle (and the platform
   toggle, styled separately above) stay visible so a logged-out reader
   can still switch to another translation of this same doc. */
body.public-view .sidebar,
body.public-view .menu-toggle,
body.public-view .page-nav,
body.public-view .share-btn {
  display: none !important;
}
body.public-view .layout { margin-left: 0; }

/* === Coming Soon placeholder === */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 24px;
  color: var(--text-muted);
  text-align: center;
}

.coming-soon-icon { font-size: 48px; opacity: 0.4; }

.coming-soon h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.coming-soon p { font-size: 0.9rem; margin: 0; max-width: 320px; }
