/* ==========================================================================
   NUKE — Design System
   Dark base with a light-pink accent. Built for the private dashboard,
   login screen, project cards, and the editor modal.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Surfaces */
  --bg: #0B0B0D;
  --bg-elevated: #111113;
  --surface: #17171A;
  --surface-hover: #1D1D20;
  --surface-sunken: #0B0B0D;

  /* Borders */
  --border: #2A2A2E;
  --border-strong: #38383D;
  --border-accent: #F5A9C8;

  /* Text */
  --text: #F5F5F5;
  --text-muted: #9A9A9E;
  --text-faint: #6B6B70;

  /* Accent (light pink) */
  --accent: #F5A9C8;
  --accent-hover: #E888B0;
  --accent-active: #DC7BA3;
  --accent-soft: rgba(245, 169, 200, 0.10);
  --accent-soft-strong: rgba(245, 169, 200, 0.18);
  --accent-glow: rgba(245, 169, 200, 0.28);

  /* Status */
  --success: #7ED9A5;
  --success-soft: rgba(126, 217, 165, 0.12);
  --error: #F27C7C;
  --error-soft: rgba(242, 124, 124, 0.12);

  /* Typography */
  --font-display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "DM Mono", "SFMono-Regular", Consolas, monospace;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 56px;

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
  --shadow-accent: 0 0 0 1px var(--accent-glow), 0 12px 28px rgba(245, 169, 200, 0.12);

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms;
  --t-base: 200ms;
  --t-slow: 320ms;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(245, 169, 200, 0.05), transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(245, 169, 200, 0.04), transparent 45%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
#app { min-height: 100vh; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; -webkit-tap-highlight-color: transparent; }
input, textarea, select { font-family: inherit; color: inherit; }
img { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* Selection */
::selection { background: var(--accent-soft-strong); color: var(--text); }

/* Focus-visible (keyboard accessibility) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- Utility text styles ---------- */
.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--text-muted);
  font-size: 12px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.muted { color: var(--text-muted); }
.error {
  color: var(--error);
  font-size: 13px;
  min-height: 18px;
  margin: 4px 0 0;
  font-weight: 500;
}
.error:not(:empty) { animation: shake 320ms var(--ease); }

@keyframes shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(245, 169, 200, 0.25));
}
.brand span {
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 15px;
  background: linear-gradient(120deg, var(--text) 40%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.mark { display: none; }

/* ==========================================================================
   Dashboard shell
   ========================================================================== */
.shell { display: flex; min-height: 100vh; }

.rail {
  width: 252px;
  flex-shrink: 0;
  padding: var(--space-7) var(--space-6);
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-elevated), var(--bg));
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  position: sticky;
  top: 0;
  height: 100vh;
}
.rail-note {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}
.rail-bottom {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 12px;
  color: var(--text-muted);
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
  flex-shrink: 0;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--success-soft); }
  50% { box-shadow: 0 0 0 6px var(--success-soft); }
}

.content { flex: 1; padding: var(--space-8) var(--space-8) 60px; max-width: 1180px; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-bottom: var(--space-7);
}
.topbar h1 {
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.top-actions { display: flex; gap: var(--space-3); align-items: center; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.primary, .secondary, .ghost, .icon-btn {
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #1A0F16;
  box-shadow: var(--shadow-sm), 0 0 0 0 var(--accent-glow);
}
.primary span { transition: transform var(--t-fast) var(--ease); }
.primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), var(--accent-active));
  box-shadow: 0 6px 18px var(--accent-glow);
  transform: translateY(-1px);
}
.primary:hover span { transform: translate(2px, -2px); }
.primary:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.primary.small { padding: 9px 16px; font-size: 13px; }

.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.secondary:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-hover); }
.secondary:active { transform: translateY(1px); }

.ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.ghost:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface); }

.icon-btn {
  padding: 7px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.icon-btn.danger:hover { border-color: var(--error); color: var(--error); background: var(--error-soft); }

button:disabled, input:disabled, textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---------- Notice / config warning ---------- */
.notice {
  background: var(--error-soft);
  border: 1px solid rgba(242, 124, 124, 0.35);
  color: var(--error);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  font-size: 14px;
  margin-bottom: var(--space-6);
  line-height: 1.6;
  position: relative;
  padding-left: 46px;
}
.notice::before {
  content: "!";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--error);
  color: var(--bg);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notice span { color: var(--text-muted); font-size: 13px; }

/* ---------- Summary stat cards ---------- */
.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}
.summary > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5);
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.summary > div::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, var(--accent-soft));
  opacity: 0;
  transition: opacity var(--t-base) var(--ease);
}
.summary > div:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.summary > div:hover::after { opacity: 1; }
.summary-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.summary strong {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Section heading ---------- */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.section-heading h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }

/* ==========================================================================
   Project grid & cards
   ========================================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--space-4);
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease),
              transform var(--t-base) var(--ease-out), background var(--t-base) var(--ease);
  position: relative;
}
.project-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-accent);
  transform: translateY(-3px);
  background: var(--surface-hover);
}

.card-top { display: flex; justify-content: space-between; align-items: center; }
.type-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
}
.type-pill.html { color: var(--accent); border-color: rgba(245, 169, 200, 0.4); background: var(--accent-soft); }
.type-pill.external { color: var(--success); border-color: rgba(126, 217, 165, 0.4); background: var(--success-soft); }

.kebab {
  color: var(--text-muted);
  font-size: 14px;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.kebab:hover { color: var(--text); background: var(--surface-sunken); }

.project-card h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-url {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  word-break: break-all;
}

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.open-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--t-fast) var(--ease), gap var(--t-fast) var(--ease);
}
.open-link:hover { color: var(--accent-hover); gap: 7px; }
.card-actions { display: flex; gap: var(--space-2); }

/* ---------- Empty state ---------- */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-9) var(--space-5);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  color: var(--text-muted);
  background: radial-gradient(circle at 50% 0%, var(--accent-soft), transparent 65%);
}
.empty-mark {
  font-size: 26px;
  color: var(--accent);
  display: block;
  margin-bottom: var(--space-3);
  animation: float 3.5s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.empty p { margin: 0 auto var(--space-5); font-size: 14px; max-width: 320px; line-height: 1.6; }

/* ==========================================================================
   Login page — decorative orbit logo doubles as a hidden unlock control
   ========================================================================== */
.login-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 20%, rgba(245, 169, 200, 0.08), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(245, 169, 200, 0.05), transparent 40%),
    var(--bg);
}

/* ---- the orbit logo — looks like pure decoration ---- */
.logo-slot {
  position: absolute;
  top: 50%;
  right: -70px;
  transform: translateY(-50%);
  z-index: 2;
}
.drag-logo {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transform: translate(0, 0);
  transition: transform var(--t-slow) var(--ease-out);
  touch-action: none;
  user-select: none;
}
.drag-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.12;
  pointer-events: none;
  animation: spin 60s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.drag-logo.snap-back { transition: transform var(--t-slow) var(--ease-out); }
.unlocked .logo-slot { opacity: 0; transition: opacity var(--t-base) var(--ease); pointer-events: none; }

/* ---- the login card, invisible until the secret drag succeeds ---- */
.login-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}
.login-card.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.login-card .brand {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.login-card .brand img { width: 52px; height: 52px; }
.login-card .brand span { font-size: 20px; letter-spacing: 0.14em; }
.login-card { text-align: center; }
.login-card h2 {
  font-size: clamp(22px, 3vw, 27px);
  margin: 8px 0 0;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.login-card form { display: flex; flex-direction: column; gap: var(--space-4); margin-top: var(--space-6); text-align: left; }
.login-card label {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-weight: 500;
}
.login-card input {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.login-card input::placeholder { color: var(--text-faint); }
.login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card .primary { justify-content: center; margin-top: var(--space-1); padding-block: 13px; }

/* ==========================================================================
   Modal / editor
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 5, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  z-index: 50;
  animation: fadeIn var(--t-base) var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-7);
  box-shadow: var(--shadow-lg);
  animation: modalIn var(--t-slow) var(--ease-out);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: var(--space-6); }
.modal-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.close {
  font-size: 20px;
  color: var(--text-muted);
  line-height: 1;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.close:hover { color: var(--text); background: var(--surface-sunken); transform: rotate(90deg); }

#project-form { display: flex; flex-direction: column; gap: var(--space-5); }
#project-form label {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  font-weight: 500;
}
#project-form input,
#project-form textarea {
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  resize: vertical;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
#project-form textarea { font-family: var(--font-mono); font-size: 13px; line-height: 1.6; min-height: 120px; }
#project-form input::placeholder,
#project-form textarea::placeholder { color: var(--text-faint); }
#project-form input:focus,
#project-form textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#project-form input[type="file"] {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-muted);
}
#project-form input[type="file"]::file-selector-button {
  background: var(--accent-soft);
  color: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  margin-right: var(--space-3);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
#project-form input[type="file"]::file-selector-button:hover { background: var(--accent-soft-strong); }

.slug-field {
  display: flex;
  align-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.slug-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.slug-field span { color: var(--text-muted); font-family: var(--font-mono); font-size: 14px; }
.slug-field input { border: none; background: transparent; padding: 12px 4px; flex: 1; box-shadow: none !important; }

.field-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.field-help { font-size: 12px; color: var(--text-faint); margin: 2px 0 0; line-height: 1.5; }

.segmented { display: flex; gap: var(--space-2); background: var(--surface-sunken); padding: 4px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.segmented button {
  flex: 1;
  padding: 9px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--t-fast) var(--ease);
}
.segmented button:hover { color: var(--text); }
.segmented button.active {
  border-color: rgba(245, 169, 200, 0.35);
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Responsive breakpoints
   ========================================================================== */
@media (max-width: 1024px) {
  .content { padding: var(--space-6) var(--space-6) 48px; }
  .rail { width: 220px; padding: var(--space-6) var(--space-5); }
}

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .rail {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 30;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-right: none;
    border-bottom: 1px solid var(--border);
    gap: var(--space-3);
  }
  .rail-note { display: none; }
  .rail-bottom { margin-top: 0; padding: 6px 12px; }
  .content { padding: var(--space-5) var(--space-4) 48px; }
  .summary { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 22px; }
}

@media (max-width: 640px) {
  .project-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .modal { max-width: 92vw; }
  .logo-slot { width: 160px; height: 160px; }
  .drag-logo { width: 160px; height: 160px; }
  .login-card { max-width: 88vw; }
}

@media (max-width: 480px) {
  .login-card { padding: var(--space-6) var(--space-5); }
  .top-actions { width: 100%; justify-content: flex-start; }
  .topbar { flex-direction: column; align-items: stretch; }
  .project-grid { grid-template-columns: 1fr; }
  .modal { padding: var(--space-5); border-radius: var(--radius-lg); max-height: 100vh; }
  .segmented { flex-direction: column; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; justify-content: center; }
  .card-actions .icon-btn { padding: 8px 10px; }
  .drag-logo { width: 130px; height: 130px; }
}

@media (max-width: 380px) {
  .rail { padding: var(--space-3) var(--space-4); }
  .brand span { font-size: 13px; }
  .content { padding: var(--space-4) var(--space-3) 40px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}