/* ==========================================================================
 * Panda Cloner — Design System
 * Google Drive look & feel: Material 3 Drive palette, Google Sans / Roboto,
 * pill navigation, white rounded content surface on #f8fafd canvas.
 * ========================================================================== */

:root {
  /* Canvas & surfaces (Drive light) */
  --bg-canvas: #f8fafd;
  --bg-surface: #ffffff;
  --bg-elevated: #f0f4f9;
  --bg-subtle: #e9eef6;
  --bg-hover: rgba(68, 71, 70, 0.08);
  --bg-press: rgba(68, 71, 70, 0.12);

  --border-subtle: #e1e3e1;
  --border-default: #c4c7c5;
  --border-strong: #747775;

  --text-primary: #1f1f1f;
  --text-secondary: #444746;
  --text-muted: #5e5e5e;
  --text-faint: #8e918f;

  /* Brand (Drive blue) */
  --primary: #0b57d0;
  --primary-hover: #0842a0;
  --on-primary: #ffffff;
  --primary-container: #c2e7ff;
  --on-primary-container: #001d35;
  --selected: #d3e3fd;
  --on-selected: #041e49;
  --primary-soft: rgba(11, 87, 208, 0.08);

  /* Status */
  --success: #146c2e;
  --success-container: #c4eed0;
  --on-success-container: #072711;
  --warning: #7a5900;
  --warning-container: #ffefc9;
  --on-warning-container: #3f2e00;
  --error: #b3261e;
  --error-container: #f9dedc;
  --on-error-container: #410e0b;

  /* Google accents */
  --g-blue: #4285f4;
  --g-red: #ea4335;
  --g-yellow: #fbbc04;
  --g-green: #34a853;

  /* Legacy aliases used by older inline styles */
  --brand-indigo: var(--primary);
  --brand-violet: var(--primary);
  --brand-cyan: var(--primary);
  --brand-emerald: var(--success);
  --brand-amber: var(--warning);
  --brand-rose: var(--error);
  --accent-text: var(--primary);

  --elev-1: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
  --elev-2: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 2px 6px 2px rgba(60, 64, 67, 0.15);
  --elev-3: 0 4px 8px 3px rgba(60, 64, 67, 0.15), 0 1px 3px rgba(60, 64, 67, 0.3);
  --shadow-card: none;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  --font-display: 'Google Sans', 'Google Sans Text', 'Product Sans', 'Roboto', Arial, sans-serif;
  --font-sans: 'Google Sans Text', 'Google Sans', 'Roboto', Arial, sans-serif;
  --font-mono: 'Roboto Mono', 'Google Sans Mono', Consolas, monospace;

  --topbar-h: 64px;
  --sidebar-w: 256px;
}

body.dark-mode {
  --bg-canvas: #1b1b1b;
  --bg-surface: #131314;
  --bg-elevated: #1e1f20;
  --bg-subtle: #282a2c;
  --bg-hover: rgba(227, 227, 227, 0.08);
  --bg-press: rgba(227, 227, 227, 0.12);

  --border-subtle: #333537;
  --border-default: #444746;
  --border-strong: #8e918f;

  --text-primary: #e3e3e3;
  --text-secondary: #c4c7c5;
  --text-muted: #a8abaa;
  --text-faint: #8e918f;

  --primary: #a8c7fa;
  --primary-hover: #d3e3fd;
  --on-primary: #062e6f;
  --primary-container: #004a77;
  --on-primary-container: #c2e7ff;
  --selected: #004a77;
  --on-selected: #c2e7ff;
  --primary-soft: rgba(168, 199, 250, 0.1);

  --success: #6dd58c;
  --success-container: #0f5223;
  --on-success-container: #c4eed0;
  --warning: #fdd663;
  --warning-container: #5c4300;
  --on-warning-container: #ffefc9;
  --error: #f2b8b5;
  --error-container: #8c1d18;
  --on-error-container: #f9dedc;

  --elev-1: 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.15);
  --elev-2: 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 2px 6px 2px rgba(0, 0, 0, 0.15);
  --elev-3: 0 4px 8px 3px rgba(0, 0, 0, 0.25), 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s ease, color 0.2s ease;
}

h1, h2, h3, .brand-title { font-family: var(--font-display); }

::selection { background: var(--primary-container); color: var(--on-primary-container); }

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 0.08rem 0.38rem;
  border-radius: var(--radius-xs);
  background: var(--bg-elevated);
  color: var(--text-primary);
  word-break: break-all;
}

a { color: var(--primary); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 12px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--border-strong); }
::-webkit-scrollbar-track { background: transparent; }

.muted { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }
.ambient-bg { display: none; }

/* ---------- Top app bar (Drive header) ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--topbar-h);
  background: var(--bg-canvas);
}
.navbar-inner {
  height: 100%;
  padding: 0 1rem 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn.menu-btn { display: none; }

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
  width: calc(var(--sidebar-w) - 0.5rem);
  padding-left: 0.6rem;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-container);
  color: var(--on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}
.brand-logo { width: 40px; height: 40px; flex-shrink: 0; display: block; transition: transform 0.3s var(--ease); }
.brand:hover .brand-logo { transform: rotate(-6deg) scale(1.06); }
.auth-brand .brand-logo { width: 60px; height: 60px; margin-bottom: 0.75rem; }
.admin-login-card .brand-logo { width: 64px; height: 64px; }
.flow-node.core .flow-icon img { display: block; }
.footer-brand img { display: block; }
.brand-title { font-size: 22px; font-weight: 400; color: var(--text-secondary); letter-spacing: 0; line-height: 1.1; }
.brand-title b { font-weight: 500; color: var(--text-primary); }
.brand-sub { display: none; }

/* Quick clone bar (Drive search pill) */
.quick-bar {
  flex: 1;
  min-width: 0;
  max-width: 720px;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.4rem 0 0.4rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.quick-bar:focus-within { background: var(--bg-surface); box-shadow: var(--elev-1); }
.quick-bar input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  outline: none;
}
.quick-bar input::placeholder { color: var(--text-secondary); }

.nav-actions { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; flex-shrink: 0; }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
  transition: background 0.15s ease;
}
.icon-btn:hover { background: var(--bg-hover); }
.icon-btn:active { background: var(--bg-press); }

.panda-bot-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 40px;
  padding: 0 1rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.panda-bot-btn:hover { background: var(--bg-hover); }

.account-pill { display: flex; align-items: center; gap: 0.35rem; }
.account-meta { line-height: 1.2; text-align: right; max-width: 170px; }
.account-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 15px;
  flex-shrink: 0;
}

.plan-chip {
  display: inline-block;
  padding: 0 0.45rem;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}
.plan-chip.pro { background: var(--selected); color: var(--on-selected); }
.plan-chip.ultra { background: var(--success-container); color: var(--on-success-container); }

/* ---------- App layout: sidebar + content surface ---------- */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--topbar-h));
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 0.5rem 1rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
}

.new-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  align-self: flex-start;
  height: 56px;
  padding: 0 1.25rem 0 1rem;
  margin: 0 0 1rem 0.25rem;
  border-radius: var(--radius-lg);
  border: none;
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--elev-1);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}
.new-btn i { font-size: 1.25rem; color: var(--text-primary); }
.new-btn:hover { box-shadow: var(--elev-3); background: var(--bg-elevated); }
body.dark-mode .new-btn { background: var(--bg-subtle); }

.nav-tabs { display: flex; flex-direction: column; gap: 1px; }
.nav-tab {
  border: none;
  background: transparent;
  color: var(--text-primary);
  height: 32px;
  padding: 0 0.75rem 0 1rem;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  text-align: left;
  white-space: nowrap;
  transition: background 0.12s ease;
}
.nav-tab i { width: 20px; text-align: center; font-size: 15px; color: var(--text-secondary); }
.nav-tab:hover { background: var(--bg-hover); }
.nav-tab.active { background: var(--primary-container); color: var(--on-primary-container); font-weight: 600; }
.nav-tab.active i { color: var(--on-primary-container); }
.nav-sep { height: 1px; background: transparent; margin: 0.5rem 0; }

.side-quota { margin-top: 1rem; padding: 0 0.5rem 0 1rem; }
.side-quota-label { display: flex; align-items: center; gap: 1.1rem; font-size: 14px; color: var(--text-primary); margin-bottom: 0.6rem; }
.side-quota-label i { width: 20px; text-align: center; color: var(--text-secondary); }
.side-quota-track { height: 4px; border-radius: 4px; background: var(--border-subtle); overflow: hidden; margin-bottom: 0.45rem; }
.side-quota-fill { height: 100%; width: 0%; background: var(--primary); border-radius: 4px; transition: width 0.4s var(--ease); }
.side-quota-fill.high { background: var(--error); }
.side-quota-text { font-size: 12px; color: var(--text-secondary); }
.side-quota .btn { margin-top: 0.85rem; }

.sidebar-foot { margin-top: auto; padding: 1rem 0.5rem 0 1rem; font-size: 12px; color: var(--text-secondary); }
.sidebar-foot a { text-decoration: none; font-weight: 500; }

.sidebar-scrim { display: none; }

.content-surface {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  margin: 0 1rem 1rem 0;
  min-height: calc(100vh - var(--topbar-h) - 1rem);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shell { flex: 1; width: 100%; max-width: 1280px; margin: 0 auto; padding: 1.25rem 1.75rem 2.5rem; }
.view-panel { display: none; }
.view-panel.active { display: block; animation: fadeIn 0.2s var(--ease); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Page headers like "My Drive" */
.page-head { margin: 0.25rem 0 1.25rem; }
.page-head h1 { font-size: 24px; font-weight: 400; color: var(--text-primary); line-height: 1.3; }
.page-head p { color: var(--text-secondary); margin-top: 0.2rem; font-size: 14px; max-width: 680px; }
.page-head-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.eyebrow { display: none; }

.section-title { margin: 0 0 1rem; }
.section-title h2 { font-size: 22px; font-weight: 400; margin-bottom: 0.2rem; }
.section-title p { color: var(--text-secondary); }

/* ---------- Landing ---------- */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
  padding: 2.5rem 0.5rem 3rem;
}
.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem 0.3rem 0.35rem;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 1.25rem;
}
.hero-pill .pill-dot {
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 500;
  font-size: 12px;
}
.landing-hero h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  color: var(--text-primary);
}
.landing-hero h1 .hl { color: var(--primary); }
.landing-hero p { font-size: 17px; color: var(--text-secondary); margin-bottom: 1.75rem; max-width: 560px; line-height: 1.6; }
.hero-note { margin-top: 1rem; font-size: 13px; color: var(--text-secondary); display: flex; gap: 1.25rem; flex-wrap: wrap; }
.hero-note span { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero-note i { color: var(--success); }

/* Mock "Drive file list" preview */
.hero-preview {
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--elev-2);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.preview-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--border-subtle); }
.preview-bar .preview-title { font-family: var(--font-display); font-size: 16px; }
.preview-bar .tag { margin-left: auto; }
.preview-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.6rem 1.1rem; border-bottom: 1px solid var(--border-subtle); font-size: 13.5px; }
.preview-row:last-of-type { border-bottom: none; }
.preview-row .f-ico { width: 20px; text-align: center; font-size: 16px; }
.preview-row .f-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-row .f-meta { color: var(--text-secondary); font-size: 12px; }
.preview-row .f-ok { color: var(--success); }
.preview-row .f-spin { color: var(--primary); }
.preview-foot { padding: 0.85rem 1.1rem 1rem; background: var(--bg-elevated); }
.preview-foot-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 0.45rem; }
.preview-track { height: 4px; border-radius: 4px; background: var(--border-subtle); overflow: hidden; }
.preview-track div { height: 100%; width: 64%; background: var(--primary); border-radius: 4px; animation: previewGrow 3.2s var(--ease) infinite alternate; }
@keyframes previewGrow { from { width: 24%; } to { width: 88%; } }
.ic-folder { color: var(--text-secondary); }
.ic-video { color: var(--g-red); }
.ic-pdf { color: var(--g-red); }
.ic-doc { color: var(--g-blue); }
.ic-sheet { color: var(--g-green); }
.ic-image { color: var(--g-red); }
.ic-zip { color: var(--text-secondary); }

/* Stats strip */
.stats-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 2.5rem; }
.stat-cell { padding: 1rem 1.15rem; border-radius: var(--radius-md); background: var(--bg-elevated); }
.stat-num { font-family: var(--font-display); font-size: 26px; font-weight: 400; color: var(--text-primary); }
.stat-num span { color: var(--primary); }
.stat-lbl { font-size: 13px; color: var(--text-secondary); }

/* Steps */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 2.5rem; }
.step-card { padding: 1.25rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-surface); }
.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-container); color: var(--on-primary-container);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 500; font-size: 14px;
  margin-bottom: 0.85rem;
}
.step-card h3 { font-size: 16px; font-weight: 500; margin-bottom: 0.25rem; }
.step-card p { font-size: 14px; color: var(--text-secondary); }

/* Features — Drive "Suggested" cards */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; margin-bottom: 2.5rem; }
.feature-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.2rem;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.feature-card:hover { background: var(--bg-subtle); }
.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 0.8rem;
  flex-shrink: 0;
}
.card .feature-icon { background: var(--bg-elevated); }
.feature-card h3 { font-size: 15px; font-weight: 500; margin-bottom: 0.25rem; }
.feature-card p { font-size: 13.5px; color: var(--text-secondary); }
.feature-card:nth-child(4n+1) .feature-icon { color: var(--g-blue); }
.feature-card:nth-child(4n+2) .feature-icon { color: var(--g-green); }
.feature-card:nth-child(4n+3) .feature-icon { color: #e37400; }
.feature-card:nth-child(4n+4) .feature-icon { color: var(--g-red); }

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 1.5rem 1.75rem;
  border-radius: var(--radius-lg);
  background: var(--primary-container);
  color: var(--on-primary-container);
}
.cta-band h2 { font-size: 22px; font-weight: 400; }
.cta-band p { font-size: 14px; opacity: 0.85; }

/* ---------- Home animations ---------- */
/* Reveal-on-scroll (only when JS has opted in, so no-JS visitors still see everything) */
.anim-ready [data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: var(--d, 0ms); }
.anim-ready [data-reveal].in { opacity: 1; transform: none; }

/* Hero entrance */
.landing-hero > div:first-child > * { animation: heroUp 0.8s var(--ease) both; }
.landing-hero > div:first-child > *:nth-child(2) { animation-delay: 0.08s; }
.landing-hero > div:first-child > *:nth-child(3) { animation-delay: 0.16s; }
.landing-hero > div:first-child > *:nth-child(4) { animation-delay: 0.24s; }
.landing-hero > div:first-child > *:nth-child(5) { animation-delay: 0.32s; }
.hero-preview { animation: heroUp 0.9s 0.2s var(--ease) both, floatY 6s 1.2s ease-in-out infinite; }
@keyframes heroUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hero-preview .preview-row { animation: rowIn 0.5s var(--ease) both; }
.hero-preview .preview-row:nth-of-type(2) { animation-delay: 0.5s; }
.hero-preview .preview-row:nth-of-type(3) { animation-delay: 0.7s; }
.hero-preview .preview-row:nth-of-type(4) { animation-delay: 0.9s; }
.hero-preview .preview-row:nth-of-type(5) { animation-delay: 1.1s; }
.hero-preview .preview-row:nth-of-type(6) { animation-delay: 1.3s; }
.hero-preview .f-ok { animation: pop 0.4s var(--ease) both; animation-delay: inherit; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* Transfer flow diagram */
.flow {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr 1.2fr 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  margin-bottom: 1.5rem;
}
.flow-node { text-align: center; }
.flow-icon {
  width: 64px; height: 64px; margin: 0 auto 0.6rem; border-radius: 50%;
  background: var(--bg-surface); box-shadow: var(--elev-1);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--text-secondary);
}
.flow-node .fa-google-drive { color: var(--g-green); }
.flow-node .fa-folder-open { color: var(--g-yellow); }
.flow-node.core .flow-icon { width: 76px; height: 76px; font-size: 34px; background: var(--primary-container); }
.flow-icon.pulse { position: relative; }
.flow-icon.pulse::before, .flow-icon.pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--primary); opacity: 0; animation: ring 2.4s ease-out infinite;
}
.flow-icon.pulse::after { animation-delay: 1.2s; }
@keyframes ring { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(1.7); opacity: 0; } }
.flow-title { font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.flow-sub { font-size: 12px; color: var(--text-secondary); }
.flow-lane {
  position: relative; height: 40px;
  background-image: linear-gradient(90deg, var(--border-default) 50%, transparent 50%);
  background-size: 12px 2px; background-repeat: repeat-x; background-position: 0 50%;
  overflow: hidden;
  animation: dashMove 1s linear infinite;
}
@keyframes dashMove { to { background-position: 12px 50%; } }
.flow-dot {
  position: absolute; top: 50%; left: 0;
  width: 28px; height: 28px; margin-top: -14px; border-radius: 8px;
  background: var(--bg-surface); box-shadow: var(--elev-1);
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  animation: travel 3.2s linear infinite; opacity: 0;
}
.flow-dot .fa-file-video, .flow-dot .fa-file-pdf, .flow-dot .fa-file-image { color: var(--g-red); }
.flow-dot .fa-file-lines { color: var(--g-blue); }
.flow-dot.d2 { animation-delay: 0.8s; }
.flow-dot.d3 { animation-delay: 1.6s; }
.flow-dot.d4 { animation-delay: 2.4s; }
@keyframes travel {
  0% { left: -10%; opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

/* Marquee */
.marquee {
  overflow: hidden;
  margin: 0 0 2.75rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; gap: 0.6rem; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-track span {
  display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap;
  height: 38px; padding: 0 1rem; border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle); background: var(--bg-surface);
  font-size: 14px; color: var(--text-secondary);
}
@keyframes marquee { to { transform: translateX(-50%); } }

/* Free vs paid compare */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 2.5rem; }
.compare-card { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.15rem; background: var(--bg-surface); display: flex; flex-direction: column; gap: 0.75rem; }
.compare-card.featured { border: 2px solid var(--primary); }
.compare-card .btn { align-self: flex-start; }
.mini-drive { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; }
.md-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.9rem; border-bottom: 1px solid var(--border-subtle); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-row:last-child { border-bottom: none; }
.md-row.wm { background: var(--warning-container); color: var(--on-warning-container); }
.anim-ready .compare-card.in .md-row.wm { animation: wmFlash 1.6s 0.6s var(--ease) both; }
@keyframes wmFlash { 0% { background: transparent; } 40% { background: var(--g-yellow); } 100% { background: var(--warning-container); } }
.compare-note { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 0.5rem; }
.compare-note .fa-stamp { color: #e37400; }

/* FAQ */
.faq { display: grid; gap: 0.5rem; margin-bottom: 2.5rem; max-width: 860px; }
.faq details { border-radius: var(--radius-md); background: var(--bg-elevated); overflow: hidden; }
.faq summary {
  list-style: none; cursor: pointer; padding: 1rem 1.15rem;
  font-family: var(--font-display); font-size: 15px; font-weight: 500;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 12px; color: var(--text-secondary); transition: transform 0.25s var(--ease); }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq summary:hover { background: var(--bg-hover); }
.faq-body { padding: 0 1.15rem 1rem; color: var(--text-secondary); font-size: 14px; line-height: 1.6; }
.faq details[open] .faq-body { animation: faqOpen 0.3s var(--ease); }
@keyframes faqOpen { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .flow { grid-template-columns: 1fr; gap: 0; padding: 1.25rem; }
  .flow-lane { height: 44px; width: 2px; margin: 0 auto; background-image: linear-gradient(180deg, var(--border-default) 50%, transparent 50%); background-size: 2px 12px; background-repeat: repeat-y; animation: none; overflow: visible; }
  .flow-dot { display: none; }
  .compare { grid-template-columns: 1fr; }
}

/* ---------- Pricing ---------- */
.pricing-head { text-align: center; margin: 1rem auto 2rem; max-width: 640px; }
.pricing-head h2 { font-size: 32px; font-weight: 400; margin-bottom: 0.4rem; line-height: 1.25; }

.cycle-switch {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 1.25rem;
}
.cycle-btn {
  border: none;
  background: transparent;
  color: var(--text-primary);
  height: 40px;
  padding: 0 1.25rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.cycle-btn + .cycle-btn { border-left: 1px solid var(--border-strong); }
.cycle-btn:hover { background: var(--bg-hover); }
.cycle-btn.active { background: var(--selected); color: var(--on-selected); }
.cycle-btn.active::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 12px; }
.cycle-save { color: var(--success); font-weight: 500; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; margin-bottom: 2rem; align-items: stretch; }
.price-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.2s ease;
}
.price-card:hover { box-shadow: var(--elev-2); }
.price-card.featured { border: 2px solid var(--primary); background: var(--bg-surface); }
.price-card .popular-flag {
  position: absolute;
  top: -13px;
  left: 1.5rem;
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-display);
}
.price-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}
.price-card.featured .price-badge { background: var(--selected); color: var(--on-selected); }
.price-name { font-size: 22px; font-weight: 400; }
.price-amount { font-family: var(--font-display); font-size: 40px; font-weight: 400; margin: 0.35rem 0 1.1rem; line-height: 1.15; }
.price-amount span { font-size: 14px; color: var(--text-secondary); }
.price-features { list-style: none; display: grid; gap: 0.6rem; margin-bottom: 1.5rem; flex: 1; align-content: start; }
.price-features li { display: flex; align-items: flex-start; gap: 0.65rem; font-size: 14px; color: var(--text-secondary); }
.price-features i { color: var(--primary); margin-top: 0.2rem; font-size: 13px; }

/* ---------- Cards, forms ---------- */
.hero-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem 0.85rem 1.1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}
.strip-left { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.strip-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--bg-surface); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero-strip-title { font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.hero-strip-desc { font-size: 13px; color: var(--text-secondary); }

.studio-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }

.card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; }
.card.narrow { max-width: 560px; margin: 2rem auto; }
.card.medium { max-width: 720px; margin: 0.5rem auto; }
.card-head {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-height: 56px;
}
.card-head h2 { font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 0.7rem; }
.card-head h2 i { color: var(--text-secondary); font-size: 15px; }
.card-head h2 i.fa-google-drive { color: var(--g-green); }
.card-body { padding: 1.25rem; }

.field { margin-bottom: 1.1rem; }
.field-label { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 0.4rem; }

.input, .select, .textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.textarea { resize: vertical; line-height: 1.5; font-family: var(--font-mono); font-size: 13px; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-primary); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.4rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%), linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.select option { background: var(--bg-surface); color: var(--text-primary); }
.select-sm { padding: 0.4rem 2.2rem 0.4rem 0.65rem; width: auto; font-size: 13px; }

.otp-input { text-align: center; font-family: var(--font-mono); font-size: 24px; letter-spacing: 0.45em; padding: 0.8rem; }
.field-hint { margin-top: 0.35rem; font-size: 12px; color: var(--text-secondary); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.filter-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Material filter chips */
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 32px;
  padding: 0 0.85rem 0 0.6rem;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.check-pill:hover { background: var(--bg-hover); }
.check-pill:has(input:checked) { background: var(--selected); border-color: var(--selected); color: var(--on-selected); }
.check-pill input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 2px solid var(--text-secondary);
  display: grid;
  place-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.check-pill input::before {
  content: '';
  width: 9px;
  height: 9px;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  background: var(--on-primary);
  transform: scale(0);
  transition: transform 0.1s ease;
}
.check-pill input:checked { background: var(--primary); border-color: var(--primary); }
.check-pill input:checked::before { transform: scale(1); }

.dest-picker-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.dest-chip {
  flex: 1;
  min-width: 180px;
  height: 44px;
  padding: 0 0.9rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 14px;
}
.dest-chip i { color: var(--text-secondary); }

.form-divider { height: 1px; background: var(--border-subtle); margin: 1.25rem 0; }
.form-section-title { font-family: var(--font-display); font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 0.75rem; }

/* Segmented buttons (Material 3) */
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-full); overflow: hidden; margin-bottom: 1.1rem; }
.segmented .seg-btn {
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  height: 40px;
  padding: 0 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.segmented .seg-btn + .seg-btn { border-left: 1px solid var(--border-strong); }
.segmented .seg-btn:hover { background: var(--bg-hover); }
.segmented .seg-btn.active { background: var(--selected); color: var(--on-selected); }
.segmented.full { display: flex; }
.segmented.full .seg-btn { flex: 1; }

/* ---------- Buttons ---------- */
.btn-group { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.btn-group.center { justify-content: center; }
.btn-group.end { justify-content: flex-end; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 1.4rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:disabled { opacity: 0.38; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { height: 48px; padding: 0 1.75rem; font-size: 15px; }
.btn-sm { height: 32px; padding: 0 0.9rem; font-size: 13px; }

/* Filled */
.btn-primary, .btn-sky { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover:not(:disabled), .btn-sky:hover:not(:disabled) { background: var(--primary-hover); box-shadow: var(--elev-1); }
body.dark-mode .btn-primary:hover:not(:disabled), body.dark-mode .btn-sky:hover:not(:disabled) { background: var(--primary-hover); }

/* Outlined */
.btn-secondary { background: transparent; color: var(--primary); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--primary-soft); }
.btn-secondary.active { background: var(--selected); color: var(--on-selected); border-color: var(--selected); }

/* Text */
.btn-ghost { background: transparent; color: var(--primary); padding: 0 0.85rem; }
.btn-ghost:hover:not(:disabled) { background: var(--primary-soft); }

/* Tonal */
.btn-tonal { background: var(--primary-container); color: var(--on-primary-container); }
.btn-tonal:hover:not(:disabled) { box-shadow: var(--elev-1); }

.btn-warning { background: var(--warning-container); color: var(--on-warning-container); }
.btn-warning:hover:not(:disabled) { box-shadow: var(--elev-1); }
.btn-danger { background: transparent; color: var(--error); border-color: var(--border-strong); }
.btn-danger:hover:not(:disabled) { background: var(--error-container); color: var(--on-error-container); border-color: var(--error-container); }

/* ---------- Tags / status chips ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 24px;
  padding: 0 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-transform: capitalize;
}
.tag.ok { background: var(--success-container); color: var(--on-success-container); }
.tag.warn { background: var(--warning-container); color: var(--on-warning-container); }
.tag.err { background: var(--error-container); color: var(--on-error-container); }
.tag.info { background: var(--selected); color: var(--on-selected); }
.tag.plain { text-transform: none; }

.inspect-list { display: grid; gap: 0.5rem; margin-top: 1.1rem; }
.inspect-item {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  font-size: 14px;
}
.inspect-item > i { font-size: 18px; margin-top: 0.1rem; color: var(--success); }
.inspect-item.warn > i { color: #e37400; }
.inspect-item.invalid > i { color: var(--error); }
.inspect-item strong { font-weight: 500; }

/* ---------- Transfer monitor ---------- */
.telemetry-empty { padding: 3rem 1.5rem; text-align: center; color: var(--text-secondary); }
.telemetry-empty .empty-icon {
  width: 72px; height: 72px; margin: 0 auto 1rem; border-radius: 50%;
  background: var(--bg-elevated); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.telemetry-empty h3 { color: var(--text-primary); font-size: 18px; font-weight: 400; margin-bottom: 0.3rem; }
.telemetry-empty p { font-size: 14px; max-width: 320px; margin: 0 auto; }

.progress-hero { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.1rem; }
.radial-wrap { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.radial-svg { width: 92px; height: 92px; transform: rotate(-90deg); }
.radial-bg { fill: none; stroke: var(--bg-subtle); stroke-width: 6; }
.radial-fg { fill: none; stroke: var(--primary); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 251.2; stroke-dashoffset: 251.2; transition: stroke-dashoffset 0.45s var(--ease), stroke 0.2s ease; }
.radial-fg.completed { stroke: var(--success); }
.radial-fg.paused { stroke: #e37400; }
.radial-fg.failed, .radial-fg.cancelled { stroke: var(--error); }
.radial-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.radial-pct { font-family: var(--font-display); font-size: 20px; font-weight: 500; line-height: 1; }
.radial-phase-mini { font-size: 10px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.25rem; }

.progress-meta { flex: 1; min-width: 0; }
.phase-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  height: 24px; padding: 0 0.65rem; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; text-transform: capitalize;
  background: var(--selected); color: var(--on-selected);
  margin-bottom: 0.45rem;
}
.phase-pill.completed { background: var(--success-container); color: var(--on-success-container); }
.phase-pill.paused { background: var(--warning-container); color: var(--on-warning-container); }
.phase-pill.failed, .phase-pill.cancelled { background: var(--error-container); color: var(--on-error-container); }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: dotPulse 1.3s ease-in-out infinite; }
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.activity-line { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.speed-strip { font-size: 12px; color: var(--text-secondary); margin-top: 0.25rem; }

.linear-track { position: relative; width: 100%; height: 4px; background: var(--bg-subtle); border-radius: 4px; overflow: hidden; margin-bottom: 1.1rem; }
.linear-fill { position: relative; height: 100%; width: 0%; border-radius: 4px; background: var(--primary); transition: width 0.45s var(--ease); overflow: hidden; }
.linear-fill.is-active::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent); animation: shimmerSweep 1.4s ease-in-out infinite; }
.linear-fill.completed { background: var(--success); }
.linear-fill.paused { background: #e37400; }
@keyframes shimmerSweep { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.metrics-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-bottom: 1rem; }
.metric-tile { background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 0.7rem 0.8rem; }
.metric-val { font-family: var(--font-display); font-size: 18px; font-weight: 500; }
.metric-lbl { font-size: 12px; color: var(--text-secondary); }
.metric-val.locked { color: #e37400; }

.console-box {
  background: #1e1f20;
  color: #e3e3e3;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  height: 210px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  margin-top: 1rem;
}
.console-box:empty::before { content: 'Waiting for log output…'; color: #8e918f; }
.log-ts { color: #8e918f; margin-right: 0.5rem; }
.log-info { color: #e3e3e3; }
.log-success { color: #6dd58c; }
.log-warn { color: #fdd663; }
.log-error { color: #f2b8b5; }
.log-folder { color: #a8c7fa; }
.log-muted { color: #a8abaa; }

.completion-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-subtle); }

/* ---------- Studio extras ---------- */
.studio-right { display: grid; gap: 1rem; align-content: start; }

.wm-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--warning-container);
  color: var(--on-warning-container);
  margin-bottom: 1.1rem;
}
.wm-banner.off { background: var(--success-container); color: var(--on-success-container); }
.wm-icon { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
body.dark-mode .wm-icon { background: rgba(0, 0, 0, 0.2); }
.wm-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.4; }
.wm-text strong { display: block; font-family: var(--font-display); font-weight: 500; font-size: 14px; }

.switch { position: relative; display: inline-flex; flex-shrink: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 52px; height: 32px; border-radius: 16px;
  background: var(--bg-subtle); border: 2px solid var(--border-strong);
  position: relative; display: flex; align-items: center; justify-content: flex-end; padding: 0 6px;
  font-size: 10px; color: var(--on-primary);
  transition: background 0.2s ease;
}
.switch-track::after {
  content: ''; position: absolute; left: 6px; top: 50%; width: 16px; height: 16px; border-radius: 50%;
  background: var(--border-strong); transform: translateY(-50%); transition: all 0.2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--primary); border-color: var(--primary); justify-content: flex-start; }
.switch input:checked + .switch-track::after { left: 26px; width: 22px; height: 22px; background: var(--on-primary); }
.switch.locked { cursor: not-allowed; }
.switch.locked .switch-track i { position: relative; z-index: 1; }
.switch:not(.locked) .switch-track i { display: none; }

.label-tools { display: inline-flex; gap: 0.9rem; font-size: 12px; }
.label-tools .link-btn { font-size: 12px; }
.recent-wrap { position: relative; }
.recent-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  width: min(420px, 80vw);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--elev-2);
  padding: 0.35rem 0;
  max-height: 280px;
  overflow-y: auto;
}
body.dark-mode .recent-menu { background: var(--bg-subtle); }
.recent-menu.open { display: block; animation: fadeIn 0.12s ease; }
.recent-item { display: block; width: 100%; text-align: left; border: none; background: transparent; color: var(--text-primary); padding: 0.55rem 0.9rem; font-family: var(--font-mono); font-size: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item:hover { background: var(--bg-hover); }
.recent-empty { padding: 0.75rem 0.9rem; font-size: 13px; color: var(--text-secondary); }

.link-meter { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.45rem; min-height: 24px; }
.link-meter .field-hint { margin: 0; }

.pro-section { position: relative; }
.pro-badge { display: none; margin-left: 0.4rem; font-size: 11px; font-weight: 500; padding: 0.05rem 0.45rem; border-radius: var(--radius-xs); background: var(--selected); color: var(--on-selected); vertical-align: middle; }
.pro-lock { display: none; }
.pro-section.locked .pro-badge { display: inline-block; }
.pro-section.locked .grid-2, .pro-section.locked .field-hint, .pro-section.locked #rename-preview { opacity: 0.45; pointer-events: none; filter: grayscale(0.4); }
.pro-section.locked .pro-lock {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 0.25rem 0 0.5rem; padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm); background: var(--selected); color: var(--on-selected);
  font-size: 13px; font-weight: 500; cursor: pointer;
}
.pro-section.locked .pro-lock:hover { box-shadow: var(--elev-1); }

.studio-extras { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }

.cat-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: -0.25rem 0 1rem; }
.cat-chip { display: inline-flex; align-items: center; gap: 0.4rem; height: 26px; padding: 0 0.6rem; border-radius: var(--radius-sm); background: var(--bg-elevated); font-size: 12px; color: var(--text-secondary); }
.cat-chip b { color: var(--text-primary); font-weight: 500; }
.cat-chip.wm { background: var(--warning-container); color: var(--on-warning-container); }
.cat-chip.wm b { color: inherit; }

.console-toolbar { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; font-family: var(--font-display); font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.console-toolbar + .console-box { margin-top: 0.4rem; }
.mini-check { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 12px; font-weight: 400; cursor: pointer; margin-right: 0.25rem; }
.mini-check input { accent-color: var(--primary); }
.icon-btn.sm { width: 32px; height: 32px; font-size: 13px; }

.jobs-list { max-height: 320px; overflow-y: auto; }
.job-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.65rem 1.25rem; border-bottom: 1px solid var(--border-subtle); cursor: pointer; transition: background 0.1s ease; }
.job-row:last-child { border-bottom: none; }
.job-row:hover { background: var(--bg-hover); }
.job-row.current { background: var(--primary-soft); }
.job-row .j-main { flex: 1; min-width: 0; }
.job-row .j-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-row .j-meta { font-size: 12px; color: var(--text-secondary); }
.job-row .j-bar { height: 3px; border-radius: 3px; background: var(--border-subtle); margin-top: 0.35rem; overflow: hidden; }
.job-row .j-bar span { display: block; height: 100%; background: var(--primary); }

/* ---------- Google sign-in & consent ---------- */
.consent-list { display: grid; gap: 0.55rem; margin-bottom: 0.9rem; }
.consent-item { display: flex; gap: 0.75rem; padding: 0.7rem 0.85rem; border-radius: var(--radius-md); background: var(--bg-elevated); font-size: 13px; line-height: 1.5; color: var(--text-secondary); text-align: left; }
body.dark-mode .consent-item { background: var(--bg-subtle); }
.consent-item strong { display: block; color: var(--text-primary); font-family: var(--font-display); font-weight: 500; font-size: 14px; margin-bottom: 0.1rem; }
.c-ico { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--selected); color: var(--on-selected); font-size: 14px; }
.c-ico.warn { background: var(--warning-container); color: var(--on-warning-container); }
.c-ico.ok { background: var(--success-container); color: var(--on-success-container); }
.consent-check { display: flex; align-items: center; gap: 0.55rem; font-size: 14px; margin: 0 0 0.9rem; cursor: pointer; }
.consent-check input { width: 18px; height: 18px; accent-color: var(--primary); }
.google-btn {
  width: 100%; height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem;
  border: 1px solid #747775; border-radius: var(--radius-full); background: #ffffff; color: #1f1f1f;
  font-family: 'Roboto', var(--font-sans); font-size: 15px; font-weight: 500; cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.google-btn:hover:not(:disabled) { background: #f8faff; box-shadow: var(--elev-1); }
.google-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.google-btn.loading svg { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body.dark-mode .google-btn { background: #131314; color: #e3e3e3; border-color: #8e918f; }
body.dark-mode .google-btn:hover:not(:disabled) { background: #1e1f20; }
.auth-divider { align-items: center; gap: 0.75rem; margin: 1rem 0 0.5rem; color: var(--text-faint); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-subtle); }
#user-auth-modal .modal-box { max-width: 460px !important; }
.account-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

/* ---------- Admin-managed navbar links ---------- */
.nav-links-ext { display: flex; align-items: center; gap: 0.15rem; margin-right: 0.25rem; }
.nav-link-ext { display: inline-flex; align-items: center; gap: 0.45rem; height: 36px; padding: 0 0.75rem; border-radius: var(--radius-full); color: var(--text-secondary); text-decoration: none; font-family: var(--font-display); font-size: 14px; font-weight: 500; white-space: nowrap; transition: background 0.12s ease, color 0.12s ease; }
.nav-link-ext:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-link-ext i { font-size: 13px; }
.side-links { display: none; }
.side-links-title { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); padding: 0.9rem 1rem 0.3rem; }
.side-link { text-decoration: none; }
@media (max-width: 1250px) { .nav-link-ext span { display: none; } .nav-link-ext { padding: 0; width: 36px; justify-content: center; } }
@media (max-width: 900px) { .nav-links-ext { display: none; } .side-links { display: flex; flex-direction: column; gap: 1px; } }

/* ---------- Site banner (admin announcements / maintenance) ---------- */
.site-banner {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 1rem 1.75rem 0; padding: 0.6rem 0.5rem 0.6rem 1rem;
  border-radius: var(--radius-md);
  background: var(--selected); color: var(--on-selected);
  font-size: 14px; animation: heroUp 0.4s var(--ease) both;
}
.site-banner[hidden] { display: none; }
.site-banner span { flex: 1; }
.site-banner.warn { background: var(--warning-container); color: var(--on-warning-container); }
.site-banner.success { background: var(--success-container); color: var(--on-success-container); }
.site-banner .icon-btn { color: inherit; }

/* ---------- Studio v2: guided setup ---------- */
.studio-grid { grid-template-columns: minmax(340px, 0.92fr) minmax(0, 1.18fr); }
.studio-right { position: sticky; top: calc(var(--topbar-h) + 0.5rem); }
.strip-meter { width: 220px; max-width: 100%; height: 4px; border-radius: 4px; background: var(--border-subtle); margin-top: 0.4rem; overflow: hidden; }
.strip-meter span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 4px; transition: width 0.5s var(--ease); }
.strip-meter span.high { background: var(--error); }

.setup-card .card-body { padding: 0.5rem 1.25rem 1.25rem; }
.setup-step { padding: 1.1rem 0 1.15rem; border-bottom: 1px solid var(--border-subtle); }
.setup-step:last-of-type { border-bottom: none; }
.step-head { display: flex; gap: 0.8rem; align-items: flex-start; margin-bottom: 0.85rem; }
.step-badge {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary); color: var(--on-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 500; font-size: 14px;
  transition: background 0.2s ease;
}
.setup-step.complete .step-badge { background: var(--success); color: #fff; }
.setup-step.complete .step-badge::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 12px; }
.setup-step.complete .step-badge { font-size: 0; }
.step-head h3 { font-size: 16px; font-weight: 500; line-height: 1.3; }
.step-head p { font-size: 13px; color: var(--text-secondary); }
.step-head .optional { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.input-tools { display: flex; justify-content: flex-end; gap: 1rem; margin: -0.35rem 0 0.35rem; font-size: 12px; }
.input-tools .link-btn { font-size: 12px; }

.dest-chip { cursor: pointer; background: var(--bg-surface); color: var(--text-primary); font-family: var(--font-sans); text-align: left; transition: background 0.12s ease, border-color 0.12s ease; }
.dest-chip:hover { background: var(--bg-hover); border-color: var(--text-primary); }
.dest-chip span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dest-caret { font-size: 11px; color: var(--text-faint) !important; }

.opt-group { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); margin-bottom: 0.5rem; }
.opt-group > summary {
  list-style: none; cursor: pointer; padding: 0.7rem 0.95rem;
  display: flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-display); font-weight: 500; font-size: 14px;
}
.opt-group > summary::-webkit-details-marker { display: none; }
.opt-group > summary > i:first-child { color: var(--text-secondary); width: 16px; text-align: center; }
.opt-group > summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 11px; color: var(--text-secondary); margin-left: auto; transition: transform 0.2s var(--ease); }
.opt-group[open] > summary::after { transform: rotate(180deg); }
.opt-group > summary:hover { background: var(--bg-hover); border-radius: var(--radius-md); }
.opt-body { padding: 0.25rem 0.95rem 0.85rem; }
.opt-group[open] .opt-body { animation: faqOpen 0.25s var(--ease); }
.opt-group .pro-badge { margin-left: 0.25rem; }
.pro-section.locked .opt-body .grid-2,
.pro-section.locked .opt-body .field-hint { opacity: 0.45; pointer-events: none; }
.studio-extras { margin-top: 0.85rem; }

.wm-banner { margin: 0.25rem 0 1rem; flex-wrap: wrap; row-gap: 0.6rem; }
.wm-banner .wm-text { flex: 1 1 220px; }
.wm-banner .switch { margin-left: auto; }
.start-btn { height: 52px; font-size: 16px; }
.start-btn i { transition: transform 0.3s var(--ease); }
.start-btn:hover:not(:disabled) i { transform: translate(2px, -2px) rotate(-8deg); }

/* ---------- Studio v2: live transfer window ---------- */
.monitor-card { min-height: 420px; }
.monitor-empty { text-align: center; padding: 3rem 1.75rem 2.5rem; color: var(--text-secondary); }
.monitor-empty h3 { font-size: 20px; font-weight: 400; color: var(--text-primary); margin: 1.25rem 0 0.4rem; }
.monitor-empty p { font-size: 14px; max-width: 380px; margin: 0 auto 1.25rem; }
.me-art { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.me-folder, .me-drive { width: 64px; height: 64px; border-radius: 18px; background: var(--bg-elevated); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.me-folder { color: var(--g-yellow); }
.me-drive { color: var(--g-green); }
.me-dots { display: flex; gap: 6px; }
.me-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); opacity: 0.25; animation: dotWave 1.4s ease-in-out infinite; }
.me-dots span:nth-child(2) { animation-delay: 0.2s; }
.me-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotWave { 0%, 100% { opacity: 0.25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }
.me-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1rem; font-size: 12px; }
.me-legend span { display: inline-flex; align-items: center; gap: 0.35rem; }

.tw-head { display: flex; align-items: center; gap: 0.85rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-subtle); }
.tw-folder { font-size: 20px; color: var(--text-secondary); }
.tw-title { flex: 1; min-width: 0; }
.tw-name { font-family: var(--font-display); font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-dest { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-head .phase-pill { margin: 0; flex-shrink: 0; }

.tw-progress { padding: 0.9rem 1.25rem 0.4rem; background: var(--bg-elevated); }
.tw-progress-row { display: flex; justify-content: space-between; gap: 1rem; font-size: 14px; color: var(--text-primary); margin-bottom: 0.5rem; }
.tw-progress-row.small { font-size: 12px; color: var(--text-secondary); margin: 0.5rem 0 0.5rem; }
.tw-progress-row.small #live-activity { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tw-progress .linear-track { margin: 0; height: 6px; }
#tw-speed { color: var(--text-secondary); white-space: nowrap; }

.tw-stats { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid var(--border-subtle); background: var(--bg-elevated); }
.tw-stats > div { padding: 0.55rem 0.75rem 0.75rem; text-align: center; }
.tw-stats b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 17px; transition: color 0.3s ease; }
.tw-stats span { font-size: 11px; color: var(--text-secondary); }
.tw-stats b.bump { animation: bump 0.4s var(--ease); }
@keyframes bump { 50% { transform: scale(1.18); color: var(--primary); } }

.tw-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.75rem 0.5rem 0.5rem; border-bottom: 1px solid var(--border-subtle); flex-wrap: wrap; }
.tw-tabs { display: flex; gap: 0.15rem; overflow-x: auto; scrollbar-width: none; }
.tw-tabs::-webkit-scrollbar { display: none; }
.tw-tab { border: none; background: transparent; color: var(--text-secondary); font-family: var(--font-display); font-weight: 500; font-size: 13px; height: 32px; padding: 0 0.75rem; border-radius: var(--radius-full); cursor: pointer; white-space: nowrap; }
.tw-tab:hover { background: var(--bg-hover); }
.tw-tab.active { background: var(--selected); color: var(--on-selected); }
.tw-tab i { font-style: normal; font-size: 11px; opacity: 0.75; margin-left: 0.15rem; }

.tw-list { max-height: 430px; overflow-y: auto; overflow-x: hidden; }
.tw-row {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto 22px;
  align-items: center;
  gap: 0.85rem;
  padding: 0.6rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  transition: background 0.3s ease;
}
.tw-row.enter { animation: rowEnter 0.45s var(--ease) both; }
@keyframes rowEnter { from { opacity: 0; transform: translateY(-12px); max-height: 0; } to { opacity: 1; transform: none; max-height: 80px; } }
.tw-row .r-ico { font-size: 17px; text-align: center; }
.tw-row .r-main { min-width: 0; }
.tw-row .r-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-row .r-path { font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-row .r-meta { font-size: 12px; color: var(--text-secondary); white-space: nowrap; text-align: right; }
.tw-row .r-state { font-size: 16px; text-align: center; }
.tw-row[data-status="copying"] { background: var(--primary-soft); }
.tw-row[data-status="copying"]::after {
  content: ''; position: absolute; left: 0; bottom: -1px; height: 2px; width: 40%;
  background: var(--primary); animation: rowBar 1.1s ease-in-out infinite;
}
@keyframes rowBar { 0% { left: -40%; } 100% { left: 100%; } }
.tw-row[data-status="done"] .r-state { color: var(--success); }
.tw-row.just-done .r-state i { animation: pop 0.45s var(--ease); }
.tw-row.just-done { animation: doneFlash 1s ease; }
@keyframes doneFlash { 0% { background: var(--success-container); } 100% { background: transparent; } }
.tw-row[data-status="skipped"], .tw-row[data-status="filtered"], .tw-row[data-status="exists"] { color: var(--text-secondary); }
.tw-row[data-status="skipped"] .r-state, .tw-row[data-status="filtered"] .r-state, .tw-row[data-status="exists"] .r-state { color: var(--text-faint); }
.tw-row[data-status="locked"] .r-state { color: #e37400; }
.tw-row[data-status="failed"] .r-state { color: var(--error); }
.tw-row[data-status="created"] .r-state { color: var(--primary); }
.tw-row[data-status="watermark"] { background: var(--warning-container); color: var(--on-warning-container); }
.tw-row[data-status="watermark"] .r-path, .tw-row[data-status="watermark"] .r-meta { color: inherit; opacity: 0.8; }
.tw-row[data-status="watermark"] .r-state { color: #e37400; }
.tw-row .r-note { color: inherit; }

/* Filter tabs */
.tw-list[data-filter="copying"] .tw-row:not([data-status="copying"]),
.tw-list[data-filter="done"] .tw-row:not([data-status="done"]),
.tw-list[data-filter="skipped"] .tw-row:not([data-status="skipped"]):not([data-status="filtered"]):not([data-status="exists"]),
.tw-list[data-filter="issues"] .tw-row:not([data-status="locked"]):not([data-status="failed"]) { display: none; }
.tw-empty { padding: 1.5rem; text-align: center; font-size: 13px; color: var(--text-secondary); }

.tw-upnext { display: none; padding: 0.55rem 1.25rem; font-size: 12px; color: var(--text-secondary); background: var(--bg-elevated); border-bottom: 1px solid var(--border-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-upnext.show { display: block; }
.tw-upnext b { font-weight: 500; color: var(--text-primary); }

.tw-done { display: flex; align-items: center; gap: 0.9rem; margin: 1rem 1.25rem 0; padding: 0.9rem 1rem; border-radius: var(--radius-md); background: var(--success-container); color: var(--on-success-container); animation: heroUp 0.5s var(--ease) both; }
.tw-done.warn { background: var(--warning-container); color: var(--on-warning-container); }
.tw-done.err { background: var(--error-container); color: var(--on-error-container); }
.tw-done-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--success); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; animation: pop 0.5s 0.15s var(--ease) both; }
.tw-done.warn .tw-done-icon { background: #e37400; }
.tw-done.err .tw-done-icon { background: var(--error); }
.tw-done-text strong { display: block; font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.tw-done-text span { font-size: 13px; }
#telemetry-live .completion-actions { margin: 0.75rem 1.25rem 0; padding-top: 0; border-top: none; }

.tw-log { margin: 1rem 1.25rem 1.25rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); }
.tw-log > summary { list-style: none; cursor: pointer; padding: 0.6rem 0.9rem; font-family: var(--font-display); font-size: 13px; font-weight: 500; color: var(--text-secondary); display: flex; align-items: center; gap: 0.55rem; }
.tw-log > summary::-webkit-details-marker { display: none; }
.tw-log > summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 10px; margin-left: auto; transition: transform 0.2s ease; }
.tw-log[open] > summary::after { transform: rotate(180deg); }
.tw-log .console-toolbar { margin: 0 0.75rem; }
.tw-log .console-box { margin: 0.4rem 0.75rem 0.75rem; height: 180px; }

/* ---------- Guided tour ---------- */
.tour-spot {
  position: fixed;
  z-index: 4000;
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55), 0 0 0 3px var(--primary);
  pointer-events: none;
  transition: top 0.35s var(--ease), left 0.35s var(--ease), width 0.35s var(--ease), height 0.35s var(--ease);
}
.tour-blocker { position: fixed; inset: 0; z-index: 3999; }
.tour-pop {
  position: fixed;
  z-index: 4001;
  width: min(360px, calc(100vw - 24px));
  background: var(--bg-surface);
  color: var(--text-primary);
  border-radius: 20px;
  box-shadow: var(--elev-3);
  padding: 1.1rem 1.2rem 1rem;
  transition: top 0.35s var(--ease), left 0.35s var(--ease);
  animation: popIn 0.25s var(--ease);
}
body.dark-mode .tour-pop { background: var(--bg-subtle); }
.tour-step-count { font-size: 12px; color: var(--primary); font-weight: 500; margin-bottom: 0.25rem; }
.tour-pop h4 { font-family: var(--font-display); font-size: 18px; font-weight: 500; margin-bottom: 0.35rem; }
.tour-pop p { font-size: 14px; color: var(--text-secondary); line-height: 1.55; }
.tour-pop ul { margin: 0.5rem 0 0 1.1rem; font-size: 13px; color: var(--text-secondary); display: grid; gap: 0.2rem; }
.tour-dots { display: flex; gap: 5px; margin: 0.9rem 0 0.75rem; }
.tour-dots span { width: 6px; height: 6px; border-radius: 3px; background: var(--border-default); transition: all 0.25s ease; }
.tour-dots span.on { width: 18px; background: var(--primary); }
.tour-actions { display: flex; align-items: center; gap: 0.5rem; }
.tour-actions .link-btn { margin-right: auto; color: var(--text-secondary); font-size: 13px; }
.tour-arrow { position: absolute; width: 14px; height: 14px; background: inherit; transform: rotate(45deg); }

@media (max-width: 1100px) {
  .studio-right { position: static; }
}
@media (max-width: 640px) {
  .tw-stats { grid-template-columns: repeat(3, 1fr); }
  .tw-stats > div:nth-child(n+4) { border-top: 1px solid var(--border-subtle); }
  .tw-row { grid-template-columns: 20px minmax(0, 1fr) 20px; padding: 0.6rem 1rem; }
  .tw-row .r-meta { display: none; }
  .tw-head, .tw-progress { padding-left: 1rem; padding-right: 1rem; }
}

/* ---------- Checkout ---------- */
.checkout-grid { display: grid; grid-template-columns: 0.9fr 1.15fr; gap: 1.25rem; }
.checkout-summary { background: var(--bg-elevated); border-radius: var(--radius-lg); padding: 1.4rem; display: flex; flex-direction: column; }
.checkout-summary .price-features { flex: 0; margin-bottom: 1.1rem; }
.local-price { font-size: 14px; color: var(--primary); font-weight: 500; margin: -0.6rem 0 1rem; }

.voucher-box { border: 1px solid var(--border-default); border-radius: var(--radius-md); padding: 0.75rem 1rem; margin-bottom: 1.1rem; }
.voucher-box summary { cursor: pointer; font-family: var(--font-display); font-weight: 500; font-size: 14px; color: var(--primary); list-style: none; display: flex; align-items: center; gap: 0.6rem; }
.voucher-box summary::-webkit-details-marker { display: none; }
.voucher-box summary::after { content: '\f078'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-left: auto; font-size: 11px; color: var(--text-secondary); transition: transform 0.2s ease; }
.voucher-box[open] summary::after { transform: rotate(180deg); }
.voucher-row { display: flex; gap: 0.5rem; margin-top: 0.8rem; align-items: center; }
.voucher-row .input { text-transform: uppercase; font-family: var(--font-mono); letter-spacing: 0.05em; }

.method-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
.method-chip {
  padding: 0.7rem 0.9rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  color: var(--text-primary);
  font-family: inherit;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.method-chip:hover { background: var(--bg-hover); }
.method-chip.active { background: var(--selected); border-color: var(--primary); color: var(--on-selected); }
.method-chip .m-name { font-family: var(--font-display); font-weight: 500; font-size: 14px; }
.method-chip .m-sub { font-size: 12px; color: var(--text-secondary); }
.method-chip.active .m-sub { color: var(--on-selected); opacity: 0.8; }

.copy-box {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  padding: 0.4rem 0.4rem 0.4rem 0.9rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  font-size: 13px; color: var(--text-secondary); min-width: 0;
}
.copy-box span { min-width: 0; overflow-wrap: anywhere; }
.copy-box strong { color: var(--text-primary); font-weight: 500; }

.dropzone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone i { color: var(--primary); margin-right: 0.35rem; }
.dropzone img { max-height: 140px; max-width: 100%; border-radius: var(--radius-sm); margin-top: 0.75rem; }

/* ---------- Analytics & tables ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
.kpi-card { background: var(--bg-elevated); border-radius: var(--radius-md); padding: 1rem 1.15rem; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; }
.kpi-head i { color: var(--primary); }
.kpi-val { font-family: var(--font-display); font-size: 28px; font-weight: 400; margin-top: 0.35rem; line-height: 1.2; }
.kpi-lbl { font-size: 13px; color: var(--text-secondary); }

.range-group .btn.active { background: var(--selected); color: var(--on-selected); border-color: var(--selected); }
.chart-axis { font-size: 11px; color: var(--text-secondary); display: flex; justify-content: space-between; margin-top: 0.5rem; }

.history-table-wrap { overflow-x: auto; }
.card-body.history-table-wrap { padding: 0; }
.history-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.history-table th, .history-table td { padding: 0.65rem 1.25rem; text-align: left; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.history-table th { font-size: 13px; font-weight: 500; color: var(--text-secondary); white-space: nowrap; }
.history-table tbody tr { transition: background 0.1s ease; }
.history-table tbody tr:hover { background: var(--bg-hover); }
.history-table tbody tr:last-child td { border-bottom: none; }
.history-table td .btn + .btn { margin-left: 0.35rem; }
.history-table .cell-name { display: flex; align-items: center; gap: 0.75rem; font-weight: 500; }
.history-table .cell-name i { color: var(--text-secondary); }

.empty-state { text-align: center; color: var(--text-secondary); font-size: 14px; padding: 2.5rem 1.25rem; }
.empty-state i { display: block; font-size: 28px; margin-bottom: 0.65rem; color: var(--text-faint); }

/* ---------- Docs ---------- */
.docs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
.doc-card { background: var(--bg-elevated); border-radius: var(--radius-md); padding: 1.25rem; }
.doc-card h3 { font-size: 16px; font-weight: 500; margin-bottom: 0.45rem; display: flex; align-items: center; gap: 0.65rem; }
.doc-card h3 i { color: var(--primary); }
.doc-card p, .doc-card li { font-size: 14px; color: var(--text-secondary); }
.doc-card ol { padding-left: 1.1rem; display: grid; gap: 0.35rem; }

/* ---------- Dialogs (Material 3) ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 2000;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; animation: fadeIn 0.15s ease; }
.modal-backdrop.open .modal-box { animation: popIn 0.22s var(--ease); }
@keyframes popIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }

.modal-box {
  width: 100%;
  max-width: 480px;
  background: var(--bg-surface);
  border-radius: 28px;
  box-shadow: var(--elev-3);
  overflow: hidden;
  margin: auto;
}
body.dark-mode .modal-box { background: var(--bg-elevated); }
.modal-box.wide { max-width: 920px; }
.modal-box.relative { position: relative; }
.modal-accent { display: none; }
.modal-body { padding: 1.5rem; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.1rem; }
.modal-head h3 { font-size: 22px; font-weight: 400; display: flex; align-items: center; gap: 0.6rem; }
.modal-head h3 i { color: var(--primary); font-size: 18px; }
.modal-head .modal-sub { font-size: 14px; color: var(--text-secondary); margin-top: 0.2rem; }
.modal-title-row { display: flex; align-items: center; gap: 0.85rem; }
.modal-title-row .feature-icon { margin: 0; background: var(--primary-container); color: var(--on-primary-container); }

.auth-brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 1.25rem; }
.auth-brand .brand-mark { width: 48px; height: 48px; font-size: 1.6rem; margin-bottom: 0.85rem; border-radius: 14px; }
.auth-brand h3 { font-size: 24px; font-weight: 400; }
.auth-brand p { font-size: 14px; color: var(--text-secondary); margin-top: 0.25rem; }
.auth-close { position: absolute; top: 0.85rem; right: 0.85rem; }
.auth-foot { text-align: center; font-size: 13px; color: var(--text-secondary); margin-top: 1rem; }
.link-btn { background: none; border: none; color: var(--primary); font-family: var(--font-display); font-weight: 500; font-size: inherit; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

.panda-vip-body { text-align: center; }
.panda-badge { display: inline-flex; align-items: center; gap: 0.45rem; height: 28px; padding: 0 0.8rem; background: var(--bg-elevated); border-radius: var(--radius-sm); color: var(--text-secondary); font-size: 12px; font-weight: 500; margin-bottom: 1rem; }
body.dark-mode .panda-badge { background: var(--bg-subtle); }
.panda-avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--primary-container); display: flex; align-items: center; justify-content: center; font-size: 2.1rem; margin: 0 auto 1rem; }
.panda-vip-body h2 { font-size: 24px; font-weight: 400; margin-bottom: 0.5rem; }
.panda-vip-body > p { font-size: 14px; color: var(--text-secondary); }
.perks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 1.25rem 0 1.4rem; text-align: left; }
.perk-item { background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 0.6rem 0.8rem; font-size: 13px; display: flex; align-items: center; gap: 0.55rem; }
body.dark-mode .perk-item { background: var(--bg-subtle); }
.perk-item i { color: var(--success); }
.panda-cta {
  display: flex; align-items: center; justify-content: center; gap: 0.55rem;
  width: 100%; height: 48px;
  background: var(--primary); color: var(--on-primary);
  text-decoration: none; font-family: var(--font-display); font-weight: 500; font-size: 15px;
  border-radius: var(--radius-full); margin-bottom: 0.5rem;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.panda-cta:hover { background: var(--primary-hover); box-shadow: var(--elev-1); }
.panda-dismiss {
  width: 100%; height: 44px;
  background: transparent; border: none; border-radius: var(--radius-full);
  color: var(--primary); font-family: var(--font-display); font-weight: 500; font-size: 14px; cursor: pointer;
}
.panda-dismiss:hover { background: var(--primary-soft); }

.notice-box {
  background: var(--selected);
  color: var(--on-selected);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin: 0 0 1.1rem;
  font-size: 14px;
  line-height: 1.55;
}
.notice-box > strong:first-child i { margin-right: 0.35rem; }
.notice-box.warn { background: var(--warning-container); color: var(--on-warning-container); }

.notice-list { display: grid; gap: 0.6rem; margin-bottom: 1.25rem; }
.notice-item { display: flex; gap: 0.85rem; padding: 0.9rem 1rem; background: var(--bg-elevated); border-radius: var(--radius-md); font-size: 14px; color: var(--text-secondary); }
body.dark-mode .notice-item { background: var(--bg-subtle); }
.notice-item .n-num { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 500; font-size: 13px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); }
.notice-item strong { color: var(--text-primary); display: block; margin-bottom: 0.15rem; font-weight: 500; }

.folder-list { max-height: 300px; overflow-y: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); margin: 0.85rem 0; }
.folder-row { display: flex; align-items: center; justify-content: space-between; padding: 0 1rem; height: 48px; border-bottom: 1px solid var(--border-subtle); cursor: pointer; font-size: 14px; transition: background 0.1s ease; }
.folder-row:last-child { border-bottom: none; }
.folder-row:hover { background: var(--bg-hover); }
.folder-row i.fa-folder { color: var(--text-secondary); margin-right: 0.85rem; }
.folder-row i.fa-chevron-right { color: var(--text-faint); font-size: 12px; }
.folder-empty { padding: 1.5rem; color: var(--text-secondary); font-size: 14px; text-align: center; }
.breadcrumb { font-family: var(--font-display); font-size: 16px; color: var(--text-primary); overflow-x: auto; white-space: nowrap; }
.breadcrumb .crumb-sep { color: var(--text-faint); margin: 0 0.35rem; }

/* ---------- Snackbar ---------- */
.toast-msg {
  position: fixed;
  left: 1.5rem;
  bottom: 1.5rem;
  z-index: 3000;
  max-width: 480px;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-xs);
  background: #303030;
  color: #f2f2f2;
  box-shadow: var(--elev-3);
  font-size: 14px;
  animation: toastIn 0.25s var(--ease);
}
body.dark-mode .toast-msg { background: #e3e3e3; color: #1f1f1f; }
.toast-msg i { color: #a8c7fa; }
.toast-msg.success i { color: #6dd58c; }
.toast-msg.error i { color: #f2b8b5; }
.toast-msg.warn i { color: #fdd663; }
body.dark-mode .toast-msg i { color: #0b57d0; }
body.dark-mode .toast-msg.success i { color: #146c2e; }
body.dark-mode .toast-msg.error i { color: #b3261e; }
body.dark-mode .toast-msg.warn i { color: #7a5900; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */
.footer { color: var(--text-secondary); font-size: 13px; border-top: 1px solid var(--border-subtle); }
.footer-inner { padding: 1rem 1.75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 0.5rem; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; align-items: center; }
.footer-links button { background: none; border: none; color: var(--text-secondary); font: inherit; cursor: pointer; }
.footer-links button:hover { color: var(--text-primary); text-decoration: underline; }
.footer a { color: var(--primary); text-decoration: none; font-weight: 500; }
.footer a:hover { text-decoration: underline; }

/* ---------- Admin ---------- */
.admin-login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: var(--bg-canvas); }
.admin-login-card { width: 100%; max-width: 450px; background: var(--bg-surface); border: 1px solid var(--border-default); border-radius: 28px; padding: 2.5rem 2.25rem 2rem; }
.admin-login-card .auth-brand h3 { font-size: 24px; }
.phase-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin-bottom: 0.45rem; }
.phase-steps span { height: 4px; border-radius: 4px; background: var(--border-subtle); transition: background 0.3s ease; }
.phase-steps span.done { background: var(--primary); }
.phase-labels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; margin-bottom: 1.5rem; font-size: 12px; color: var(--text-faint); }
.phase-labels span.done { color: var(--primary); font-weight: 500; }
.err-box { display: none; align-items: center; gap: 0.6rem; background: var(--error-container); color: var(--on-error-container); padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 1rem; }
.err-box.show { display: flex; }
.admin-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; margin-bottom: 1rem; }
.badge-count { margin-left: auto; font-size: 12px; font-weight: 500; color: inherit; }

/* ---------- Admin console v2 ---------- */
.admin-live { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 12px; color: var(--text-secondary); margin-left: 0.5rem; white-space: nowrap; }
.admin-live .pulse-dot { color: var(--success); }
.admin-body .brand-title { white-space: nowrap; }
.admin-chip { font-size: 11px; font-weight: 500; vertical-align: middle; padding: 0.15rem 0.45rem; border-radius: var(--radius-xs); background: var(--primary-container); color: var(--on-primary-container); letter-spacing: 0.04em; text-transform: uppercase; }
.nav-group { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); padding: 0.9rem 1rem 0.3rem; }
.nav-group:first-child { padding-top: 0.25rem; }
.admin-body .page-head { margin-bottom: 1rem; }

.admin-kpi-grid { grid-template-columns: repeat(4, 1fr); }
.kpi-sub { font-size: 12px; color: var(--text-secondary); margin-top: 0.15rem; }
.kpi-sub a { text-decoration: none; font-weight: 500; }
.kpi-card.attention { background: var(--warning-container); }
.kpi-card.attention .kpi-lbl, .kpi-card.attention .kpi-sub, .kpi-card.attention .kpi-val { color: var(--on-warning-container); }

.admin-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.chart-card.wide { grid-column: 1 / -1; }
.chart-sub { font-size: 13px; font-weight: 400; }
.bar-chart { position: relative; }
.bar-chart svg { display: block; overflow: visible; }
.bar-chart .cbar { fill: var(--primary); transition: opacity 0.15s ease; }
.bar-chart .cb.hover .cbar { opacity: 0.75; }
.bar-chart .cb { cursor: default; }
.bar-chart .cg { stroke: var(--border-subtle); stroke-width: 1; stroke-dasharray: 3 4; }
.bar-chart .ca { stroke: var(--border-default); stroke-width: 1; }
.chart-max { position: absolute; top: -2px; left: 0; font-size: 11px; color: var(--text-secondary); background: var(--bg-surface); padding-right: 0.35rem; }
.chart-tip {
  position: fixed; z-index: 5000; display: none; pointer-events: none;
  background: #303030; color: #f2f2f2; border-radius: var(--radius-sm); padding: 0.5rem 0.7rem;
  box-shadow: var(--elev-2); font-size: 12px; min-width: 120px;
}
body.dark-mode .chart-tip { background: #e3e3e3; color: #1f1f1f; }
.chart-tip .t-date { opacity: 0.75; }
.chart-tip .t-val { font-family: var(--font-display); font-size: 15px; font-weight: 500; }
.chart-tip .t-sub { opacity: 0.8; }

.admin-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.admin-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.admin-split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.admin-split .studio-right { position: static; }

.hbars { display: grid; gap: 0.85rem; }
.hbar-label { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 13px; margin-bottom: 0.3rem; }
.hbar-label b { font-weight: 500; }
.hbar-track { height: 8px; border-radius: 4px; background: var(--bg-subtle); overflow: hidden; }
.hbar-track span { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.6s var(--ease); }

.history-table.compact th, .history-table.compact td { padding: 0.5rem 1rem; }
.history-table .num { text-align: right; white-space: nowrap; }
.history-table code { word-break: normal; white-space: nowrap; }
.history-table tr.clickable { cursor: pointer; }
.history-table .cell-name > div { min-width: 0; }
.small { font-size: 12px; }
.table-search { max-width: 280px; padding: 0.5rem 0.85rem; }
.table-count { padding: 0.6rem 1.25rem 0; }
.mini-progress { height: 4px; border-radius: 4px; background: var(--border-subtle); overflow: hidden; margin-top: 0.3rem; }
.mini-progress span { display: block; height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.4s var(--ease); }

.activity-list { max-height: 380px; overflow-y: auto; }
.activity-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.6rem 1.25rem; border-bottom: 1px solid var(--border-subtle); }
.activity-row:last-child { border-bottom: none; }
.activity-row > i { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-elevated); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.activity-row.warn > i { background: var(--warning-container); color: var(--on-warning-container); }
.activity-row.error > i { background: var(--error-container); color: var(--on-error-container); }
.activity-row .a-main { flex: 1; min-width: 0; }
.activity-row .a-title { font-size: 14px; text-transform: capitalize; }
.activity-row .muted.small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-meta span { display: inline-block; margin: 0 0.75rem 0.15rem 0; font-size: 12px; color: var(--text-secondary); word-break: break-all; }
.log-meta b { font-weight: 500; color: var(--text-primary); }

.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; cursor: pointer; }
.toggle-row strong { display: block; font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.toggle-row small { display: block; font-size: 13px; color: var(--text-secondary); }
.toggle-inline { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 13px; color: var(--text-secondary); cursor: pointer; margin-right: 0.5rem; }
.toggle-inline .switch-track { transform: scale(0.85); }
.sticky-save { position: sticky; bottom: 0; padding: 1rem 0 0.25rem; display: flex; justify-content: flex-end; background: linear-gradient(transparent, var(--bg-surface) 40%); }

.pm-list { display: grid; gap: 1rem; }
.pm-card.off { opacity: 0.65; }
.pm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 0.85rem; }
.pm-grid.prices { grid-template-columns: repeat(4, 1fr); }
.plans-tbl th:first-child { color: var(--text-secondary); font-weight: 400; }
.plans-tbl td, .plans-tbl thead th { text-align: center; }

/* Plans & pricing editor */
.plan-editor { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.plan-card.pro { border: 2px solid var(--primary); }
.plan-price-preview { font-family: var(--font-display); font-size: 18px; color: var(--primary); }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--text-secondary); font-size: 14px; }
.input-prefix .input { padding-left: 1.7rem; }
.small-toggle { padding: 0.45rem 0; border-bottom: 1px solid var(--border-subtle); }
.small-toggle strong { font-size: 14px; }
.small-toggle small { font-size: 12px; }
.small-toggle .switch-track { transform: scale(0.85); }
.check-list { list-style: none; display: grid; gap: 0.6rem; font-size: 14px; color: var(--text-secondary); }
.check-list i { color: var(--success); margin-right: 0.5rem; }

/* Navbar link rows */
.nav-link-row { display: grid; grid-template-columns: 110px minmax(0, 0.8fr) minmax(0, 1.4fr) auto auto; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; }
.nav-link-row .input { padding: 0.45rem 0.65rem; }

/* Email templates */
.tpl-grid { display: grid; gap: 0.5rem; }
.tpl-card { display: flex; align-items: center; gap: 0.85rem; padding: 0.75rem 0.9rem; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-primary); text-align: left; cursor: pointer; font-family: inherit; transition: border-color 0.12s ease, background 0.12s ease; }
.tpl-card:hover { background: var(--bg-hover); }
.tpl-card.active { border: 2px solid var(--primary); background: var(--primary-soft); }
.tpl-card span:nth-child(2) { flex: 1; }
.tpl-card b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 15px; }
.tpl-card small { font-size: 12px; color: var(--text-secondary); }
.tpl-card > i { color: var(--primary); font-size: 18px; }
.tpl-swatch { width: 44px; height: 34px; border-radius: 8px; flex-shrink: 0; border: 1px solid var(--border-subtle); }
.tpl-swatch.classic { background: linear-gradient(#ffffff 0 30%, #c4eed0 30% 45%, #ffffff 45% 100%); }
.tpl-swatch.celebration { background: linear-gradient(#0b57d0 0 45%, #f0f4f9 45% 100%); }
.tpl-swatch.minimal { background: repeating-linear-gradient(#ffffff 0 6px, #e1e3e1 6px 7px); }
.email-preview-card { position: sticky; top: calc(var(--topbar-h) + 0.5rem); }
.email-subject { display: flex; flex-direction: column; gap: 0.1rem; padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--border-subtle); }
.email-subject b { font-weight: 500; font-size: 15px; }
#e-frame { display: block; width: 100%; height: 680px; border: 0; background: #f0f4f9; }

@media (max-width: 1200px) { .plan-editor { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .nav-link-row { grid-template-columns: 1fr 1fr; } }

/* User drawer */
.drawer-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.32); z-index: 2400; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 2500;
  width: min(520px, 100vw); background: var(--bg-surface); box-shadow: var(--elev-3);
  transform: translateX(100%); transition: transform 0.28s var(--ease);
  display: flex; flex-direction: column;
}
body.dark-mode .drawer { background: var(--bg-elevated); }
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-subtle); }
.drawer-head h3 { font-size: 20px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem; }
.drawer-profile { display: flex; gap: 0.9rem; align-items: center; margin-bottom: 1rem; }
.drawer-profile .d-name { font-family: var(--font-display); font-size: 18px; }
.d-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
.d-stats > div { background: var(--bg-elevated); border-radius: var(--radius-md); padding: 0.75rem 0.9rem; }
body.dark-mode .d-stats > div { background: var(--bg-subtle); }
.d-stats b { display: block; font-family: var(--font-display); font-weight: 500; font-size: 18px; }
.d-stats span { font-size: 12px; color: var(--text-secondary); }
.d-facts { display: grid; grid-template-columns: 130px 1fr; gap: 0.4rem 0.75rem; font-size: 13px; margin-bottom: 0.5rem; }
.d-facts dt { color: var(--text-secondary); }
.d-facts dd { word-break: break-all; }
.d-section { border-top: 1px solid var(--border-subtle); padding-top: 1rem; margin-top: 1rem; }
.d-section h4 { font-family: var(--font-display); font-weight: 500; font-size: 15px; margin-bottom: 0.65rem; }
.d-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.d-row .input { padding: 0.4rem 0.6rem; }
.d-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.d-section .history-table.compact th, .d-section .history-table.compact td { padding: 0.45rem 0.25rem; }

@media (max-width: 1200px) {
  .admin-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .admin-charts, .admin-grid-2, .admin-grid-3, .admin-split { grid-template-columns: 1fr; }
  .admin-live { display: none; }
  .pm-grid.prices { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .admin-kpi-grid, .pm-grid, .pm-grid.prices, .d-stats { grid-template-columns: 1fr; }
  .table-search { max-width: none; width: 100%; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .landing-hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .studio-grid, .checkout-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .icon-btn.menu-btn { display: inline-flex; }
  .brand { width: auto; padding-left: 0; }
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    width: 280px;
    z-index: 1500;
    padding-top: 1rem;
    background: var(--bg-canvas);
    box-shadow: var(--elev-3);
    transform: translateX(-100%);
    transition: transform 0.25s var(--ease);
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.32); z-index: 1400; }
  .content-surface { margin: 0 0.5rem 0.5rem; }
  .kpi-grid, .admin-kpis, .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .account-meta, .panda-bot-btn { display: none; }
  .quick-bar { max-width: none; }
  .brand-title { font-size: 20px; }
}
@media (max-width: 800px) {
  .quick-bar { height: 44px; }
  .quick-bar input { font-size: 14px; }
}
@media (max-width: 640px) {
  .quick-bar { display: none; }
  #account-area .btn-ghost, .nav-actions .help-btn { display: none; }
  .nav-actions .btn { padding: 0 1rem; }
  .navbar-inner { padding: 0 0.5rem 0 0.25rem; gap: 0.25rem; }
  .brand-title { font-size: 18px; }
}
@media (max-width: 400px) {
  .brand-title { display: none; }
  .shell { padding: 1rem 1rem 2rem; }
  .steps-grid, .features-grid, .docs-grid, .grid-2, .perks-grid, .method-chips { grid-template-columns: 1fr; }
  .progress-hero { flex-direction: column; text-align: center; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-body { padding: 1.25rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .toast-msg { left: 0.75rem; right: 0.75rem; min-width: 0; }
  .admin-login-card { padding: 2rem 1.25rem 1.5rem; }
}
@media (max-width: 420px) {
  .kpi-grid, .admin-kpis, .stats-strip { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
