﻿/* Global layout */

:root {
  --app-bg-0: #07111c;
  --app-bg-1: #0b1828;
  --app-bg-2: #102236;
  --app-surface-0: rgba(9, 19, 31, 0.95);
  --app-surface-1: rgba(13, 27, 42, 0.94);
  --app-surface-2: rgba(18, 37, 56, 0.94);
  --app-surface-3: rgba(27, 54, 79, 0.92);
  --app-line-soft: rgba(196, 222, 255, 0.1);
  --app-line-strong: rgba(136, 197, 255, 0.26);
  --app-text-0: #f3f8ff;
  --app-text-1: rgba(231, 239, 250, 0.82);
  --app-text-2: rgba(160, 168, 184, 0.9);
  --app-accent: #73d7ff;
  --app-accent-strong: #8bc5ff;
  --app-accent-surface: rgba(115, 215, 255, 0.12);
  --app-danger: #ff7e8d;
  --app-radius-sm: 12px;
  --app-radius-md: 16px;
  --app-radius-lg: 24px;
  --app-shadow-soft: 0 20px 50px rgba(0, 0, 0, 0.24);
  --app-shadow-strong: 0 28px 80px rgba(0, 0, 0, 0.34);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

/* Background color */
body {
  background:
    radial-gradient(900px 420px at 18% -10%, rgba(115, 215, 255, 0.15), transparent 60%),
    linear-gradient(160deg, var(--app-bg-0) 0%, var(--app-bg-1) 48%, #09131d 100%);
  color: var(--app-text-0);
}

.navis-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.navis-brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex: 0 0 auto;
}

.navis-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.navis-brand-name {
  color: var(--app-text-0);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

.navis-brand-tagline {
  color: var(--app-text-2);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}

/* Main app layout */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* ===== Sidebar / toolbar ===== */

.sidebar {
  width: 260px;
  height: 100vh;
  background: var(--app-surface-0);
  border-right: 1px solid var(--app-line-soft);
  padding: 16px 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: 100vh;
}

.app-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 4px 0;
  position: sticky;
  top: 0;
  background: inherit;   /* keeps same sidebar background */
  padding-top: 12px;
  z-index: 5;
}

.app-subtitle {
  font-size: 0.8rem;
  opacity: 0.75;
  margin: 0;
}

.toolbar-section {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.toolbar-section h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
  margin: 0 0 8px 0;
}

/* Buttons in the toolbar */
.tool-button {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  border: 1px solid var(--app-line-soft);
  background: rgba(255, 255, 255, 0.03);
  color: var(--app-text-0);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}

.tool-button:hover {
  background: var(--app-accent-surface);
  border-color: var(--app-line-strong);
}

.tool-button:active {
  transform: translateY(1px);
}

.tool-button.is-active {
  background: rgba(143, 208, 255, 0.14);
  border-color: rgba(143, 208, 255, 0.34);
}

/* ===== 3D viewer area ===== */

#viewer-container {
  flex: 1;               /* take all remaining space */
  position: relative;
  height: 100%;
}

/* The canvas Three.js creates */
#viewer-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.viewer-back-btn {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 25;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--app-line-strong);
  background: rgba(7, 17, 27, 0.74);
  color: var(--app-text-0);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
}

.viewer-back-btn:hover {
  background: rgba(11, 28, 40, 0.92);
  border-color: rgba(143, 208, 255, 0.4);
}

/* Dropdown styles */
.tool-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--app-text-2);
}

.tool-select {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--app-line-soft);
  background: rgba(9, 21, 31, 0.88);
  color: var(--app-text-0);
  font-size: 0.85rem;
}

/* ===== Annotation bar (bottom navigation) ===== */

#annotation-bar {
  position: fixed;
  left: 260px;          /* same as sidebar width */
  right: 0;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: auto;
  z-index: 10;
  font-size: 0.85rem;
}

.annotation-nav {
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(8, 19, 28, 0.78);
  color: var(--app-text-0);
  cursor: pointer;
}

.annotation-select {
  min-width: 220px;
  max-width: 320px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--app-line-soft);
  background: rgba(8, 19, 28, 0.9);
  color: var(--app-text-0);
}

/* Optional: labels & dropdown styling in sidebar */
.tool-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaaaaa;
}

.tool-select {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #333;
  background: #161616;
  color: #f5f5f5;
  font-size: 0.85rem;
}

/* ===== Annotation bar (already from Phase 5A; keep if present) ===== */

#annotation-bar {
  position: fixed;
  left: 260px;
  right: 0;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: auto;
  z-index: 10;
  font-size: 0.85rem;
}

.annotation-nav {
  border: none;
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(0,0,0,0.7);
  color: #f5f5f5;
  cursor: pointer;
}

.annotation-select {
  min-width: 220px;
  max-width: 320px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.85);
  color: #f5f5f5;
}

/* Sidebar label + select (same as before, safe to duplicate) */
.tool-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaaaaa;
}

.tool-select {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid #333;
  background: #161616;
  color: #f5f5f5;
  font-size: 0.85rem;
}

/* ===== 3D markers overlay ===== */

#annotation-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;      /* projected pins must stay inside the viewer */
  pointer-events: none;   /* markers themselves re-enable pointer events */
  z-index: 20;
}

.annotation-marker {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.85);
  border: 2px solid rgba(255,255,255,0.9);
  color: #ffffff;
  font-size: 0.75rem;
  display: block;
  text-align: center;
  line-height: 30px; /* same as height → perfectly centered */
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,0,0,0.5);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.annotation-marker:hover {
  transform: scale(1.05);
  background: rgba(0,0,0,0.95);
}

.annotation-marker.active {
  background: #ffffff;
  color: #111111;
  border-color: #ffffff;
}

/* ===== Annotation info panel ===== */

.annotation-panel {
  position: fixed;
  right: 16px;
  bottom: 72px; /* above the bottom bar */
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.annotation-panel.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.annotation-panel-inner {
  max-width: 320px;
  background: var(--app-surface-1);
  border-radius: 12px;
  border: 1px solid var(--app-line-soft);
  box-shadow: 0 10px 30px rgba(0,0,0,0.42);
  padding: 10px 12px 12px;
  color: var(--app-text-0);
  font-size: 0.85rem;
}

.annotation-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.annotation-panel-header span {
  font-weight: 600;
  font-size: 0.9rem;
}

.annotation-panel-close {
  border: none;
  background: transparent;
  color: var(--app-text-2);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
}

.annotation-panel-close:hover {
  color: var(--app-text-0);
}

.annotation-panel-body {
  line-height: 1.4;
  max-height: 220px;     /* controls how tall the text area can grow */
  overflow-y: auto;      /* enables scrollbar */
  white-space: pre-wrap; /* keeps line breaks from the AI */
  padding-right: 6px;    /* space so text doesn't touch scrollbar */
}

/* === Annotation panel footer (AI button + status) === */

.annotation-panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}

.annotation-panel-ai-button {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--app-line-strong);
  background: rgba(255,255,255,0.04);
  color: var(--app-text-0);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.annotation-panel-ai-button:hover:not(:disabled) {
  background: var(--app-accent-surface);
  border-color: rgba(143, 208, 255, 0.4);
  transform: translateY(-1px);
}

.annotation-panel-ai-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.annotation-panel-status {
  flex: 1;
  text-align: right;
  font-size: 0.7rem;
  color: var(--app-text-2);
}

.annotation-panel-info {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--app-line-soft);
  background: rgba(255,255,255,0.04);
  color: var(--app-text-1);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.annotation-panel-info:hover {
  background: var(--app-accent-surface);
  border-color: var(--app-line-strong);
  color: var(--app-text-0);
}

.annotation-panel-meta {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--app-line-soft);
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--app-text-2);
  overflow-wrap: anywhere;
}

/* ===== AI Review / Validation Modal ===== */

.ai-review-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none; /* shown via .open */
}

.ai-review-modal.open {
  display: block;
}

.ai-review-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 14, 0.72);
}

.ai-review-dialog {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 24px));
  max-height: min(80vh, 720px);

  background: var(--app-surface-1);
  border: 1px solid var(--app-line-soft);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.7);
  color: var(--app-text-0);

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ai-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--app-line-soft);
}

.ai-review-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.ai-review-close {
  border: none;
  background: transparent;
  color: var(--app-text-2);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 6px;
}
.ai-review-close:hover {
  color: var(--app-text-0);
}

.ai-review-subtitle {
  padding: 10px 14px 0;
  font-size: 0.78rem;
  color: var(--app-text-2);
}

.ai-review-text {
  margin: 10px 14px 0;
  width: calc(100% - 28px);
  min-height: 220px;
  flex: 1;

  background: rgba(255,255,255,0.03);
  border: 1px solid var(--app-line-soft);
  border-radius: 10px;
  color: var(--app-text-0);
  padding: 10px 12px;
  resize: none;

  line-height: 1.45;
  font-size: 0.9rem;

  overflow-y: auto; /* scrollbar */
  white-space: pre-wrap;
}

.ai-review-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "status actions"
    "meta actions";
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--app-line-soft);
}

.ai-review-status {
  grid-area: status;
  font-size: 0.75rem;
  color: var(--app-text-2);
  max-width: 100%;
  min-width: 0;
}

.ai-review-meta {
  grid-area: meta;
  font-size: 0.68rem;
  line-height: 1.25;
  color: var(--app-text-2);
  min-width: 0;
  overflow-wrap: anywhere;
}

.ai-review-actions {
  grid-area: actions;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ai-review-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--app-line-strong);
  background: rgba(255,255,255,0.04);
  color: var(--app-text-0);
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.ai-review-btn:hover:not(:disabled) {
  background: var(--app-accent-surface);
  border-color: rgba(143, 208, 255, 0.36);
  transform: translateY(-1px);
}

.ai-review-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.ai-review-btn-primary {
  background: rgba(125, 224, 202, 0.96);
  color: #082018;
  border-color: rgba(125, 224, 202, 0.96);
}
.ai-review-btn-primary:hover:not(:disabled) {
  background: rgba(143, 208, 255, 0.98);
  border-color: rgba(143, 208, 255, 0.98);
}

.ai-review-btn-secondary {
  border-color: rgba(255,255,255,0.55);
}

/* Edit button */
.annotation-panel-edit-button{
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--app-line-strong);
  background: rgba(255,255,255,0.04);
  color: var(--app-text-0);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.annotation-panel-edit-button:hover{
  background: var(--app-accent-surface);
  border-color: rgba(143, 208, 255, 0.4);
  transform: translateY(-1px);
}

/* Simple modal */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 14, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  z-index: 9999;
}

.modal{
  width: min(720px, 92vw);
  max-height: 80vh;
  background:
    linear-gradient(180deg, rgba(15, 28, 42, 0.96), rgba(8, 18, 29, 0.94));
  border: 1px solid var(--app-line-soft);
  border-radius: 22px;
  box-shadow: var(--app-shadow-strong);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(18px);
}

.modal-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
}

.modal-title{
  font-weight: 700;
  color: var(--app-text-0);
  letter-spacing: -0.02em;
}

.modal-close{
  border: 0;
  background: transparent;
  color: var(--app-text-1);
  font-size: 22px;
  cursor: pointer;
}

.modal-textarea{
  width: 100%;
  min-height: 220px;
  max-height: 50vh;
  resize: vertical;
  border-radius: 16px;
  border: 1px solid var(--app-line-soft);
  background: rgba(255,255,255,0.04);
  color: var(--app-text-0);
  padding: 14px;
  line-height: 1.55;
  overflow: auto;
}

.modal-footer{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.modal-btn{
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid var(--app-line-soft);
  background: rgba(255,255,255,0.04);
  color: var(--app-text-0);
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.modal-btn.primary{
  background: linear-gradient(135deg, rgba(115, 215, 255, 0.94), rgba(139, 197, 255, 0.98));
  color: #081625;
  border-color: rgba(139, 197, 255, 0.46);
}

.modal-btn:hover:not(:disabled){
  transform: translateY(-1px);
  border-color: rgba(139, 197, 255, 0.24);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.modal-btn:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}

.modal-btn.primary:disabled{
  background: rgba(115, 215, 255, 0.18);
  color: rgba(238, 248, 255, 0.64);
  border-color: rgba(115, 215, 255, 0.14);
}

.create-project-modal{
  width: min(560px, 92vw);
  max-height: min(84vh, 760px);
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(15, 19, 24, 0.14);
  box-shadow: 0 24px 60px rgba(15, 19, 24, 0.18);
  backdrop-filter: none;
}

.create-project-modal .modal-title,
.create-project-modal .tool-label,
.create-project-modal .create-project-dropzone-title{
  color: #101418;
}

.create-project-modal .modal-close{
  color: rgba(15, 19, 24, 0.58);
}

.create-project-modal .modal-close:hover{
  color: #101418;
}

.create-project-body{
  display: grid;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.create-project-body::-webkit-scrollbar{
  width: 8px;
}

.create-project-body::-webkit-scrollbar-thumb{
  background: rgba(195, 211, 226, 0.24);
  border-radius: 999px;
}

.create-project-body::-webkit-scrollbar-track{
  background: transparent;
}

.create-project-field{
  display: grid;
  gap: 8px;
}

.create-project-dropzone{
  display: grid;
  gap: 14px;
  justify-items: start;
  padding: 18px;
  border-radius: 18px;
  border: 1px dashed rgba(15, 19, 24, 0.14);
  background:
    linear-gradient(180deg, rgba(15, 19, 24, 0.02), rgba(15, 19, 24, 0.01));
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
  cursor: pointer;
}

.create-project-dropzone:hover,
.create-project-dropzone:focus-visible,
.create-project-dropzone.is-dragover{
  border-color: rgba(15, 19, 24, 0.22);
  background:
    linear-gradient(180deg, rgba(15, 19, 24, 0.04), rgba(15, 19, 24, 0.02));
  box-shadow: 0 0 0 4px rgba(15, 19, 24, 0.06);
  transform: translateY(-1px);
  outline: none;
}

.create-project-dropzone.has-file{
  border-style: solid;
  border-color: rgba(15, 19, 24, 0.18);
  background:
    linear-gradient(180deg, rgba(15, 19, 24, 0.05), rgba(15, 19, 24, 0.02));
}

.create-project-dropzone-icon{
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(15, 19, 24, 0.08);
  background: rgba(15, 19, 24, 0.04);
  color: #101418;
}

.create-project-dropzone-icon svg{
  width: 18px;
  height: 18px;
  display: block;
}

.create-project-dropzone-copy{
  display: grid;
  gap: 4px;
}

.create-project-dropzone-title{
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.create-project-dropzone-subtitle{
  color: rgba(15, 19, 24, 0.62);
  font-size: 0.84rem;
  line-height: 1.45;
}

.create-project-upload-button{
  width: auto;
  min-width: 0;
}

.create-project-input{
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 19, 24, 0.12);
  background: rgba(15, 19, 24, 0.03);
  color: #101418;
}

.create-project-input:focus{
  outline: none;
  border-color: rgba(15, 19, 24, 0.24);
  box-shadow: 0 0 0 4px rgba(15, 19, 24, 0.06);
}

.create-project-helper{
  min-height: 1.2em;
  color: rgba(15, 19, 24, 0.58);
  font-size: 0.76rem;
  line-height: 1.5;
}

.create-project-helper.is-error{
  color: rgba(255, 173, 173, 0.88);
}

.create-project-upload-status{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 19, 24, 0.08);
  background: rgba(15, 19, 24, 0.03);
  font-size: 0.8rem;
  color: rgba(15, 19, 24, 0.62);
  min-height: 1.2em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.create-project-upload-status.is-error{
  color: #8f1e33;
  border-color: rgba(186, 43, 63, 0.18);
  background: rgba(186, 43, 63, 0.06);
}

.create-project-modal .tool-select,
.create-project-modal .tool-button,
.create-project-modal .modal-btn{
  border-color: rgba(15, 19, 24, 0.14);
  background: transparent;
  color: #101418;
  box-shadow: none;
}

.create-project-modal .tool-select{
  min-height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(15, 19, 24, 0.03);
}

.create-project-modal .tool-select:focus{
  outline: none;
  border-color: rgba(15, 19, 24, 0.24);
  box-shadow: 0 0 0 4px rgba(15, 19, 24, 0.06);
}

.create-project-modal .tool-button:hover,
.create-project-modal .modal-btn:hover:not(:disabled){
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
  box-shadow: none;
}

.create-project-modal .modal-btn.primary{
  background: #101418;
  border-color: #101418;
  color: #ffffff;
}

.create-project-modal .modal-btn.primary:hover:not(:disabled){
  background: rgba(16, 20, 24, 0.88);
  border-color: rgba(16, 20, 24, 0.88);
}

.create-project-modal .modal-btn.primary:disabled{
  background: rgba(16, 20, 24, 0.22);
  border-color: rgba(16, 20, 24, 0.14);
  color: rgba(16, 20, 24, 0.42);
}

.confirm-modal{
  width: min(460px, 92vw);
}

.confirm-modal-copy{
  display: grid;
  gap: 10px;
}

.confirm-modal-text{
  margin: 0;
  color: var(--app-text-1);
  line-height: 1.6;
  font-size: 0.92rem;
}

.toggle-row{
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.9);
  user-select: none;
  cursor: pointer;
}

.toggle-row input{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-switch{
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.toggle-switch::after{
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #f4f7fb;
  box-shadow: 0 3px 10px rgba(0,0,0,0.28);
  transition: transform 220ms ease;
}

.toggle-label{
  font-weight: 600;
  letter-spacing: 0.01em;
}

.toggle-row input:checked + .toggle-switch{
  background: linear-gradient(135deg, #5fd0ff 0%, #5cf0cb 100%);
  border-color: rgba(126,236,220,0.72);
  box-shadow: 0 0 0 4px rgba(92,240,203,0.12);
}

.toggle-row input:checked + .toggle-switch::after{
  transform: translateX(20px);
}

.toggle-row.admin-active {
  color: #ffffff;
  font-weight: 600;
}

.toggle-row.admin-active .toggle-label {
  text-shadow: 0 0 6px rgba(255,255,255,0.35);
}

.hint-text{
  font-size: 0.78rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.3;
}

/* Phase B2 - backend status */
.backend-status {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  opacity: 0.9;
}

.backend-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #f4b942;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 0 12px rgba(244,185,66,0.35);
  flex: 0 0 auto;
}

.backend-status-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  color: rgba(214, 229, 244, 0.68);
}

.backend-status.is-online .backend-status-dot {
  background: #52e28b;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 0 14px rgba(82,226,139,0.6);
}

.backend-status.is-offline .backend-status-dot {
  background: #ff5c6c;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 0 14px rgba(255,92,108,0.55);
}

.backend-status.is-checking .backend-status-dot {
  background: #f4b942;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 0 12px rgba(244,185,66,0.4);
}

.backend-project-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.backend-project-select {
  width: 100%;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.25);
  color: #fff;
  outline: none;
}

.sidebar-subgroup {
  margin-top: 0.35rem;
  padding-top: 0.2rem;
}

.sidebar-subgroup-title {
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 4px;
}

.sidebar-subgroup-title::-webkit-details-marker { display: none; }

.sidebar-subgroup-title::after {
  content: "▾";
  opacity: 0.6;
}

.sidebar-subgroup:not([open]) > .sidebar-subgroup-title::after {
  content: "▸";
}

.sidebar-subgroup-body {
  margin-top: 0.35rem;
  padding: 0.7rem 0.75rem 0.35rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

/* Make delete button slightly more noticeable */
#backend-project-delete {
  border-color: rgba(255, 120, 120, 0.35);
}
#backend-project-delete:hover {
  border-color: rgba(255, 120, 120, 0.7);
}

/* Collapsible sidebar groups */
.side-group {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 10px;
  margin-top: 10px;
}

.side-group-title {
  list-style: none;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.side-group-title::-webkit-details-marker { display: none; }

.side-group-title::after {
  content: "▾";
  opacity: 0.6;
  transform: translateY(-1px);
}

details:not([open]) > .side-group-title::after {
  content: "▸";
}

/* ===== Sidebar redesign ===== */

body.viewer-page,
body.editor-page {
  --sidebar-width: 256px;
  --sidebar-collapsed-width: 92px;
  background: linear-gradient(180deg, #08131d 0%, #0a1823 48%, #09131c 100%);
  color: var(--app-text-0);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.viewer-page.sidebar-collapsed,
body.editor-page.sidebar-collapsed {
  --sidebar-width: var(--sidebar-collapsed-width);
}

body.viewer-page #app,
body.editor-page #app {
  position: relative;
  min-width: 0;
  isolation: isolate;
}

body.viewer-page #app::before,
body.editor-page #app::before {
  display: none;
}

body.viewer-page .sidebar,
body.editor-page .sidebar {
  width: var(--sidebar-width);
  flex: 0 0 var(--sidebar-width);
  height: 100vh;
  padding: 22px 16px 16px;
  border-right: 1px solid rgba(15, 20, 26, 0.12);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
  gap: 18px;
  overflow: hidden;
  transition: width 0.28s ease, flex-basis 0.28s ease, padding 0.28s ease, transform 0.28s ease;
  position: relative;
  z-index: 3;
}

body.viewer-page .sidebar::before,
body.editor-page .sidebar::before,
body.viewer-page .sidebar::after,
body.editor-page .sidebar::after {
  display: none;
}

body.viewer-page .sidebar-top,
body.editor-page .sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(15, 20, 26, 0.12);
  position: relative;
  z-index: 6;
}

body.viewer-page .sidebar-brand,
body.editor-page .sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body.viewer-page .sidebar-brand-logo,
body.editor-page .sidebar-brand-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: brightness(0) saturate(100%);
}

body.viewer-page .sidebar-brand-copy,
body.editor-page .sidebar-brand-copy {
  min-width: 0;
}

body.viewer-page .sidebar-kicker,
body.editor-page .sidebar-kicker {
  display: none;
}

body.viewer-page .app-title,
body.editor-page .app-title {
  margin: 0;
  padding: 0;
  position: static;
  background: transparent;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #101418;
}

body.viewer-page .sidebar-mode-badge,
body.editor-page .sidebar-mode-badge {
  align-self: flex-start;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: rgba(15, 20, 26, 0.56);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.viewer-page .sidebar-scroll,
body.editor-page .sidebar-scroll {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

body.viewer-page .sidebar-scroll::-webkit-scrollbar,
body.editor-page .sidebar-scroll::-webkit-scrollbar {
  width: 8px;
}

body.viewer-page .sidebar-scroll::-webkit-scrollbar-thumb,
body.editor-page .sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(15, 20, 26, 0.16);
  border-radius: 999px;
}

body.viewer-page .sidebar-cluster,
body.editor-page .sidebar-cluster {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(15, 20, 26, 0.12);
}

body.viewer-page .sidebar-cluster-label,
body.editor-page .sidebar-cluster-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(15, 20, 26, 0.5);
}

body.viewer-page .tool-button,
body.editor-page .tool-button {
  width: 100%;
  min-height: 42px;
  margin-bottom: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: #101418;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  box-shadow: none;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

body.viewer-page .tool-button:hover,
body.editor-page .tool-button:hover {
  background: rgba(15, 20, 26, 0.05);
  border-color: rgba(15, 20, 26, 0.12);
  box-shadow: none;
  transform: none;
}

body.viewer-page .tool-button:active,
body.editor-page .tool-button:active {
  color: #101418;
}

body.viewer-page .tool-button.is-active,
body.editor-page .tool-button.is-active {
  background: rgba(15, 20, 26, 0.08);
  border-color: rgba(15, 20, 26, 0.16);
}

body.viewer-page .tool-button:disabled,
body.editor-page .tool-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

body.viewer-page .tool-button-icon,
body.editor-page .tool-button-icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 16px;
  align-self: center;
  line-height: 0;
  color: rgba(15, 20, 26, 0.72);
}

body.viewer-page .tool-button-icon svg,
body.editor-page .tool-button-icon svg,
body.viewer-page .side-group-title-icon svg,
body.editor-page .side-group-title-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

body.viewer-page .side-group-caret svg,
body.editor-page .side-group-caret svg {
  width: 12px;
  height: 12px;
  display: block;
}

body.viewer-page .tool-button-danger,
body.editor-page .tool-button-danger {
  color: #8f2231;
}

body.viewer-page .tool-button-danger .tool-button-icon,
body.editor-page .tool-button-danger .tool-button-icon {
  color: #8f2231;
}

body.viewer-page .tool-button-label,
body.editor-page .tool-button-label {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.viewer-page .side-group,
body.editor-page .side-group {
  margin: 0;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid rgba(15, 20, 26, 0.12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.viewer-page .side-group-title,
body.editor-page .side-group-title,
body.viewer-page .sidebar-subgroup-title,
body.editor-page .sidebar-subgroup-title {
  list-style: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  color: #101418;
}

body.viewer-page .side-group-title::after,
body.editor-page .side-group-title::after,
body.viewer-page .sidebar-subgroup-title::after,
body.editor-page .sidebar-subgroup-title::after {
  content: none;
}

body.viewer-page .side-group-title-main,
body.editor-page .side-group-title-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

body.viewer-page .side-group-title-icon,
body.editor-page .side-group-title-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 0;
  color: rgba(15, 20, 26, 0.68);
  flex: 0 0 auto;
  line-height: 0;
}

body.viewer-page .side-group-title-text,
body.editor-page .side-group-title-text {
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

body.viewer-page .side-group-caret,
body.editor-page .side-group-caret {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  align-self: center;
  line-height: 0;
  color: rgba(15, 20, 26, 0.5);
  transition: transform 0.18s ease;
}

body.viewer-page details:not([open]) > .side-group-title .side-group-caret,
body.editor-page details:not([open]) > .side-group-title .side-group-caret,
body.viewer-page details:not([open]) > .sidebar-subgroup-title .side-group-caret,
body.editor-page details:not([open]) > .sidebar-subgroup-title .side-group-caret {
  transform: rotate(-90deg);
}

body.viewer-page .toolbar-section,
body.editor-page .toolbar-section {
  margin-top: 10px;
  padding-top: 0;
  border-top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body.viewer-page .toolbar-section h2,
body.editor-page .toolbar-section h2 {
  display: none;
}

body.viewer-page .tool-label,
body.editor-page .tool-label {
  margin-bottom: 0;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(15, 20, 26, 0.52);
}

body.viewer-page .tool-select,
body.editor-page .tool-select,
body.viewer-page .backend-project-select,
body.editor-page .backend-project-select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 20, 26, 0.14);
  background: rgba(255, 255, 255, 0.98);
  color: #101418;
  font-size: 0.76rem;
  outline: none;
  box-shadow: none;
}

body.viewer-page .backend-status,
body.editor-page .backend-status {
  margin-top: 0;
  margin-bottom: 0;
  padding: 0 0 16px;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(15, 20, 26, 0.12);
  color: rgba(15, 20, 26, 0.72);
  font-size: 0.75rem;
}

body.viewer-page .backend-project-row,
body.editor-page .backend-project-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 0;
}

body.viewer-page .backend-status-dot,
body.editor-page .backend-status-dot {
  box-shadow: none;
}

body.viewer-page .backend-status-label,
body.editor-page .backend-status-label {
  color: rgba(15, 20, 26, 0.52);
}

body.viewer-page .sidebar-subgroup,
body.editor-page .sidebar-subgroup {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 20, 26, 0.12);
}

body.viewer-page .sidebar-subgroup-title,
body.editor-page .sidebar-subgroup-title {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(15, 20, 26, 0.56);
}

body.viewer-page .sidebar-subgroup-body,
body.editor-page .sidebar-subgroup-body {
  margin-top: 6px;
  padding: 8px 0 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.viewer-page .toggle-row,
body.editor-page .toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  font-size: 0.78rem;
  color: #101418;
}

body.viewer-page .toggle-row input,
body.editor-page .toggle-row input {
  width: 1px;
  height: 1px;
  margin: 0;
}

body.viewer-page .toggle-switch,
body.editor-page .toggle-switch {
  background: rgba(15, 20, 26, 0.08);
  border-color: rgba(15, 20, 26, 0.14);
  box-shadow: inset 0 0 0 1px rgba(15, 20, 26, 0.04);
}

body.viewer-page .toggle-switch::after,
body.editor-page .toggle-switch::after {
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 20, 26, 0.18);
}

body.viewer-page .toggle-row input:checked + .toggle-switch,
body.editor-page .toggle-row input:checked + .toggle-switch {
  background: rgba(15, 20, 26, 0.78);
  border-color: rgba(15, 20, 26, 0.78);
  box-shadow: none;
}

body.viewer-page .toggle-row.admin-active,
body.editor-page .toggle-row.admin-active {
  color: #101418;
}

body.viewer-page .toggle-row.admin-active .toggle-label,
body.editor-page .toggle-row.admin-active .toggle-label {
  text-shadow: none;
}

body.viewer-page .hint-text,
body.editor-page .hint-text {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  font-size: 0.68rem;
  color: rgba(15, 20, 26, 0.6);
  line-height: 1.5;
}

body.viewer-page .sidebar-footer,
body.editor-page .sidebar-footer {
  position: relative;
  z-index: 1;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 20, 26, 0.12);
}

body.viewer-page .sidebar-collapse-button,
body.editor-page .sidebar-collapse-button {
  background: transparent;
}

body.viewer-page .sidebar-collapse-button .tool-button-icon,
body.editor-page .sidebar-collapse-button .tool-button-icon {
  color: rgba(15, 20, 26, 0.72);
}

body.viewer-page.sidebar-collapsed .sidebar,
body.editor-page.sidebar-collapsed .sidebar {
  padding-left: 12px;
  padding-right: 12px;
}

body.viewer-page.sidebar-collapsed .sidebar-brand-copy,
body.editor-page.sidebar-collapsed .sidebar-brand-copy,
body.viewer-page.sidebar-collapsed .sidebar-mode-badge,
body.editor-page.sidebar-collapsed .sidebar-mode-badge,
body.viewer-page.sidebar-collapsed .sidebar-user,
body.editor-page.sidebar-collapsed .sidebar-user,
body.viewer-page.sidebar-collapsed .sidebar-cluster-label,
body.editor-page.sidebar-collapsed .sidebar-cluster-label,
body.viewer-page.sidebar-collapsed .tool-button-label,
body.editor-page.sidebar-collapsed .tool-button-label,
body.viewer-page.sidebar-collapsed .side-group-title-text,
body.editor-page.sidebar-collapsed .side-group-title-text {
  width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  display: none;
}

body.viewer-page.sidebar-collapsed .sidebar-brand,
body.editor-page.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}

body.viewer-page.sidebar-collapsed .backend-status,
body.editor-page.sidebar-collapsed .backend-status {
  display: grid;
  place-items: center;
  padding: 10px;
  min-height: 44px;
}

body.viewer-page.sidebar-collapsed .backend-status-label,
body.editor-page.sidebar-collapsed .backend-status-label,
body.viewer-page.sidebar-collapsed #backend-status-text,
body.editor-page.sidebar-collapsed #backend-status-text {
  display: none;
}

body.viewer-page.sidebar-collapsed .tool-button,
body.editor-page.sidebar-collapsed .tool-button {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  gap: 0;
  text-align: center;
}

body.viewer-page.sidebar-collapsed .side-group,
body.editor-page.sidebar-collapsed .side-group {
  padding: 14px 0 0;
  border-radius: 0;
}

body.viewer-page.sidebar-collapsed .side-group-title,
body.editor-page.sidebar-collapsed .side-group-title,
body.viewer-page.sidebar-collapsed .sidebar-subgroup-title,
body.editor-page.sidebar-collapsed .sidebar-subgroup-title {
  justify-content: center;
}

body.viewer-page.sidebar-collapsed .tool-button-icon,
body.editor-page.sidebar-collapsed .tool-button-icon,
body.viewer-page.sidebar-collapsed .side-group-title-icon,
body.editor-page.sidebar-collapsed .side-group-title-icon {
  margin: 0 auto;
}

body.viewer-page.sidebar-collapsed .side-group-title-main,
body.editor-page.sidebar-collapsed .side-group-title-main {
  width: 100%;
  justify-content: center;
  gap: 0;
}

body.viewer-page.sidebar-collapsed .side-group-caret,
body.editor-page.sidebar-collapsed .side-group-caret {
  display: none;
}

body.viewer-page.sidebar-collapsed .toolbar-section,
body.editor-page.sidebar-collapsed .toolbar-section,
body.viewer-page.sidebar-collapsed .sidebar-subgroup,
body.editor-page.sidebar-collapsed .sidebar-subgroup {
  display: none;
}

body.viewer-page #annotation-bar,
body.editor-page #annotation-bar {
  left: calc(var(--sidebar-width) + 18px);
  bottom: 18px;
  transition: left 0.28s ease;
}

body.viewer-page .viewer-back-btn,
body.editor-page .viewer-back-btn {
  top: 18px;
  left: 18px;
  padding: 10px 14px;
  border: 1px solid var(--app-line-soft);
  background: rgba(10, 23, 34, 0.82);
  box-shadow: none;
  backdrop-filter: blur(14px);
  font-size: 0.76rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 10px;
}

body.viewer-page .annotation-nav,
body.editor-page .annotation-nav {
  min-height: 38px;
  padding: 8px 12px;
  background: rgba(8, 18, 28, 0.86);
  border: 1px solid var(--app-line-soft);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  font-size: 0.74rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 10px;
}

body.viewer-page .annotation-nav-info,
body.editor-page .annotation-nav-info {
  min-width: 38px;
  padding: 8px 10px;
}

body.viewer-page .annotation-nav-icon,
body.editor-page .annotation-nav-icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  line-height: 0;
}

body.viewer-page .annotation-nav-icon svg,
body.editor-page .annotation-nav-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

body.viewer-page .annotation-select,
body.editor-page .annotation-select {
  min-width: 180px;
  background: rgba(8, 18, 28, 0.92);
  border-color: var(--app-line-soft);
  font-size: 0.74rem;
  min-height: 38px;
  border-radius: 10px;
}

body.viewer-page .annotation-panel-inner,
body.editor-page .annotation-panel-inner {
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(15, 19, 24, 0.14);
  box-shadow: 0 24px 60px rgba(15, 19, 24, 0.18);
  color: #101418;
}

body.viewer-page .annotation-panel-header span,
body.editor-page .annotation-panel-header span,
body.viewer-page .annotation-panel-body,
body.editor-page .annotation-panel-body,
body.viewer-page .annotation-panel-status,
body.editor-page .annotation-panel-status,
body.viewer-page .annotation-panel-meta,
body.editor-page .annotation-panel-meta {
  color: #101418;
}

body.viewer-page .annotation-panel-close,
body.editor-page .annotation-panel-close {
  color: rgba(15, 19, 24, 0.58);
}

body.viewer-page .annotation-panel-close:hover,
body.editor-page .annotation-panel-close:hover {
  color: #101418;
}

body.viewer-page .annotation-panel-info,
body.editor-page .annotation-panel-info,
body.viewer-page .annotation-panel-ai-button,
body.editor-page .annotation-panel-ai-button,
body.viewer-page .annotation-panel-edit-button,
body.editor-page .annotation-panel-edit-button {
  background: transparent;
  border-color: rgba(15, 19, 24, 0.14);
  color: #101418;
}

body.viewer-page .annotation-panel-info:hover,
body.editor-page .annotation-panel-info:hover,
body.viewer-page .annotation-panel-ai-button:hover:not(:disabled),
body.editor-page .annotation-panel-ai-button:hover:not(:disabled),
body.viewer-page .annotation-panel-edit-button:hover,
body.editor-page .annotation-panel-edit-button:hover {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
}

body.viewer-page .annotation-panel-meta,
body.editor-page .annotation-panel-meta {
  border-top-color: rgba(15, 19, 24, 0.1);
}

body.viewer-page .modal,
body.editor-page .modal {
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(15, 19, 24, 0.14);
  box-shadow: 0 24px 60px rgba(15, 19, 24, 0.18);
  backdrop-filter: none;
}

body.viewer-page .modal-title,
body.editor-page .modal-title {
  color: #101418;
}

body.viewer-page .modal-close,
body.editor-page .modal-close {
  color: rgba(15, 19, 24, 0.58);
}

body.viewer-page .modal-close:hover,
body.editor-page .modal-close:hover {
  color: #101418;
}

body.viewer-page .modal-textarea,
body.editor-page .modal-textarea {
  background: rgba(15, 19, 24, 0.03);
  border-color: rgba(15, 19, 24, 0.12);
  color: #101418;
}

body.viewer-page .modal-btn,
body.editor-page .modal-btn {
  background: transparent;
  border-color: rgba(15, 19, 24, 0.14);
  color: #101418;
  box-shadow: none;
}

body.viewer-page .modal-btn:hover:not(:disabled),
body.editor-page .modal-btn:hover:not(:disabled) {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
  box-shadow: none;
}

body.viewer-page .modal-btn.primary,
body.editor-page .modal-btn.primary {
  background: #101418;
  border-color: #101418;
  color: #ffffff;
}

body.viewer-page .modal-btn.primary:hover:not(:disabled),
body.editor-page .modal-btn.primary:hover:not(:disabled) {
  background: rgba(16, 20, 24, 0.88);
  border-color: rgba(16, 20, 24, 0.88);
}

body.viewer-page .modal-btn.primary:disabled,
body.editor-page .modal-btn.primary:disabled {
  background: rgba(16, 20, 24, 0.22);
  border-color: rgba(16, 20, 24, 0.14);
  color: rgba(16, 20, 24, 0.42);
}

body.viewer-page #viewer-feedback-modal,
body.editor-page #viewer-feedback-modal {
  background: rgba(11, 18, 28, 0.42);
  backdrop-filter: blur(10px);
}

body.viewer-page .viewer-feedback-modal,
body.editor-page .viewer-feedback-modal {
  width: min(440px, calc(100vw - 32px));
  max-height: none;
  padding: 0;
  gap: 0;
  overflow: hidden;
}

body.viewer-page .viewer-feedback-modal::before,
body.editor-page .viewer-feedback-modal::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, rgba(16, 20, 24, 0.16), rgba(16, 20, 24, 0.42));
}

body.viewer-page #viewer-feedback-modal[data-variant="success"] .viewer-feedback-modal::before,
body.editor-page #viewer-feedback-modal[data-variant="success"] .viewer-feedback-modal::before {
  background: linear-gradient(90deg, rgba(84, 194, 132, 0.92), rgba(115, 215, 255, 0.9));
}

body.viewer-page #viewer-feedback-modal[data-variant="error"] .viewer-feedback-modal::before,
body.editor-page #viewer-feedback-modal[data-variant="error"] .viewer-feedback-modal::before {
  background: linear-gradient(90deg, rgba(210, 64, 88, 0.9), rgba(245, 140, 122, 0.9));
}

body.viewer-page .viewer-feedback-modal .modal-header,
body.editor-page .viewer-feedback-modal .modal-header {
  padding: 22px 22px 0;
}

body.viewer-page .viewer-feedback-modal .modal-title,
body.editor-page .viewer-feedback-modal .modal-title {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

body.viewer-page .viewer-feedback-modal .modal-close,
body.editor-page .viewer-feedback-modal .modal-close {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(15, 19, 24, 0.1);
  background: rgba(15, 19, 24, 0.02);
  font-size: 1.15rem;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

body.viewer-page .viewer-feedback-modal .modal-close:hover,
body.editor-page .viewer-feedback-modal .modal-close:hover {
  background: rgba(15, 19, 24, 0.06);
  border-color: rgba(15, 19, 24, 0.18);
  transform: translateY(-1px);
}

body.viewer-page .viewer-feedback-copy,
body.editor-page .viewer-feedback-copy {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 18px 22px 4px 92px;
  min-height: 74px;
}

body.viewer-page .viewer-feedback-copy::before,
body.editor-page .viewer-feedback-copy::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 22px;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(15, 19, 24, 0.08);
  background: linear-gradient(180deg, rgba(15, 19, 24, 0.02), rgba(15, 19, 24, 0.05));
}

body.viewer-page .viewer-feedback-copy::after,
body.editor-page .viewer-feedback-copy::after {
  position: absolute;
  top: 14px;
  left: 22px;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

body.viewer-page #viewer-feedback-modal[data-variant="success"] .viewer-feedback-copy::before,
body.editor-page #viewer-feedback-modal[data-variant="success"] .viewer-feedback-copy::before {
  border-color: rgba(84, 194, 132, 0.18);
  background: linear-gradient(180deg, rgba(84, 194, 132, 0.12), rgba(115, 215, 255, 0.08));
}

body.viewer-page #viewer-feedback-modal[data-variant="success"] .viewer-feedback-copy::after,
body.editor-page #viewer-feedback-modal[data-variant="success"] .viewer-feedback-copy::after {
  content: "✓";
  color: #178552;
}

body.viewer-page #viewer-feedback-modal[data-variant="error"] .viewer-feedback-copy::before,
body.editor-page #viewer-feedback-modal[data-variant="error"] .viewer-feedback-copy::before {
  border-color: rgba(210, 64, 88, 0.18);
  background: linear-gradient(180deg, rgba(210, 64, 88, 0.1), rgba(245, 140, 122, 0.08));
}

body.viewer-page #viewer-feedback-modal[data-variant="error"] .viewer-feedback-copy::after,
body.editor-page #viewer-feedback-modal[data-variant="error"] .viewer-feedback-copy::after {
  content: "!";
  color: #b32643;
}

body.viewer-page .viewer-feedback-copy .confirm-modal-text,
body.editor-page .viewer-feedback-copy .confirm-modal-text {
  color: rgba(15, 19, 24, 0.72);
  font-size: 0.95rem;
  line-height: 1.65;
}

body.viewer-page .viewer-feedback-modal .modal-footer,
body.editor-page .viewer-feedback-modal .modal-footer {
  padding: 16px 22px 22px;
  justify-content: flex-end;
}

body.viewer-page .viewer-feedback-modal .modal-btn.primary,
body.editor-page .viewer-feedback-modal .modal-btn.primary {
  min-width: 112px;
}

body.viewer-page .ai-review-dialog,
body.editor-page .ai-review-dialog {
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(15, 19, 24, 0.14);
  box-shadow: 0 24px 60px rgba(15, 19, 24, 0.18);
  color: #101418;
}

body.viewer-page .ai-review-header,
body.editor-page .ai-review-header,
body.viewer-page .ai-review-footer,
body.editor-page .ai-review-footer {
  border-color: rgba(15, 19, 24, 0.1);
}

body.viewer-page .ai-review-title,
body.editor-page .ai-review-title,
body.viewer-page .ai-review-subtitle,
body.editor-page .ai-review-subtitle,
body.viewer-page .ai-review-status,
body.editor-page .ai-review-status,
body.viewer-page .ai-review-meta,
body.editor-page .ai-review-meta {
  color: #101418;
}

body.viewer-page .ai-review-close,
body.editor-page .ai-review-close {
  color: rgba(15, 19, 24, 0.58);
}

body.viewer-page .ai-review-close:hover,
body.editor-page .ai-review-close:hover {
  color: #101418;
}

body.viewer-page .ai-review-text,
body.editor-page .ai-review-text {
  background: rgba(15, 19, 24, 0.03);
  border-color: rgba(15, 19, 24, 0.12);
  color: #101418;
}

body.viewer-page .ai-review-btn,
body.editor-page .ai-review-btn {
  background: transparent;
  border-color: rgba(15, 19, 24, 0.14);
  color: #101418;
}

body.viewer-page .ai-review-btn:hover:not(:disabled),
body.editor-page .ai-review-btn:hover:not(:disabled) {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
}

body.viewer-page .ai-review-btn-primary,
body.editor-page .ai-review-btn-primary {
  background: #101418;
  border-color: #101418;
  color: #ffffff;
}

body.viewer-page .ai-review-btn-primary:hover:not(:disabled),
body.editor-page .ai-review-btn-primary:hover:not(:disabled) {
  background: rgba(16, 20, 24, 0.88);
  border-color: rgba(16, 20, 24, 0.88);
}

body.viewer-page .viewer-back-btn,
body.editor-page .viewer-back-btn,
body.viewer-page .annotation-nav,
body.editor-page .annotation-nav,
body.viewer-page .annotation-select,
body.editor-page .annotation-select {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 19, 24, 0.14);
  color: #101418;
  box-shadow: 0 18px 40px rgba(15, 19, 24, 0.14);
  backdrop-filter: none;
}

body.viewer-page .viewer-back-btn:hover,
body.editor-page .viewer-back-btn:hover,
body.viewer-page .annotation-nav:hover,
body.editor-page .annotation-nav:hover,
body.viewer-page .annotation-select:hover,
body.editor-page .annotation-select:hover {
  background: rgba(255, 255, 255, 0.99);
  border-color: rgba(15, 19, 24, 0.24);
}

body.viewer-page .model-info-row,
body.editor-page .model-info-row {
  border-bottom-color: rgba(15, 19, 24, 0.08);
}

body.viewer-page .model-info-label,
body.editor-page .model-info-label {
  color: rgba(15, 19, 24, 0.56);
}

body.viewer-page .model-info-value,
body.editor-page .model-info-value {
  color: #101418;
}

.model-info-modal {
  width: min(520px, 92vw);
}

.model-info-body {
  display: grid;
  gap: 6px;
}

.model-info-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.model-info-row:last-child {
  border-bottom: 0;
}

.model-info-label {
  color: rgba(193, 208, 224, 0.7);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.viewer-page .sidebar-user,
body.editor-page .sidebar-user {
  display: grid;
  gap: 3px;
  padding-top: 2px;
}

body.viewer-page .sidebar-user-label,
body.editor-page .sidebar-user-label {
  color: rgba(15, 20, 26, 0.5);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.viewer-page .sidebar-user-name,
body.editor-page .sidebar-user-name {
  color: #101418;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.model-info-value {
  color: #eef6ff;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: right;
}

@media (max-width: 980px) {
  body.viewer-page,
  body.editor-page {
    --sidebar-width: min(320px, calc(100vw - 24px));
    --sidebar-collapsed-width: 86px;
  }

  body.viewer-page #app,
  body.editor-page #app {
    display: block;
  }

  body.viewer-page .sidebar,
  body.editor-page .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: auto;
    max-height: 100vh;
    border-radius: 0;
    z-index: 40;
  }

  body.viewer-page #viewer-container,
  body.editor-page #viewer-container {
    width: 100vw;
    height: 100vh;
  }

  body.viewer-page #annotation-bar,
  body.editor-page #annotation-bar {
    left: 18px;
    right: 18px;
  }

  body.viewer-page .viewer-back-btn,
  body.editor-page .viewer-back-btn {
    left: auto;
    right: 18px;
  }
}

@media (max-width: 640px) {
  body.viewer-page #annotation-bar,
  body.editor-page #annotation-bar {
    gap: 6px;
    flex-wrap: wrap;
  }

  body.viewer-page .annotation-select,
  body.editor-page .annotation-select {
    min-width: 180px;
    max-width: 100%;
  }

  .model-info-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .model-info-value {
    text-align: left;
  }
}

/* ===== Phase 3: Login/Home pages ===== */
.page {
  background: #0b0b0c;
  color: #eaeaea;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

body.page-login {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(860px 520px at 12% 12%, rgba(125, 224, 202, 0.15), transparent 60%),
    radial-gradient(760px 420px at 88% 20%, rgba(143, 208, 255, 0.16), transparent 54%),
    linear-gradient(180deg, #061019 0%, #08151f 45%, #07111a 100%);
  color: var(--app-text-0);
}

body.page-login .auth-page {
  width: min(1380px, calc(100% - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 28px;
  align-items: stretch;
}

body.page-login .auth-hero,
body.page-login .auth-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.32);
}

body.page-login .auth-hero {
  min-height: clamp(620px, 88vh, 880px);
  padding: 48px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 20%, rgba(143, 208, 255, 0.18), transparent 32%),
    radial-gradient(circle at 82% 84%, rgba(125, 224, 202, 0.15), transparent 28%),
    linear-gradient(160deg, rgba(14, 29, 43, 0.96) 0%, rgba(8, 18, 28, 0.98) 56%, rgba(5, 12, 19, 0.99) 100%);
}

body.page-login .auth-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 30%),
    linear-gradient(0deg, rgba(4, 10, 18, 0.08), rgba(4, 10, 18, 0.4)),
    repeating-linear-gradient(90deg, rgba(184, 212, 227, 0.04) 0 1px, transparent 1px 92px),
    repeating-linear-gradient(0deg, rgba(184, 212, 227, 0.03) 0 1px, transparent 1px 92px);
  opacity: 0.6;
  pointer-events: none;
}

body.page-login .auth-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: 12%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(125, 224, 202, 0.18) 0%, rgba(125, 224, 202, 0) 70%);
  filter: blur(12px);
  pointer-events: none;
}

body.page-login .auth-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

body.page-login .navis-brand-auth,
body.page-login .navis-brand-card {
  position: relative;
  z-index: 1;
}

body.page-login .navis-brand-auth {
  margin-bottom: 30px;
}

body.page-login .navis-brand-card {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.page-login .navis-brand-auth .navis-brand-logo,
body.page-login .navis-brand-card .navis-brand-logo {
  width: 46px;
  height: 46px;
}

body.page-login .auth-kicker {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(235, 244, 255, 0.8);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.page-login .auth-hero-title {
  margin: 0;
  font-size: clamp(2.7rem, 4.1vw, 4.3rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
  color: #f7fbff;
}

body.page-login .auth-hero-subtitle {
  margin: 22px 0 0;
  max-width: 32rem;
  color: rgba(227, 239, 248, 0.84);
  font-size: clamp(1.02rem, 1.35vw, 1.22rem);
  line-height: 1.7;
}

body.page-login .auth-feature-list {
  margin-top: 42px;
  display: grid;
  gap: 18px;
}

body.page-login .auth-feature-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

body.page-login .auth-feature-dot {
  width: 12px;
  height: 12px;
  margin-top: 5px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--app-accent-strong), var(--app-accent));
  box-shadow: 0 0 20px rgba(125, 224, 202, 0.48);
}

body.page-login .auth-feature-item strong {
  display: block;
  color: #f4f8ff;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

body.page-login .auth-feature-item p {
  margin: 6px 0 0;
  color: rgba(214, 227, 238, 0.72);
  font-size: 0.9rem;
  line-height: 1.55;
}

body.page-login .auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(620px, 88vh, 880px);
}

body.page-login .auth-card {
  width: min(100%, 460px);
  padding: 38px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(15, 28, 42, 0.94), rgba(9, 19, 29, 0.9));
  backdrop-filter: blur(22px);
}

body.page-login .auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top, rgba(143, 208, 255, 0.13), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 26%);
  pointer-events: none;
}

body.page-login .auth-eyebrow,
body.page-login .auth-card-title,
body.page-login .auth-card-copy,
body.page-login .auth-label,
body.page-login .auth-msg,
body.page-login .auth-input,
body.page-login .auth-btn {
  position: relative;
  z-index: 1;
}

body.page-login .auth-eyebrow {
  margin: 0 0 12px;
  color: rgba(191, 207, 224, 0.78);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

body.page-login .auth-card-title {
  margin: 0;
  color: #f6faff;
  font-size: clamp(1.95rem, 3vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

body.page-login .auth-card-copy {
  margin: 14px 0 28px;
  color: rgba(214, 226, 237, 0.7);
  font-size: 0.96rem;
  line-height: 1.6;
}

body.page-login .auth-label {
  display: block;
  margin: 0 0 10px;
  color: rgba(228, 238, 248, 0.84);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

body.page-login .auth-input {
  width: 100%;
  margin: 0;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--app-text-0);
  font-size: 0.98rem;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease, transform 180ms ease;
}

body.page-login .auth-input::placeholder {
  color: rgba(189, 205, 221, 0.44);
}

body.page-login .auth-input:focus {
  outline: none;
  border-color: rgba(143, 208, 255, 0.42);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 4px rgba(143, 208, 255, 0.12);
  transform: translateY(-1px);
}

body.page-login .auth-btn {
  width: 100%;
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px solid rgba(125, 224, 202, 0.78);
  background: linear-gradient(135deg, rgba(125, 224, 202, 0.98), rgba(143, 208, 255, 0.96));
  color: #082018;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

body.page-login .auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(94, 176, 203, 0.22);
  filter: brightness(1.03);
}

body.page-login .auth-btn:active {
  transform: translateY(0);
}

body.page-login .auth-msg {
  min-height: 1.4em;
  margin-top: 16px;
  color: rgba(216, 228, 240, 0.8);
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-btn.secondary { opacity: 0.85; }
.auth-btn.small { padding: 6px 10px; border-radius: 10px; }

.auth-actions { display: flex; gap: 10px; margin-top: 10px; }

.projects-list { margin-top: 10px; display: grid; gap: 10px; }
.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--app-line-soft);
  background: rgba(255,255,255,0.03);
}
.project-name { font-weight: 600; }

@media (max-width: 980px) {
  body.page-login .auth-page {
    width: min(100%, calc(100% - 28px));
    padding: 18px 0 28px;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  body.page-login .auth-hero,
  body.page-login .auth-panel {
    min-height: auto;
  }

  body.page-login .auth-hero {
    padding: 34px 28px;
    border-radius: 28px;
  }

  body.page-login .auth-panel {
    padding-bottom: 10px;
  }

  body.page-login .auth-card {
    width: min(100%, 560px);
  }

  .home-topbar {
    padding: 24px 28px 0;
    flex-wrap: wrap;
  }

  .home-nav {
    order: 3;
    margin-left: 0;
  }

  .home-profile {
    margin-left: auto;
  }

  .home-hero {
    min-height: 620px;
  }

  .home-hero-inner {
    padding: 144px 36px 92px;
    max-width: 500px;
  }

  .profile-topbar {
    padding: 24px 28px 0;
    flex-wrap: wrap;
  }

  .profile-main {
    width: min(100%, calc(100% - 28px));
  }

  .profile-header-card,
  .profile-edit-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-header-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-header-actions {
    justify-content: flex-start;
  }

  .profile-header-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .profile-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-course-stats,
  .profile-course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-ai-metrics,
  .profile-ai-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-analytics-card,
  .profile-analytics-card-wide {
    grid-column: span 1;
  }

  .profile-analytics-card-wide {
    grid-column: 1 / -1;
  }

  .profile-recent-card {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .profile-course-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-course-media {
    min-height: 180px;
    max-width: 260px;
  }

  .profile-course-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  body.page-login .auth-page {
    width: min(100%, calc(100% - 20px));
    padding: 10px 0 20px;
  }

  body.page-login .auth-hero {
    padding: 26px 20px;
    border-radius: 24px;
  }

  body.page-login .auth-feature-list {
    margin-top: 28px;
    gap: 12px;
  }

  body.page-login .auth-feature-item {
    padding: 14px 15px;
    border-radius: 18px;
    gap: 14px;
  }

  body.page-login .auth-card {
    padding: 28px 20px;
    border-radius: 24px;
  }

  body.page-login .auth-card-copy {
    margin-bottom: 22px;
  }

  body.page-login .navis-brand-auth,
  body.page-login .navis-brand-card,
  .navis-brand-home {
    gap: 12px;
  }

  body.page-login .navis-brand-auth .navis-brand-logo,
  body.page-login .navis-brand-card .navis-brand-logo,
  .navis-brand-home .navis-brand-logo {
    width: 40px;
    height: 40px;
  }

  .profile-topbar {
    padding: 18px 16px 0;
  }

  .profile-main {
    width: min(100%, calc(100% - 20px));
    padding-bottom: 40px;
  }

  .profile-header-card {
    padding: 22px 18px;
    gap: 18px;
  }

  .profile-header-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 22px;
    font-size: 1.6rem;
  }

  .profile-stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-course-stats,
  .profile-course-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-ai-metric-card,
  .profile-ai-card,
  .profile-analytics-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .profile-header-meta {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-analytics-grid,
  .profile-quality-grid,
  .profile-usage-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-activity-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .profile-activity-time {
    text-align: left;
    white-space: normal;
  }

  .profile-recent-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-recent-thumb {
    min-height: 148px;
  }

  .profile-recent-top {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-edit-modal {
    width: min(100%, calc(100% - 20px));
  }

  .profile-course-modal {
    width: min(100%, calc(100% - 20px));
  }
}

/* ============================
   Viewer mode (read-only)
   ============================ */
body.mode-viewer #admin-section,
body.mode-viewer #authoring-section {
  display: none !important;
}

/* Hide AI write/edit controls in viewer mode */
body.mode-viewer #annotation-panel-ai,
body.mode-viewer #annotation-panel-edit,
body.mode-viewer #ai-review-modal {
  display: none !important;
}

/* Hide backend write controls in viewer mode (keep load/select visible) */
body.mode-viewer #backend-project-new,
body.mode-viewer #backend-project-save,
body.mode-viewer #backend-project-delete,
body.mode-viewer #backend-project-rename,
body.mode-viewer #backend-project-rename-btn {
  display: none !important;
}

/* ===== Home (course layout) ===== */
:root {
  --home-hero-image: none;
}

body.page-home {
  --home-bg: #ece7de;
  --home-bg-soft: #f6f2eb;
  --home-line: rgba(15, 20, 26, 0.16);
  --home-line-soft: rgba(15, 20, 26, 0.08);
  --home-ink: #0f1318;
  --home-muted: rgba(15, 19, 24, 0.68);
  --home-muted-strong: rgba(15, 19, 24, 0.82);
  --home-hero-ink: rgba(247, 244, 238, 0.96);
  --home-hero-muted: rgba(247, 244, 238, 0.78);
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(1200px 580px at 18% -8%, rgba(255, 255, 255, 0.42), transparent 72%),
    linear-gradient(180deg, #ece7de 0%, #e9e3d8 42%, #f5f1ea 100%);
  color: var(--home-ink);
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.home-shell {
  min-height: 100vh;
  width: 100%;
  position: relative;
}

.home-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  width: auto;
  margin: 0;
  padding: 28px 56px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--home-line);
}

body.page-home .home-topbar {
  background: transparent;
  backdrop-filter: none;
  border-bottom: 0;
}

.home-topbar .navis-brand-home .navis-brand-name,
.home-topbar .navis-brand-home .navis-brand-tagline,
.home-topbar .home-nav a,
.home-topbar .home-nav a:hover,
.home-topbar .home-nav a[aria-current="page"],
.home-topbar .home-user-line {
  color: #101418 !important;
}

.navis-brand-home {
  flex: 0 0 auto;
}

.navis-brand-home .navis-brand-logo {
  width: 44px;
  height: 44px;
}

.navis-brand-home .navis-brand-name {
  color: var(--home-ink);
}

.navis-brand-home .navis-brand-tagline {
  color: var(--home-muted);
}

.home-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  padding: 0;
  margin-left: auto;
}

.home-nav a {
  position: relative;
  color: var(--home-ink);
  text-decoration: none;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.home-nav a + a {
  margin-left: 18px;
  padding-left: 18px;
}

.home-nav a + a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 14px;
  background: rgba(15, 19, 24, 0.18);
  transform: translateY(-50%);
}

.home-nav a:hover {
  color: var(--home-ink);
}

.home-nav a[aria-current="page"] {
  color: var(--home-ink);
}

.home-profile {
  display: flex;
  align-items: center;
  gap: 10px 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 0;
}

.home-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #101418;
  color: rgba(248, 244, 238, 0.96);
  font-weight: 700;
  letter-spacing: 0.03em;
}

.home-avatar.has-image {
  color: transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.navis-profile-menu-host {
  position: relative;
}

.navis-profile-menu-trigger,
.sidebar-user-avatar {
  cursor: pointer;
}

.navis-profile-menu-trigger:focus-visible,
.sidebar-user-avatar:focus-visible {
  outline: 2px solid rgba(114, 181, 255, 0.62);
  outline-offset: 3px;
}

.navis-profile-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 70;
  min-width: 188px;
  padding: 10px;
  border-radius: 20px;
  border: 1px solid rgba(126, 161, 191, 0.22);
  background:
    linear-gradient(180deg, rgba(17, 29, 43, 0.98), rgba(9, 17, 28, 0.98)),
    radial-gradient(circle at top right, rgba(89, 170, 255, 0.14), transparent 42%);
  box-shadow: 0 24px 56px rgba(1, 7, 14, 0.42);
  backdrop-filter: blur(18px);
}

body.page-home .navis-profile-menu-trigger:focus-visible,
body.page-profile .navis-profile-menu-trigger:focus-visible,
body.page-courses .navis-profile-menu-trigger:focus-visible,
body.page-course .navis-profile-menu-trigger:focus-visible,
body.page-project .navis-profile-menu-trigger:focus-visible {
  outline: 2px solid rgba(15, 19, 24, 0.42);
}

body.page-home .navis-profile-menu,
body.page-profile .navis-profile-menu,
body.page-courses .navis-profile-menu,
body.page-course .navis-profile-menu,
body.page-project .navis-profile-menu {
  border: 1px solid var(--home-line);
  background:
    linear-gradient(180deg, rgba(250, 248, 243, 0.98), rgba(244, 239, 231, 0.98)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.24), transparent 42%);
  box-shadow: 0 24px 56px rgba(16, 20, 24, 0.14);
}

body.page-home .navis-profile-menu-link,
body.page-home .navis-profile-menu-action,
body.page-profile .navis-profile-menu-link,
body.page-profile .navis-profile-menu-action,
body.page-courses .navis-profile-menu-link,
body.page-courses .navis-profile-menu-action,
body.page-course .navis-profile-menu-link,
body.page-course .navis-profile-menu-action,
body.page-project .navis-profile-menu-link,
body.page-project .navis-profile-menu-action {
  color: var(--home-ink);
}

body.page-home .navis-profile-menu-link:hover,
body.page-home .navis-profile-menu-link:focus-visible,
body.page-home .navis-profile-menu-action:hover,
body.page-home .navis-profile-menu-action:focus-visible,
body.page-profile .navis-profile-menu-link:hover,
body.page-profile .navis-profile-menu-link:focus-visible,
body.page-profile .navis-profile-menu-action:hover,
body.page-profile .navis-profile-menu-action:focus-visible,
body.page-courses .navis-profile-menu-link:hover,
body.page-courses .navis-profile-menu-link:focus-visible,
body.page-courses .navis-profile-menu-action:hover,
body.page-courses .navis-profile-menu-action:focus-visible,
body.page-course .navis-profile-menu-link:hover,
body.page-course .navis-profile-menu-link:focus-visible,
body.page-course .navis-profile-menu-action:hover,
body.page-course .navis-profile-menu-action:focus-visible,
body.page-project .navis-profile-menu-link:hover,
body.page-project .navis-profile-menu-link:focus-visible,
body.page-project .navis-profile-menu-action:hover,
body.page-project .navis-profile-menu-action:focus-visible {
  background: rgba(15, 19, 24, 0.06);
  color: var(--home-ink);
}

.navis-profile-menu-link,
.navis-profile-menu-action {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #eef5ff;
  text-decoration: none;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.navis-profile-menu-link:hover,
.navis-profile-menu-link:focus-visible,
.navis-profile-menu-action:hover,
.navis-profile-menu-action:focus-visible {
  background: rgba(89, 170, 255, 0.14);
  color: #ffffff;
  outline: none;
}

.navis-sidebar-user-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  position: relative;
  z-index: 12;
}

.sidebar-user-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  width: 100%;
}

.sidebar-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(243, 248, 255, 0.96), rgba(206, 224, 238, 0.92));
  color: #162334;
  font-weight: 700;
  letter-spacing: 0.03em;
  order: -1;
}

.sidebar-user-avatar.has-image {
  color: transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.navis-sidebar-user-menu .navis-profile-menu {
  top: calc(100% + 10px);
  left: 0;
  right: auto;
  z-index: 120;
}

.home-logout-btn {
  border: 1px solid #101418;
  background: #101418;
  color: rgba(248, 244, 238, 0.96);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.home-logout-btn:hover {
  background: #000000;
}

.home-hero {
  width: 100vw;
  max-width: none;
  margin: 0;
  margin-left: calc(50% - 50vw);
  min-height: 100svh;
  position: relative;
  border-radius: 0;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid #101418;
  background: transparent;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgb(255, 255, 255) 10%, rgba(255, 255, 255, 0.76) 26%, rgba(255, 255, 255, 0) 44%, rgba(255, 255, 255, 0) 50%);
  z-index: 1;
  pointer-events: none;
}

.home-hero::before {
  content: none;
}

.home-hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: none;
  transform-origin: center;
  filter: none;
  pointer-events: auto;
}

.home-hero-spline {
  border: 0;
  display: block;
  width: 100%;
  height: 100%;
  transform: scale(1.06);
  transform-origin: center;
  mix-blend-mode: normal;
  opacity: 1;
}


.home-hero-inner {
  max-width: 560px;
  min-height: 100svh;
  padding: 172px 56px 104px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.home-hero-kicker {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(234, 242, 250, 0.76);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-hero-title {
  margin: 0;
  font-size: clamp(3.8rem, 6vw, 5.6rem);
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--home-ink);
}

.home-hero-tagline {
  margin: 18px 0 0;
  font-size: clamp(1.18rem, 1.7vw, 1.52rem);
  line-height: 1.35;
  color: var(--home-muted-strong);
}

.home-hero-sub {
  margin-top: 18px;
  font-size: clamp(0.98rem, 1.2vw, 1.08rem);
  line-height: 1.72;
  max-width: 480px;
  color: var(--home-muted);
}

.home-content {
  width: min(1500px, 100%);
  margin: 0 auto 52px;
  padding: 28px 40px 0;
  box-sizing: border-box;
  position: relative;
  z-index: 0;
}

.home-content::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: -52px;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  background:
    linear-gradient(180deg, rgba(250, 248, 243, 0.72), rgba(244, 239, 231, 0.96)),
    var(--home-bg-soft);
  z-index: -1;
}

.home-user-line {
  margin: 0;
  color: var(--home-ink);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: right;
  align-self: center;
}

.home-module-title {
  margin: 0 0 16px;
  padding-top: 0;
  border-top: none;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  font-weight: 650;
  color: var(--home-ink);
}

.home-teacher-cta {
  margin: 32px 0 0;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.home-teacher-cta[hidden] {
  display: none !important;
}

.home-teacher-btn {
  border: 1px solid #101418;
  background: #101418;
  color: rgba(248, 244, 238, 0.96);
  border-radius: 999px;
  min-height: 54px;
  padding: 0 26px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(16, 20, 24, 0.12);
}

.home-teacher-btn:hover {
  background: #000000;
}

.home-teacher-desc {
  margin: 0;
  color: var(--home-muted-strong);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 32rem;
}

.project-grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(5,minmax(220px, 280px));
  justify-content: center;
  margin: 0 auto;
}

.project-card {
  width: 100%;
  max-width: 260px;
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--home-line, rgba(15, 20, 26, 0.16));
  background: rgba(250, 248, 243, 0.82);
  box-shadow: 0 24px 60px rgba(16, 20, 24, 0.12);
  cursor: pointer;
  isolation: isolate;
  transition:
    transform 280ms ease,
    box-shadow 280ms ease;
}

.project-card:hover,
.project-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 30px 70px rgba(16, 20, 24, 0.16), 0 0 0 1px rgba(15, 19, 24, 0.1);
}

.project-card:focus-visible {
  outline: 2px solid rgba(15, 19, 24, 0.72);
  outline-offset: 2px;
}

/* ===== Profile page ===== */
body.page-profile {
  --profile-sidebar-width: 248px;
  --profile-content-gap: clamp(24px, 2vw, 40px);
  --profile-content-edge: clamp(20px, 2vw, 40px);
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(920px 420px at 12% -8%, rgba(115, 215, 255, 0.14), transparent 58%),
    radial-gradient(760px 340px at 88% 2%, rgba(139, 197, 255, 0.08), transparent 54%),
    linear-gradient(180deg, #050d16 0%, #07111c 42%, #040b15 100%);
}

.profile-shell {
  min-height: 100vh;
}

.profile-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 28px 56px 16px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--home-line);
}

.profile-topbar-user {
  margin-left: 0;
}

.profile-main {
  width: auto;
  max-width: 1680px;
  margin: 0 var(--profile-content-edge) 0 calc(var(--profile-sidebar-width) + var(--profile-content-gap));
  padding: 36px 0 72px;
  display: block;
  transition: margin 240ms ease, max-width 240ms ease;
}

.profile-content-stack {
  min-width: 0;
}

.profile-section-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--profile-sidebar-width, 248px);
  z-index: 12;
  transition: width 240ms ease;
}

.profile-section-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 118px 18px 24px;
  border: 0;
  border-right: 1px solid rgba(15, 20, 26, 0.12);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: none;
  box-shadow: none;
  transition: padding 240ms ease;
}

.profile-sidebar-toggle,
.profile-sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: #101418;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.profile-sidebar-toggle {
  border-color: rgba(15, 20, 26, 0.12);
  background: rgba(15, 20, 26, 0.03);
  font-weight: 600;
}

.profile-sidebar-links {
  display: grid;
  gap: 6px;
}

.profile-sidebar-icon {
  width: 18px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}

.profile-sidebar-label {
  white-space: nowrap;
  transition: opacity 180ms ease, width 180ms ease;
}

.profile-sidebar-link:hover,
.profile-sidebar-toggle:hover,
.profile-sidebar-link:focus-visible,
.profile-sidebar-toggle:focus-visible {
  background: rgba(15, 20, 26, 0.06);
  border-color: rgba(15, 20, 26, 0.16);
  outline: none;
}

.profile-sidebar-link.is-active {
  background: rgba(15, 20, 26, 0.08);
  border-color: rgba(15, 20, 26, 0.16);
}

.profile-sidebar-link-top {
  margin-top: 12px;
}

.profile-sidebar-link-top::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 14px;
  right: 14px;
  height: 1px;
  background: rgba(15, 20, 26, 0.12);
}

.profile-section-sidebar.is-collapsed .profile-section-sidebar-panel {
  padding: 118px 10px 24px;
  align-items: center;
}

.profile-section-sidebar.is-collapsed {
  width: 82px;
}

.profile-section-sidebar.is-collapsed .profile-sidebar-toggle,
.profile-section-sidebar.is-collapsed .profile-sidebar-link {
  width: 50px;
  min-width: 50px;
  min-height: 50px;
  justify-content: center;
  gap: 0;
  padding: 0;
  align-self: center;
}

.profile-section-sidebar.is-collapsed .profile-sidebar-label {
  width: 0;
  opacity: 0;
  overflow: hidden;
}

body.page-profile.profile-sidebar-collapsed .profile-main {
  margin-left: calc(82px + var(--profile-content-gap));
}

.profile-hero {
  margin-top: 10px;
}

.profile-header-card {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr);
  gap: 12px;
  align-items: stretch;
  padding: 10px 0 18px;
  border-radius: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.page-profile {
  background: rgba(255, 255, 255, 0.98);
  color: #101418;
}

body.page-profile .profile-section {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid rgba(15, 20, 26, 0.12);
}

body.page-profile .profile-scroll-target {
  scroll-margin-top: 118px;
}

@media (max-width: 1180px) {
  .profile-main {
    width: min(1320px, calc(100% - 28px));
    max-width: none;
    margin: 0 auto;
  }

  .profile-section-sidebar {
    position: static;
    width: auto;
  }

  .profile-section-sidebar.is-collapsed {
    width: auto;
  }

  .profile-section-sidebar-panel,
  .profile-section-sidebar.is-collapsed .profile-section-sidebar-panel {
    width: 100%;
    height: auto;
    padding: 12px;
    border-right: 0;
    border: 1px solid rgba(15, 20, 26, 0.12);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.98);
  }

  .profile-section-sidebar.is-collapsed .profile-sidebar-toggle,
  .profile-section-sidebar.is-collapsed .profile-sidebar-link {
    justify-content: flex-start;
    padding: 0 14px;
  }

  .profile-section-sidebar.is-collapsed .profile-sidebar-label {
    width: auto;
    opacity: 1;
    overflow: visible;
  }

  body.page-profile.profile-sidebar-collapsed .profile-main {
    width: min(1320px, calc(100% - 28px));
    margin: 0 auto;
  }

  .profile-sidebar-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .profile-sidebar-links {
    grid-template-columns: minmax(0, 1fr);
  }
}

body.page-profile .profile-name,
body.page-profile .profile-email,
body.page-profile .profile-section-title,
body.page-profile .profile-stat-value,
body.page-profile .profile-course-stat-value,
body.page-profile .profile-course-title,
body.page-profile .profile-ai-metric-value,
body.page-profile .profile-ai-card-title,
body.page-profile .profile-ai-content,
body.page-profile .profile-analytics-card-title,
body.page-profile .profile-quality-value,
body.page-profile .profile-usage-value,
body.page-profile .profile-data-row-value,
body.page-profile .profile-activity-title,
body.page-profile .profile-recent-title,
body.page-profile .profile-header-meta-value,
body.page-profile .profile-role,
body.page-profile .profile-course-status {
  color: #101418;
}

body.page-profile .profile-eyebrow,
body.page-profile .profile-meta,
body.page-profile .profile-descriptor,
body.page-profile .profile-header-meta-label,
body.page-profile .profile-section-subtitle,
body.page-profile .profile-stat-label,
body.page-profile .profile-course-stat-label,
body.page-profile .profile-course-description,
body.page-profile .profile-course-footer,
body.page-profile .profile-ai-metric-label,
body.page-profile .profile-ai-card-subtitle,
body.page-profile .profile-ai-status,
body.page-profile .profile-analytics-card-subtitle,
body.page-profile .profile-quality-label,
body.page-profile .profile-usage-label,
body.page-profile .profile-data-row-label,
body.page-profile .profile-activity-time,
body.page-profile .profile-activity-detail,
body.page-profile .profile-recent-meta,
body.page-profile .profile-recent-description,
body.page-profile .profile-empty-state,
body.page-profile .profile-empty-state-compact,
body.page-profile .profile-avatar-help {
  color: rgba(15, 19, 24, 0.64);
}

body.page-profile .profile-stat-card,
body.page-profile .profile-course-stat,
body.page-profile .profile-course-card,
body.page-profile .profile-ai-metric-card,
body.page-profile .profile-ai-card,
body.page-profile .profile-analytics-card,
body.page-profile .profile-quality-item,
body.page-profile .profile-usage-card,
body.page-profile .profile-data-row,
body.page-profile .profile-activity-item,
body.page-profile .profile-recent-card,
body.page-profile .profile-empty-state,
body.page-profile .profile-empty-state-compact {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

body.page-profile .profile-stat-card:hover,
body.page-profile .profile-recent-card:hover,
body.page-profile .profile-recent-card:focus-visible {
  transform: none;
  box-shadow: none;
}

body.page-profile .profile-course-card {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-bottom: 1px solid rgba(15, 19, 24, 0.14);
}

body.page-profile .profile-course-card:first-child {
  border-top: 1px solid rgba(15, 19, 24, 0.14);
}

body.page-profile .profile-stat-icon,
body.page-profile .profile-ai-card-icon {
  background: transparent;
  border: 1px solid rgba(15, 20, 26, 0.12);
  color: #101418;
}

body.page-profile .profile-role,
body.page-profile .profile-course-status {
  background: transparent;
  border-color: rgba(15, 20, 26, 0.14);
}

body.page-profile .profile-edit-btn,
body.page-profile .profile-avatar-upload-btn,
body.page-profile .profile-ai-btn,
body.page-profile .profile-course-action,
body.page-profile .profile-recent-open,
body.page-profile .profile-recent-manage {
  background: transparent;
  border: 1px solid rgba(15, 20, 26, 0.16);
  box-shadow: none;
  color: #101418;
}

body.page-profile .profile-edit-btn:hover,
body.page-profile .profile-avatar-upload-btn:hover,
body.page-profile .profile-ai-btn:hover:not(:disabled),
body.page-profile .profile-course-action:hover,
body.page-profile .profile-recent-open:hover,
body.page-profile .profile-recent-manage:hover {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
  transform: translateY(-1px);
}

.profile-header-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 6px 0;
}

.profile-avatar,
.profile-avatar-preview {
  width: 92px;
  height: 92px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(239, 249, 255, 0.98), rgba(205, 225, 238, 0.92));
  color: #163041;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.profile-avatar.has-image,
.profile-avatar-preview.has-image {
  color: transparent;
}

.profile-header-copy {
  min-width: 0;
  display: grid;
}

.profile-eyebrow {
  margin: 0 0 8px;
  color: rgba(195, 211, 226, 0.5);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-name {
  margin: 0;
  font-size: clamp(1.8rem, 2.5vw, 2.35rem);
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.profile-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: rgba(219, 231, 242, 0.68);
  font-size: 0.92rem;
}

.profile-role {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(139, 197, 255, 0.14);
  background: rgba(115, 215, 255, 0.05);
  color: rgba(235, 245, 255, 0.86);
  font-size: 0.78rem;
  font-weight: 600;
}

.profile-descriptor {
  margin: 10px 0 0;
  max-width: 54ch;
  color: rgba(214, 227, 240, 0.58);
  font-size: 0.88rem;
  line-height: 1.55;
}

.profile-header-side {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  padding-top: 6px;
}

.profile-header-actions {
  display: flex;
  justify-content: flex-end;
}

.profile-header-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-header-meta-item {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-header-meta-label {
  color: rgba(198, 214, 230, 0.46);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.profile-header-meta-value {
  color: rgba(242, 247, 255, 0.88);
  font-size: 0.84rem;
  font-weight: 550;
  line-height: 1.35;
}

.profile-edit-btn,
.profile-avatar-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(139, 197, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: var(--app-text-0);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.profile-edit-btn:hover,
.profile-avatar-upload-btn:hover {
  background: rgba(115, 215, 255, 0.1);
  border-color: rgba(139, 197, 255, 0.34);
  transform: translateY(-1px);
}

.profile-section {
  margin-top: 34px;
}

.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.profile-section-copy {
  display: grid;
  gap: 4px;
}

.profile-section-title {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 650;
  color: #f3f8ff;
  letter-spacing: -0.01em;
}

.profile-section-subtitle {
  margin: 0;
  color: rgba(208, 222, 236, 0.58);
  font-size: 0.82rem;
  line-height: 1.5;
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.profile-stat-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 18px 18px 17px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(9, 19, 30, 0.78), rgba(7, 16, 26, 0.72));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.profile-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 197, 255, 0.16);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(115, 215, 255, 0.05);
}

.profile-stat-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: rgba(222, 236, 249, 0.9);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-stat-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.profile-stat-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.profile-stat-label {
  color: rgba(195, 211, 226, 0.56);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-stat-value {
  color: #f5f9ff;
  font-size: clamp(1.1rem, 1.55vw, 1.5rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.profile-ai-section {
  margin-top: 32px;
}

.profile-course-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.profile-course-stat {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(8, 18, 28, 0.54);
}

.profile-course-stat-label {
  color: rgba(195, 211, 226, 0.54);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-course-stat-value {
  color: #f5f9ff;
  font-size: 1rem;
  font-weight: 650;
}

.profile-courses-list {
  display: grid;
  gap: 0;
}

.profile-course-card {
  --profile-course-image: linear-gradient(135deg, rgba(199, 210, 220, 0.9), rgba(244, 239, 231, 0.98));
  position: relative;
  padding: 22px 0;
  border-bottom: 1px solid rgba(15, 19, 24, 0.14);
}

.profile-course-card:first-child {
  border-top: 1px solid rgba(15, 19, 24, 0.14);
}

.profile-course-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) auto;
  align-items: start;
  gap: 20px;
}

.profile-course-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.profile-course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.profile-course-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-course-status {
  color: #f5f9ff;
  border: 1px solid rgba(139, 197, 255, 0.12);
  background: rgba(115, 215, 255, 0.08);
}

.profile-course-status.status-draft {
  background: rgba(196, 203, 214, 0.12);
  border-color: rgba(196, 203, 214, 0.12);
}

.profile-course-status.status-published {
  background: rgba(115, 215, 255, 0.12);
  border-color: rgba(115, 215, 255, 0.18);
}

.profile-course-status.status-archived {
  background: rgba(255, 184, 107, 0.12);
  border-color: rgba(255, 184, 107, 0.18);
}

.profile-course-title {
  margin: 0;
  color: #f5f9ff;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.profile-course-media {
  min-height: 168px;
  background-image: var(--profile-course-image);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  filter: grayscale(1) contrast(1.06) brightness(0.96);
}

.profile-course-actions {
  display: flex;
  align-self: start;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.profile-course-action {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid rgba(139, 197, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--app-text-0);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.profile-course-action:hover {
  background: rgba(115, 215, 255, 0.1);
  border-color: rgba(139, 197, 255, 0.3);
  transform: translateY(-1px);
}

.profile-course-action-danger:hover {
  background: rgba(255, 122, 122, 0.12);
  border-color: rgba(255, 122, 122, 0.24);
}

.profile-course-owner {
  margin: 0 0 10px;
  font-size: 0.9rem;
  line-height: 1.5;
}

body.page-profile .profile-leave-course-modal {
  width: min(500px, 92vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 26px;
  gap: 22px;
  background: #fff;
  border: 1px solid rgba(15, 19, 24, 0.14);
  box-shadow: 0 24px 60px rgba(15, 19, 24, 0.18);
  color: #101418;
}

.profile-leave-course-modal .modal-title,
.profile-leave-course-modal .modal-close,
.profile-leave-course-modal .confirm-modal-text {
  color: #101418;
}

.profile-leave-course-summary {
  display: grid;
  gap: 6px;
  padding: 16px;
  margin-bottom: 8px;
  border-radius: 14px;
  background: #f5f6f7;
  overflow-wrap: anywhere;
}

.profile-leave-course-summary span {
  color: rgba(15, 19, 24, 0.64);
  font-size: 0.86rem;
}

.profile-leave-course-status {
  margin: 4px 0 0;
  color: #a52b2b;
  font-size: 0.88rem;
  line-height: 1.5;
}

.profile-leave-course-modal .modal-footer {
  flex-wrap: wrap;
}

.profile-leave-course-modal .modal-btn {
  background: transparent;
  border-color: rgba(15, 19, 24, 0.18);
  color: #101418;
}

.profile-leave-course-modal .modal-btn:hover:not(:disabled) {
  background: #f0f1f2;
}

.profile-leave-course-modal .modal-btn.primary {
  background: #101418;
  border-color: #101418;
  color: #fff;
}

.profile-leave-course-modal .modal-btn.primary:hover:not(:disabled) {
  background: #303438;
}

.profile-leave-course-modal button:focus-visible {
  outline: 2px solid #536d8d;
  outline-offset: 3px;
}

.profile-course-description {
  margin: 0;
  color: rgba(216, 229, 241, 0.68);
  font-size: 0.9rem;
  line-height: 1.6;
}

.profile-course-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: rgba(198, 214, 230, 0.58);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-ai-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.profile-ai-metric-card {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(8, 18, 28, 0.54);
}

.profile-ai-metric-label {
  color: rgba(195, 211, 226, 0.54);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-ai-metric-value {
  color: #f5f9ff;
  font-size: 1rem;
  font-weight: 650;
}

.profile-ai-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.profile-ai-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(139, 197, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(10, 20, 31, 0.78), rgba(8, 18, 28, 0.7));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.profile-ai-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-ai-card-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.profile-ai-card-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(139, 197, 255, 0.14);
  background: rgba(115, 215, 255, 0.08);
  color: rgba(240, 247, 255, 0.88);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.profile-ai-card-title {
  margin: 0;
  color: #f5f9ff;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.profile-ai-card-subtitle {
  margin: 5px 0 0;
  color: rgba(208, 222, 236, 0.58);
  font-size: 0.82rem;
  line-height: 1.5;
}

.profile-ai-content {
  min-height: 92px;
  color: rgba(231, 239, 250, 0.82);
  font-size: 0.92rem;
  line-height: 1.65;
}

.profile-ai-content.profile-ai-empty {
  color: rgba(195, 211, 226, 0.58);
}

.profile-ai-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.profile-ai-status {
  min-height: 1.2em;
  color: rgba(195, 211, 226, 0.56);
  font-size: 0.76rem;
}

.profile-ai-actions {
  display: flex;
  justify-content: flex-start;
}

.profile-ai-btn {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(139, 197, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--app-text-0);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.profile-ai-btn:hover:not(:disabled) {
  background: rgba(115, 215, 255, 0.1);
  border-color: rgba(139, 197, 255, 0.3);
  transform: translateY(-1px);
}

.profile-ai-btn.is-active {
  background: rgba(115, 215, 255, 0.12);
  border-color: rgba(139, 197, 255, 0.3);
}

.profile-ai-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.profile-analytics-section {
  margin-top: 34px;
}

.profile-analytics-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}

.profile-analytics-card {
  grid-column: span 4;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(8, 18, 28, 0.74), rgba(7, 16, 26, 0.68));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
}

.profile-analytics-card-wide {
  grid-column: span 8;
}

.profile-analytics-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-analytics-card-title {
  margin: 0;
  color: #f5f9ff;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.profile-analytics-card-subtitle {
  margin: 5px 0 0;
  color: rgba(208, 222, 236, 0.58);
  font-size: 0.8rem;
  line-height: 1.5;
}

.profile-quality-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-quality-item,
.profile-usage-card {
  display: grid;
  gap: 6px;
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
}

.profile-quality-label,
.profile-usage-label {
  color: rgba(195, 211, 226, 0.54);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-quality-value,
.profile-usage-value {
  color: #f5f9ff;
  font-size: 1rem;
  font-weight: 650;
}

.profile-data-rows {
  display: grid;
  gap: 10px;
}

.profile-data-rows-secondary {
  margin-top: 2px;
}

.profile-data-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-data-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.profile-data-row-label {
  color: rgba(205, 219, 233, 0.68);
  font-size: 0.84rem;
  line-height: 1.5;
}

.profile-data-row-value {
  color: #f4f8ff;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: right;
}

.profile-usage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-activity-feed {
  display: grid;
  gap: 12px;
}

.profile-activity-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.profile-activity-dot {
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 999px;
  background: rgba(119, 206, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(115, 215, 255, 0.08);
}

.profile-activity-body {
  display: grid;
  gap: 5px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-activity-item:last-child .profile-activity-body {
  padding-bottom: 0;
  border-bottom: 0;
}

.profile-activity-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.profile-activity-title {
  color: #f5f9ff;
  font-size: 0.9rem;
  font-weight: 600;
}

.profile-activity-time {
  color: rgba(195, 211, 226, 0.54);
  font-size: 0.72rem;
  text-align: right;
  white-space: nowrap;
}

.profile-activity-detail {
  margin: 0;
  color: rgba(214, 227, 240, 0.66);
  font-size: 0.84rem;
  line-height: 1.55;
}

.profile-empty-state-compact {
  min-height: 100%;
  padding: 18px;
}

.profile-recent-list {
  display: grid;
  gap: 12px;
}

.profile-recent-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(8, 18, 28, 0.72), rgba(7, 16, 26, 0.66));
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.profile-recent-card:hover,
.profile-recent-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(139, 197, 255, 0.16);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(115, 215, 255, 0.05);
}

.profile-recent-card:focus-visible {
  outline: 2px solid rgba(236, 246, 255, 0.74);
  outline-offset: 2px;
}

.profile-recent-thumb {
  min-height: 104px;
  border-radius: 16px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    linear-gradient(130deg, #6aa9bc 5%, #d3efe8 42%, #38778f 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.profile-recent-thumb.has-image {
  background-color: #09121d;
}

.profile-recent-body {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 10px;
}

.profile-recent-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.profile-recent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.profile-recent-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.profile-recent-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: #f5f9ff;
  letter-spacing: -0.02em;
}

.profile-recent-meta {
  color: rgba(198, 214, 230, 0.58);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-recent-description {
  color: rgba(216, 229, 241, 0.68);
  font-size: 0.9rem;
  line-height: 1.6;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-recent-open {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid rgba(139, 197, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--app-text-0);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.profile-recent-open:hover {
  background: rgba(115, 215, 255, 0.1);
  border-color: rgba(139, 197, 255, 0.3);
  transform: translateY(-1px);
}

.profile-recent-manage {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid rgba(139, 197, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--app-text-0);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.profile-recent-manage:hover {
  background: rgba(115, 215, 255, 0.1);
  border-color: rgba(139, 197, 255, 0.3);
  transform: translateY(-1px);
}

.profile-empty-state {
  padding: 26px 24px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 18, 28, 0.68);
  color: rgba(223, 233, 244, 0.7);
}

.profile-edit-modal {
  width: min(760px, 94vw);
}

.profile-course-modal {
  width: min(680px, 94vw);
}

.profile-project-manage-modal {
  width: min(720px, 94vw);
  max-height: min(88vh, 820px);
}

.profile-project-manage-layout {
  display: grid;
  gap: 18px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.profile-project-manage-summary {
  display: grid;
  gap: 6px;
}

.profile-project-manage-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 650;
}

.profile-project-manage-course {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
}

.profile-project-manage-section {
  display: grid;
  gap: 12px;
}

.profile-project-manage-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.profile-project-manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-project-duplicate-options {
  display: grid;
  gap: 10px;
}

.profile-project-duplicate-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 19, 24, 0.12);
  background: rgba(15, 19, 24, 0.02);
  color: #101418;
  cursor: pointer;
}

.profile-project-duplicate-option input {
  margin: 0;
}

.profile-course-layout {
  display: grid;
  gap: 18px;
}

.profile-course-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-course-textarea {
  min-height: 150px;
}

.profile-edit-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.profile-edit-avatar-panel {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.profile-avatar-preview {
  width: 132px;
  height: 132px;
}

.profile-avatar-help {
  margin: 0;
  color: rgba(197, 212, 227, 0.66);
  font-size: 0.82rem;
  line-height: 1.55;
}

.profile-edit-fields {
  display: grid;
  gap: 16px;
}

.profile-visibility-switch {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 19, 24, 0.1);
  border-radius: 18px;
  background: rgba(15, 19, 24, 0.02);
  color: #101418;
  cursor: pointer;
}

.profile-visibility-switch[hidden] {
  display: none !important;
}

.profile-visibility-switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.profile-visibility-switch-control {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(15, 19, 24, 0.1);
  border: 1px solid rgba(15, 19, 24, 0.14);
  transition: background 180ms ease, border-color 180ms ease;
}

.profile-visibility-switch-control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 19, 24, 0.18);
  transition: transform 180ms ease;
}

.profile-visibility-switch-input:checked + .profile-visibility-switch-control {
  background: rgba(16, 20, 24, 0.84);
  border-color: rgba(16, 20, 24, 0.84);
}

.profile-visibility-switch-input:checked + .profile-visibility-switch-control::after {
  transform: translateX(20px);
}

.profile-visibility-switch-copy {
  display: grid;
  gap: 3px;
}

.profile-visibility-switch-title {
  color: #101418;
  font-size: 0.92rem;
  font-weight: 600;
}

.profile-visibility-switch-text {
  color: rgba(15, 19, 24, 0.62);
  font-size: 0.86rem;
  line-height: 1.55;
}

.profile-field {
  display: grid;
  gap: 8px;
}

.profile-field-label {
  color: rgba(198, 214, 230, 0.72);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-edit-status {
  min-height: 44px;
}

body.page-profile #edit-profile-modal .profile-edit-modal {
  width: min(920px, 94vw);
  max-height: min(90vh, 860px);
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(15, 19, 24, 0.14);
  box-shadow: 0 24px 60px rgba(15, 19, 24, 0.18);
  padding: 24px;
  gap: 20px;
  overflow: hidden;
}

body.page-profile #edit-profile-modal .modal-title,
body.page-profile #edit-profile-modal .modal-close,
body.page-profile #edit-profile-modal .profile-field-label {
  color: #101418;
}

body.page-profile #edit-profile-modal .profile-field-label {
  color: rgba(15, 19, 24, 0.56);
}

body.page-profile #edit-profile-modal .profile-edit-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

body.page-profile #edit-profile-modal .profile-edit-avatar-panel {
  gap: 16px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(15, 19, 24, 0.08);
  background: rgba(15, 19, 24, 0.02);
}

body.page-profile #edit-profile-modal .profile-avatar-preview {
  width: 148px;
  height: 148px;
  border-radius: 28px;
  border: 1px solid rgba(15, 19, 24, 0.1);
}

body.page-profile #edit-profile-modal .create-project-input {
  min-height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(15, 19, 24, 0.12);
  background: rgba(15, 19, 24, 0.03);
  color: #101418;
  box-shadow: none;
}

body.page-profile #edit-profile-modal .create-project-input:focus {
  outline: none;
  border-color: rgba(15, 19, 24, 0.24);
  box-shadow: 0 0 0 4px rgba(15, 19, 24, 0.06);
}

body.page-profile #edit-profile-modal .create-project-input[readonly] {
  color: rgba(15, 19, 24, 0.62);
  cursor: default;
}

.password-visibility-field {
  position: relative;
  min-width: 0;
}

.password-visibility-field > input {
  width: 100%;
}

body.page-profile #edit-profile-modal .password-visibility-field .create-project-input {
  padding-right: 54px;
}

.password-visibility-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: rgba(15, 19, 24, 0.56);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.password-visibility-toggle:hover {
  background: rgba(15, 19, 24, 0.07);
  color: #101418;
}

.password-visibility-toggle:focus-visible {
  outline: none;
  border-color: rgba(15, 19, 24, 0.3);
  box-shadow: 0 0 0 3px rgba(15, 19, 24, 0.07);
}

.password-visibility-icon {
  position: relative;
  width: 19px;
  height: 13px;
  border: 1.6px solid currentColor;
  border-radius: 50%;
}

.password-visibility-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: currentColor;
}

.password-visibility-toggle.is-visible::after {
  content: "";
  position: absolute;
  width: 23px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-45deg);
}

.profile-account-security {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.profile-account-security-title {
  margin: 0 0 2px;
  color: rgba(15, 19, 24, 0.52);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.profile-account-panel {
  border: 1px solid rgba(15, 19, 24, 0.1);
  border-radius: 18px;
  background: rgba(15, 19, 24, 0.02);
  overflow: hidden;
}

.profile-account-panel summary {
  min-height: 66px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #101418;
  cursor: pointer;
  list-style: none;
  transition: background-color 160ms ease;
}

.profile-account-panel summary:hover {
  background: rgba(15, 19, 24, 0.045);
}

.profile-account-panel summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(15, 19, 24, 0.13);
}

.profile-account-panel summary::-webkit-details-marker {
  display: none;
}

.profile-account-panel-copy {
  display: grid;
  gap: 3px;
}

.profile-account-panel-copy strong {
  font-size: 0.92rem;
  font-weight: 650;
}

.profile-account-panel-copy small {
  color: rgba(15, 19, 24, 0.58);
  font-size: 0.8rem;
  line-height: 1.45;
}

.profile-account-panel-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: rgba(15, 19, 24, 0.62);
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1;
  transition: color 160ms ease, transform 180ms ease;
}

.profile-account-panel summary:hover .profile-account-panel-icon {
  color: #101418;
  transform: scale(1.12);
}

.profile-account-panel[open] .profile-account-panel-icon {
  transform: rotate(45deg);
}

.profile-account-panel[open] summary:hover .profile-account-panel-icon {
  transform: rotate(45deg) scale(1.12);
}

.profile-account-panel-body {
  padding: 16px;
  display: grid;
  gap: 14px;
  border-top: 1px solid rgba(15, 19, 24, 0.08);
}

.profile-account-status {
  min-height: 20px;
  color: rgba(15, 19, 24, 0.62);
  font-size: 0.84rem;
  line-height: 1.5;
}

.profile-account-status.is-error {
  color: #a52538;
}

.profile-account-status.is-success {
  color: #176b4c;
}

.profile-account-panel-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.profile-account-local-link {
  color: rgba(15, 19, 24, 0.7);
  font-size: 0.82rem;
  font-weight: 600;
  text-underline-offset: 3px;
}

body.page-profile #edit-profile-modal .profile-avatar-upload-btn,
body.page-profile #edit-profile-modal .modal-btn {
  background: transparent;
  border-color: rgba(15, 19, 24, 0.14);
  color: #101418;
  box-shadow: none;
}

body.page-profile #edit-profile-modal .profile-avatar-upload-btn:hover,
body.page-profile #edit-profile-modal .modal-btn:hover:not(:disabled) {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
}

body.page-profile #edit-profile-modal .modal-btn.primary {
  background: #101418;
  border-color: #101418;
  color: #ffffff;
}

body.page-profile #edit-profile-modal .modal-btn.primary:hover:not(:disabled) {
  background: rgba(16, 20, 24, 0.88);
  border-color: rgba(16, 20, 24, 0.88);
}

body.page-profile #edit-profile-modal .profile-avatar-help,
body.page-profile #edit-profile-modal .profile-edit-status {
  color: rgba(15, 19, 24, 0.58);
}

body.page-profile #edit-profile-modal .profile-edit-status {
  min-height: 24px;
}

body.page-profile #edit-profile-modal .profile-edit-status:empty {
  display: none;
}

body.page-profile #edit-profile-modal .modal-footer {
  flex: 0 0 auto;
}

body.page-profile #course-modal .profile-course-modal,
body.page-course #course-edit-modal .profile-course-modal,
body.page-course #course-ai-modal .profile-course-modal {
  width: min(640px, 94vw);
  max-height: min(88vh, 760px);
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(15, 19, 24, 0.14);
  box-shadow: 0 24px 60px rgba(15, 19, 24, 0.18);
  padding: 24px;
  gap: 20px;
  overflow: hidden;
}

.profile-course-layout {
  display: grid;
  gap: 18px;
}

body.page-profile #course-modal .profile-course-layout,
body.page-course #course-edit-modal .profile-course-layout,
body.page-course #course-content-section-modal .profile-course-layout,
body.page-course #course-content-block-modal .profile-course-layout,
body.page-course #course-ai-modal .profile-course-layout {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

body.page-profile #course-modal .modal-title,
body.page-profile #course-modal .modal-close,
body.page-profile #course-modal .profile-field-label,
body.page-course #course-edit-modal .modal-title,
body.page-course #course-edit-modal .modal-close,
body.page-course #course-edit-modal .profile-field-label,
body.page-course #course-content-section-modal .modal-title,
body.page-course #course-content-section-modal .modal-close,
body.page-course #course-content-section-modal .profile-field-label,
body.page-course #course-content-block-modal .modal-title,
body.page-course #course-content-block-modal .modal-close,
body.page-course #course-content-block-modal .profile-field-label,
body.page-course #course-ai-modal .modal-title,
body.page-course #course-ai-modal .modal-close,
body.page-course #course-ai-modal .profile-field-label {
  color: #101418;
}

body.page-profile #course-modal .profile-field-label,
body.page-course #course-edit-modal .profile-field-label,
body.page-course #course-content-section-modal .profile-field-label,
body.page-course #course-content-block-modal .profile-field-label,
body.page-course #course-ai-modal .profile-field-label {
  color: rgba(15, 19, 24, 0.56);
}

body.page-course #course-content-block-modal .profile-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.page-course #course-content-block-modal .course-content-visibility-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(15, 19, 24, 0.72);
}

body.page-course #course-content-block-modal .course-content-visibility-toggle-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.page-course #course-content-block-modal .course-content-visibility-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

body.page-course #course-content-block-modal .course-content-visibility-switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

body.page-course #course-content-block-modal .course-content-visibility-switch-control {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: rgba(15, 19, 24, 0.1);
  border: 1px solid rgba(15, 19, 24, 0.14);
  transition: background 180ms ease, border-color 180ms ease;
}

body.page-course #course-content-block-modal .course-content-visibility-switch-control::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 19, 24, 0.18);
  transition: transform 180ms ease;
}

body.page-course #course-content-block-modal .course-content-visibility-switch-input:checked + .course-content-visibility-switch-control {
  background: rgba(16, 20, 24, 0.84);
  border-color: rgba(16, 20, 24, 0.84);
}

body.page-course #course-content-block-modal .course-content-visibility-switch-input:checked + .course-content-visibility-switch-control::after {
  transform: translateX(18px);
}

body.page-course #course-content-block-modal .course-content-richtext-wrap {
  display: grid;
  gap: 0;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 22px;
  background: rgba(15, 19, 24, 0.02);
  overflow: hidden;
}

body.page-course #course-content-block-modal .course-content-richtext-wrap[hidden] {
  display: none !important;
}

body.page-course #course-content-block-modal .course-content-richtext-toolbar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid rgba(15, 19, 24, 0.1);
  background: rgba(255, 255, 255, 0.88);
}

body.page-course #course-content-block-modal .course-content-richtext-controls {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-width: 0;
  transition: max-height 180ms ease;
}

body.page-course #course-content-block-modal .course-content-richtext-controls.is-collapsed {
  max-height: 40px;
  overflow: hidden;
}

body.page-course #course-content-block-modal .course-content-richtext-controls.is-expanded {
  max-height: none;
}

body.page-course #course-content-block-modal .course-content-richtext-select {
  width: 74px;
  min-width: 74px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(15, 19, 24, 0.14);
  border-radius: 999px;
  background: #ffffff;
  color: #101418;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
}

body.page-course #course-content-block-modal .course-content-richtext-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 999px;
  background: transparent;
  color: #101418;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

body.page-course #course-content-block-modal .course-content-richtext-btn:hover {
  background: rgba(15, 19, 24, 0.045);
  border-color: rgba(15, 19, 24, 0.18);
  transform: translateY(-1px);
}

body.page-course #course-content-block-modal .course-content-richtext-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.9;
}

body.page-course #course-content-block-modal .course-content-richtext-btn-label {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
}

body.page-course #course-content-block-modal .course-content-richtext-btn-label.is-italic {
  font-style: italic;
}

body.page-course #course-content-block-modal .course-content-richtext-btn-label.is-underlined {
  text-decoration: underline;
}

body.page-course #course-content-block-modal .course-content-richtext-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 999px;
  background: transparent;
  color: #101418;
  cursor: pointer;
  flex: 0 0 auto;
}

body.page-course #course-content-block-modal .course-content-richtext-toggle:hover {
  background: rgba(15, 19, 24, 0.045);
  border-color: rgba(15, 19, 24, 0.18);
}

body.page-course #course-content-block-modal .course-content-richtext-toggle[hidden] {
  display: none !important;
}

body.page-course #course-content-block-modal .course-content-richtext-editor {
  min-height: 220px;
  padding: 20px;
  background: transparent;
  color: #101418;
  font-size: 0.98rem;
  line-height: 1.75;
  outline: none;
  cursor: text;
  user-select: text;
}

body.page-course #course-content-block-modal .course-content-richtext-editor:empty::before {
  content: "Write the text content for this block";
  color: rgba(15, 19, 24, 0.4);
}

body.page-course #course-content-block-modal .course-content-richtext-footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid rgba(15, 19, 24, 0.1);
  background: rgba(255, 255, 255, 0.68);
}

body.page-course #course-content-block-modal .course-content-richtext-word-count {
  color: rgba(15, 19, 24, 0.58);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

body.page-course #course-content-block-modal .course-content-block-picker-view {
  display: grid;
  gap: 28px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

body.page-course #course-content-block-modal .course-content-block-picker-view[hidden],
body.page-course #course-content-block-modal .course-content-block-form-view[hidden],
body.page-course #course-content-block-modal .course-content-block-back[hidden],
body.page-course #course-content-block-modal .course-content-placeholder-panel[hidden],
body.page-course #course-content-block-modal .course-content-visibility-toggle[hidden],
body.page-course #course-content-block-modal .profile-field[hidden],
body.page-course #course-content-block-modal .profile-course-layout[hidden] {
  display: none !important;
}

body.page-course #course-content-block-modal .course-content-block-picker-kicker,
body.page-course #course-content-block-modal .course-content-block-picker-group-title {
  margin: 0;
  color: rgba(15, 19, 24, 0.56);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.page-course #course-content-block-modal .course-content-block-picker-group {
  display: grid;
  gap: 14px;
}

body.page-course #course-content-block-modal .course-content-block-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

body.page-course #course-content-block-modal .course-content-block-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 150px;
  padding: 22px 18px;
  border: 1px solid rgba(15, 19, 24, 0.1);
  border-radius: 22px;
  background: transparent;
  color: #101418;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

body.page-course #course-content-block-modal .course-content-block-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 19, 24, 0.18);
  background: transparent;
  box-shadow: 0 14px 30px rgba(15, 19, 24, 0.08);
}

body.page-course #course-content-block-modal .course-content-block-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
}

body.page-course #course-content-block-modal .course-content-block-card-icon svg {
  width: 26px;
  height: 26px;
}

body.page-course #course-content-block-modal .course-content-block-card-label {
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

body.page-course #course-content-block-modal .course-content-block-form-view {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

body.page-course #course-content-block-modal .course-content-block-form-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

body.page-course #course-content-block-modal .course-content-block-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 999px;
  background: transparent;
  color: #101418;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

body.page-course #course-content-block-modal .course-content-block-back:hover {
  background: rgba(15, 19, 24, 0.04);
}

body.page-course #course-content-block-modal .course-content-block-kind-label {
  margin: 0;
  color: rgba(15, 19, 24, 0.56);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.page-course #course-content-block-modal .course-content-placeholder-panel {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 18px;
  border: 1px solid rgba(15, 19, 24, 0.1);
  border-radius: 20px;
  background: rgba(15, 19, 24, 0.025);
}

body.page-course #course-content-block-modal .course-content-placeholder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(15, 19, 24, 0.05);
  flex: 0 0 auto;
}

body.page-course #course-content-block-modal .course-content-placeholder-copy {
  display: grid;
  gap: 6px;
}

body.page-course #course-content-block-modal .course-content-placeholder-title,
body.page-course #course-content-block-modal .course-content-placeholder-text {
  margin: 0;
}

body.page-course #course-content-block-modal .course-content-placeholder-title {
  color: #101418;
  font-size: 1rem;
  font-weight: 600;
}

body.page-course #course-content-block-modal .course-content-placeholder-text {
  color: rgba(15, 19, 24, 0.72);
  font-size: 0.95rem;
  line-height: 1.65;
}

@media (max-width: 820px) {
  body.page-course #course-content-block-modal .course-content-block-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.page-profile #course-modal .create-project-input,
body.page-profile #course-modal .tool-select,
body.page-profile #course-modal .modal-textarea,
body.page-course #course-edit-modal .create-project-input,
body.page-course #course-edit-modal .tool-select,
body.page-course #course-edit-modal .modal-textarea,
body.page-course #course-content-section-modal .create-project-input,
body.page-course #course-content-section-modal .tool-select,
body.page-course #course-content-section-modal .modal-textarea,
body.page-course #course-content-block-modal .create-project-input,
body.page-course #course-content-block-modal .tool-select,
body.page-course #course-content-block-modal .modal-textarea,
body.page-course #course-ai-modal .create-project-input,
body.page-course #course-ai-modal .tool-select,
body.page-course #course-ai-modal .modal-textarea {
  border: 1px solid rgba(15, 19, 24, 0.12);
  background: rgba(15, 19, 24, 0.03);
  color: #101418;
  box-shadow: none;
}

body.page-profile #course-modal .create-project-input,
body.page-profile #course-modal .tool-select,
body.page-course #course-edit-modal .create-project-input,
body.page-course #course-edit-modal .tool-select,
body.page-course #course-content-section-modal .create-project-input,
body.page-course #course-content-section-modal .tool-select,
body.page-course #course-content-block-modal .create-project-input,
body.page-course #course-content-block-modal .tool-select,
body.page-course #course-ai-modal .create-project-input,
body.page-course #course-ai-modal .tool-select {
  min-height: 50px;
  padding: 0 16px;
  border-radius: 16px;
}

body.page-profile #course-modal .create-project-input:focus,
body.page-profile #course-modal .tool-select:focus,
body.page-profile #course-modal .modal-textarea:focus,
body.page-course #course-edit-modal .create-project-input:focus,
body.page-course #course-edit-modal .tool-select:focus,
body.page-course #course-edit-modal .modal-textarea:focus,
body.page-course #course-content-section-modal .create-project-input:focus,
body.page-course #course-content-section-modal .tool-select:focus,
body.page-course #course-content-section-modal .modal-textarea:focus,
body.page-course #course-content-block-modal .create-project-input:focus,
body.page-course #course-content-block-modal .tool-select:focus,
body.page-course #course-content-block-modal .modal-textarea:focus,
body.page-course #course-ai-modal .create-project-input:focus,
body.page-course #course-ai-modal .tool-select:focus,
body.page-course #course-ai-modal .modal-textarea:focus {
  outline: none;
  border-color: rgba(15, 19, 24, 0.24);
  box-shadow: 0 0 0 4px rgba(15, 19, 24, 0.06);
}

body.page-profile #course-modal .profile-course-textarea,
body.page-course #course-edit-modal .profile-course-textarea,
body.page-course #course-content-section-modal .profile-course-textarea,
body.page-course #course-content-block-modal .profile-course-textarea,
body.page-course #course-ai-modal .profile-course-textarea {
  min-height: 190px;
  border-radius: 20px;
}

body.page-profile #course-modal .modal-btn,
body.page-course #course-edit-modal .modal-btn,
body.page-course #course-content-section-modal .modal-btn,
body.page-course #course-content-block-modal .modal-btn,
body.page-course #course-ai-modal .modal-btn {
  background: transparent;
  border-color: rgba(15, 19, 24, 0.14);
  color: #101418;
  box-shadow: none;
}

body.page-profile #course-modal .modal-btn:hover:not(:disabled),
body.page-course #course-edit-modal .modal-btn:hover:not(:disabled),
body.page-course #course-content-section-modal .modal-btn:hover:not(:disabled),
body.page-course #course-content-block-modal .modal-btn:hover:not(:disabled),
body.page-course #course-ai-modal .modal-btn:hover:not(:disabled) {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
}

body.page-profile #course-modal .modal-btn.primary,
body.page-course #course-edit-modal .modal-btn.primary,
body.page-course #course-content-section-modal .modal-btn.primary,
body.page-course #course-content-block-modal .modal-btn.primary,
body.page-course #course-ai-modal .modal-btn.primary {
  background: #101418;
  border-color: #101418;
  color: #ffffff;
}

body.page-profile #course-modal .modal-btn.primary:hover:not(:disabled),
body.page-course #course-edit-modal .modal-btn.primary:hover:not(:disabled),
body.page-course #course-content-section-modal .modal-btn.primary:hover:not(:disabled),
body.page-course #course-content-block-modal .modal-btn.primary:hover:not(:disabled),
body.page-course #course-ai-modal .modal-btn.primary:hover:not(:disabled) {
  background: rgba(16, 20, 24, 0.88);
  border-color: rgba(16, 20, 24, 0.88);
}

body.page-profile #course-modal .profile-edit-status,
body.page-course #course-edit-modal .profile-edit-status,
body.page-course #course-content-section-modal .profile-edit-status,
body.page-course #course-content-block-modal .profile-edit-status,
body.page-course #course-ai-modal .profile-edit-status {
  min-height: 24px;
}

body.page-course #course-content-block-status[hidden] {
  display: none !important;
}

body.page-course #course-ai-modal #course-ai-status {
  align-self: flex-start;
  width: auto;
  max-width: 100%;
  min-height: 0;
}

body.page-course #course-ai-modal #course-ai-status[hidden] {
  display: none !important;
}

body.page-profile #course-modal .modal-footer,
body.page-course #course-edit-modal .modal-footer,
body.page-course #course-content-section-modal .modal-footer,
body.page-course #course-content-block-modal .modal-footer,
body.page-course #course-ai-modal .modal-footer {
  flex: 0 0 auto;
}

body.page-course #course-ai-modal .modal-footer[hidden] {
  display: none !important;
}

body.page-course #course-ai-modal .profile-course-modal {
  width: min(760px, 94vw);
  max-height: min(88vh, 820px);
}

body.page-course #course-ai-modal .course-ai-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.page-course #course-ai-modal .course-ai-minimize-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(15, 19, 24, 0.1);
  border-radius: 999px;
  background: transparent;
  color: rgba(15, 19, 24, 0.72);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

body.page-course #course-ai-modal .course-ai-minimize-btn:hover {
  background: rgba(15, 19, 24, 0.04);
  border-color: rgba(15, 19, 24, 0.2);
  color: #101418;
}

body.page-course #course-ai-modal .course-ai-minimize-btn svg {
  width: 16px;
  height: 16px;
}

body.page-course .course-ai-restore-btn {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #101418;
  box-shadow: 0 18px 40px rgba(15, 19, 24, 0.14);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

body.page-course .course-ai-restore-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 19, 24, 0.22);
  box-shadow: 0 22px 44px rgba(15, 19, 24, 0.18);
}

body.page-course .course-ai-restore-btn[hidden] {
  display: none !important;
}

body.page-course .course-ai-restore-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

body.page-course .course-ai-restore-label {
  font-size: 0.9rem;
  font-weight: 700;
}

body.page-course #course-ai-modal .course-ai-view {
  display: grid;
  gap: 22px;
}

body.page-course #course-ai-modal .course-ai-view[hidden] {
  display: none !important;
}

body.page-course #course-ai-modal .course-ai-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

body.page-course #course-ai-modal .course-ai-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

body.page-course #course-ai-modal .course-ai-settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 999px;
  background: transparent;
  color: rgba(15, 19, 24, 0.68);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
  flex: 0 0 auto;
}

body.page-course #course-ai-modal .course-ai-settings-btn:hover,
body.page-course #course-ai-modal .course-ai-settings-btn.is-active {
  background: rgba(15, 19, 24, 0.04);
  border-color: rgba(15, 19, 24, 0.22);
  color: #101418;
}

body.page-course #course-ai-modal .course-ai-settings-btn svg {
  width: 16px;
  height: 16px;
}

body.page-course #course-ai-modal .course-ai-settings-screen {
  display: grid;
  gap: 16px;
  min-height: 100%;
}

body.page-course #course-ai-modal .course-ai-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

body.page-course #course-ai-modal .course-ai-settings-copy {
  display: grid;
  gap: 6px;
}

body.page-course #course-ai-modal .course-ai-settings-title,
body.page-course #course-ai-modal .course-ai-settings-subtitle {
  margin: 0;
}

body.page-course #course-ai-modal .course-ai-settings-title {
  color: #101418;
  font-size: 1rem;
  font-weight: 700;
}

body.page-course #course-ai-modal .course-ai-settings-subtitle {
  color: rgba(15, 19, 24, 0.62);
  font-size: 0.88rem;
  line-height: 1.55;
}

body.page-course #course-ai-modal .course-ai-settings-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 999px;
  background: transparent;
  color: rgba(15, 19, 24, 0.68);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

body.page-course #course-ai-modal .course-ai-settings-close:hover {
  background: rgba(15, 19, 24, 0.04);
  border-color: rgba(15, 19, 24, 0.22);
  color: #101418;
}

body.page-course #course-ai-modal .course-ai-settings-close svg {
  width: 16px;
  height: 16px;
}

body.page-course #course-ai-modal .course-ai-settings-body {
  display: grid;
  gap: 14px;
}

body.page-course #course-ai-modal .course-ai-settings-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 19, 24, 0.08);
}

body.page-course #course-ai-modal .course-ai-settings-actions {
  display: flex;
  justify-content: flex-start;
}

body.page-course #course-ai-modal .course-ai-settings-actions .course-ai-reset-btn {
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
}

body.page-course #course-ai-modal .course-ai-settings-actions .course-ai-reset-btn svg {
  width: 14px;
  height: 14px;
}

body.page-course #course-ai-modal .course-ai-settings-status {
  color: rgba(15, 19, 24, 0.62);
  font-size: 0.84rem;
  line-height: 1.55;
}

body.page-course #course-ai-modal .course-ai-settings-status.is-error {
  color: #8f1e33;
}

body.page-course #course-ai-modal .course-ai-settings-test {
  display: grid;
  gap: 14px;
  padding-top: 4px;
  border-top: 1px solid rgba(15, 19, 24, 0.08);
}

body.page-course #course-ai-modal .course-ai-settings-test-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

body.page-course #course-ai-modal .course-ai-settings-title-small {
  font-size: 0.92rem;
}

body.page-course #course-ai-modal .course-ai-mic-test-btn {
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
}

body.page-course #course-ai-modal .course-ai-mic-test-btn.is-active {
  border-color: rgba(186, 43, 63, 0.22);
  background: rgba(186, 43, 63, 0.08);
  color: #8f1e33;
}

body.page-course #course-ai-modal .course-ai-mic-test-meter {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  width: fit-content;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(15, 19, 24, 0.08);
  background: rgba(15, 19, 24, 0.03);
}

body.page-course #course-ai-modal .course-ai-mic-test-bar {
  width: 8px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(16, 20, 24, 0.86), rgba(16, 20, 24, 0.36));
  transform-origin: center bottom;
  transform: scaleY(0.18);
  opacity: 0.35;
  transition: transform 80ms linear, opacity 80ms linear;
}

body.page-course #course-ai-modal .course-ai-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 999px;
  background: transparent;
  color: rgba(15, 19, 24, 0.66);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

body.page-course #course-ai-modal .course-ai-tab:hover:not(:disabled) {
  background: rgba(15, 19, 24, 0.04);
  border-color: rgba(15, 19, 24, 0.22);
  color: #101418;
}

body.page-course #course-ai-modal .course-ai-tab.is-active {
  background: #101418;
  border-color: #101418;
  color: #ffffff;
}

body.page-course #course-ai-modal .course-ai-tab:disabled {
  opacity: 0.46;
  cursor: default;
}

body.page-course #course-ai-modal .course-ai-helper-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(15, 19, 24, 0.08);
  border-radius: 22px;
  background: rgba(15, 19, 24, 0.02);
}

body.page-course #course-ai-modal .course-ai-helper-title,
body.page-course #course-ai-modal .course-ai-review-kicker {
  margin: 0;
  color: rgba(15, 19, 24, 0.56);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

body.page-course #course-ai-modal .course-ai-helper-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

body.page-course #course-ai-modal .course-ai-helper-btn {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 999px;
  background: #ffffff;
  color: #101418;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

body.page-course #course-ai-modal .course-ai-helper-btn:hover {
  background: rgba(15, 19, 24, 0.04);
  border-color: rgba(15, 19, 24, 0.22);
  transform: translateY(-1px);
}

body.page-course #course-ai-modal .course-ai-prompt-textarea {
  min-height: 220px;
  resize: vertical;
}

body.page-course #course-ai-modal .profile-field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

body.page-course #course-ai-modal .course-ai-prompt-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
  line-height: 1;
}

body.page-course #course-ai-modal .course-ai-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(15, 19, 24, 0.1);
  border-radius: 999px;
  background: transparent;
  color: rgba(15, 19, 24, 0.72);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

body.page-course #course-ai-modal .course-ai-reset-btn:hover {
  background: rgba(15, 19, 24, 0.04);
  border-color: rgba(15, 19, 24, 0.2);
  color: #101418;
}

body.page-course #course-ai-modal .course-ai-attachment-btn {
  width: 42px;
  padding: 0;
}

body.page-course #course-ai-modal .course-ai-attachment-btn svg {
  width: 16px;
  height: 16px;
}

body.page-course #course-ai-modal .course-ai-attachment-chip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

body.page-course #course-ai-modal .course-ai-attachment-chip[hidden] {
  display: none !important;
}

body.page-course #course-ai-modal .course-ai-attachment-pill {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 999px;
  background: rgba(15, 19, 24, 0.035);
  color: rgba(15, 19, 24, 0.78);
  font-size: 0.84rem;
  font-weight: 600;
}

body.page-course #course-ai-modal .course-ai-attachment-chip-icon,
body.page-course #course-ai-modal .course-ai-attachment-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

body.page-course #course-ai-modal .course-ai-attachment-chip-icon svg,
body.page-course #course-ai-modal .course-ai-attachment-remove svg {
  width: 15px;
  height: 15px;
}

body.page-course #course-ai-modal .course-ai-attachment-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.page-course #course-ai-modal .course-ai-attachment-remove {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(15, 19, 24, 0.58);
  cursor: pointer;
}

body.page-course #course-ai-modal .course-ai-attachment-remove:hover {
  background: rgba(15, 19, 24, 0.08);
  color: #101418;
}

body.page-course #course-ai-modal .course-ai-voice-btn {
  gap: 8px;
  position: relative;
}

body.page-course #course-ai-modal .course-ai-voice-btn.is-recording {
  border-color: rgba(186, 43, 63, 0.22);
  background: rgba(186, 43, 63, 0.08);
  color: #8f1e33;
}

body.page-course #course-ai-modal .course-ai-voice-btn.is-processing {
  border-color: rgba(15, 19, 24, 0.14);
  background: rgba(15, 19, 24, 0.06);
  color: rgba(15, 19, 24, 0.72);
}

body.page-course #course-ai-modal .course-ai-voice-btn.is-recording:hover {
  background: rgba(186, 43, 63, 0.12);
  border-color: rgba(186, 43, 63, 0.3);
  color: #7d1328;
}

body.page-course #course-ai-modal .course-ai-voice-btn:disabled {
  cursor: wait;
  opacity: 0.76;
}

body.page-course #course-ai-modal .course-ai-voice-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(15, 19, 24, 0.08);
  border-radius: 18px;
  background: rgba(15, 19, 24, 0.03);
}

body.page-course #course-ai-modal .course-ai-voice-status[hidden] {
  display: none !important;
}

body.page-course #course-ai-modal .course-ai-voice-status.is-recording {
  border-color: rgba(186, 43, 63, 0.16);
  background: rgba(186, 43, 63, 0.05);
}

body.page-course #course-ai-modal .course-ai-voice-status.is-processing {
  border-color: rgba(15, 19, 24, 0.12);
  background: rgba(15, 19, 24, 0.045);
}

body.page-course #course-ai-modal .course-ai-voice-meter {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  min-width: 54px;
  height: 24px;
}

body.page-course #course-ai-modal .course-ai-voice-wave {
  width: 6px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 19, 24, 0.24);
  transform-origin: center bottom;
  transform: scaleY(0.18);
  opacity: 0.35;
  transition: transform 80ms linear, opacity 80ms linear;
}

body.page-course #course-ai-modal .course-ai-voice-status.is-recording .course-ai-voice-wave {
  background: linear-gradient(180deg, rgba(186, 43, 63, 0.76), rgba(143, 30, 51, 0.98));
}

body.page-course #course-ai-modal .course-ai-voice-status.is-processing .course-ai-voice-wave {
  background: linear-gradient(180deg, rgba(16, 20, 24, 0.62), rgba(16, 20, 24, 0.3));
}

body.page-course #course-ai-modal .course-ai-voice-text {
  color: rgba(15, 19, 24, 0.72);
  font-size: 0.88rem;
  line-height: 1.5;
}

body.page-course #course-ai-modal .course-ai-review-head {
  display: grid;
  gap: 8px;
}

body.page-course #course-ai-modal .course-ai-review-copy {
  margin: 0;
  color: rgba(15, 19, 24, 0.68);
  font-size: 0.96rem;
  line-height: 1.65;
}

body.page-course #course-ai-modal .course-ai-problems {
  padding: 16px 18px;
  border: 1px solid rgba(15, 19, 24, 0.1);
  border-radius: 18px;
  background: rgba(15, 19, 24, 0.03);
  color: rgba(15, 19, 24, 0.74);
}

body.page-course #course-ai-modal .course-ai-problems.is-error {
  border-color: rgba(186, 43, 63, 0.18);
  background: rgba(186, 43, 63, 0.06);
  color: #8f1e33;
}

body.page-course #course-ai-modal .course-ai-problems p,
body.page-course #course-ai-modal .course-ai-problems ul {
  margin: 0;
}

body.page-course #course-ai-modal .course-ai-problems ul {
  padding-left: 18px;
}

body.page-course #course-ai-modal .course-ai-review-list {
  display: grid;
  gap: 12px;
}

body.page-course #course-ai-modal .course-ai-review-item {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid rgba(15, 19, 24, 0.08);
  border-radius: 18px;
  background: rgba(15, 19, 24, 0.02);
}

body.page-course #course-ai-modal .course-ai-review-item-title,
body.page-course #course-ai-modal .course-ai-review-item-copy {
  margin: 0;
}

body.page-course #course-ai-modal .course-ai-review-item-title {
  color: #101418;
  font-size: 0.98rem;
  font-weight: 700;
}

body.page-course #course-ai-modal .course-ai-review-item-copy {
  color: rgba(15, 19, 24, 0.68);
  font-size: 0.94rem;
  line-height: 1.6;
}

@media (max-width: 720px) {
  body.page-course #course-ai-modal .course-ai-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-course #course-ai-modal .course-ai-settings-btn {
    align-self: flex-end;
  }

  body.page-course #course-ai-modal .course-ai-settings-test-head {
    flex-direction: column;
    align-items: stretch;
  }

  body.page-course #course-ai-modal .course-ai-helper-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.page-course #course-ai-modal .course-ai-helper-btn {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  body.page-course #course-ai-modal .course-ai-helper-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.page-course .course-ai-restore-btn {
    right: 16px;
    bottom: 16px;
    min-height: 44px;
    padding: 0 14px;
  }
}

body.page-profile #project-manage-modal .profile-project-manage-modal {
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(15, 19, 24, 0.14);
  box-shadow: 0 24px 60px rgba(15, 19, 24, 0.18);
  padding: 24px;
  gap: 20px;
  overflow: hidden;
}

body.page-profile #project-manage-modal .modal-title,
body.page-profile #project-manage-modal .modal-close,
body.page-profile #project-manage-modal .profile-field-label,
body.page-profile #project-manage-modal .profile-project-manage-name {
  color: #101418;
}

body.page-profile #project-manage-modal .profile-project-manage-course {
  color: rgba(15, 19, 24, 0.64);
}

body.page-profile #project-manage-modal .tool-select,
body.page-profile #project-manage-modal .modal-btn {
  border-color: rgba(15, 19, 24, 0.14);
  background: transparent;
  color: #101418;
  box-shadow: none;
}

body.page-profile #project-manage-modal .tool-select {
  min-height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  background: rgba(15, 19, 24, 0.03);
}

body.page-profile #project-manage-modal .tool-select:focus {
  outline: none;
  border-color: rgba(15, 19, 24, 0.24);
  box-shadow: 0 0 0 4px rgba(15, 19, 24, 0.06);
}

body.page-profile #project-manage-modal .modal-btn:hover:not(:disabled) {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
}

body.page-profile #project-manage-modal .modal-btn.primary {
  background: #101418;
  border-color: #101418;
  color: #ffffff;
}

body.page-profile #project-manage-modal .modal-btn.primary:hover:not(:disabled) {
  background: rgba(16, 20, 24, 0.88);
  border-color: rgba(16, 20, 24, 0.88);
}

body.page-profile #project-manage-modal .profile-edit-status {
  min-height: 24px;
}

.project-card-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08)),
    linear-gradient(135deg, #d6cdc0 0%, #f1ebe1 42%, #8c8478 100%);
  transform: scale(1.001);
  transition:
    transform 320ms ease,
    filter 280ms ease;
}

.project-card-media.has-image {
  background-color: #09121d;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(16, 20, 24, 0.04) 0%, rgba(16, 20, 24, 0.12) 42%, rgba(16, 20, 24, 0.8) 100%);
  opacity: 0.72;
  transition: opacity 260ms ease, background 260ms ease;
}

.project-card:hover .project-card-media,
.project-card:focus-visible .project-card-media {
  transform: scale(1.03);
  filter: brightness(0.74) saturate(0.8);
}

.project-card:hover .project-card-overlay,
.project-card:focus-visible .project-card-overlay {
  opacity: 1;
  background:
    linear-gradient(180deg, rgba(16, 20, 24, 0.12) 0%, rgba(16, 20, 24, 0.34) 38%, rgba(16, 20, 24, 0.92) 100%);
}

.project-card-download {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(248, 244, 238, 0.36);
  border-radius: 999px;
  background: rgba(248, 244, 238, 0.14);
  color: rgba(248, 244, 238, 0.94);
  font-size: 0.98rem;
  line-height: 1;
  cursor: pointer;
  transition:
    background 240ms ease,
    transform 240ms ease,
    border-color 240ms ease;
}

.project-card-download:hover {
  background: rgba(248, 244, 238, 0.22);
  border-color: rgba(248, 244, 238, 0.56);
  transform: translateY(-1px);
}

.project-card-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.project-card-body {
  margin-top: auto;
  transform: translateY(150px);
  transition: transform 300ms ease;
}

.project-card:hover .project-card-body,
.project-card:focus-visible .project-card-body {
  transform: translateY(0);
}

.project-card-title {
  margin: 0;
  color: rgba(248, 244, 238, 0.96);
  font-size: 1.12rem;
  line-height: 1.15;
  font-weight: 650;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

.project-card-description {
  margin-top: 12px;
  overflow-y: auto;
  max-height: 0;
  opacity: 0;
  color: rgba(247, 244, 238, 0.86);
  font-size: 0.9rem;
  line-height: 1.48;
  padding-right: 4px;
  transition:
    max-height 300ms ease,
    opacity 220ms ease,
    transform 300ms ease;
  transform: translateY(18px);
}

.project-card-description::-webkit-scrollbar {
  width: 6px;
}

.project-card-description::-webkit-scrollbar-thumb {
  background: rgba(247, 244, 238, 0.28);
  border-radius: 999px;
}

.project-card-tags {
  margin-top: auto;
  max-height: 0;
  overflow: hidden;
  color: rgba(247, 244, 238, 0.72);
  font-size: 0.76rem;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(18px);
  transition:
    max-height 300ms ease,
    opacity 240ms ease,
    transform 300ms ease;
}

.project-card:hover .project-card-description,
.project-card:focus-visible .project-card-description {
  max-height: 132px;
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover .project-card-tags,
.project-card:focus-visible .project-card-tags {
  max-height: 2.7em;
  opacity: 1;
  transform: translateY(0);
}

.project-empty {
  grid-column: 1 / -1;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--home-line);
  background: rgba(250, 248, 243, 0.86);
  color: var(--home-muted-strong);
}

@media (max-width: 1280px) {
  .project-grid {
    grid-template-columns: repeat(3, minmax(220px, 280px));
  }
}

@media (max-width: 980px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(220px, 280px));
  }

  .project-card {
    min-height: 340px;
  }
}

@media (max-width: 680px) {
  .home-content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .home-topbar {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px 0;
  }

  .navis-brand-home {
    width: 100%;
  }

  .home-profile {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .home-user-line {
    width: 100%;
    order: 3;
    text-align: left;
    font-size: 0.66rem;
  }

  .home-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0;
  }

  .home-hero-inner {
    padding: 34px 22px 64px;
  }

  .home-hero {
    min-height: 440px;
  }

  .home-hero-title {
    font-size: clamp(3rem, 16vw, 4rem);
  }

  .home-hero-tagline {
    font-size: 1rem;
  }

  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-card {
    min-height: 380px;
  }

  .project-card-content {
    padding: 16px;
  }

  .project-card-body {
    transform: translateY(96px);
  }

  .project-card-description {
    font-size: 0.88rem;
  }
}

/* ===== Project page (course project detail) ===== */
body.page-courses {
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  color: #101418;
}

body.page-course {
  --profile-sidebar-width: 248px;
  --course-content-gap: clamp(24px, 2vw, 40px);
  --course-content-edge: clamp(20px, 2vw, 40px);
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  color: #101418;
}

.courses-shell {
  min-height: 100vh;
  width: 100%;
}

.courses-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 28px 56px 16px;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--home-line);
}

.courses-main {
  width: min(1320px, calc(100% - 48px));
  margin: 24px auto 0;
  padding-bottom: 64px;
}

body.page-courses {
  background: rgba(255, 255, 255, 0.98);
  color: #101418;
}

body.page-course .course-page-title,
body.page-course .course-section-title,
body.page-course .course-management-head h3,
body.page-course .course-management-copy h4,
body.page-course .profile-course-subject,
body.page-course .profile-course-status {
  color: #101418;
}

body.page-course .profile-eyebrow,
body.page-course .course-page-description,
body.page-course .course-page-dates,
body.page-course .course-access-message,
body.page-course .course-projects-status,
body.page-course .course-management-status,
body.page-course .course-management-copy p,
body.page-course .course-project-meta,
body.page-course .profile-empty-state {
  color: rgba(15, 19, 24, 0.64);
}

body.page-course .profile-course-subject,
body.page-course .profile-course-status,
body.page-course .profile-edit-btn,
body.page-course .profile-ai-btn,
body.page-course .course-manage-action {
  background: transparent;
  border-color: rgba(15, 19, 24, 0.14);
  color: #101418;
  box-shadow: none;
}

body.page-course .profile-edit-btn:hover,
body.page-course .profile-ai-btn:hover:not(:disabled),
body.page-course .course-manage-action:hover {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
}

body.page-course .course-participants-modal .modal-title,
body.page-course .course-participants-modal .modal-close,
body.page-course .course-confirm-modal .modal-title,
body.page-course .course-confirm-modal .modal-close,
body.page-course .course-confirm-modal .confirm-modal-text {
  color: #101418;
}

body.page-course .course-participants-modal .profile-empty-state {
  background: rgba(15, 19, 24, 0.04);
  border-color: rgba(15, 19, 24, 0.08);
  color: rgba(15, 19, 24, 0.64);
}

body.page-course .course-confirm-modal {
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(15, 19, 24, 0.14);
  box-shadow: 0 24px 60px rgba(15, 19, 24, 0.18);
}

body.page-courses .courses-title,
body.page-courses .course-browse-title,
body.page-courses .profile-course-subject,
body.page-courses .profile-course-status {
  color: #101418;
}

body.page-courses .courses-subtitle,
body.page-courses .courses-status,
body.page-courses .course-browse-description,
body.page-courses .course-browse-footer {
  color: rgba(15, 19, 24, 0.64);
}

body.page-courses .courses-hero,
body.page-courses .profile-empty-state {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

body.page-courses .course-browse-card.is-highlighted {
  box-shadow: 0 18px 42px rgba(15, 19, 24, 0.1);
}

body.page-courses .profile-course-subject,
body.page-courses .profile-course-status {
  background: transparent;
  border-color: rgba(15, 20, 26, 0.14);
}

body.page-courses .profile-ai-btn,
body.page-courses .profile-edit-btn {
  background: transparent;
  border: 1px solid rgba(15, 20, 26, 0.16);
  color: #101418;
  box-shadow: none;
}

body.page-courses .profile-ai-btn:hover:not(:disabled),
body.page-courses .profile-edit-btn:hover {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
  color: #101418;
}

body.page-courses .profile-ai-btn.is-active {
  background: rgba(15, 19, 24, 0.08);
  border-color: rgba(15, 19, 24, 0.22);
  color: #101418;
}

.courses-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(10, 20, 31, 0.82), rgba(8, 18, 28, 0.74)),
    radial-gradient(circle at top left, rgba(115, 215, 255, 0.08), transparent 46%);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.2);
}

.courses-hero-copy {
  max-width: 780px;
}

.courses-title {
  margin: 0;
  color: #f5f9ff;
  font-size: clamp(2rem, 3.2vw, 3rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.courses-subtitle {
  margin: 14px 0 0;
  color: rgba(214, 227, 240, 0.66);
  font-size: 0.96rem;
  line-height: 1.7;
}

.courses-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.courses-status {
  margin: 18px 0 14px;
  color: rgba(198, 214, 230, 0.66);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.course-browse-card {
  --course-card-image: linear-gradient(135deg, rgba(199, 210, 220, 0.9), rgba(244, 239, 231, 0.98));
  position: relative;
  min-height: 214px;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: rgba(255, 255, 255, 0.98);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(16, 20, 24, 0.78),
    inset 0 -1px 0 rgba(16, 20, 24, 0.78);
  transition:
    transform 320ms ease,
    box-shadow 320ms ease;
}

.course-browse-card.is-highlighted {
  box-shadow: none;
}

.course-browse-card:hover,
.course-browse-card:focus-visible {
  transform: none;
  box-shadow:
    inset 0 1px 0 rgba(16, 20, 24, 0.78),
    inset 0 -1px 0 rgba(16, 20, 24, 0.78);
}

.course-browse-card:focus-visible {
  outline: 2px solid rgba(16, 20, 24, 0.28);
  outline-offset: 3px;
}

.course-browse-media {
  position: absolute;
  top: 1px;
  right: 0;
  bottom: 1px;
  left: 0;
  background-image: var(--course-card-image);
  background-repeat: no-repeat;
  background-position: 112% 100%;
  background-size: auto 108%;
  filter: grayscale(1) contrast(1.06) brightness(0.96);

  transform-origin: center center;
  transition:
    transform 360ms ease,
    filter 320ms ease;
}

.course-browse-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
  transition:
    background 320ms ease,
    opacity 320ms ease;
}

.course-browse-card:hover .course-browse-media,
.course-browse-card:focus-visible .course-browse-media {
  transform: scale(1.06);
  filter: grayscale(1) contrast(1.08) brightness(0.9);
}

.course-browse-card:hover .course-browse-overlay,
.course-browse-card:focus-visible .course-browse-overlay {
  background: rgba(16, 20, 24, 0.08);
}

.course-browse-content {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 214px;
  padding: 16px 18px 18px;
}

.course-browse-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: flex-start;
  width: min(54%, 220px);
}

.course-browse-title {
  margin: 0;
  color: #101418;
  font-size: clamp(1.45rem, 1.9vw, 1.8rem);
  line-height: 0.98;
  font-weight: 400;
  letter-spacing: -0.05em;
}

.course-browse-details {
  margin-top: auto;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(26px);
  transition:
    max-height 320ms ease,
    opacity 220ms ease,
    transform 320ms ease;
}

.course-browse-card:hover .course-browse-details,
.course-browse-card:focus-visible .course-browse-details {
  max-height: 180px;
  opacity: 1;
  transform: translateY(0);
}

.course-browse-description {
  margin: 0;
  color: rgba(16, 20, 24, 0.84);
  font-size: 1rem;
  line-height: 1.48;
}

.course-browse-footer {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  color: rgba(16, 20, 24, 0.72);
  font-size: 0.8rem;
  line-height: 1.45;
  letter-spacing: 0.03em;
  text-transform: none;
}

@media (max-width: 1320px) {
  .courses-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.page-project {
  overflow-x: hidden;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  color: #101418;
}

.project-shell {
  min-height: 100vh;
  width: 100%;
  padding-bottom: 64px;
}

.project-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  padding: 28px 56px 16px;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--home-line);
}

.project-nav {
  margin-left: auto;
}

.project-profile {
  display: flex;
  align-items: center;
  margin-left: 0;
}

.project-author-badge {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, rgba(244, 246, 249, 0.98), rgba(221, 228, 235, 0.96));
  color: #101418;
  box-shadow: none;
}

.project-author-badge.has-image {
  color: transparent;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.project-main {
  width: min(1320px, calc(100% - 48px));
  margin: 24px auto 0;
}

.project-title-wrap {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.project-title-main {
  margin: 0;
  text-align: left;
  font-size: clamp(2.1rem, 3.4vw, 3.3rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  color: #101418;
}

.project-course-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 19, 24, 0.14);
  background: transparent;
}

.project-course-label {
  color: rgba(15, 19, 24, 0.54);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.project-course-link {
  color: #101418;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.project-course-link:hover {
  color: rgba(15, 19, 24, 0.72);
}

#app.project-app {
  display: block;
  width: 100%;
  height: auto;
  position: relative;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.project-hidden-controls {
  display: none !important;
}

body.page-project #viewer-container {
  width: 100%;
  height: min(66vh, 760px);
  min-height: 420px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(15, 19, 24, 0.12);
  background: #ffffff;
  box-shadow: none;
}

body.page-project #annotation-bar {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 12;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(15, 19, 24, 0.12);
}

.project-details {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 19, 24, 0.12);
  display: grid;
  gap: 22px;
}

.project-details-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.project-details-block {
  min-width: 0;
}

.project-section-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(15, 19, 24, 0.54);
}

.project-tags-line {
  margin: 0;
  color: rgba(15, 19, 24, 0.74);
  font-size: 0.98rem;
  line-height: 1.65;
}

.project-links-line {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

.project-link-btn {
  border: 1px solid rgba(15, 19, 24, 0.14);
  background: transparent;
  color: #101418;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 11px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
  white-space: nowrap;
}

.project-link-btn:hover {
  color: #101418;
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
  transform: translateY(-1px);
}

#project-questions-btn {
  margin-left: auto;
}

.project-download-size {
  margin: 0;
  color: rgba(15, 19, 24, 0.56);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-description {
  padding-top: 22px;
  border-top: 1px solid rgba(15, 19, 24, 0.12);
}

.project-description p {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.8;
  color: rgba(15, 19, 24, 0.78);
}

.project-hidden-author {
  display: none;
}

.project-model-info-modal {
  width: min(520px, 92vw);
}

.project-model-info-body {
  display: grid;
  gap: 6px;
}

.project-model-info-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(15, 19, 24, 0.08);
}

.project-model-info-row:last-child {
  border-bottom: 0;
}

.project-model-info-label {
  color: rgba(15, 19, 24, 0.56);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-model-info-value {
  color: #101418;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: right;
}

body.page-project .annotation-nav,
body.page-project .annotation-select {
  color: #101418;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(15, 19, 24, 0.12);
  box-shadow: none;
}

body.page-project .annotation-panel-inner,
body.page-project .project-model-info-modal,
body.page-project #edit-modal .modal {
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(15, 19, 24, 0.14);
  box-shadow: 0 24px 60px rgba(15, 19, 24, 0.18);
  color: #101418;
}

body.page-project .annotation-panel-header span,
body.page-project .modal-title,
body.page-project .project-model-info-title,
body.page-project .annotation-panel-body,
body.page-project .annotation-panel-status,
body.page-project .annotation-panel-meta,
body.page-project .modal-close {
  color: #101418;
}

body.page-project .annotation-panel-close {
  color: rgba(15, 19, 24, 0.58);
}

body.page-project .annotation-panel-close:hover {
  color: #101418;
}

body.page-project .annotation-panel-ai-button,
body.page-project .annotation-panel-edit-button,
body.page-project .modal-btn {
  background: transparent;
  border-color: rgba(15, 19, 24, 0.14);
  color: #101418;
}

body.page-project .annotation-panel-ai-button:hover:not(:disabled),
body.page-project .annotation-panel-edit-button:hover,
body.page-project .modal-btn:hover:not(:disabled) {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
}

body.page-project .modal-btn.primary {
  background: #101418;
  border-color: #101418;
  color: #ffffff;
}

body.page-project .modal-btn.primary:hover:not(:disabled) {
  background: rgba(16, 20, 24, 0.88);
  border-color: rgba(16, 20, 24, 0.88);
}

body.page-project #edit-modal .modal-textarea {
  background: rgba(15, 19, 24, 0.03);
  border-color: rgba(15, 19, 24, 0.12);
  color: #101418;
}

@media (max-width: 860px) {
  .courses-main,
  .project-main {
    width: min(1320px, calc(100% - 28px));
  }

  .courses-hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px 20px;
  }

  .courses-actions {
    justify-content: flex-start;
  }

  .courses-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .course-browse-card {
    min-height: 240px;
  }

  .course-browse-content {
    min-height: 240px;
    padding: 16px 16px 18px;
  }

  .course-browse-body {
    width: min(60%, 224px);
  }

  .course-browse-media {
    background-position: 122% 100%;
    background-size: auto 102%;
  }

  .project-title-main {
    margin-bottom: 16px;
  }

  body.page-project #viewer-container {
    height: min(62vh, 560px);
    min-height: 320px;
  }

  #app.project-app {
    padding: 12px;
    border-radius: 22px;
  }

  body.page-project #annotation-bar {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .project-details {
    gap: 18px;
  }

  .project-details-intro {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .project-link-btn {
    font-size: 0.84rem;
  }

  .project-download-size {
    font-size: 0.78rem;
  }

  .project-links-line {
    justify-content: flex-start;
  }

  .project-description p {
    font-size: 0.98rem;
  }

  .project-model-info-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .project-model-info-value {
    text-align: left;
  }
}

.course-section-sidebar {
  z-index: 12;
}

.course-section-sidebar .profile-section-sidebar-panel {
  padding-top: 118px;
  min-height: 0;
  overflow: hidden;
}

.course-section-sidebar .profile-sidebar-toggle,
.course-section-sidebar .profile-sidebar-link-top {
  flex-shrink: 0;
}

.course-sidebar-links {
  --course-scrollbar-thumb: rgba(15, 20, 26, 0.14);
  scrollbar-width: thin;
  scrollbar-color: var(--course-scrollbar-thumb) transparent;
  min-height: 0;
  min-width: 0;
  width: 100%;
  flex: 0 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  grid-auto-rows: max-content;
}

.course-section-sidebar:hover .course-sidebar-links,
.course-sidebar-links:focus-within {
  --course-scrollbar-thumb: rgba(15, 20, 26, 0.38);
}

.course-sidebar-links::-webkit-scrollbar {
  width: 6px;
}

.course-sidebar-links::-webkit-scrollbar-track {
  background: transparent;
}

.course-sidebar-links::-webkit-scrollbar-thumb {
  background: var(--course-scrollbar-thumb);
  border-radius: 999px;
}

.course-sidebar-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 6px;
}

.course-sidebar-link {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.course-sidebar-link .profile-sidebar-icon {
  flex-shrink: 0;
}

.course-section-sidebar .course-sidebar-link .profile-sidebar-label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.course-sidebar-title-text {
  display: inline-block;
  vertical-align: top;
}

.course-sidebar-link .course-sidebar-title-clip.is-scrolling {
  text-overflow: clip;
}

@media (prefers-reduced-motion: reduce) {
  .course-sidebar-link .course-sidebar-title-clip.is-scrolling {
    text-overflow: ellipsis;
  }
  .course-sidebar-title-text {
    transform: none !important;
  }
}

.course-sidebar-group + .course-sidebar-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 19, 24, 0.1);
}

.course-sidebar-group-label {
  margin: 0;
  padding: 6px 14px 2px;
  color: rgba(15, 19, 24, 0.5);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.course-sidebar-link-project.is-locked {
  opacity: 0.56;
  cursor: not-allowed;
}

.course-sidebar-link-project.is-locked:hover,
.course-sidebar-link-project.is-locked:focus-visible {
  background: transparent;
  border-color: transparent;
}

.course-sidebar-empty {
  margin: 0;
  padding: 8px 14px 0;
  color: rgba(15, 19, 24, 0.58);
  font-size: 0.92rem;
  line-height: 1.6;
}

.profile-section-sidebar.is-collapsed .course-sidebar-empty {
  display: none;
}

.profile-section-sidebar.is-collapsed .course-sidebar-group-label {
  display: none;
}

.course-scroll-target {
  scroll-margin-top: 118px;
}

.course-page-main {
  width: auto;
  max-width: 1680px;
  margin: 24px var(--course-content-edge) 56px calc(var(--profile-sidebar-width) + var(--course-content-gap));
  display: grid;
  gap: 22px;
  transition: margin 240ms ease, max-width 240ms ease;
}

body.page-course.course-sidebar-collapsed .course-page-main {
  margin-left: calc(82px + var(--course-content-gap));
}

.course-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(15, 19, 24, 0.14);
  border-radius: 16px;
  background: transparent;
  color: #101418;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.course-back-link:hover {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
  color: #101418;
  transform: translateY(-1px);
}

.course-hero-card,
.course-panel {
  border: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.course-hero-card {
  padding: 0 0 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
}

.course-hero-copy {
  display: grid;
  gap: 14px;
}

.course-page-title {
  margin: 0;
  color: #101418;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.course-page-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.course-page-meta-row .profile-course-status[hidden] {
  display: none !important;
}

.course-page-teacher {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 19, 24, 0.12);
  color: rgba(15, 19, 24, 0.74);
  background: transparent;
  font-size: 0.9rem;
}

.course-page-description {
  margin: 0;
  max-width: 860px;
  color: rgba(15, 19, 24, 0.78);
  font-size: 1rem;
  line-height: 1.75;
}

.course-page-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: rgba(15, 19, 24, 0.58);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.course-page-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  min-width: 210px;
}

.course-page-actions .profile-edit-btn,
.course-page-actions .profile-ai-btn,
.course-page-actions .course-content-edit-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
}

.course-page-actions .course-ai-entry-btn {
  gap: 10px;
}

.course-page-actions .course-ai-entry-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.course-page-actions .course-ai-entry-icon svg {
  width: 16px;
  height: 16px;
}

.course-ai-sparkle-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  line-height: 1;
}

.course-ai-sparkle {
  position: absolute;
  color: currentColor;
  line-height: 1;
}

.course-ai-sparkle-main {
  font-size: 0.92rem;
}

.course-ai-sparkle-top {
  top: 0;
  right: -1px;
  font-size: 0.48rem;
  opacity: 0.92;
}

.course-ai-sparkle-side {
  bottom: 1px;
  left: -1px;
  font-size: 0.42rem;
  opacity: 0.78;
}

.course-page-actions .profile-edit-btn[hidden],
.course-page-actions .profile-ai-btn[hidden] {
  display: none !important;
}

.course-participants-trigger {
  position: relative;
}

.course-participants-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d62323;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.98);
}

.course-participants-modal {
  width: min(820px, 94vw);
  max-height: min(84vh, 880px);
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(15, 19, 24, 0.14);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(15, 19, 24, 0.18);
  padding: 22px;
  gap: 18px;
}

.course-content-modal {
  width: min(760px, 94vw);
  max-height: min(86vh, 860px);
  background: rgba(255, 255, 255, 0.99);
  border: 1px solid rgba(15, 19, 24, 0.14);
  box-shadow: 0 24px 60px rgba(15, 19, 24, 0.18);
  padding: 22px;
  gap: 18px;
  overflow: hidden;
}

.course-content-modal #course-content-field-file {
  display: grid;
  gap: 18px;
}

.course-participants-layout {
  display: grid;
  gap: 18px;
  min-height: 0;
}

.course-participants-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.course-participant-owner {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 19, 24, 0.08);
  font-size: 0.86rem;
  font-weight: 600;
}

.course-participants-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(15, 19, 24, 0.14);
  background: transparent;
  color: #101418;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.course-participants-tab:hover {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.24);
}

.course-participants-tab.is-active {
  background: rgba(15, 19, 24, 0.08);
  border-color: rgba(15, 19, 24, 0.22);
}

.course-participants-panel {
  display: none;
  gap: 16px;
  min-height: 0;
}

.course-participants-panel.is-active {
  display: grid;
}

.course-panel {
  padding: 24px 0 0;
  border-top: 1px solid rgba(15, 19, 24, 0.12);
}

.course-section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  margin-bottom: 18px;
}

.course-section-title {
  margin: 0;
  color: #101418;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.course-access-message,
.course-projects-status {
  margin: 0;
  color: rgba(15, 19, 24, 0.66);
  font-size: 0.95rem;
  line-height: 1.65;
}

.course-access-panel {
  display: grid;
  gap: 14px;
}

.course-access-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.course-access-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.course-content-head {
  align-items: flex-start;
}

.course-content-head-side {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.course-content-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.course-content-edit-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: #101418;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.course-content-edit-switch[hidden],
.course-content-actions .profile-edit-btn[hidden] {
  display: none !important;
}

.course-content-edit-switch-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.course-content-edit-switch-control {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(15, 19, 24, 0.1);
  border: 1px solid rgba(15, 19, 24, 0.14);
  transition: background 180ms ease, border-color 180ms ease;
}

.course-content-edit-switch-control::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(15, 19, 24, 0.18);
  transition: transform 180ms ease;
}

.course-content-edit-switch-input:checked + .course-content-edit-switch-control {
  background: rgba(16, 20, 24, 0.84);
  border-color: rgba(16, 20, 24, 0.84);
}

.course-content-edit-switch-input:checked + .course-content-edit-switch-control::after {
  transform: translateX(20px);
}

.course-content-edit-switch-label {
  white-space: nowrap;
}

.course-content-root {
  display: grid;
  gap: 0;
}

.course-content-section-create {
  position: relative;
  display: grid;
  justify-items: center;
  width: 100%;
  padding: 0 0 14px;
  border: 0;
  background: transparent;
  color: rgba(16, 20, 24, 0.72);
  cursor: pointer;
}

.course-content-section-create-line {
  position: relative;
  width: 100%;
  height: 2px;
}

.course-content-section-create-line::before,
.course-content-section-create-line::after {
  content: "";
  position: absolute;
  top: 0;
  border-top: 2px dashed rgba(15, 19, 24, 0.18);
}

.course-content-section-create-line::before {
  left: 0;
  width: calc(50% - 18px);
}

.course-content-section-create-line::after {
  right: 0;
  width: calc(50% - 18px);
}

.course-content-section-create-plus {
  position: absolute;
  top: -11px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid rgba(15, 19, 24, 0.18);
  background: #ffffff;
  color: rgba(15, 19, 24, 0.18);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  transform: translateX(-50%);
}

.course-content-section-create-label {
  margin-top: 12px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.course-content-section-create:hover {
  color: #101418;
}

.course-content-section-create:hover .course-content-section-create-line::before,
.course-content-section-create:hover .course-content-section-create-line::after {
  border-top-color: rgba(15, 19, 24, 0.42);
}

.course-content-section-create:hover .course-content-section-create-plus {
  border-color: rgba(15, 19, 24, 0.42);
  color: rgba(15, 19, 24, 0.42);
}

.course-content-empty {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 0;
  min-height: 0;
  border: 0;
  background: transparent;
}

.course-content-empty-title,
.course-content-empty-copy {
  margin: 0;
}

.course-content-empty-title {
  color: #101418;
  font-size: 1.02rem;
  font-weight: 600;
}

.course-content-empty-copy {
  color: rgba(15, 19, 24, 0.64);
  font-size: 0.96rem;
  line-height: 1.65;
}

.course-content-empty-cta {
  margin-top: 4px;
}

.course-content-section {
  display: grid;
  gap: 16px;
  padding: 24px 0;
}

.course-content-section + .course-content-section {
  border-top: 1px solid rgba(15, 19, 24, 0.12);
}

.course-content-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.course-content-section-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.course-content-section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(15, 19, 24, 0.7);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
  flex: 0 0 auto;
}

.course-content-section-toggle:hover {
  background: rgba(15, 19, 24, 0.06);
  color: #101418;
}

.course-content-section-toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.course-content-section-title {
  margin: 0;
  color: #101418;
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.course-content-section-actions,
.course-content-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.course-content-blocks {
  display: grid;
  gap: 0;
}

.course-content-block + .course-content-block {
  border-top: 1px solid rgba(15, 19, 24, 0.08);
}

.course-content-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 16px 0;
}

.course-content-block-main {
  min-width: 0;
  flex: 1 1 auto;
}

.course-content-block-heading {
  margin: 0;
  color: #101418;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.course-content-block-heading-text {
  margin-top: 8px;
  color: rgba(15, 19, 24, 0.76);
  font-size: 0.96rem;
  line-height: 1.7;
}

.course-content-block-text {
  color: rgba(15, 19, 24, 0.82);
  font-size: 0.98rem;
  line-height: 1.72;
}

.course-content-block-text p,
.course-content-block-text div,
.course-content-block-text ul,
.course-content-block-text ol,
.course-content-block-text pre {
  margin: 0 0 0.9rem;
}

.course-content-block-text p:last-child,
.course-content-block-text div:last-child,
.course-content-block-text ul:last-child,
.course-content-block-text ol:last-child,
.course-content-block-text pre:last-child {
  margin-bottom: 0;
}

.course-content-block-text ul,
.course-content-block-text ol {
  padding-left: 1.35rem;
}

.course-content-block-text a {
  color: #101418;
  text-decoration: underline;
}

.course-content-block-text code {
  padding: 0.14rem 0.35rem;
  border-radius: 8px;
  background: rgba(15, 19, 24, 0.06);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92em;
}

.course-content-resource-block,
.course-content-project-ref {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.course-content-image-dropzone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px dashed rgba(15, 19, 24, 0.18);
  border-radius: 22px;
  background: rgba(15, 19, 24, 0.02);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
  cursor: pointer;
}

.course-content-image-dropzone:hover,
.course-content-image-dropzone:focus-visible,
.course-content-image-dropzone.is-dragover {
  border-color: rgba(15, 19, 24, 0.32);
  background: rgba(15, 19, 24, 0.04);
  box-shadow: 0 12px 28px rgba(15, 19, 24, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.course-content-image-dropzone-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
}

.course-content-image-dropzone-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.course-content-image-dropzone-title,
.course-content-image-dropzone-text {
  margin: 0;
}

.course-content-image-dropzone-title {
  color: #101418;
  font-size: 0.96rem;
  font-weight: 600;
}

.course-content-image-dropzone-text,
.course-content-image-selection {
  color: rgba(15, 19, 24, 0.62);
  font-size: 0.9rem;
  line-height: 1.55;
}

.course-content-image-selection {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.course-content-image-preview-wrap {
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 16px;
  background: rgba(15, 19, 24, 0.03);
}

.course-content-image-preview {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
  background: #ffffff;
}

.course-content-image-block {
  display: grid;
  gap: 14px;
}

.course-content-image-shell {
  width: min(100%, 560px);
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 24px;
  background: rgba(15, 19, 24, 0.03);
  cursor: zoom-in;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.course-content-image-shell:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(15, 19, 24, 0.26);
  box-shadow: 0 18px 36px rgba(15, 19, 24, 0.1);
}

.course-content-image-shell:disabled {
  cursor: default;
}

.course-content-image {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  background: #ffffff;
}

.course-content-image-placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  color: rgba(15, 19, 24, 0.52);
  font-size: 0.94rem;
  line-height: 1.6;
}

.course-content-image-placeholder[hidden] {
  display: none !important;
}

.course-image-lightbox-modal {
  width: min(1180px, 96vw);
  max-height: min(92vh, 980px);
  padding: 22px;
  border: 1px solid rgba(15, 19, 24, 0.14);
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 28px 70px rgba(15, 19, 24, 0.22);
}

.course-image-lightbox-modal .modal-header {
  align-items: center;
}

.course-image-lightbox-modal .modal-close {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 19, 24, 0.16);
  border-radius: 999px;
  background: rgba(16, 20, 24, 0.92);
  color: #ffffff;
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(15, 19, 24, 0.18);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.course-image-lightbox-modal .modal-close:hover {
  background: #000000;
  border-color: rgba(15, 19, 24, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(15, 19, 24, 0.22);
}

.course-image-lightbox-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  overflow: auto;
  border-radius: 22px;
  background: rgba(15, 19, 24, 0.03);
}

.course-image-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: min(80vh, 820px);
  object-fit: contain;
}

@media (max-width: 720px) {
  .course-content-image-dropzone {
    align-items: stretch;
    flex-direction: column;
  }

  .course-content-image-dropzone-main {
    width: 100%;
  }

  .course-content-image-browse,
  #course-content-image-browse {
    width: 100%;
  }

  .course-content-image-shell {
    width: 100%;
  }

  .course-content-image {
    max-height: 240px;
  }
}

.course-content-resource-copy,
.course-content-project-copy {
  display: grid;
  gap: 6px;
}

.course-content-resource-title {
  margin: 0;
  color: #101418;
  font-size: 1rem;
  font-weight: 600;
}

.course-content-resource-meta,
.course-content-project-meta,
.course-content-project-note {
  margin: 0;
  color: rgba(15, 19, 24, 0.64);
  font-size: 0.92rem;
  line-height: 1.62;
}

.course-content-project-note {
  font-size: 0.84rem;
}

.course-content-resource-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(15, 19, 24, 0.14);
  background: transparent;
  color: #101418;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 180ms ease, border-color 180ms ease;
}

.course-content-resource-link:hover {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.28);
}

.course-content-resource-link.is-disabled {
  color: rgba(15, 19, 24, 0.42);
  pointer-events: none;
}

.course-content-inline-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  color: #2457d6;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
}

.course-content-inline-link::before {
  content: "\2192";
  color: currentColor;
  font-size: 0.95em;
}

.course-content-inline-link:hover {
  text-decoration: underline;
}

.course-content-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 19, 24, 0.12);
  background: transparent;
  color: rgba(15, 19, 24, 0.72);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.course-content-icon-btn:hover {
  background: rgba(15, 19, 24, 0.05);
  border-color: rgba(15, 19, 24, 0.2);
  color: #101418;
}

.course-content-icon-btn.is-danger {
  color: #8f2231;
}

.course-content-add-block {
  width: fit-content;
}

.course-content-section-empty {
  padding: 16px 0 0;
  color: rgba(15, 19, 24, 0.58);
  font-size: 0.92rem;
  line-height: 1.6;
}

.course-access-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 19, 24, 0.12);
  background: transparent;
  color: #101418;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.course-access-pill.status-owner,
.course-access-pill.status-enrolled {
  border-color: rgba(15, 19, 24, 0.18);
  background: rgba(15, 19, 24, 0.05);
}

.course-access-pill.status-pending {
  border-color: rgba(15, 19, 24, 0.18);
  background: rgba(15, 19, 24, 0.05);
}

.course-access-pill.status-rejected {
  border-color: rgba(15, 19, 24, 0.18);
  background: rgba(15, 19, 24, 0.05);
}

.course-management-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.course-management-card {
  display: grid;
  gap: 16px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.course-management-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.course-management-head h3 {
  margin: 0;
  color: #101418;
  font-size: 1rem;
}

.course-management-status {
  margin: 0;
  color: rgba(15, 19, 24, 0.62);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.course-management-list {
  display: grid;
  gap: 12px;
  max-height: min(54vh, 520px);
  overflow-y: auto;
  padding-right: 4px;
}

.course-management-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-radius: 0;
  border: 0;
  border-top: 1px solid rgba(15, 19, 24, 0.1);
  background: transparent;
}

.course-management-copy {
  display: grid;
  gap: 4px;
}

.course-management-copy h4 {
  margin: 0;
  color: #101418;
  font-size: 0.98rem;
}

.course-management-copy p {
  margin: 0;
  color: rgba(15, 19, 24, 0.64);
  font-size: 0.9rem;
  line-height: 1.5;
}

.course-management-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.course-manage-action {
  min-width: 94px;
}

.profile-empty-state.compact {
  min-height: 120px;
}

.course-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 260px));
  gap: 28px;
  justify-content: flex-start;
}

.course-project-card {
  max-width: 260px;
}

.course-project-card[role="link"] {
  cursor: pointer;
}

.course-project-card.is-locked {
  cursor: default;
}

.course-project-card.is-locked:hover,
.course-project-card.is-locked:focus-visible {
  transform: none;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  outline: none;
}

.course-project-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(238, 246, 255, 0.18);
  background: rgba(6, 17, 28, 0.68);
  color: rgba(244, 248, 255, 0.96);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.course-project-card.is-locked .course-project-badge {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(6, 17, 28, 0.8);
  color: rgba(222, 230, 240, 0.92);
}

@media (max-width: 1180px) {
  .course-page-main,
  body.page-course.course-sidebar-collapsed .course-page-main {
    width: min(1320px, calc(100% - 28px));
    max-width: none;
    margin: 24px auto 56px;
  }
}

@media (max-width: 980px) {

  .course-hero-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .course-page-actions {
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .course-projects-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 260px));
    justify-content: center;
  }

  .course-management-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .course-page-main {
    width: min(1320px, calc(100% - 28px));
    margin: 18px auto 36px;
  }

  body.page-course.course-sidebar-collapsed .course-page-main {
    width: min(1320px, calc(100% - 28px));
    margin: 18px auto 36px;
  }

  .course-participants-modal {
    width: min(100%, calc(100% - 20px));
    padding: 18px;
  }

  .course-hero-card,
  .course-panel {
    padding: 20px;
    border-radius: 0;
  }

  .course-hero-card {
    padding: 0 0 20px;
  }

  .course-panel {
    padding: 20px 0 0;
  }

  .course-section-head,
  .course-project-top,
  .course-project-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .course-projects-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .course-project-card {
    justify-self: center;
  }

  .course-access-top,
  .course-management-item,
  .course-management-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .course-content-head-side,
  .course-content-actions,
  .course-content-section-head,
  .course-content-block,
  .course-content-resource-block,
  .course-content-project-ref {
    width: 100%;
    justify-items: start;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .course-management-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .course-content-block-actions,
  .course-content-section-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ===== Login page redesign ===== */
body.page-login {
  --login-bg: #ece7de;
  --login-bg-soft: #f6f2eb;
  --login-line: rgba(15, 20, 26, 0.16);
  --login-line-soft: rgba(15, 20, 26, 0.08);
  --login-ink: #0f1318;
  --login-muted: rgba(15, 19, 24, 0.68);
  --login-muted-strong: rgba(15, 19, 24, 0.82);
  --login-hero-ink: rgba(247, 244, 238, 0.96);
  --login-hero-muted: rgba(247, 244, 238, 0.78);
  --login-hero-shift: 0px;
  --login-hero-scale: 1.03;
  --login-panel-shift: 0px;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(1200px 580px at 18% -8%, rgba(255, 255, 255, 0.42), transparent 72%),
    linear-gradient(180deg, #ece7de 0%, #e9e3d8 42%, #f5f1ea 100%);
  color: var(--login-ink);
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body.page-login .login-page {
  position: relative;
}

body.page-login .login-landing {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(300px, 0.34fr) minmax(0, 0.66fr);
  align-items: stretch;
}

body.page-login .login-brand-panel {
  position: relative;
  min-height: 100svh;
  padding: clamp(28px, 4vw, 56px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(244, 239, 231, 0.96)),
    var(--login-bg-soft);
  border-right: 1px solid #000000;
  overflow: hidden;
}

body.page-login .login-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.25), transparent 36%),
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.58), transparent 42%);
  pointer-events: none;
}

body.page-login .login-brand-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 36px;
  transform: translate3d(0, var(--login-panel-shift), 0);
  transition: transform 220ms ease-out;
}

body.page-login .login-brand-lockup {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  margin: 0;
}

body.page-login .login-brand-logo {
  width: clamp(88px, 9vw, 132px);
  height: auto;
  object-fit: contain;
}

body.page-login .login-brand-word {
  color: var(--login-ink);
  font-size: clamp(1.7rem, 2.4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.3em;
  line-height: 1;
  text-transform: uppercase;
}

body.page-login .login-brand-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

body.page-login .login-hero-panel {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  background: #0f1317;
}

body.page-login .login-hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 12, 15, 0.82) 0%, rgba(10, 12, 15, 0.58) 26%, rgba(10, 12, 15, 0.22) 46%, rgba(10, 12, 15, 0.06) 68%),
    linear-gradient(180deg, rgba(8, 10, 13, 0.08) 0%, rgba(8, 10, 13, 0.18) 100%);
  z-index: 1;
  pointer-events: none;
}

body.page-login .login-hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 1;
  pointer-events: none;
}

body.page-login .login-hero-media {
  position: absolute;
  inset: 0;
  background: url("images/login_bg.png") right center / cover no-repeat;
  will-change: transform;
  transform: translate3d(0, var(--login-hero-shift), 0) scale(var(--login-hero-scale));
  transform-origin: center top;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.page-login .login-hero-content {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  width: min(100%, 620px);
  padding: clamp(44px, 6vw, 76px) clamp(34px, 5vw, 76px) clamp(54px, 7vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0;
}

body.page-login .login-hero-kicker {
  margin: 0 0 20px;
  color: rgba(247, 244, 238, 0.72);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body.page-login .login-hero-title {
  margin: 0;
  color: var(--login-hero-ink);
  font-size: clamp(3.6rem, 8vw, 6.8rem);
  font-weight: 600;
  letter-spacing: -0.06em;
  line-height: 0.92;
}

body.page-login .login-hero-subtitle {
  margin: 22px 0 0;
  max-width: 29rem;
  color: var(--login-hero-muted);
  font-size: clamp(1.05rem, 1.5vw, 1.24rem);
  line-height: 1.72;
}

body.page-login .login-feature-list {
  margin-top: 36px;
  display: grid;
  gap: 18px;
}

body.page-login .login-feature-item {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

body.page-login .login-feature-bullet {
  width: 9px;
  height: 9px;
  margin-top: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.08);
}

body.page-login .login-feature-item strong {
  display: block;
  color: rgba(249, 246, 241, 0.94);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

body.page-login .login-feature-item p {
  margin: 6px 0 0;
  color: rgba(247, 244, 238, 0.7);
  font-size: 0.94rem;
  line-height: 1.62;
}

body.page-login .login-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 40px;
}

body.page-login .login-hero-btn,
body.page-login .login-forgot-link {
  width: fit-content;
  margin-top: 12px;
  display: block;
  color: var(--login-muted-strong);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}

body.page-login .login-forgot-link:hover,
body.page-login .login-forgot-link:focus-visible {
  color: var(--login-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

body.page-login .login-submit {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

body.page-login .login-hero-btn:hover,
body.page-login .login-submit:hover {
  transform: translateY(-1px);
}

body.page-login .login-hero-btn:active,
body.page-login .login-submit:active {
  transform: translateY(0);
}

body.page-login .login-hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: 14px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
}

body.page-login .login-hero-btn-primary {
  border-color: rgba(255, 255, 255, 0.86);
  background: rgba(248, 244, 238, 0.94);
  color: #101418;
  box-shadow: 0 18px 40px rgba(7, 10, 14, 0.18);
}

body.page-login .login-hero-btn-primary:hover {
  background: #ffffff;
}

body.page-login .login-hero-btn-secondary {
  border-color: rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 244, 238, 0.92);
  backdrop-filter: blur(8px);
}

body.page-login .login-hero-btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.1);
}

body.page-login .login-brand-actions .login-hero-btn-primary {
  border-color: #101418;
  background: #101418;
  color: rgba(248, 244, 238, 0.96);
  box-shadow: 0 16px 32px rgba(16, 20, 24, 0.12);
}

body.page-login .login-brand-actions .login-hero-btn-primary:hover {
  background: #000000;
}

body.page-login .login-brand-actions .login-hero-btn-secondary {
  border-color: rgba(16, 20, 24, 0.18);
  background: rgba(255, 255, 255, 0.48);
  color: #101418;
  backdrop-filter: none;
}

body.page-login .login-brand-actions .login-hero-btn-secondary:hover {
  border-color: rgba(16, 20, 24, 0.3);
  background: rgba(255, 255, 255, 0.7);
}

body.page-login .login-signin-section {
  position: relative;
  padding: clamp(72px, 10vw, 132px) 0 clamp(84px, 12vw, 140px);
  background:
    linear-gradient(180deg, rgba(250, 248, 243, 0.72), rgba(244, 239, 231, 0.96)),
    var(--login-bg-soft);
  border-top: 1px solid rgba(15, 20, 26, 0.06);
}

body.page-login .login-signin-section::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 140px;
  background: linear-gradient(180deg, rgba(15, 20, 26, 0.06), transparent 70%);
  opacity: 0.4;
  pointer-events: none;
}

body.page-login .login-signin-wrap {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 72px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.68fr);
  gap: clamp(36px, 6vw, 92px);
  align-items: start;
}

body.page-login .login-signin-copy {
  max-width: 44rem;
}

body.page-login .login-section-kicker {
  margin: 0 0 20px;
  color: rgba(15, 19, 24, 0.54);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body.page-login .login-section-title {
  margin: 0;
  max-width: 13ch;
  color: var(--login-ink);
  font-size: clamp(2.4rem, 4.8vw, 4.8rem);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

body.page-login .login-section-text {
  margin: 24px 0 0;
  max-width: 34rem;
  color: var(--login-muted-strong);
  font-size: 1rem;
  line-height: 1.76;
}

body.page-login .login-form-shell {
  width: min(100%, 420px);
  margin-left: auto;
  padding-top: 20px;
  border-top: 1px solid var(--login-line);
}

body.page-login .login-label {
  display: block;
  margin: 0 0 12px;
  color: rgba(15, 19, 24, 0.68);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.page-login .login-label-spaced {
  margin-top: 24px;
}

body.page-login .login-input {
  width: 100%;
  padding: 18px 0 16px;
  border: 0;
  border-bottom: 1px solid rgba(15, 20, 26, 0.22);
  background: transparent;
  color: var(--login-ink);
  font: inherit;
  font-size: 1.2rem;
  line-height: 1.4;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

body.page-login .login-input::placeholder {
  color: rgba(15, 19, 24, 0.38);
}

body.page-login .login-input:focus {
  outline: none;
  border-bottom-color: rgba(15, 19, 24, 0.72);
}

body.page-login .login-password-field {
  position: relative;
}

body.page-login .login-password-field .login-input {
  padding-right: 52px;
}

body.page-login .login-password-toggle {
  position: absolute;
  top: 50%;
  right: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: rgba(15, 19, 24, 0.58);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

body.page-login .login-password-toggle:hover {
  background: rgba(15, 19, 24, 0.06);
  color: var(--login-ink);
}

body.page-login .login-password-toggle:focus-visible {
  outline: none;
  border-color: rgba(15, 19, 24, 0.34);
  box-shadow: 0 0 0 3px rgba(15, 19, 24, 0.08);
}

body.page-login .login-password-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.page-login .login-password-toggle.is-visible::after {
  content: "";
  position: absolute;
  width: 23px;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-45deg);
}

body.page-login .login-submit {
  min-width: 156px;
  margin-top: 28px;
  padding: 14px 24px;
  background: #101418;
  color: rgba(248, 244, 238, 0.96);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

body.page-login .login-submit:hover {
  box-shadow: 0 18px 36px rgba(16, 20, 24, 0.14);
}

body.page-login .login-message {
  min-height: 1.5em;
  margin-top: 18px;
  color: rgba(15, 19, 24, 0.64);
  font-size: 0.92rem;
  line-height: 1.55;
}

body.page-login .login-message.is-error,
body.page-login .login-message.is-success {
  min-height: 0;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 12px;
}

body.page-login .login-message.is-error {
  border-color: rgba(174, 55, 68, 0.22);
  background: rgba(174, 55, 68, 0.07);
  color: #9b2f3d;
}

body.page-login .login-message.is-success {
  border-color: rgba(28, 124, 94, 0.2);
  background: rgba(28, 124, 94, 0.07);
  color: #176f55;
}

@media (max-width: 1080px) {
  body.page-login .login-landing {
    grid-template-columns: minmax(0, 1fr);
  }

  body.page-login .login-brand-panel {
    min-height: auto;
    padding: 28px 24px;
    border-right: 0;
    border-bottom: 1px solid #000000;
  }

  body.page-login .login-brand-inner {
    min-height: auto;
    gap: 28px;
    justify-content: center;
  }

  body.page-login .login-brand-lockup {
    margin: 0;
    gap: 18px;
  }

  body.page-login .login-hero-panel,
  body.page-login .login-hero-content {
    min-height: min(92svh, 900px);
  }

  body.page-login .login-hero-content {
    width: min(100%, 720px);
    padding-top: 56px;
  }

  body.page-login .login-signin-wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  body.page-login .login-form-shell {
    margin-left: 0;
  }
}

/* ===== Signup ===== */
body.page-signup {
  --signup-ink: #101418;
  --signup-muted: rgba(16, 20, 24, 0.62);
  --signup-line: rgba(16, 20, 24, 0.14);
  min-height: 100vh;
  height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #f5f1ea;
  color: var(--signup-ink);
  font-family: "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body.page-signup * {
  box-sizing: border-box;
}

body.page-signup [hidden] {
  display: none !important;
}

.signup-page {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(520px, 0.56fr) minmax(380px, 0.44fr);
}

.signup-panel {
  min-width: 0;
  padding: clamp(28px, 5vw, 72px);
  display: flex;
  align-items: center;
  background:
    radial-gradient(720px 420px at 8% 0%, rgba(255, 255, 255, 0.72), transparent 68%),
    linear-gradient(180deg, #faf8f3, #f1ece3);
}

.signup-panel-inner {
  width: min(100%, 680px);
  margin: 0 auto;
}

.signup-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.signup-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--signup-ink);
  text-decoration: none;
}

.signup-brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.signup-brand span {
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.signup-progress {
  margin: clamp(46px, 8vh, 78px) 0 28px;
  display: flex;
  gap: 28px;
  color: rgba(16, 20, 24, 0.34);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.signup-progress span {
  padding-bottom: 8px;
  border-bottom: 1px solid transparent;
}

.signup-progress span.is-active {
  color: var(--signup-ink);
  border-color: var(--signup-ink);
}

.signup-step {
  animation: signup-reveal 320ms ease both;
}

.signup-kicker {
  margin: 0 0 14px;
  color: rgba(16, 20, 24, 0.5);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.signup-step h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.8rem);
  font-weight: 600;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.signup-intro {
  max-width: 38rem;
  margin: 20px 0 0;
  color: var(--signup-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.signup-role-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.signup-role-card {
  min-height: 190px;
  padding: 24px;
  display: grid;
  align-content: start;
  gap: 14px;
  border: 1px solid var(--signup-line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.44);
  color: var(--signup-ink);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.signup-role-card:hover,
.signup-role-card.is-selected {
  transform: translateY(-2px);
  border-color: rgba(16, 20, 24, 0.42);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 44px rgba(16, 20, 24, 0.08);
}

.signup-role-card.is-selected {
  box-shadow: inset 0 0 0 1px var(--signup-ink), 0 18px 44px rgba(16, 20, 24, 0.08);
}

.signup-role-number {
  color: rgba(16, 20, 24, 0.42);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.signup-role-card strong {
  font-size: 1.4rem;
}

.signup-role-card > span:last-child {
  color: var(--signup-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.signup-next,
.signup-submit,
.signup-back,
.signup-development-link {
  min-height: 48px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border-radius: 999px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.signup-next,
.signup-submit {
  border: 1px solid #101418;
  background: #101418;
  color: #f8f4ee;
}

.signup-next {
  margin-top: 28px;
}

.signup-next:disabled,
.signup-submit:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.signup-back,
.signup-development-link {
  border: 1px solid var(--signup-line);
  background: rgba(255, 255, 255, 0.42);
  color: var(--signup-ink);
}

.signup-name-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.signup-field {
  margin-top: 22px;
  display: grid;
  gap: 9px;
}

.signup-name-grid .signup-field {
  margin-top: 0;
}

.signup-field > span,
.signup-field > label {
  color: rgba(16, 20, 24, 0.62);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.signup-field input {
  width: 100%;
  min-height: 50px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(16, 20, 24, 0.22);
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--signup-ink);
  font: inherit;
  font-size: 1.05rem;
}

.signup-field input:focus {
  border-bottom-color: rgba(16, 20, 24, 0.78);
}

.signup-field .password-visibility-field input {
  padding-right: 50px;
}

.signup-field .password-visibility-toggle {
  right: 0;
}

.signup-field small {
  color: rgba(16, 20, 24, 0.48);
  font-size: 0.78rem;
}

.signup-message {
  min-height: 24px;
  margin-top: 20px;
  color: var(--signup-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.signup-message.is-error {
  color: #a52538;
}

.signup-form-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.signup-login-link {
  min-height: 42px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--signup-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  color: var(--signup-muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.signup-login-link:hover {
  border-color: rgba(16, 20, 24, 0.32);
  background: rgba(255, 255, 255, 0.72);
  color: var(--signup-ink);
}

.signup-success-mark {
  width: 54px;
  height: 54px;
  margin-bottom: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #101418;
  color: #f8f4ee;
  font-size: 1.25rem;
}

.signup-development-link {
  width: fit-content;
  margin-top: 24px;
}

.signup-success-login {
  width: fit-content;
  margin-top: 12px;
}

.signup-account-content {
  margin-top: clamp(64px, 11vh, 118px);
}

.signup-account-form {
  width: min(100%, 560px);
  margin-top: 30px;
}

.signup-account-form .signup-submit {
  margin-top: 8px;
}

.signup-account-form .signup-development-link {
  margin-top: 14px;
}

.signup-visual {
  position: sticky;
  top: 0;
  min-height: 100svh;
  overflow: hidden;
  background: #101418;
}

.signup-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 10, 13, 0.08), rgba(8, 10, 13, 0.64));
}

.signup-visual-media {
  position: absolute;
  inset: 0;
  background: url("images/login_bg.png") 68% center / cover no-repeat;
  transform: scale(1.025);
}

.signup-visual-copy {
  position: absolute;
  z-index: 1;
  left: clamp(32px, 5vw, 68px);
  right: clamp(32px, 5vw, 68px);
  bottom: clamp(38px, 7vh, 72px);
  display: grid;
  gap: 12px;
  color: #f8f4ee;
}

.signup-visual-copy span {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.signup-visual-copy strong {
  max-width: 11ch;
  font-size: clamp(2.25rem, 3.8vw, 4.25rem);
  font-weight: 550;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

@keyframes signup-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 980px) {
  .signup-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .signup-visual {
    position: relative;
    min-height: clamp(220px, 32svh, 340px);
    grid-row: 1;
  }

  .signup-panel {
    grid-row: 2;
    padding-block: clamp(32px, 7vw, 58px);
  }

  .signup-visual-media {
    background-position: 64% 34%;
  }

  .signup-visual-copy {
    bottom: 30px;
  }

  .signup-visual-copy strong {
    max-width: none;
    font-size: clamp(2rem, 7vw, 3.5rem);
  }
}

@media (min-width: 981px) and (max-height: 900px) {
  .signup-account-content {
    margin-top: 52px;
  }

  .signup-panel {
    align-items: flex-start;
    padding-top: 30px;
    padding-bottom: 40px;
  }

  .signup-progress {
    margin-top: 34px;
    margin-bottom: 22px;
  }

  .signup-step h1 {
    font-size: clamp(2.5rem, 4vw, 4rem);
  }

  .signup-intro {
    margin-top: 14px;
  }

  .signup-name-grid {
    margin-top: 24px;
  }

  .signup-field {
    margin-top: 17px;
  }

  .signup-field input {
    min-height: 44px;
  }

  .signup-form-actions {
    margin-top: 10px;
  }

  .signup-visual-copy {
    bottom: 34px;
  }
}

@media (max-width: 620px) {
  .signup-panel {
    padding: 24px 18px 40px;
  }

  .signup-progress {
    margin-top: 38px;
  }

  .signup-topbar {
    align-items: flex-start;
  }

  .signup-brand img {
    width: 42px;
    height: 42px;
  }

  .signup-brand span {
    display: none;
  }

  .signup-login-link {
    min-height: 40px;
    padding-inline: 14px;
  }

  .signup-role-grid,
  .signup-name-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .signup-role-card {
    min-height: 150px;
  }

  .signup-form-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .signup-back,
  .signup-submit,
  .signup-next {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .signup-visual {
    display: none;
  }

  .signup-panel {
    grid-row: 1;
    min-height: 100svh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .signup-step {
    animation: none;
  }
}

@media (max-width: 720px) {
  body.page-login .login-brand-panel {
    padding: 24px 18px;
  }

  body.page-login .login-brand-word {
    font-size: 1.38rem;
    letter-spacing: 0.22em;
  }

  body.page-login .login-brand-actions {
    width: 100%;
  }

  body.page-login .login-hero-panel,
  body.page-login .login-hero-content {
    min-height: 82svh;
  }

  body.page-login .login-hero-media {
    background-position: 72% center;
  }

  body.page-login .login-hero-panel::before {
    background:
      linear-gradient(180deg, rgba(10, 12, 15, 0.2) 0%, rgba(10, 12, 15, 0.34) 42%, rgba(10, 12, 15, 0.74) 100%),
      linear-gradient(90deg, rgba(10, 12, 15, 0.48) 0%, rgba(10, 12, 15, 0.12) 48%, rgba(10, 12, 15, 0.06) 100%);
  }

  body.page-login .login-hero-content {
    padding: 34px 20px 30px;
  }

  body.page-login .login-hero-title {
    font-size: clamp(2.8rem, 18vw, 4rem);
  }

  body.page-login .login-hero-subtitle {
    max-width: 22rem;
    font-size: 1rem;
  }

  body.page-login .login-feature-list {
    gap: 16px;
  }

  body.page-login .login-feature-item {
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 12px;
  }

  body.page-login .login-hero-actions {
    gap: 12px;
  }

  body.page-login .login-hero-btn,
  body.page-login .login-submit {
    width: 100%;
    justify-content: center;
  }

  body.page-login .login-signin-section {
    padding-top: 56px;
  }

  body.page-login .login-signin-wrap {
    width: min(100%, calc(100% - 36px));
    gap: 32px;
  }

  body.page-login .login-section-title {
    max-width: 10ch;
    font-size: clamp(2rem, 12vw, 3.1rem);
  }

  body.page-login .login-form-shell {
    width: 100%;
  }

  body.page-login .login-input {
    font-size: 1.08rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-login .login-brand-inner,
  body.page-login .login-hero-media,
  body.page-login .login-hero-btn,
  body.page-login .login-submit {
    transition: none;
  }
}

/* Native modal dialog keeps keyboard focus and background interaction contained. */
.project-delete-dialog {
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  box-sizing: border-box;
  margin: auto;
  padding: 28px;
  overflow-y: auto;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 24px;
  background: #fff;
  color: #101418;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.25);
}
.project-delete-dialog::backdrop {
  background: rgba(11, 18, 28, 0.55);
  backdrop-filter: blur(5px);
}
.project-delete-dialog form { margin: 0; }
.project-delete-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: #fff0f0;
  color: #bd3434;
}
.project-delete-dialog h2 {
  margin: 20px 0 12px;
  font-size: 1.45rem;
  letter-spacing: -0.035em;
}
.project-delete-dialog p {
  margin: 0;
  color: #656a70;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.project-delete-dialog strong { color: #101418; font-weight: 600; }
.project-delete-dialog .modal-close { align-self: flex-start; padding: 4px 8px; }
.project-delete-dialog .modal-footer { margin-top: 28px; }
.project-delete-dialog .modal-btn { font-weight: 600; min-height: 44px; }
body .project-delete-dialog .project-delete-confirm {
  background: #bd3434;
  border-color: #bd3434;
  color: #fff;
}
body .project-delete-dialog .project-delete-confirm:hover:not(:disabled) {
  background: #a52b2b;
  border-color: #a52b2b;
  color: #fff;
}
.project-delete-dialog button:focus-visible {
  outline: 2px solid #101418;
  outline-offset: 3px;
}

/* Project lighting controls are present only in the editor. */
.lighting-controls { margin-top: 12px; padding: 14px 10px 0; border-top: 1px solid rgba(15, 19, 24, 0.1); }
.lighting-controls[hidden] { display: none; }
.lighting-control-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 0.86rem; font-weight: 600; color: #101418; }
.lighting-switch { display: inline-flex; align-items: center; gap: 8px; font-size: 0.72rem; }
.lighting-switch input { width: 18px; height: 18px; accent-color: #17645d; cursor: pointer; }
.glow-slider { display: block; width: 100%; margin: 0; accent-color: #17645d; cursor: pointer; }
.lighting-controls output { font-variant-numeric: tabular-nums; color: #656a70; font-size: 0.78rem; }
.lighting-controls p { margin: 10px 0 0; font-size: 0.73rem; line-height: 1.5; color: #656a70; }
.lighting-controls input:disabled { cursor: not-allowed; opacity: 0.5; }
.lighting-controls input:focus-visible { outline: 2px solid #17645d; outline-offset: 4px; }

.model-lights-control { margin: 16px 0; }
.model-lights-control [hidden] { display: none; }

/* Home learning sections: scoped below the existing hero. */
.page-home .home-content {
  padding-top: 88px;
}
.page-home .home-section {
  margin: 0 auto 112px;
}
.page-home .home-section-heading {
  max-width: 780px;
  margin: 0 auto 44px;
  text-align: center;
}
.page-home .home-eyebrow {
  margin: 0 0 16px;
  color: #436660;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.5;
}
.page-home .home-content h2 {
  margin: 0 0 18px;
  font-size: clamp(1.8rem, 2.8vw, 2.65rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
  text-wrap: balance;
}
.page-home .home-section-intro {
  margin: 0;
  color: var(--home-muted);
  font-size: 1.05rem;
  line-height: 1.75;
}
.page-home .home-section-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  vertical-align: middle;
}
.page-home .home-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 44px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.page-home .home-step {
  position: relative;
  padding: 32px;
  border: 1px solid var(--home-line-soft);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 24px rgba(16, 20, 24, 0.025);
}
.page-home .home-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -28px;
  width: 9px;
  height: 9px;
  border-top: 1px solid #8c9995;
  border-right: 1px solid #8c9995;
  transform: translateY(-50%) rotate(45deg);
}
.page-home .home-icon-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 26px;
  border-radius: 14px;
  background: #edf1ed;
  color: #365d55;
}
.page-home .home-step h3,
.page-home .home-feature-copy h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 650;
  line-height: 1.35;
}
.page-home .home-step-number { color: #64746f; }
.page-home .home-step p,
.page-home .home-feature-copy p {
  margin: 0;
  color: var(--home-muted);
  font-size: 1rem;
  line-height: 1.7;
}
.page-home .home-learning {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: clamp(32px, 4vw, 64px);
  align-items: center;
}
.page-home .home-studio-image {
  padding: 10px;
  border: 1px solid var(--home-line-soft);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 18px 46px rgba(16, 20, 24, 0.07);
}
.page-home .home-studio-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}
.page-home .home-learning-points {
  display: grid;
  gap: 18px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.page-home .home-learning-points li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.98rem;
  font-weight: 550;
}
.page-home .home-learning-points .home-section-icon { color: #436660; }
.page-home .home-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}
.page-home .home-feature-card {
  overflow: hidden;
  border: 1px solid var(--home-line-soft);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 10px 30px rgba(16, 20, 24, 0.035);
}
.page-home .home-feature-card .home-image-trigger img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--home-line-soft);
}
.page-home .home-feature-copy { padding: 28px 30px 32px; }
.page-home .home-explore-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 52px;
  border: 1px solid var(--home-line-soft);
  border-radius: 26px;
  background: linear-gradient(120deg, #edf0eb, #faf8f3);
}
.page-home .home-explore-cta h2 { max-width: 700px; }
.page-home .home-teacher-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  white-space: nowrap;
}
.page-home .home-teacher-btn:focus-visible {
  outline: 3px solid #436660;
  outline-offset: 5px;
}
.page-home .home-projects {
  padding-top: 60px;
  border-top: 1px solid var(--home-line-soft);
}
@media (max-width: 1000px) {
  .page-home .home-learning { grid-template-columns: 1fr; }
  .page-home .home-learning-copy { max-width: 660px; }
  .page-home .home-learning-points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-home .home-step { padding: 24px; }
  .page-home .home-steps { gap: 30px; }
  .page-home .home-step:not(:last-child)::after { right: -20px; }
  .page-home .home-explore-cta { padding: 36px; }
}
@media (max-width: 700px) {
  .page-home .home-content { padding-top: 56px; }
  .page-home .home-section { margin-bottom: 64px; }
  .page-home .home-section-heading { margin-bottom: 28px; }
  .page-home .home-steps,
  .page-home .home-feature-grid { grid-template-columns: 1fr; gap: 20px; }
  .page-home .home-step:not(:last-child)::after { display: none; }
  .page-home .home-icon-tile { margin-bottom: 20px; }
  .page-home .home-feature-copy { padding: 24px; }
  .page-home .home-explore-cta { flex-direction: column; align-items: flex-start; padding: 28px; gap: 28px; }
  .page-home .home-projects { padding-top: 40px; }
}
@media (max-width: 420px) {
  .page-home .home-learning-points { grid-template-columns: 1fr; }
}

/* Let the arrow reach the pill edge, then gently fade back into place. */
.page-home .home-teacher-btn {
  overflow: hidden;
}
.page-home .home-studio-arrow-window {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  overflow: visible;
}
.page-home .home-studio-arrow {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
@keyframes navis-studio-arrow-cycle {
  0% { transform: translateX(0); opacity: 1; }
  48% { transform: translateX(56px); opacity: 1; }
  49% { transform: translateX(56px); opacity: 0; }
  50% { transform: translateX(-16px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
.page-home .home-teacher-btn:focus-visible .home-studio-arrow {
  animation: navis-studio-arrow-cycle 1200ms cubic-bezier(0.45, 0, 0.55, 1);
}
@media (hover: hover) {
  .page-home .home-teacher-btn:hover .home-studio-arrow {
    animation: navis-studio-arrow-cycle 1200ms cubic-bezier(0.45, 0, 0.55, 1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .page-home .home-teacher-btn .home-studio-arrow,
  .page-home .home-teacher-btn:hover .home-studio-arrow,
  .page-home .home-teacher-btn:focus-visible .home-studio-arrow {
    animation: none;
  }
}

/* A continuous white surface from the hero into the home content. */
.page-home .home-hero { border-bottom: 0; }
.page-home .home-content::before { background: #fff; }
.page-home .home-step-number { margin-right: 6px; }
.page-home .home-image-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  overflow: hidden;
  line-height: 0;
}
.page-home .home-studio-image .home-image-trigger { border-radius: 14px; }
.page-home .home-feature-card .home-image-trigger { border-radius: 21px 21px 0 0; }
.page-home .home-image-trigger img {
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
}
.page-home .home-image-trigger:focus-visible {
  outline: 3px solid #436660;
  outline-offset: -4px;
}
@media (hover: hover) {
  .page-home .home-image-trigger:hover img { transform: scale(1.025); }
}
body.page-home:has(.home-image-dialog[open]) { overflow: hidden; }
.page-home .home-image-dialog {
  box-sizing: border-box;
  width: min(1500px, calc(100vw - 32px));
  max-width: none;
  max-height: 94svh;
  padding: 16px;
  border: 1px solid rgba(15, 20, 26, 0.12);
  border-radius: 20px;
  background: #fff;
  color: var(--home-ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
}
.page-home .home-image-dialog::backdrop { background: rgba(10, 15, 20, 0.78); }
.page-home .home-image-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.page-home .home-image-dialog-header h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.page-home .home-image-close {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 1px solid var(--home-line-soft);
  border-radius: 50%;
  background: #f4f5f4;
  color: var(--home-ink);
  font-size: 1.6rem;
  cursor: pointer;
}
.page-home .home-image-close:hover { background: #e7ebe8; }
.page-home .home-image-close:focus-visible { outline: 2px solid #436660; outline-offset: 2px; }
.page-home .home-image-dialog > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(94svh - 106px);
  object-fit: contain;
  border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) {
  .page-home .home-image-trigger img { transition: none; transform: none; }
}

@media (max-width: 700px) {
  .page-home .home-image-dialog { width: calc(100vw - 16px); padding: 8px; border-radius: 12px; }
  .page-home .home-image-dialog > img { max-height: calc(94svh - 90px); }
}

/* About NAVIS: the existing navigation with a quiet research-page layout. */
body.page-about {
  background: #fff;
  --about-muted: #626b77;
  --about-accent: #415c75;
  --about-line: #e1e6eb;
}
body.page-about .home-topbar {
  position: relative;
  padding: 24px 40px;
  background: #f9fafb;
}
.page-about .about-main { color: #101820; }
.page-about .about-hero {
  position: relative;
  overflow: hidden;
  background: #f8f9fa;
}
.page-about .about-hero-art {
  position: absolute;
  inset: 0 0 0 25%;
  background: url("images/navis_home/navis_studio.png") right center / cover no-repeat;
}
.page-about .about-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #f9fafb 0%, #f9fafb 32%, rgba(249, 250, 251, 0.94) 42%, rgba(249, 250, 251, 0.25) 66%, transparent 86%);
  pointer-events: none;
}
.page-about .about-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: auto;
  padding: 56px 40px 32px;
}
.page-about .about-eyebrow {
  margin: 0 0 16px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--about-muted);
}
.page-about h1 {
  max-width: 710px;
  margin: 0 0 20px;
  font-size: clamp(2rem, 3.3vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
}
.page-about p { line-height: 1.65; }
.page-about .about-introduction { max-width: 590px; margin: 0 0 24px; color: #555e69; }
.page-about .about-owner-details { display: flex; align-items: flex-start; gap: 16px; }
.page-about .about-owner h4 { margin: 0 0 8px; font-size: 1.1rem; line-height: 1.4; }
.page-about .about-owner p + p { margin-top: 12px; }
.page-about .about-icon { width: 32px; height: 32px; flex-shrink: 0; color: var(--about-accent); }
.page-about .about-content { max-width: 1440px; margin: auto; padding: 44px 40px 64px; }
.page-about .about-content h2 { margin: 0 0 14px; font-size: 1.8rem; letter-spacing: -0.02em; line-height: 1.25; }
.page-about .about-content p { margin: 0; color: var(--about-muted); }
.page-about .about-research-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.page-about .about-motivation p + p { margin-top: 24px; }
.page-about .about-panel { border-radius: 14px; background: #f5f7f9; padding: 26px; }
.page-about .about-content .about-card-title { display: flex; gap: 18px; align-items: center; font-size: 1.2rem; margin-bottom: 22px; }
.page-about .about-facts { margin: 0; font-size: 0.9rem; color: var(--about-muted); }
.page-about .about-facts > div { display: grid; grid-template-columns: 145px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--about-line); }
.page-about .about-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.page-about .about-facts dt,
.page-about .about-facts dd { margin: 0; line-height: 1.5; }
.page-about .about-institutions { margin-top: 32px; }
.page-about .about-institution-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.page-about .about-institution,
.page-about .about-advisors,
.page-about .about-owner { min-width: 0; padding: 0 22px; }
.page-about .about-institution-grid > :not(:last-child) { border-right: 1px solid var(--about-line); }
.page-about .about-institution-grid h3 { margin: 0 0 16px; font-size: 0.95rem; line-height: 1.4; }
.page-about .about-institution-grid p { font-size: 0.9rem; }
.page-about .about-institution-grid p span { font-size: 0.8rem; }
.page-about .about-logo-frame { height: 76px; margin: 8px 0 16px; display: flex; align-items: center; }
.page-about .about-logo-frame img { width: 100%; max-width: 310px; height: 100%; object-fit: contain; }
.page-about .about-vigo-logo { overflow: hidden; }
.page-about .about-vigo-logo img { object-fit: cover; mix-blend-mode: multiply; }
.page-about .about-advisor-list { display: flex; gap: 20px; align-items: flex-start; }
.page-about .about-advisor-list ul { margin: 0; padding: 0; list-style: none; }
.page-about .about-advisor-list li + li { margin-top: 20px; }
.page-about .about-advisor-list strong,
.page-about .about-advisor-list span { display: block; font-size: 0.92rem; line-height: 1.6; }
.page-about .about-advisor-list span { color: var(--about-muted); }
.page-about .about-objectives { display: grid; grid-template-columns: 0.85fr 1.25fr; gap: 40px; align-items: center; margin-top: 36px; }
.page-about .about-objective-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.page-about .about-objective { padding: 20px 16px; border-radius: 10px; background: #f7f9fa; border: 1px solid var(--about-line); }
.page-about .about-objective h3 { font-size: 0.88rem; line-height: 1.4; margin: 12px 0 10px; }
.page-about .about-objective p { font-size: 0.88rem; line-height: 1.5; }
@media (max-width: 1200px) {
  body.page-about .home-topbar { flex-wrap: wrap; gap: 20px; }
  .page-about .about-research-grid { gap: 28px; }
  .page-about .about-facts > div { grid-template-columns: 110px 1fr; }
  .page-about .about-institution,
  .page-about .about-advisors,
  .page-about .about-owner { padding: 0 18px; }
  .page-about .about-institution-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .page-about .about-institution-grid > :nth-child(2) { border-right: 0; }
  .page-about .about-objectives { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 850px) {
  .page-about .about-hero-art { inset: 0; }
  .page-about .about-hero::after { background: linear-gradient(90deg, rgba(249, 250, 251, 0.98), rgba(249, 250, 251, 0.9) 65%, rgba(249, 250, 251, 0.7)); }
  .page-about .about-research-grid { grid-template-columns: 1fr; }
  .page-about .about-institution-grid { grid-template-columns: 1fr; gap: 26px; }
  .page-about .about-institution-grid > :not(:last-child) { padding: 0 0 24px; border-right: 0; border-bottom: 1px solid var(--about-line); }
  .page-about .about-institution-grid > :last-child { padding: 0; }
  .page-about .about-objective-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  body.page-about .home-topbar { padding: 20px; }
  .page-about .about-hero-inner { padding: 36px 20px 28px; }
  .page-about .about-content { padding: 32px 20px 48px; }
  .page-about .about-panel { padding: 22px; }
  .page-about .about-facts > div { grid-template-columns: 1fr; gap: 3px; }
  .page-about .about-facts dt { font-weight: 600; color: #394959; }
}
@media (max-width: 380px) {
  .page-about .about-objective-grid { grid-template-columns: 1fr; }
}

.profile-account-danger { margin-top: 24px; border: 1px solid #dba5aa; border-radius: 12px; padding: 0; background: #fff8f8; }
.profile-account-danger:not([open]) { width: fit-content; max-width: 100%; }
.profile-account-danger summary { min-height: 44px; padding: 8px 14px; color: #a32132; font-size: 0.84rem; font-weight: 700; cursor: pointer; }
.profile-account-danger p { line-height: 1.6; }
.modal-btn.profile-delete-account-btn { justify-self: start; width: fit-content; max-width: 100%; min-height: 44px; padding: 8px 14px; font-size: 0.84rem; background: #a32132; color: #fff; border-color: #a32132; }
.modal-btn.profile-delete-account-btn:hover:not(:disabled) { background: #821927; }

/* Ownership stays visible even when similarly named courses share a catalogue. */
.course-browse-owner {
  align-self: flex-start;
  max-width: 100%;
  margin: 0;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: #39454a;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#delete-account-form { gap: 12px; }
#delete-account-status { margin: 0; min-height: 0; }
#delete-account-status:empty { display: none; }
.profile-account-deleted-dialog {
  width: min(320px, calc(100vw - 40px));
  box-sizing: border-box;
  padding: 24px;
  border: 1px solid rgba(15, 19, 24, 0.12);
  border-radius: 20px;
  background: #fff;
  color: #101418;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.16);
}
.profile-account-deleted-dialog::backdrop { background: rgba(15, 19, 24, 0.45); }
.profile-account-deleted-dialog h2 { margin: 0 0 20px; font-size: 1.15rem; }
.profile-account-deleted-dialog .modal-btn { min-width: 80px; min-height: 44px; background: #101418; color: #fff; border-color: #101418; }

/* Courses catalogue: shared NAVIS navigation, a quieter dashboard below it. */
.page-courses .courses-main { width: min(1480px, calc(100% - 112px)); margin: 42px auto 0; }
.page-courses .courses-hero { padding: 0; gap: 28px; margin-bottom: 28px; }
.page-courses .courses-title { font-size: clamp(2.5rem, 4vw, 3.6rem); font-weight: 700; letter-spacing: -0.045em; }
.page-courses .courses-subtitle { margin-top: 10px; color: #78818e; }
.page-courses .courses-actions { flex-shrink: 0; gap: 12px; }
.page-courses .courses-actions a, .page-courses .courses-actions button { min-height: 46px; padding: 12px 23px; border-radius: 17px; font-size: 0.9rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.page-courses .courses-actions [hidden] { display: none; }
body.page-courses .courses-actions .profile-ai-btn.is-active, .page-courses .courses-actions #courses-create-link { background: #101418; color: #fff; border-color: #101418; }
body.page-courses .courses-actions .profile-ai-btn.is-active:hover, .page-courses .courses-actions #courses-create-link:hover { background: #292e33; color: #fff; }
.courses-actions svg { width: 18px; height: 18px; }
.courses-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; max-width: 790px; margin-bottom: 24px; }
.courses-stat { display: flex; align-items: center; gap: 22px; min-height: 92px; padding: 19px 24px; border: 1px solid #e3e6eb; border-radius: 16px; background: #fff; }
.courses-stat > svg { width: 30px; height: 30px; flex-shrink: 0; }
.courses-stat strong { display: block; font-size: 1.6rem; font-weight: 650; line-height: 1.25; font-variant-numeric: tabular-nums; }
.courses-stat span { display: block; margin-top: 4px; font-size: 0.9rem; color: #78818e; }
.courses-toolbar { display: flex; gap: 16px; }
.courses-search { display: flex; align-items: center; flex: 1; gap: 14px; min-width: 0; padding: 0 18px; border: 1px solid #dfe3e9; border-radius: 16px; background: #f6f7f8; }
.courses-search svg { width: 22px; height: 22px; flex-shrink: 0; color: #39424d; }
.courses-search input { width: 100%; min-width: 0; height: 54px; padding: 0; border: 0; outline: none; background: transparent; color: #101418; font: inherit; font-size: 0.92rem; }
.courses-search input::placeholder { color: #858e9c; }
.courses-search:focus-within { outline: 2px solid #45636b; outline-offset: 2px; }
.courses-sort { display: flex; align-items: center; gap: 6px; padding: 0 16px; border: 1px solid #dfe3e9; border-radius: 16px; background: #fff; font-size: 0.9rem; color: #505965; }
.courses-sort select { height: 54px; width: 118px; border: 0; color: #101418; background: transparent; font: inherit; cursor: pointer; }
.page-courses .courses-status { margin: 12px 0; min-height: 16px; text-transform: none; letter-spacing: 0; font-size: 0.78rem; color: #77808b; }
.page-courses .courses-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.courses-grid > .profile-empty-state { grid-column: 1 / -1; padding: 32px 0; }
.course-catalogue-card { cursor: pointer; position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: #fff; border: 1px solid #dfe3e9; border-radius: 17px; box-shadow: 0 3px 12px rgba(15, 19, 24, 0.025); transition: box-shadow 200ms ease, transform 200ms ease; }
.course-catalogue-card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(15, 19, 24, 0.08); }
.course-catalogue-card:focus-within, .course-catalogue-card.is-highlighted { outline: 2px solid #45636b; outline-offset: 3px; }
.course-catalogue-cover { aspect-ratio: 1.55; position: relative; display: grid; place-items: center; overflow: hidden; background: linear-gradient(145deg, #e7e8ea, #f8f9fa); color: #a3aab2; }
.course-catalogue-cover > svg { width: 42px; height: 42px; }
.course-catalogue-cover.has-image > svg { visibility: hidden; }
.course-catalogue-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; transition: transform 350ms ease; }
.course-catalogue-card:hover .course-catalogue-cover img { transform: scale(1.025); }
.course-catalogue-content { position: relative; display: flex; flex-direction: column; flex: 1; gap: 14px; margin-top: -10px; padding: 20px; border-top: 1px solid #dfe3e9; border-radius: 17px 17px 0 0; background: #fff; }
.course-catalogue-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.course-catalogue-heading h2 { margin: 0; font-size: 1.27rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.35; overflow-wrap: anywhere; }
.course-catalogue-badge { flex-shrink: 0; border: 1px solid #d6dbe2; border-radius: 999px; padding: 5px 10px; color: #101418; font-size: 0.74rem; font-weight: 600; }
.course-catalogue-badge.is-owned { background: #101418; color: #fff; border-color: #101418; }
.course-catalogue-owner { margin: 0; color: #68717e; font-size: 0.86rem; line-height: 1.5; overflow-wrap: anywhere; }
.course-catalogue-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: auto; padding-top: 16px; border-top: 1px solid #edf0f3; color: #67717e; font-size: 0.8rem; }
.course-catalogue-meta span { display: inline-flex; align-items: center; gap: 7px; }
.course-catalogue-meta span + span { border-left: 1px solid #dfe3e9; padding-left: 14px; }
.course-catalogue-meta svg { width: 18px; height: 18px; flex-shrink: 0; }
.course-catalogue-open { display: flex; align-items: center; justify-content: space-between; min-height: 46px; gap: 12px; margin-top: 4px; padding: 11px 15px; border: 1px solid #d6dbe2; border-radius: 17px; color: #101418; text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.course-catalogue-open svg { width: 22px; height: 22px; }
.course-catalogue-card:hover .course-catalogue-open { background: #f6f7f8; }
@media (max-width: 1200px) {
  .page-courses .courses-main { width: calc(100% - 64px); }
  .page-courses .courses-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-courses .courses-hero { flex-wrap: wrap; }
}
@media (max-width: 960px) {
  .page-courses .courses-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .courses-stat { padding: 16px; gap: 14px; }
}
@media (max-width: 600px) {
  .page-courses .courses-main { width: calc(100% - 32px); margin-top: 28px; }
  .page-courses .courses-grid { grid-template-columns: minmax(0, 1fr); }
  .page-courses .courses-actions { width: 100%; gap: 8px; }
  .page-courses .courses-actions a, .page-courses .courses-actions button { padding: 10px 14px; font-size: 0.82rem; }
  .courses-stats { gap: 8px; }
  .courses-stat { padding: 14px 10px; gap: 8px; flex-direction: column; align-items: flex-start; }
  .courses-stat > svg { width: 22px; height: 22px; }
  .courses-stat strong { font-size: 1.35rem; }
  .courses-stat span { font-size: 0.72rem; }
  .courses-toolbar { flex-direction: column; gap: 10px; }
  .courses-sort { align-self: flex-end; }
  .courses-sort select { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .course-catalogue-card, .course-catalogue-cover img { transition: none; }
  .course-catalogue-card:hover, .course-catalogue-card:hover .course-catalogue-cover img { transform: none; }
}

/* Private reusable instructions shared by Profile and Course Edit with AI. */
#profile-prompts-section[hidden], #profile-sidebar-prompts[hidden] { display: none; }
.personal-prompts-list { display: grid; gap: 14px; }
.personal-prompt-card { padding: 20px; border: 1px solid #e0e4e8; border-radius: 16px; background: #fff; color: #101418; }
.personal-prompt-card h3 { margin: 0 0 8px; font-size: 1rem; font-weight: 650; overflow-wrap: anywhere; }
.personal-prompt-preview { margin: 0 0 16px; color: #67717b; font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.personal-prompts-status { margin: 12px 0; font-size: 0.87rem; line-height: 1.5; color: #58636e; overflow-wrap: anywhere; }
.personal-prompts-status:empty { display: none; }
.personal-prompt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.personal-prompt-action { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 15px; border: 1px solid #d7dce1; border-radius: 12px; background: #fff; color: #101418; font: inherit; font-size: 0.86rem; font-weight: 600; cursor: pointer; }
.personal-prompt-action:hover:not(:disabled) { background: #f1f3f4; }
.personal-prompt-action.is-primary { background: #101418; color: #fff; border-color: #101418; }
.personal-prompt-action.is-primary:hover:not(:disabled) { background: #2b3035; }
.personal-prompt-action.is-destructive { color: #a32132; border-color: #dfb5bc; }
.personal-prompt-action.is-destructive:hover:not(:disabled) { background: #fff2f3; }
.personal-prompt-action:disabled { opacity: 0.55; cursor: wait; }
.personal-prompt-action:focus-visible, .personal-prompt-dialog input:focus-visible, .personal-prompt-dialog textarea:focus-visible { outline: 2px solid #37666b; outline-offset: 3px; }
#profile-personal-prompts > [data-create] { margin-bottom: 16px; }
.personal-prompt-dialog { width: min(680px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); box-sizing: border-box; padding: 28px; overflow-y: auto; border: 1px solid #dce1e5; border-radius: 22px; background: #fff; color: #101418; box-shadow: 0 24px 72px rgba(15, 19, 24, 0.2); }
.personal-prompt-dialog::backdrop { background: rgba(15, 19, 24, 0.45); }
.personal-prompt-dialog h2 { margin: 0 0 22px; font-size: 1.3rem; }
.personal-prompt-dialog form { display: grid; gap: 18px; }
.personal-prompt-dialog label { display: grid; gap: 8px; color: #46515b; font-size: 0.9rem; font-weight: 600; }
.personal-prompt-dialog input, .personal-prompt-dialog textarea { width: 100%; min-width: 0; box-sizing: border-box; padding: 12px 14px; border: 1px solid #dce1e5; border-radius: 12px; background: #fafbfc; color: #101418; font: inherit; font-weight: 400; line-height: 1.6; }
.personal-prompt-dialog textarea { min-height: 250px; resize: vertical; }
.personal-prompt-dialog .personal-prompt-actions { justify-content: flex-end; }
.personal-prompt-delete-dialog { max-width: 420px; }
.personal-prompt-delete-dialog p { line-height: 1.6; overflow-wrap: anywhere; }
.personal-prompts-intro { margin: 0; color: #66717b; font-size: 0.9rem; line-height: 1.6; }
.personal-prompts-intro a { color: #24565d; text-underline-offset: 3px; }
#course-ai-saved-list { min-width: 0; }
body.page-course #course-ai-modal .course-ai-tabs { flex-wrap: wrap; }
@media (max-width: 600px) {
  .personal-prompt-dialog { padding: 20px; }
  .personal-prompt-card { padding: 16px; }
  body.page-course #course-ai-modal .course-ai-topbar { flex-wrap: wrap; }
}

/* Create Project: model source, local preview and upload details. */
.create-project-modal{width:min(720px,94vw);max-height:92vh;padding:24px;border-radius:24px}
.create-project-body{display:flex;flex-direction:column;gap:14px;padding:2px 8px 2px 2px}
.create-project-body>*,#create-project-upload-panel>*{flex-shrink:0}
.create-project-basics,.ml-model-details{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.create-project-field{font-size:13px;font-weight:600;min-width:0}
.create-project-field small{font-weight:400;color:#64717a}
.create-project-modal .create-project-input,.create-project-modal .tool-select{box-sizing:border-box;min-height:42px;padding:10px 12px;border-radius:11px;font:inherit;background:#fafbfc}
.create-project-modal .create-project-helper{font-size:12px;min-height:0}
.create-model-tabs{display:flex;gap:10px;flex-wrap:wrap;margin:8px 0}
.create-model-tab{display:inline-flex;align-items:center;gap:9px;padding:12px 16px;border:1px solid transparent;border-radius:13px;background:#eef0f2;color:#5b6570;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.create-model-tab svg{width:17px;height:17px;display:block}
.create-model-tab.is-active{background:#101519;color:#fff}
.create-model-tab:focus-visible{outline:2px solid #176d63;outline-offset:3px}
.create-step-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0 10px}
.create-step-heading h3{font-size:15px;margin:0;color:#101519}
.create-step-heading>span{font-size:11px;color:#65717a;text-align:right}
.create-project-modal .create-project-dropzone{justify-items:center;text-align:center;padding:20px;gap:9px;border-radius:13px;border:1px dashed #cbd2d7;background:#f7f8fa}
.create-project-modal .create-project-dropzone-icon{background:none;border:0;width:32px;height:32px}
.create-project-modal .create-project-dropzone-icon svg{width:30px;height:30px}
.create-project-modal .create-project-dropzone-title{font-size:14px}
.create-project-modal .create-project-upload-button{border-radius:12px;background:white;padding:10px 18px;font-size:13px}
.create-project-modal .create-project-upload-status{background:none;border:0;padding:0;font-size:11px;min-height:0}
.create-preview-card{display:grid;grid-template-columns:1fr 1fr;border:1px solid #dfe3e7;border-radius:14px;overflow:hidden;background:#fafbfc}
.create-preview-image{min-height:200px;position:relative;background:#e9edf0;display:grid;place-items:center;color:#63727c;font-size:12px;text-align:center}
.create-preview-image img{width:100%;height:100%;object-fit:contain;position:absolute;inset:0}
.create-preview-details{padding:18px;display:flex;flex-direction:column;gap:7px;min-width:0;font-size:12px;color:#65717a}
.create-preview-details>strong{color:#101519;font-size:14px;overflow-wrap:anywhere}
.create-preview-details p{margin:8px 0;line-height:1.5}
.create-preview-details p.is-ready{color:#18784b}
.create-preview-details dl{display:grid;grid-template-columns:1fr auto;gap:8px;margin:0}
.create-preview-details dt,.create-preview-details dd{margin:0}
.create-project-modal [hidden]{display:none!important}
.create-project-modal .ml-field{font-size:13px;margin:0 0 16px}
.create-project-modal .ml-field input,.create-project-modal .ml-field select{font-size:13px;border-radius:10px}
.create-project-modal .ml-message:empty{display:none}
@media(max-width:560px){.create-project-modal{padding:18px}.create-project-basics,.create-project-modal .ml-model-details{grid-template-columns:1fr;gap:12px}.create-model-tab{padding:10px;font-size:12px;gap:6px}.create-model-tabs{gap:6px}.create-preview-card{grid-template-columns:1fr}.create-preview-image{min-height:180px}.create-step-heading{align-items:flex-start}}

.create-project-modal .create-project-field{color:#101519}
.create-project-modal #create-project-library-selection:empty{display:none}
body.editor-page .create-project-modal #create-project-upload{width:auto;justify-self:center;justify-content:center;border:1px solid #dfe3e7;border-radius:12px;padding:10px 18px;background:white}

/* Creation keeps its draft mounted behind a compact, translucent loading card. */
.create-project-modal { position: relative; box-sizing: border-box; }
#create-project-modal .create-project-modal.is-creating {
  width: min(320px, 100%);
  padding: 32px 24px;
  gap: 0;
  overflow: auto;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.create-project-modal.is-creating > .modal-header,
.create-project-modal.is-creating > .create-project-body,
.create-project-modal.is-creating > .modal-footer { display: none; }
.create-project-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #24282c;
  outline: none;
  animation: create-project-loading-in 160ms ease-out both;
}
.create-project-loading canvas { width: 112px; height: 112px; flex: 0 0 auto; margin-bottom: 18px; color: inherit; }
.create-project-loading-title { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.create-project-loading-detail { margin: 9px 0 0; font-size: 14px; line-height: 1.5; color: #64717a; }
@keyframes create-project-loading-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .create-project-loading { animation: none; }
}

.create-preview-details dt,.create-preview-details p.is-ready{display:flex;align-items:center;gap:9px}
.create-preview-details dt .ml-icon{width:17px;height:17px;color:#566571}
.create-preview-details p.is-ready .ml-icon{width:21px;height:21px}

/* Compact project rename dialog. */
.project-rename-dialog { width:min(440px,calc(100vw - 32px)); box-sizing:border-box; padding:26px; border:1px solid #d9dddf; border-radius:22px; background:#fcfcfc; color:#101418; box-shadow:0 24px 80px #0004; }
.project-rename-dialog::backdrop { background:rgba(11,18,28,.42); backdrop-filter:blur(6px); }
.project-rename-dialog form { margin:0; }
.project-rename-header { display:flex; align-items:center; gap:12px; margin-bottom:24px; }
.project-rename-header h2 { margin:0; font-size:1.18rem; letter-spacing:-.025em; }
.project-rename-header .modal-close { margin-left:auto; }
.project-rename-icon { display:grid; place-items:center; padding:10px; border-radius:12px; background:#edf2f1; color:#24665f; }
.project-rename-icon svg { width:20px; height:20px; }
.project-rename-dialog label { display:block; margin-bottom:8px; font-size:.9rem; font-weight:600; }
.project-rename-dialog input { box-sizing:border-box; width:100%; padding:12px 14px; border:1px solid #d9dddf; border-radius:12px; background:#f5f6f6; color:inherit; font:inherit; }
.project-rename-dialog input:focus-visible { outline:2px solid #24665f; outline-offset:2px; }
.project-rename-dialog [role="alert"] { margin:10px 0 0; color:#b42338; font-size:.85rem; }
.project-rename-dialog [role="alert"]:empty { display:none; }
.project-rename-dialog .modal-footer { margin-top:24px; gap:10px; }
.project-rename-dialog .modal-btn { min-height:40px; }
.project-rename-dialog .modal-btn.primary { background:#101418; color:white; border-color:#101418; }

/* Pin naming shares the compact NAVIS form-dialog styling. */
.pin-name-dialog .modal-close { color:#64717a; }
.pin-name-dialog .modal-close:hover { color:#101418; }
.pin-name-dialog .modal-btn:not(.primary) { background:#f5f6f6; color:#101418; border-color:#d9dddf; }
.pin-name-dialog .modal-btn:focus-visible,
.pin-name-dialog .modal-close:focus-visible { outline:2px solid #24665f; outline-offset:3px; }

/* Project background uses the same compact visual-control layout. */
.background-control { margin-top: 18px; }
.background-reset { border: 0; padding: 2px 0; background: transparent; color: #17645d; font: inherit; font-size: 0.75rem; cursor: pointer; }
.background-reset:hover { text-decoration: underline; }
.background-reset:focus-visible { outline: 2px solid #17645d; outline-offset: 4px; }
.background-reset:disabled { opacity: 0.5; cursor: not-allowed; }

/* Shared, viewport-local playback for animated models. */
.model-animation-control {
  position: absolute; left: 16px; bottom: 72px; z-index: 5;
  display: grid; place-items: center; width: 36px; height: 36px; padding: 8px;
  border: 1px solid rgba(80,90,95,.24); border-radius: 50%;
  color: #172329; background: rgba(245,248,249,.86);
  box-shadow: 0 2px 8px rgba(0,0,0,.12); cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.model-animation-control svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.models-preview-stage > .model-animation-control { bottom: 16px; }
.model-animation-control:focus-visible,
.animation-controls-visible > .model-animation-control { opacity: 1; pointer-events: auto; }
@media (hover: hover) { .has-model-animation:hover > .model-animation-control { opacity: 1; pointer-events: auto; } }
.model-animation-control:focus-visible { outline: 2px solid #176c67; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .model-animation-control { transition: none; } }
