/* Shared look for the Tutorial, Privacy Policy and Terms pages */
:root {
  --bg: #090D16;
  --card-bg: #121829;
  --card-hover: #172037;
  --card-border: #1E2943;
  --primary: #38BDF8;
  --accent: #6366F1;
  --purple: #7C3AED;
  --purple-soft: #A78BFA;
  --emerald: #10B981;
  --amber: #F59E0B;
  --blue-link: #60A5FA;
  --text: #F1F5F9;
  --text-body: #CBD5E1;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --radius: 16px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: var(--blue-link); }
img { max-width: 100%; display: block; }

/* ---------- Header + mobile drawer ---------- */
header {
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.1rem; }
.logo-img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.nav-links { display: flex; align-items: center; gap: 24px; list-style: none; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: 0.95rem; transition: color 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text);
  width: 38px; height: 38px;
  border-radius: 9px;
  align-items: center; justify-content: center;
  cursor: pointer;
}
.drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 9999;
  justify-content: flex-end;
}
.drawer-overlay.open { display: flex; }
.drawer-content {
  width: 270px; max-width: 82%; height: 100%;
  background: #0e1422;
  border-left: 1px solid var(--card-border);
  padding: 20px 16px;
  display: flex; flex-direction: column;
  animation: slideIn 0.22s ease-out;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid var(--card-border); margin-bottom: 16px; }
.drawer-close { background: rgba(255, 255, 255, 0.08); border: none; color: var(--text-body); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 1.05rem; }
.drawer-nav { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.drawer-nav a { display: block; padding: 12px 14px; border-radius: 10px; color: var(--text-muted); text-decoration: none; font-weight: 600; }
.drawer-nav a:hover, .drawer-nav a.active { background: rgba(56, 189, 248, 0.12); color: var(--primary); }

footer {
  margin-top: auto;
  background: #060910;
  border-top: 1px solid var(--card-border);
  padding: 28px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
}
footer nav { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
footer nav a { color: var(--text-muted); text-decoration: none; }
footer nav a:hover { color: var(--primary); }

/* ---------- Legal pages (Privacy, Terms) ---------- */
.container { max-width: 900px; margin: 36px auto 60px; padding: 0 24px; width: 100%; }
.card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 44px; }
.legal h1 { font-size: 2.1rem; font-weight: 800; color: #fff; line-height: 1.25; margin-bottom: 8px; }
.meta { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--card-border); }
.legal h2 { font-size: 1.25rem; font-weight: 700; color: #fff; margin: 34px 0 12px; display: flex; align-items: center; gap: 10px; }
.legal h2::before { content: ""; width: 4px; height: 18px; background: var(--primary); border-radius: 2px; flex-shrink: 0; }
.legal h3 { font-size: 1.05rem; font-weight: 700; color: #E2E8F0; margin: 20px 0 8px; }
.legal p, .legal ul { color: var(--text-body); margin-bottom: 14px; font-size: 1rem; }
.legal ul { padding-left: 22px; }
.legal li { margin-bottom: 8px; }
.legal strong { color: #fff; }

.summary {
  background: rgba(16, 185, 129, 0.07);
  border: 1px solid rgba(16, 185, 129, 0.28);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 8px;
}
.summary h2 { margin-top: 0 !important; }
.summary h2::before { background: var(--emerald) !important; }
.summary ul { list-style: none; padding-left: 0; margin-bottom: 0; }
.summary li { display: flex; gap: 10px; align-items: flex-start; }
.summary li::before { content: "✓"; color: var(--emerald); font-weight: 800; flex-shrink: 0; }

.data-table { width: 100%; border-collapse: collapse; margin: 6px 0 16px; font-size: 0.95rem; }
.data-table th, .data-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--card-border); vertical-align: top; }
.data-table th { color: #fff; font-weight: 700; background: rgba(255, 255, 255, 0.03); }
.data-table td { color: var(--text-body); }
.table-wrap { overflow-x: auto; }

.note {
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 12px;
  padding: 14px 18px;
  color: #BAE6FD;
  margin: 10px 0 16px;
}
.note strong { color: #E0F2FE; }

.bottom-link-box { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--card-border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.bottom-link-box span { color: var(--text-dim); }
.blue-link { color: var(--blue-link); font-weight: 700; font-size: 1.05rem; }

/* ---------- Tutorial ---------- */
.page-header { text-align: center; padding: 52px 24px 18px; max-width: 760px; margin: 0 auto; }
.page-header h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 14px; }
.page-header p { color: var(--text-muted); font-size: 1.12rem; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 24px; width: 100%; }

.toc { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 22px auto 10px; }
.toc a {
  text-decoration: none; color: var(--text-body); font-weight: 600; font-size: 0.92rem;
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 30px; padding: 8px 16px;
}
.toc a:hover { border-color: var(--primary); color: var(--primary); }

.overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 30px 0 10px; }
.overview-item { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 22px; }
.overview-item .num { width: 34px; height: 34px; border-radius: 50%; background: var(--purple); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.overview-item h3 { font-size: 1.08rem; margin-bottom: 6px; }
.overview-item p { color: var(--text-muted); font-size: 0.94rem; }

.section { margin: 64px 0 0; }
.section-label { color: var(--primary); font-weight: 800; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.section h2 { font-size: 1.85rem; font-weight: 800; line-height: 1.25; margin-bottom: 10px; }
.section > p.lead { color: var(--text-muted); font-size: 1.05rem; max-width: 720px; margin-bottom: 22px; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.choice { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--text); display: block; transition: border-color 0.2s, transform 0.2s; }
.choice:hover { border-color: var(--purple-soft); transform: translateY(-2px); }
.choice .tag { display: inline-block; font-size: 0.75rem; font-weight: 800; color: #052e1c; background: var(--emerald); border-radius: 20px; padding: 2px 10px; margin-bottom: 10px; }
.choice .tag.grey { background: #334155; color: #E2E8F0; }
.choice h3 { font-size: 1.2rem; margin-bottom: 6px; }
.choice p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 10px; }
.choice .go { color: var(--purple-soft); font-weight: 700; font-size: 0.95rem; }

.setup { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.setup.three { grid-template-columns: repeat(3, 1fr); }
.setup-step { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; }
.setup-step .head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.setup-step .n { width: 28px; height: 28px; border-radius: 50%; background: var(--purple); color: #fff; font-weight: 800; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.setup-step h3 { font-size: 1rem; line-height: 1.3; }
.setup-step p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 14px; flex-grow: 1; }

.callout { display: flex; gap: 14px; align-items: flex-start; border-radius: 14px; padding: 16px 18px; margin-top: 16px; font-size: 0.97rem; }
.callout .ico { font-size: 1.3rem; line-height: 1.4; flex-shrink: 0; }
.callout.green { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.28); color: #A7F3D0; }
.callout.blue { background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.25); color: #BAE6FD; }
.callout.amber { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.3); color: #FDE68A; }
.callout strong { color: #fff; }

.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.how { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.how img { width: 100%; height: auto; aspect-ratio: 420 / 868; background: var(--card-bg); }
.how-grid.two { grid-template-columns: repeat(2, 1fr); max-width: 680px; }
.how-grid.four { grid-template-columns: repeat(4, 1fr); }
.how .body { padding: 16px 18px 20px; }
.choice.static { cursor: default; }
.choice.static:hover { transform: none; border-color: var(--card-border); }
.choice ol { color: var(--text-body); padding-left: 20px; font-size: 0.95rem; }
.choice ol li { margin-bottom: 6px; }
.data-table.plain-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.data-table.plain-card tr:last-child td { border-bottom: none; }
.how h3 { font-size: 1.05rem; margin-bottom: 4px; }
.how p { color: var(--text-muted); font-size: 0.92rem; }

.gesture-table { width: 100%; border-collapse: collapse; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden; margin-top: 18px; }
.gesture-table td { padding: 14px 16px; border-bottom: 1px solid var(--card-border); color: var(--text-body); vertical-align: top; }
.gesture-table tr:last-child td { border-bottom: none; }
.gesture-table td:first-child { color: #fff; font-weight: 700; width: 42%; }

.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tool { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px; padding: 18px; }
.tool strong { display: block; margin-bottom: 4px; }
.tool span { color: var(--text-muted); font-size: 0.92rem; }

.langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.langs span { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 30px; padding: 6px 14px; font-size: 0.92rem; color: var(--text-body); }

.faq details { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 14px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 18px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 18px 16px; color: var(--text-body); font-size: 0.96rem; }
.faq .answer ol, .faq .answer ul { padding-left: 20px; margin-top: 6px; }

/* ---------- Phone mock-ups of the Settings screens (same look as the app's own guide) ---------- */
.phone {
  margin-top: auto;
  align-self: center;
  width: 100%;
  max-width: 210px;
  background: #0F1219;
  border: 4px solid #262B38;
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 10px 12px 16px;
  min-height: 210px;
}
.phone .notch { width: 40px; height: 4px; border-radius: 3px; background: #262B38; margin: 0 auto 12px; }
.m-head { display: flex; align-items: center; gap: 4px; color: #E2E8F0; font-weight: 700; font-size: 0.82rem; margin-bottom: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-head::before { content: "‹"; color: #64748B; font-size: 1.1rem; line-height: 1; margin-right: 2px; }
.m-line { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.m-line::before { content: ""; width: 22px; height: 22px; border-radius: 7px; background: #1C2130; flex-shrink: 0; }
.m-line::after { content: ""; height: 8px; width: 62%; border-radius: 5px; background: #1C2130; }
.m-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; font-size: 0.78rem; color: #CBD5E1; }
.m-target {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  background: #1E2230;
  border: 2px solid var(--purple-soft);
  border-radius: 12px;
  padding: 7px 8px;
  margin: 4px 0;
  font-size: 0.78rem; font-weight: 600; color: #fff;
  animation: ring 1.6s ease-in-out infinite;
}
@keyframes ring { 0%, 100% { border-color: rgba(167, 139, 250, 0.3); } 50% { border-color: rgba(167, 139, 250, 0.95); } }
.m-target .finger { position: absolute; right: 6px; bottom: -12px; font-size: 1.05rem; filter: drop-shadow(0 2px 2px rgba(0,0,0,.6)); animation: tap 1.6s ease-in-out infinite; }
@keyframes tap { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.m-icon { width: 22px; height: 22px; border-radius: 7px; background: #2563EB; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; flex-shrink: 0; }
.m-app { width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0; object-fit: cover; }
.m-sub { display: block; font-size: 0.68rem; font-weight: 400; color: #94A3B8; }
.m-grow { flex: 1; min-width: 0; }
.m-switch { width: 32px; height: 18px; border-radius: 10px; background: #334155; position: relative; flex-shrink: 0; animation: switchTrack 2.4s infinite; }
.m-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #94A3B8; animation: switchKnob 2.4s infinite; }
@keyframes switchTrack { 0%, 40% { background: #334155; } 50%, 90% { background: var(--purple); } 100% { background: #334155; } }
@keyframes switchKnob { 0%, 40% { left: 3px; background: #94A3B8; } 50%, 90% { left: 17px; background: #fff; } 100% { left: 3px; background: #94A3B8; } }
.m-radio { width: 15px; height: 15px; border-radius: 50%; border: 2px solid #475569; flex-shrink: 0; position: relative; }
.m-radio.on { border-color: var(--purple-soft); }
.m-radio.on::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--purple-soft); }
.m-radio.pick { animation: radioRing 2.4s infinite; }
.m-radio.pick::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--purple-soft); animation: radioDot 2.4s infinite; }
.m-radio.unpick::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--purple-soft); animation: radioDotOff 2.4s infinite; }
@keyframes radioRing { 0%, 45% { border-color: #475569; } 55%, 95% { border-color: var(--purple-soft); } 100% { border-color: #475569; } }
@keyframes radioDot { 0%, 45% { transform: scale(0); } 55%, 95% { transform: scale(1); } 100% { transform: scale(0); } }
@keyframes radioDotOff { 0%, 45% { transform: scale(1); } 55%, 95% { transform: scale(0); } 100% { transform: scale(1); } }
.m-dialog { background: #1E2230; border-radius: 14px; padding: 10px; margin-top: 8px; }
.m-dialog .q { display: flex; gap: 8px; align-items: flex-start; font-size: 0.74rem; font-weight: 700; color: #fff; line-height: 1.35; margin-bottom: 10px; }
.m-dialog .btns { display: flex; justify-content: flex-end; align-items: center; gap: 10px; font-size: 0.74rem; }
.m-dialog .cancel { color: #64748B; }
.m-dialog .ok { background: var(--purple); color: #fff; font-weight: 800; border-radius: 9px; padding: 4px 12px; border: 2px solid var(--purple-soft); animation: ring 1.6s ease-in-out infinite; }
.m-keys { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0 4px; }
.m-volkey { width: 70px; height: 26px; border-radius: 8px; background: #1E2230; border: 2px solid #334155; color: #94A3B8; font-size: 0.72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.m-volkey.hold { border-color: var(--purple-soft); color: #fff; animation: hold 1.8s ease-in-out infinite; }
@keyframes hold { 0%, 100% { transform: translateX(0); background: #1E2230; } 30%, 80% { transform: translateX(-4px); background: #2E2552; } }
.m-caption { color: #94A3B8; font-size: 0.72rem; text-align: center; }

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

/* ---------- Phones ---------- */
@media (max-width: 900px) {
  .setup, .setup.three { grid-template-columns: repeat(2, 1fr); }
  .how-grid, .how-grid.four, .tools { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .nav-links { display: none; }
  .menu-toggle { display: flex; }
  .header-container { padding: 0 16px; height: 58px; }
  .logo span { font-size: 0.95rem; }
  .container { padding: 0 16px; margin: 16px auto 36px; }
  .card { padding: 22px 18px; border-radius: 14px; }
  .legal h1 { font-size: 1.6rem; }
  .legal h2 { font-size: 1.1rem; }
  .legal p, .legal ul { font-size: 0.95rem; }
  .wrap { padding: 0 16px; }
  .page-header { padding: 32px 16px 8px; }
  .page-header h1 { font-size: 1.9rem; }
  .overview, .choice-grid { grid-template-columns: 1fr; }
  .section { margin-top: 48px; }
  .section h2 { font-size: 1.45rem; }
  .gesture-table td:first-child { width: 46%; }
}
@media (max-width: 520px) {
  .setup, .setup.three, .how-grid, .how-grid.two, .how-grid.four, .tools { grid-template-columns: 1fr; }
  .phone { max-width: 230px; }
  /* One picture per row: keep it phone-sized instead of the full width */
  .how img { max-width: 250px; margin: 14px auto 0; border-radius: 14px; }
}
