/* ==========================================================================
   Base d'exercices — Entretien agrès
   Design system: Neon (dark, neon green on near-black)
   ========================================================================== */

:root {
  /* Primary */
  --accent: #a855f7;
  --accent-dark: #7e22ce;

  /* Accent */
  --electric-blue: #0ea5e9;

  /* Neutrals */
  --text-primary: #ededed;
  --text-secondary: #a0a0a0;
  --text-muted: #6b6b6b;

  /* Surfaces */
  --bg: #0c0d0d;
  --sidebar-bg: #111213;
  --surface: #1a1b1e;
  --surface-raised: #242528;
  --border: #2e2f33;

  /* Semantic */
  --success: #00e599;
  --error: #ff4444;
  --warning: #f59e0b;

  /* Type */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Consolas, monospace;

  /* Radius */
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 8px;
  --r-full: 9999px;

  /* Elevation */
  --shadow-raised: 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-overlay: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-modal: 0 8px 40px rgba(0, 0, 0, 0.6);

  --sidebar-w: 240px;
  --topnav-h: 56px;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
html {
  -webkit-tap-highlight-color: transparent;
}
body {
  scroll-behavior: smooth;
}
[hidden] {
  display: none !important;
}
body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button {
  font-family: inherit;
}
::selection {
  background: var(--accent);
  color: #fff;
}

/* Focus states — always visible, accessible */
button:focus-visible,
input:focus-visible,
[contenteditable]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   Typography scale
   ========================================================================== */
.t-display {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.t-h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.t-h2 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
}
.t-h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}
.t-body {
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
}
.t-small {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-secondary);
}
.t-code {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
}

/* ==========================================================================
   App shell — sidebar (240px) + fluid content
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.sidebar-brand {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}
.sidebar-brand .mark .dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--accent);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.7);
}
.sidebar-brand .sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.sidebar-nav {
  padding: 14px 12px;
}

.sidebar-section {
  padding: 16px 12px 4px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
}
.sidebar-section .t-small {
  padding: 0 12px 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}
.chip-list {
  padding: 0 4px;
}

/* ==========================================================================
   Line sidebar — reactive tick-mark nav (LineSidebar style)
   ========================================================================== */
.line-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.line-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.line-item:hover {
  background: rgba(255, 255, 255, 0.03);
}
.line-item.active {
  background: rgba(168, 85, 247, 0.08);
}
.line-ticks {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}
.line-tick {
  height: 1px;
  width: 40px;
  background: var(--text-muted);
  transform-origin: left center;
  transition:
    width 0.12s ease-out,
    transform 0.12s ease-out,
    background-color 0.15s ease;
}
.line-tick-sub {
  width: 20px;
}
.line-item:hover .line-tick,
.line-item.active .line-tick {
  background: var(--accent);
}
.line-index {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.line-item:hover .line-index,
.line-item.active .line-index {
  color: var(--accent);
}
.line-label {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition:
    color 0.15s ease,
    transform 0.15s ease;
}
.line-item:hover .line-label,
.line-item.active .line-label {
  color: var(--text-primary);
  transform: translateX(2px);
}
.line-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.15s ease;
}
.line-item.active .line-count {
  color: var(--accent);
}

.sidebar-user {
  margin-top: auto;
  padding: 14px 16px;
  padding-bottom: max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  background: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.sidebar-user .who {
  flex: 1;
  min-width: 0;
}
.sidebar-user .email {
  font-size: 12px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user .logout {
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.sidebar-user .logout:hover {
  color: var(--error);
}

.hamburger {
  display: none;
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.hamburger:hover {
  border-color: var(--text-secondary);
}
.hamburger span {
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  z-index: 39;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* ==========================================================================
   Content
   ========================================================================== */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

.topnav {
  height: var(--topnav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--surface);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topnav h2 {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.topnav .search-wrap {
  flex: 1;
  max-width: 420px;
  position: relative;
}
#search {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 9px 14px;
  outline: none;
}
#search::placeholder {
  color: var(--text-muted);
}
#search:focus {
  border-color: var(--accent);
}
.topnav .count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.page {
  padding: 24px;
  max-width: 1400px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-dark);
}
.btn-secondary {
  background: transparent;
  border-color: var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover {
  border-color: var(--text-secondary);
}
.btn-danger {
  background: var(--error);
  color: #fff;
}
.btn-danger:hover {
  opacity: 0.88;
}
.btn-ghost {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 6px 8px;
}
.btn-ghost:hover {
  color: var(--text-primary);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ==========================================================================
   Cards / exercise grid
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-raised);
  opacity: 0;
  animation: cardIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: calc(var(--i, 0) * 18ms);
  transition:
    border-color 0.12s ease,
    transform 0.12s ease;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card .thumb-wrap {
  position: relative;
  aspect-ratio: 1/1;
  background: var(--surface-raised);
}
.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card .idnum {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(12, 13, 13, 0.8);
  backdrop-filter: blur(2px);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 2px 6px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}
.card .cat-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--tag-color, var(--accent));
  border: 1px solid var(--border);
}
.card .info {
  padding: 14px;
}
.card .name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-transform: capitalize;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.card .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.empty-state {
  padding: 60px 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  grid-column: 1/-1;
}

/* ==========================================================================
   Modal
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 60;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-overlay.show {
  opacity: 1;
}
.modal {
  background: var(--surface);
  max-width: 640px;
  width: 100%;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-modal);
  position: relative;
  transform: scale(0.96) translateY(8px);
  opacity: 0;
  transition:
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.2s ease;
}
.modal-overlay.show .modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  width: 32px;
  height: 32px;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  color: var(--text-primary);
}
.modal-body {
  padding: 28px;
}
.modal-body .modal-img {
  display: block;
  width: 320px;
  max-width: 100%;
  aspect-ratio: 1/1;
  object-fit: contain;
  background: var(--bg);
  border-radius: var(--r-md);
  margin: 0 auto 18px;
  image-rendering: auto;
}
.modal-body h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: capitalize;
}
.modal-body .modal-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.modal-body ol {
  padding-left: 20px;
  margin: 0 0 24px;
  font-size: 14px;
  color: var(--text-secondary);
}
.modal-body ol li {
  margin-bottom: 8px;
}
.add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.add-row .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  width: 100%;
  margin-bottom: 4px;
}

/* ==========================================================================
   Plan view
   ========================================================================== */
.plan-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.plan-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.plan-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}
.plan-tab.active {
  background: rgba(168, 85, 247, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}
.plan-tab .pt-name {
  outline: none;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-tab .pt-name:focus {
  text-decoration: underline;
  white-space: normal;
}
.plan-tab .pt-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px;
}
.plan-tab .pt-del:hover {
  color: var(--error);
}
.plan-tab-add {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
}
.plan-tab-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.plan-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}
.save-indicator .pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-full);
  background: var(--border);
}
.save-indicator.show .pulse-dot {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(168, 85, 247, 0.8);
  animation: pulse 1.2s ease-in-out infinite;
}
.save-indicator.show {
  color: var(--accent);
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
@media (max-width: 640px) {
  .plan-grid {
    grid-template-columns: 1fr;
  }
}

.plan-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  min-height: 160px;
}
.plan-col h3 {
  font-size: 13px;
  font-weight: 600;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.plan-col h3 .sc-name {
  outline: none;
  flex: 1;
  min-width: 0;
}
.plan-col h3 .sc-name:focus {
  text-decoration: underline;
}
.plan-col h3 .sc-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px;
  flex-shrink: 0;
}
.plan-col h3 .sc-del:hover {
  color: var(--error);
}
.plan-col h3 .sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}

.plan-col-add {
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.plan-col-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.plan-list {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.plan-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 16px 0;
  text-align: center;
}
.plan-item {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.plan-item img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--surface);
  flex-shrink: 0;
  cursor: pointer;
}
.plan-item img:hover {
  outline: 2px solid var(--accent);
}
.plan-item .pi-body {
  flex: 1;
  min-width: 0;
}
.plan-item .pi-name {
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 5px;
  text-transform: capitalize;
  color: var(--text-primary);
}
.plan-item .pi-name:focus {
  outline: 1px solid var(--accent);
  border-radius: 2px;
}
.plan-item input.pi-sets {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 11px;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 3px 0;
  background: transparent;
  color: var(--text-secondary);
}
.plan-item input.pi-sets:focus {
  outline: none;
  border-bottom-color: var(--accent);
  color: var(--text-primary);
}
.plan-item .pi-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.plan-item .pi-remove:hover {
  color: var(--error);
}
.add-manual {
  margin: 0 12px 12px;
  font-family: inherit;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  padding: 9px;
  border-radius: var(--r-md);
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
}
.add-manual:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.add-search-wrap {
  position: relative;
  margin: 0 12px 12px;
}
.add-search-input {
  width: 100%;
  font-family: inherit;
  font-size: 12px;
  color: var(--text-primary);
  background: var(--surface-raised);
  border: 1px solid var(--accent);
  border-radius: var(--r-md);
  padding: 9px 10px;
  outline: none;
}
.add-search-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  max-height: 240px;
  overflow-y: auto;
  z-index: 10;
  box-shadow: var(--shadow-overlay);
}
.add-search-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-primary);
}
.add-search-item:hover {
  background: var(--surface);
}
.add-search-item img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--surface);
}
.add-search-custom {
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  cursor: pointer;
}
.add-search-custom:hover {
  background: var(--surface);
  color: var(--text-primary);
}

/* ==========================================================================
   Auth screen
   ========================================================================== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(168, 85, 247, 0.08),
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(14, 165, 233, 0.06),
      transparent 40%
    ),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--shadow-raised);
}
.auth-card .mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
}
.auth-card .mark .dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  background: var(--accent);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.7);
}
.auth-card .mark span {
  font-weight: 700;
  font-size: 15px;
}
.auth-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}
.auth-card .sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 22px;
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 9px 14px;
  outline: none;
}
.field input:focus {
  border-color: var(--accent);
}
.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
}
.auth-toggle {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}
.auth-toggle button {
  background: none;
  border: none;
  color: var(--electric-blue);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}
.auth-msg {
  font-size: 12.5px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  margin-bottom: 14px;
  display: none;
}
.auth-msg.error {
  display: block;
  background: rgba(255, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(255, 68, 68, 0.3);
}
.auth-msg.info {
  display: block;
  background: rgba(168, 85, 247, 0.08);
  color: var(--accent);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1023px) {
  .sidebar {
    width: min(var(--sidebar-w), 82vw);
    transform: translateX(-100%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
    padding-top: env(safe-area-inset-top);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-scrim {
    display: block;
  }
  .sidebar-scrim.show {
    opacity: 1;
    pointer-events: auto;
  }
  .hamburger {
    display: flex;
  }
  .content {
    margin-left: 0;
  }
  .topnav {
    padding-left: 64px;
  }
  .line-item {
    padding: 11px 10px;
  }

  /* Stagger the nav items in on open */
  .sidebar .line-item {
    opacity: 0;
    transform: translateX(-10px);
  }
  .sidebar.open .line-item {
    animation: lineItemIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: calc(60ms + var(--i, 0) * 35ms);
  }
}
@keyframes lineItemIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 520px) {
  .topnav h2 {
    display: none;
  }
  .page {
    padding: 16px;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  .card .info {
    padding: 10px;
  }
  .card .name {
    font-size: 13px;
  }
  .card .meta {
    font-size: 10px;
  }
  .modal-body {
    padding: 20px;
  }
  .modal-body .modal-img {
    width: 220px;
  }
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    max-width: 100%;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 92vh;
    overflow-y: auto;
  }
}
