/* ── JCWD Client Portal — Global Styles ──
   Brand system: navy #1F2838 / sky #97E2FF / slate #3C4B66 on white/#EEEEF0,
   Inter, card radius 24, action radius 10. Mirrors the CRM dashboard shell. */

:root {
  --color-canvas-white: #FFFFFF;
  --color-canvas-gray:  #EEEEF0;
  --color-primary:      #1F2838;
  --color-secondary:    #97E2FF;
  --color-accent:       #3C4B66;
  --color-border:       #EEEEF0;
  --color-text-muted:   #6b7280;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-card:   18px;
  --radius-action: 10px;
  --shadow-card: 0 1px 3px rgba(31, 40, 56, 0.06);
  --shadow-pop:  0 12px 40px rgba(31, 40, 56, 0.18);
}

[data-theme="dark"] {
  --color-canvas-white: #1a2233;
  --color-canvas-gray:  #0d1520;
  --color-primary:      #e5e7eb;
  --color-accent:       #9aa4b2;
  --color-border:       #2d3748;
  --color-text-muted:   #9ca3af;
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-pop:  0 12px 40px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background: #f5f5f6;
  color: var(--color-primary);
  -webkit-font-smoothing: antialiased;
}
[data-theme="dark"] html, [data-theme="dark"] body { background: #0d1520; }

button { font-family: inherit; }
input, textarea { font-family: inherit; }

/* Boot splash */
.boot-splash {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1F2838;
}
.boot-splash svg { animation: boot-pulse 1.2s ease-in-out infinite; }
@keyframes boot-pulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* ── App shell (CRM pattern) ─────────────────────────────────────────── */

.app-shell { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
  background: #1F2838;
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
[data-theme="dark"] .sidebar { background: #0d1520; }

.sidebar-header {
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-header .mark { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sidebar-header .mark svg { width: 30px; height: 30px; display: block; }
.sidebar-header h1 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.3px;
  margin: 0;
  text-transform: capitalize;
}
.sidebar-header .sub { font-size: 10.5px; color: #7a8695; margin-top: 1px; font-weight: 500; }

.sidebar-nav {
  flex: 1;
  padding: 14px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  margin: 0 12px;
  border-radius: 10px;
  color: #9aa4b2;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  background: transparent;
  border: none;
  text-align: left;
  width: calc(100% - 24px);
  text-decoration: none;
  position: relative;
}
.sidebar-item:hover { background-color: rgba(255,255,255,0.05); color: #e5e7eb; }
.sidebar-item.active { background-color: rgba(151, 226, 255, 0.10); color: #97E2FF; }
.sidebar-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-item .badge {
  margin-left: auto;
  background: #97E2FF;
  color: #1F2838;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 10px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 0 12px; }
.sidebar-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #97E2FF; color: #1F2838;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.sidebar-user .name { font-size: 12.5px; font-weight: 600; color: #e5e7eb; }
.sidebar-user .role { font-size: 10.5px; color: #7a8695; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toggle-track {
  margin-left: auto;
  width: 30px; height: 17px; border-radius: 9px;
  background: rgba(255,255,255,0.15);
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.toggle-track.on { background: #97E2FF; }
.toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #fff;
  transition: left 0.2s ease;
}
.toggle-track.on .toggle-thumb { left: 15px; background: #1F2838; }

/* Language switch (client sidebar) */
.lang-switch {
  display: flex; gap: 4px; margin: 6px 26px;
}
.lang-switch button {
  flex: 1;
  padding: 5px 0;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: #9aa4b2;
  cursor: pointer;
}
.lang-switch button.active { background: #97E2FF; border-color: #97E2FF; color: #1F2838; }

/* ── Main area ──────────────────────────────────────────────────────── */

.main-scroll {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  background: #f5f5f6;
  display: flex;
  flex-direction: column;
}
[data-theme="dark"] .main-scroll { background: #0d1520; }

.main-content {
  padding: 28px 32px 80px;
  max-width: 1160px;
  width: 100%;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  text-transform: capitalize;
}
.page-head .crumb {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.page-head .crumb a { color: var(--color-text-muted); text-decoration: none; }
.page-head .crumb a:hover { color: var(--color-primary); }
.page-sub { font-size: 13px; color: var(--color-text-muted); margin-top: 4px; }

/* ── Cards / surfaces ───────────────────────────────────────────────── */

.card {
  background: var(--color-canvas-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 22px; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.ws-card {
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  position: relative;
}
.ws-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(31,40,56,0.10); border-color: #d9dade; }
[data-theme="dark"] .ws-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.4); border-color: #3a465c; }

/* Status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: capitalize;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.onboarding { background: rgba(151, 226, 255, 0.25); color: #22688a; }
.pill.content    { background: #fef3c7; color: #92400e; }
.pill.build      { background: #ede9fe; color: #5b21b6; }
.pill.review     { background: #ffedd5; color: #9a3412; }
.pill.live       { background: #d1fae5; color: #065f46; }
.pill.pending    { background: var(--color-canvas-gray); color: var(--color-text-muted); }
.pill.submitted  { background: rgba(151, 226, 255, 0.25); color: #22688a; }
.pill.approved   { background: #d1fae5; color: #065f46; }
[data-theme="dark"] .pill.onboarding, [data-theme="dark"] .pill.submitted { background: rgba(151,226,255,0.12); color: #97E2FF; }
[data-theme="dark"] .pill.content { background: rgba(251,191,36,0.12); color: #fbbf24; }
[data-theme="dark"] .pill.build   { background: rgba(167,139,250,0.12); color: #a78bfa; }
[data-theme="dark"] .pill.review  { background: rgba(251,146,60,0.12); color: #fb923c; }
[data-theme="dark"] .pill.live, [data-theme="dark"] .pill.approved { background: rgba(52,211,153,0.12); color: #34d399; }

/* Progress bars */
.progress-track {
  height: 7px;
  border-radius: 999px;
  background: var(--color-canvas-gray);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #1F2838;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] .progress-fill { background: #97E2FF; }
.progress-fill.sky { background: #97E2FF; }

/* ── Buttons (brand anatomy: navy bg + sky text + arrow) ─────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-action);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.1s ease;
  text-transform: capitalize;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: #1F2838; color: #97E2FF; }
.btn-primary:hover:not(:disabled) { background: #2a3548; }
[data-theme="dark"] .btn-primary { background: #97E2FF; color: #1F2838; }
[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: #b3eaff; }
.btn-ghost {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--color-accent); }
.btn-danger { background: transparent; color: #dc2626; border: 1px solid #fecaca; }
.btn-danger:hover:not(:disabled) { background: #fef2f2; }
[data-theme="dark"] .btn-danger { border-color: rgba(220,38,38,0.4); }
[data-theme="dark"] .btn-danger:hover:not(:disabled) { background: rgba(220,38,38,0.1); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-icon {
  width: 30px; height: 30px; padding: 0;
  border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.btn-icon:hover { color: var(--color-primary); border-color: var(--color-accent); }
.btn-icon.danger:hover { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
[data-theme="dark"] .btn-icon.danger:hover { background: rgba(220,38,38,0.1); border-color: rgba(220,38,38,0.4); }

/* ── Forms ───────────────────────────────────────────────────────────── */

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-primary);
}
.field .hint { font-size: 11.5px; color: var(--color-text-muted); margin-top: 5px; }

.input, textarea.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-action);
  border: 1px solid #d9dade;
  background: var(--color-canvas-white);
  color: var(--color-primary);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.input:focus { border-color: #97E2FF; box-shadow: 0 0 0 3px rgba(151, 226, 255, 0.25); }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.5; }
[data-theme="dark"] .input { border-color: #2d3748; background: #0d1520; }
.input::placeholder { color: #9ca3af; }
[data-theme="dark"] .input::placeholder { color: #4b5563; }

/* Custom dropdown (never native select) */
.dd { position: relative; }
.dd-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-action);
  border: 1px solid #d9dade;
  background: var(--color-canvas-white);
  color: var(--color-primary);
  font-size: 13.5px;
  cursor: pointer;
  text-align: left;
}
[data-theme="dark"] .dd-btn { border-color: #2d3748; background: #0d1520; }
.dd-btn svg { flex-shrink: 0; color: var(--color-text-muted); }
.dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--color-canvas-white);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  z-index: 60;
  max-height: 260px;
  overflow-y: auto;
  padding: 5px;
}
.dd-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-primary);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.dd-item:hover { background: var(--color-canvas-gray); }
.dd-item.selected { background: rgba(151, 226, 255, 0.18); font-weight: 600; }

/* ── Tabs ────────────────────────────────────────────────────────────── */

.tab-bar {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 22px;
  overflow-x: auto;
}
.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
}
.tab:hover { color: var(--color-primary); }
.tab.active { color: var(--color-primary); border-bottom-color: #97E2FF; }
.tab .badge {
  background: #97E2FF; color: #1F2838;
  font-size: 10px; font-weight: 800;
  min-width: 17px; height: 17px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px;
}

/* ── Modal (custom, never native) ────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 21, 32, 0.55);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.15s ease;
}
.modal {
  background: var(--color-canvas-white);
  border-radius: 20px;
  box-shadow: var(--shadow-pop);
  width: 100%;
  max-width: 520px;
  max-height: min(86vh, 780px);
  display: flex;
  flex-direction: column;
  animation: modal-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal.wide { max-width: 760px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
}
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; text-transform: capitalize; }
.modal-body { padding: 16px 22px; overflow-y: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px 20px;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ── Toast ───────────────────────────────────────────────────────────── */

.toast-wrap {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #1F2838;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 11px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  display: flex;
  align-items: center;
  gap: 9px;
  animation: toast-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.error { background: #7f1d1d; }
.toast svg { color: #97E2FF; flex-shrink: 0; }
.toast.error svg { color: #fca5a5; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Lists / tables ──────────────────────────────────────────────────── */

.row-list { display: flex; flex-direction: column; gap: 12px; }
.item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
}
.item-row .grow { flex: 1; min-width: 0; }
.item-row .title { font-size: 13.5px; font-weight: 600; }
.item-row .meta { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }

.empty-state {
  text-align: center;
  padding: 52px 20px;
  color: var(--color-text-muted);
}
.empty-state svg { margin-bottom: 12px; opacity: 0.45; }
.empty-state .t { font-size: 14px; font-weight: 600; color: var(--color-primary); margin-bottom: 4px; }
.empty-state .s { font-size: 12.5px; max-width: 380px; margin: 0 auto; line-height: 1.5; }

/* ── Comments ────────────────────────────────────────────────────────── */

.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment {
  display: flex;
  gap: 10px;
}
.comment .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px;
  flex-shrink: 0;
}
.comment .avatar.admin { background: #1F2838; color: #97E2FF; }
.comment .avatar.client { background: #97E2FF; color: #1F2838; }
[data-theme="dark"] .comment .avatar.admin { background: #2d3748; }
.comment .bubble {
  background: var(--color-canvas-gray);
  border-radius: 4px 14px 14px 14px;
  padding: 9px 13px;
  font-size: 13px;
  line-height: 1.5;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
[data-theme="dark"] .comment .bubble { background: #0d1520; border: 1px solid #2d3748; }
.comment .who { font-size: 11px; color: var(--color-text-muted); margin-bottom: 3px; display: flex; gap: 6px; align-items: baseline; }
.comment .who b { color: var(--color-primary); font-size: 11.5px; }

.comment-box { display: flex; gap: 8px; margin-top: 14px; align-items: flex-end; }
.comment-box textarea {
  flex: 1;
  min-height: 42px;
  max-height: 130px;
}

.comment-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 7px;
  position: relative;
}
.comment-toggle:hover { color: var(--color-primary); background: var(--color-canvas-gray); }
.comment-toggle .badge {
  background: #ef4444;
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  min-width: 15px;
  height: 15px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ── Uploads / dropzone ──────────────────────────────────────────────── */

.dropzone {
  border: 1.5px dashed #cbd2da;
  border-radius: 14px;
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
  color: var(--color-text-muted);
  font-size: 12.5px;
}
.dropzone:hover, .dropzone.drag { border-color: #97E2FF; background: rgba(151, 226, 255, 0.06); }
[data-theme="dark"] .dropzone { border-color: #2d3748; }
.dropzone svg { margin-bottom: 8px; opacity: 0.6; }
.dropzone .up-title { font-weight: 600; color: var(--color-primary); font-size: 13px; margin-bottom: 2px; }

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.thumb {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-canvas-gray);
  aspect-ratio: 1;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .x {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(13, 21, 32, 0.72);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.thumb:hover .x { opacity: 1; }
.thumb .file-chip {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; font-size: 10.5px; color: var(--color-text-muted);
  padding: 8px; text-align: center; overflow-wrap: anywhere;
}

/* Upload progress overlay on thumbs */
.thumb .uploading {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
}
[data-theme="dark"] .thumb .uploading { background: rgba(13,21,32,0.7); }

.spinner {
  width: 22px; height: 22px;
  border: 3px solid var(--color-border);
  border-top-color: #1F2838;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
[data-theme="dark"] .spinner { border-top-color: #97E2FF; }
.spinner.lg { width: 34px; height: 34px; }
@keyframes spin { to { transform: rotate(360deg); } }
.center-load { display: flex; align-items: center; justify-content: center; padding: 60px 0; }

/* ── Template annotator ──────────────────────────────────────────────── */

.annot-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-canvas-gray);
  user-select: none;
  -webkit-user-select: none;
}
.annot-stage img { width: 100%; display: block; pointer-events: none; }
.annot-stage.placing { cursor: crosshair; }

.pin {
  position: absolute;
  width: 26px; height: 26px;
  border-radius: 50% 50% 50% 4px;
  background: #1F2838;
  color: #97E2FF;
  border: 2px solid #97E2FF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  transform: translate(-50%, -50%) rotate(0deg);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(13, 21, 32, 0.35);
  transition: transform 0.1s ease;
  z-index: 5;
}
.pin:hover, .pin.active { transform: translate(-50%, -50%) scale(1.18); z-index: 6; }
.pin.draggable { cursor: grab; }
.pin.dragging { cursor: grabbing; transform: translate(-50%, -50%) scale(1.25); }

.pin-pop {
  position: absolute;
  z-index: 20;
  width: 250px;
  background: var(--color-canvas-white);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  padding: 13px 15px;
}
.pin-pop .pp-label { font-size: 13px; font-weight: 700; margin-bottom: 3px; display: flex; align-items: center; gap: 7px; }
.pin-pop .pp-num {
  width: 19px; height: 19px; border-radius: 50%;
  background: #1F2838; color: #97E2FF;
  font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pin-pop .pp-note { font-size: 12px; color: var(--color-text-muted); line-height: 1.5; }
.pin-pop .pp-link {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 8px;
  font-size: 11.5px; font-weight: 600;
  color: #22688a;
  cursor: pointer;
  background: rgba(151, 226, 255, 0.2);
  padding: 4px 9px;
  border-radius: 7px;
  border: none;
}
[data-theme="dark"] .pin-pop .pp-link { color: #97E2FF; background: rgba(151,226,255,0.1); }

/* ── Tutorials ───────────────────────────────────────────────────────── */

.tut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.tut-card { overflow: hidden; cursor: pointer; transition: transform 0.12s ease, box-shadow 0.12s ease; }
.tut-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(31,40,56,0.10); }
.tut-thumb {
  aspect-ratio: 16 / 9;
  background: #1F2838;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.tut-thumb .play {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(151, 226, 255, 0.92);
  color: #1F2838;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tut-body { padding: 13px 15px; }
.tut-body .t { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.tut-body .d { font-size: 12px; color: var(--color-text-muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-canvas-gray);
  color: var(--color-accent);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.video-frame { width: 100%; aspect-ratio: 16/9; border: none; border-radius: 12px; background: #000; }
video.video-frame { object-fit: contain; }

/* ── Auth screens ────────────────────────────────────────────────────── */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1F2838;
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .auth-card { background: #1a2233; }
.auth-mark { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.auth-mark h1 { font-size: 18px; font-weight: 800; margin: 0; letter-spacing: -0.4px; text-transform: capitalize; }
.auth-mark .s { font-size: 11.5px; color: var(--color-text-muted); margin-top: 1px; }
.auth-err {
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12.5px;
  padding: 10px 13px;
  border-radius: 10px;
  margin-bottom: 14px;
}
[data-theme="dark"] .auth-err { background: rgba(220,38,38,0.12); color: #fca5a5; }

/* checklist */
.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.check-row:hover { background: var(--color-canvas-gray); }
.check-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid #d9dade;
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  flex-shrink: 0;
}
.check-dot.done { background: #1F2838; border-color: #1F2838; color: #97E2FF; }
[data-theme="dark"] .check-dot { border-color: #2d3748; }
[data-theme="dark"] .check-dot.done { background: #97E2FF; border-color: #97E2FF; color: #1F2838; }

/* ── Mobile ──────────────────────────────────────────────────────────── */

.mobile-app-bar { display: none; }
.mobile-bottom-nav { display: none; }

@media (max-width: 820px) {
  .app-shell { height: 100dvh; }
  .sidebar { display: none; }

  .mobile-app-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    background: #1F2838;
  }
  .mobile-app-bar .title { color: #fff; font-weight: 700; font-size: 15px; flex: 1; text-transform: capitalize; }
  .mobile-app-bar .bar-icon {
    background: none; border: none; color: #97E2FF; cursor: pointer;
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  }

  .mobile-bottom-nav {
    position: sticky;
    bottom: 0;
    z-index: 40;
    display: flex;
    background: #1F2838;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    margin-top: auto;
  }
  .mobile-bottom-nav > * {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 7px 2px;
    background: none;
    border: none;
    color: #9aa4b2;
    font-size: 9.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border-radius: 10px;
    position: relative;
  }
  .mobile-bottom-nav > *.active { color: #97E2FF; }
  .mobile-bottom-nav svg { width: 20px; height: 20px; }
  .mobile-bottom-nav .badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    background: #ef4444;
    color: #fff;
    font-size: 8.5px;
    font-weight: 800;
    min-width: 14px;
    height: 14px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .main-content { padding: 18px 16px 40px; }
  .page-head h2 { font-size: 19px; }
  .modal { max-height: 90vh; border-radius: 18px; }
  .grid-cards { grid-template-columns: 1fr; }
}
