/* Shared motion and layout refinements for public pages and the owner console. */
.site-shell {
  overflow: clip;
}

.site-shell:not(.admin-page) .eyebrow::before {
  background-image: linear-gradient(90deg, var(--cyan), var(--blue), var(--violet), var(--cyan));
  background-size: 220% 100%;
  animation: public-accent-color 8s ease-in-out infinite;
}

@keyframes public-accent-color {
  0%, 100% {
    background-position: 0% 50%;
    box-shadow: 0 0 7px color-mix(in srgb, var(--cyan) 55%, transparent);
  }
  50% {
    background-position: 100% 50%;
    box-shadow: 0 0 8px color-mix(in srgb, var(--violet) 58%, transparent);
  }
}

html[data-theme-transition='light']::view-transition-new(root) {
  animation: theme-wave-light 620ms cubic-bezier(0.22, 0.72, 0.18, 1) both;
  backface-visibility: hidden;
  transform-origin: left center;
  will-change: clip-path, transform;
}

html[data-theme-transition='dark']::view-transition-new(root) {
  animation: theme-wave-dark 620ms cubic-bezier(0.22, 0.72, 0.18, 1) both;
  backface-visibility: hidden;
  transform-origin: right center;
  will-change: clip-path, transform;
}

html[data-theme-transition]::view-transition-old(root) {
  animation: none;
}

@keyframes theme-wave-light {
  0% {
    clip-path: polygon(0 0, 0 100%, 0 100%, 0 93.75%, 0 87.5%, 0 81.25%, 0 75%, 0 68.75%, 0 62.5%, 0 56.25%, 0 50%, 0 43.75%, 0 37.5%, 0 31.25%, 0 25%, 0 18.75%, 0 12.5%, 0 6.25%, 0 0);
    transform: perspective(1400px) rotateY(-4deg) scale(1.02);
  }
  58% {
    clip-path: polygon(0 0, 0 100%, 74% 100%, 76% 93.75%, 78% 87.5%, 80% 81.25%, 81% 75%, 80% 68.75%, 77% 62.5%, 73% 56.25%, 70% 50%, 69% 43.75%, 70% 37.5%, 73% 31.25%, 77% 25%, 80% 18.75%, 81% 12.5%, 80% 6.25%, 78% 0);
    transform: perspective(1400px) rotateY(-1.5deg) scale(1.008);
  }
  100% {
    clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 93.75%, 100% 87.5%, 100% 81.25%, 100% 75%, 100% 68.75%, 100% 62.5%, 100% 56.25%, 100% 50%, 100% 43.75%, 100% 37.5%, 100% 31.25%, 100% 25%, 100% 18.75%, 100% 12.5%, 100% 6.25%, 100% 0);
    transform: perspective(1400px) rotateY(0) scale(1);
  }
}

@keyframes theme-wave-dark {
  0% {
    clip-path: polygon(100% 0, 100% 100%, 100% 100%, 100% 93.75%, 100% 87.5%, 100% 81.25%, 100% 75%, 100% 68.75%, 100% 62.5%, 100% 56.25%, 100% 50%, 100% 43.75%, 100% 37.5%, 100% 31.25%, 100% 25%, 100% 18.75%, 100% 12.5%, 100% 6.25%, 100% 0);
    transform: perspective(1400px) rotateY(4deg) scale(1.02);
  }
  58% {
    clip-path: polygon(100% 0, 100% 100%, 26% 100%, 24% 93.75%, 22% 87.5%, 20% 81.25%, 19% 75%, 20% 68.75%, 23% 62.5%, 27% 56.25%, 30% 50%, 31% 43.75%, 30% 37.5%, 27% 31.25%, 23% 25%, 20% 18.75%, 19% 12.5%, 20% 6.25%, 22% 0);
    transform: perspective(1400px) rotateY(1.5deg) scale(1.008);
  }
  100% {
    clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 93.75%, 0 87.5%, 0 81.25%, 0 75%, 0 68.75%, 0 62.5%, 0 56.25%, 0 50%, 0 43.75%, 0 37.5%, 0 31.25%, 0 25%, 0 18.75%, 0 12.5%, 0 6.25%, 0 0);
    transform: perspective(1400px) rotateY(0) scale(1);
  }
}

.theme-icon-enter-active,
.theme-icon-leave-active {
  transition: opacity 160ms ease, transform 220ms ease;
}

.theme-icon-enter-from {
  opacity: 0;
  transform: rotate(-35deg) scale(0.65);
}

.theme-icon-leave-to {
  opacity: 0;
  transform: rotate(35deg) scale(0.65);
}

.mfa-secret,
.mfa-recovery-codes {
  display: grid;
  gap: 9px;
  margin: 18px 0;
  padding: 13px;
  border: 1px solid rgba(25, 230, 239, 0.3);
  border-radius: 7px;
  background: rgba(5, 13, 31, 0.74);
}

.mfa-secret span {
  color: var(--muted);
  font: 10px var(--mono);
}

.mfa-secret code,
.mfa-recovery-codes code {
  color: var(--cyan);
  font: 14px var(--mono);
  overflow-wrap: anywhere;
}

.mfa-recovery-codes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mfa-manual {
  margin-bottom: 5px;
}

.mfa-uri {
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  .site-shell:not(.admin-page) .eyebrow::before {
    animation: none;
  }

  html[data-theme-transition]::view-transition-new(root) {
    animation: none;
    transform: none;
    will-change: auto;
  }

  .theme-icon-enter-active,
  .theme-icon-leave-active {
    transition: none;
  }
}

.public-background-settings {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.public-background-settings h2,
.public-background-settings p {
  margin: 0;
}

.admin-settings-group {
  grid-column: 1 / -1;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid rgba(81, 146, 196, 0.24);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(7, 18, 35, 0.76), rgba(5, 13, 27, 0.62));
}

.admin-settings-group > summary {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 4px 14px;
  cursor: pointer;
  list-style: none;
}

.admin-settings-group > summary::-webkit-details-marker { display: none; }
.admin-settings-group > summary::after { margin-left: auto; color: var(--cyan); content: '+'; font: 20px/1 var(--mono); }
.admin-settings-group[open] > summary::after { content: '−'; }
.admin-settings-group > summary > span { color: var(--text); font-weight: 650; }
.admin-settings-group > summary > small { color: var(--muted); font-size: 11px; }
.admin-settings-group__content { display: grid; min-width: 0; gap: 12px; padding-top: 12px; }

.public-backdrop-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px 18px;
}

.floating-icon-tuners {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(74, 131, 204, 0.22);
  border-radius: 8px;
}

.floating-icon-tuners legend { padding: 0 6px; color: var(--cyan); font: 11px var(--mono); }
.floating-icon-tuners > p { grid-column: 1 / -1; margin: 0; font-size: 11px; }
.floating-icon-tuning { display: grid; min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.floating-icon-tuning > strong { grid-column: 1 / -1; color: var(--text); font-size: 11px; }
.floating-icon-tuning > label { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) 72px auto; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.floating-icon-tuning input { width: 100%; min-width: 0; }

.admin-password-control { position: relative; min-width: 0; }
.admin-password-control > input { width: 100%; padding-right: 46px; }
.admin-password-control > button {
  position: absolute;
  top: 50%;
  right: 3px;
  display: grid;
  width: 38px;
  height: 36px;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.admin-password-control > button:hover,
.admin-password-control > button:focus-visible { color: var(--cyan); }

.public-ambient-backdrop {
  position: fixed;
  z-index: 1;
  inset: 0;
  background:
    radial-gradient(ellipse at 18% 36%, rgba(17, 179, 205, 0.22), transparent 37%),
    radial-gradient(ellipse at 78% 74%, rgba(112, 78, 212, 0.18), transparent 40%);
  opacity: var(--public-ambient-intensity, 0.35);
  pointer-events: none;
}

.public-maze-canvas {
  opacity: var(--public-maze-intensity, 0.45);
}

.site-shell > .shell-container {
  z-index: 4;
}

html[data-public-background-image='off'] .site-shell::after {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
}

@media (min-width: 981px) {
  .admin-nav {
    position: sticky;
    top: 78px;
    align-self: start;
    max-height: calc(100vh - 96px);
    overflow: auto;
  }
}

.project-filters {
  display: grid;
  grid-template-columns: minmax(200px, 1.5fr) repeat(3, minmax(130px, 0.8fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  margin: 0 0 10px;
}

.project-filters .field {
  min-width: 0;
  margin: 0;
}

.project-filters input,
.project-filters select {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(4, 12, 28, 0.78);
  color: var(--text);
}

.project-filter-reset {
  white-space: nowrap;
}

.project-results-count {
  margin: 0 0 14px;
  color: var(--muted);
  font: 11px var(--mono);
}

.project-filters + .project-results-count {
  margin-top: 0;
}

.latest-activity {
  display: grid;
  gap: 5px;
  margin-top: 16px;
  padding: 14px;
}

.latest-activity > strong {
  color: var(--cyan);
  font: 11px var(--mono);
}

.latest-activity > span {
  font-size: 12px;
}

.gallery-cover-badge {
  color: var(--cyan);
  font: 10px var(--mono);
}

.project-gallery-item,
.project-gallery-item img {
  max-width: 100%;
}

.project-gallery-item img {
  display: block;
}

.gallery-editor-preview {
  display: grid;
  grid-template-columns: minmax(100px, 160px) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.gallery-editor-preview img {
  display: block;
  width: 100%;
  height: 100px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.gallery-editor-preview span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.journey-group + .journey-group {
  margin-top: 34px;
}

.journey-group > h2 {
  margin: 0 0 14px;
  font-size: 21px;
}

.education-status,
.certification-status {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  padding: 4px 8px;
  border: 1px solid rgba(57, 242, 163, 0.32);
  border-radius: 999px;
  color: var(--green);
  font: 10px var(--mono);
}

.certification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
  gap: 14px;
}

.certification-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 18px;
}

.certification-icon {
  margin: 6px auto 0;
  color: var(--cyan);
}

.certification-badge {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
}

.certification-copy {
  min-width: 0;
}

.certification-issuer {
  color: var(--cyan);
  font-size: 11px;
}

.certification-copy h2,
.certification-copy h3 {
  margin: 5px 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.ai-type-section + .ai-type-section {
  margin-top: 28px;
}

.ai-type-heading {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 17px;
}

.ai-tool-card {
  align-items: center;
}

.ai-tool-card h3 {
  margin: 0;
  color: #d8e9f8;
  font: 600 13px var(--mono);
}

.ai-tool-description {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.ai-tool-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  color: var(--muted);
  font: 10px var(--mono);
}

.ai-tool-meta a,
.ai-tool-type {
  color: var(--cyan);
}

.ai-tool-type {
  font-size: 10px;
}

.project-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 10px;
  margin: 0;
}

.project-metrics > div,
.testimonial-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 13, 31, 0.35);
}

.project-metrics dt {
  color: var(--muted);
  font: 11px var(--mono);
}

.project-metrics dd {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
}

.project-metrics dd strong {
  color: var(--cyan);
  font-size: 18px;
}

.project-metrics dd span {
  color: var(--muted);
  font-size: 12px;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 14px;
}

.testimonial-card {
  margin: 0;
}

.testimonial-card blockquote {
  margin: 0 0 16px;
  color: var(--text);
}

.testimonial-card figcaption {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.testimonial-card figcaption strong {
  color: var(--cyan);
}

.skill-filters {
  grid-template-columns: minmax(200px, 1.5fr) minmax(140px, 0.8fr) auto;
}

.page-visibility-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.page-visibility-options label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.service-health-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
}

.service-health-panel h2,
.service-health-panel p {
  margin: 0;
}

.service-health-results {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  color: var(--cyan);
  font: 12px var(--mono);
}

.service-health-results small {
  color: var(--muted);
}

.activity-log-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.activity-log-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(5, 13, 31, 0.3);
}

.activity-log-row > div {
  display: grid;
  gap: 3px;
}

.activity-log-row small,
.mission-types {
  color: var(--muted);
}

.mission-types {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.appointment-link {
  width: fit-content;
  margin-top: 14px;
}

.contact-honeypot {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.privacy-copy {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.privacy-copy h2,
.privacy-copy p {
  margin: 0;
}

.privacy-copy a,
.privacy-notice a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-notice {
  margin: 18px 0;
  color: var(--muted);
  font-size: 12px;
}

.certification-copy p {
  margin: 0 0 12px;
  color: #bdcde0;
}

.certification-details {
  display: grid;
  gap: 5px;
  margin: 10px 0;
  font-size: 11px;
}

.certification-details div {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 8px;
}

.certification-details dt {
  color: var(--muted);
}

.certification-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.certification-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.certification-skills li {
  padding: 4px 8px;
  border: 1px solid rgba(25, 230, 239, 0.2);
  border-radius: 999px;
  color: #b9d8e8;
  font-size: 11px;
}

.certification-status.expired {
  border-color: rgba(255, 100, 127, 0.42);
  color: #ff9cac;
}

.certification-verify {
  width: fit-content;
  margin-top: 12px;
}

.journey-evidence-link {
  width: fit-content;
  margin-top: 12px;
}

.evidence-document-field {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(74, 131, 204, .25);
  border-radius: 8px;
  background: rgba(4, 12, 28, .24);
}

.evidence-document-field > small {
  line-height: 1.55;
}

.evidence-document-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.certification-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 34px auto;
  padding: 32px 24px;
  text-align: center;
}

.certification-empty > svg {
  color: var(--cyan);
}

.certification-empty h2,
.certification-empty p {
  margin: 0;
}

.certification-empty p {
  max-width: 560px;
  color: var(--muted);
}

.scroll-reveal {
  transition:
    opacity 760ms ease,
    transform 760ms cubic-bezier(0.16, 1, 0.3, 1),
    filter 760ms ease;
  transition-delay: var(--reveal-delay, 0ms);
}

.scroll-reveal.is-pending {
  opacity: 0;
  filter: blur(9px);
  transform: translate3d(0, 58px, 0) scale(0.94);
  will-change: opacity, transform;
}

.scroll-reveal.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translate3d(0, 0, 0) scale(1);
  will-change: auto;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .site-shell .project-card,
  .site-shell .project-feature,
  .site-shell .content-panel,
  .site-shell .timeline-card,
  .site-shell .technology-card,
  .site-shell .ai-tool-card,
  .site-shell .achievement-card,
  .site-shell .certification-card,
  .site-shell .project-gallery-item {
    position: relative;
    isolation: isolate;
    transform-style: preserve-3d;
    transition:
      transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1),
      border-color 320ms ease,
      box-shadow 320ms ease,
      background-color 320ms ease;
  }

  .site-shell .project-card::after,
  .site-shell .project-feature::after,
  .site-shell .content-panel::after,
  .site-shell .timeline-card::after,
  .site-shell .technology-card::after,
  .site-shell .ai-tool-card::after,
  .site-shell .achievement-card::after,
  .site-shell .certification-card::after,
  .site-shell .project-gallery-item::after {
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(360px circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(25, 230, 239, 0.18), transparent 72%);
    content: '';
    opacity: 0;
    pointer-events: none;
    transition: opacity 320ms ease;
  }

  .project-feature,
  .timeline-card,
  .technology-card,
  .ai-tool-card,
  .achievement-card {
    transition:
      transform 240ms ease,
      border-color 240ms ease,
      box-shadow 240ms ease;
  }

  .project-feature:hover,
  .timeline-card:hover,
  .technology-card:hover,
  .ai-tool-card:hover,
  .achievement-card:hover {
    transform: perspective(900px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg)) translateY(-7px) scale(1.015);
    border-color: rgba(25, 230, 239, 0.58);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.34), 0 0 32px rgba(25, 230, 239, 0.16);
  }

  .site-shell .project-card:hover,
  .site-shell .project-feature:hover,
  .site-shell .content-panel:hover,
  .site-shell .timeline-card:hover,
  .site-shell .technology-card:hover,
  .site-shell .ai-tool-card:hover,
  .site-shell .achievement-card:hover,
  .site-shell .certification-card:hover,
  .site-shell .project-gallery-item:hover {
    transform: perspective(900px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg)) translateY(-7px) scale(1.015);
    border-color: rgba(25, 230, 239, 0.58);
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.34), 0 0 32px rgba(25, 230, 239, 0.16);
  }

  .site-shell .project-card:hover::after,
  .site-shell .project-feature:hover::after,
  .site-shell .content-panel:hover::after,
  .site-shell .timeline-card:hover::after,
  .site-shell .technology-card:hover::after,
  .site-shell .ai-tool-card:hover::after,
  .site-shell .achievement-card:hover::after,
  .site-shell .certification-card:hover::after,
  .site-shell .project-gallery-item:hover::after {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .scroll-reveal.is-pending,
  .scroll-reveal.is-visible {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
    will-change: auto;
  }
}

@media (max-width: 860px) {
  .project-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-filters .field:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .project-filters {
    grid-template-columns: 1fr;
  }

  .project-filters .field:first-child {
    grid-column: auto;
  }

  .project-filter-reset {
    width: 100%;
  }
}

html[data-theme='light'] {
  scrollbar-color: #3983a2 #e6eef5;
}

html[data-theme='light']::-webkit-scrollbar-track {
  background: #e6eef5;
  border-left-color: rgba(39, 93, 124, 0.16);
}

html[data-theme='light']::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #188ba0, #7665bd);
  border-color: #e6eef5;
}

html[data-theme='light']::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #08778e, #6650b5);
}

html[data-theme='light'] .topbar .nav-links a {
  padding: 7px 9px;
  border-radius: 7px;
  color: #344d68;
  transition: color 180ms ease, background-color 180ms ease;
}

.project-card-content {
  display: block;
  min-width: 0;
}

.project-name,
.project-desc {
  display: block;
  min-width: 0;
}

.project-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-desc {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.project-card-content > .tag-list {
  display: flex;
  flex-wrap: wrap;
}

.section-head .text-link.section-sub {
  color: var(--cyan);
  font: 12px var(--mono);
}

html[data-theme='light'] .topbar .nav-links a:hover {
  background: rgba(20, 121, 145, 0.09);
  color: #12647a;
}

html[data-theme='light'] .topbar .nav-links a.active {
  background: rgba(20, 121, 145, 0.13);
  color: #07596e;
  font-weight: 600;
}

html[data-theme='light'] .topbar .nav-links a.active::before,
html[data-theme='light'] .topbar .nav-links a.active::after {
  display: none;
}

html[data-theme='light'] .topbar .nav-links a:focus-visible {
  outline-color: #08778e;
  outline-offset: 2px;
}

html[data-theme='light'] .topbar .nav-links {
  gap: clamp(5px, 1.15vw, 16px);
}

html[data-theme='light'] .topbar .theme-toggle:hover {
  background: rgba(20, 121, 145, 0.12);
  color: #07596e;
}

@media (max-width: 1080px) {
  html[data-theme='light'] .topbar .nav-links {
    gap: 5px;
    padding: 12px;
    border: 1px solid rgba(37, 73, 112, 0.2);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 18px 32px rgba(34, 62, 96, 0.18);
  }

  html[data-theme='light'] .topbar .nav-links a {
    display: block;
    padding: 10px 12px;
  }
}

.admin-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  overflow: clip;
}

.admin-shell {
  position: relative;
  z-index: 1;
  transition: opacity 300ms ease, filter 300ms ease, transform 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.admin-maze-canvas {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  opacity: 0.88;
  mix-blend-mode: screen;
}

.maze-mode-toggle {
  position: fixed;
  z-index: 45;
  right: 22px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(90, 208, 232, 0.34);
  border-radius: 999px;
  background: rgba(3, 12, 27, 0.82);
  color: #bdeef4;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  backdrop-filter: none;
  cursor: pointer;
  font: 11px var(--mono);
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.maze-mode-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  background: rgba(8, 40, 61, 0.92);
}

.admin-page--immersive .admin-shell {
  opacity: 0;
  filter: none;
  transform: scale(0.985);
  pointer-events: none;
  visibility: hidden;
}

.admin-page--immersive .maze-mode-toggle {
  top: 18px;
  right: 20px;
  bottom: auto;
}

.project-view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 14px;
  color: var(--muted);
  font: 11px var(--mono);
}

.project-view-toolbar > div {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(74, 131, 204, 0.24);
  border-radius: 9px;
  background: rgba(4, 12, 28, 0.4);
}

.project-view-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 33px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 10px var(--mono);
}

.project-view-toolbar button.selected,
.project-view-toolbar button:hover {
  background: rgba(25, 230, 239, 0.12);
  color: var(--cyan);
}

.project-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr));
  gap: 14px;
}

.project-document-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
  align-items: start;
  gap: 16px;
}

.project-document-window {
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 350px;
  overflow: hidden;
  border: 1px solid rgba(74, 131, 204, 0.32);
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(9, 24, 44, 0.94), rgba(4, 12, 25, 0.96));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.project-document-window:hover {
  transform: translateY(-3px);
  border-color: rgba(25, 230, 239, 0.5);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.3), 0 0 20px rgba(25, 230, 239, 0.08);
}

.project-document-titlebar {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(74, 131, 204, 0.24);
  background: linear-gradient(90deg, rgba(15, 43, 68, 0.94), rgba(24, 27, 58, 0.88));
}

.project-document-titlebar > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  color: #bfefff;
  font: 10px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-document-titlebar > span svg {
  flex: none;
  color: var(--cyan);
}

.project-document-page {
  display: grid;
  gap: 12px;
  margin: 12px;
  padding: 14px;
  border: 1px solid rgba(112, 145, 184, 0.2);
  border-radius: 7px;
  background: linear-gradient(145deg, rgba(17, 31, 50, 0.88), rgba(10, 18, 34, 0.92));
}

.project-document-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.project-document-heading > div {
  min-width: 0;
}

.project-document-kicker {
  color: #88cfe3;
  font: 8px var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-document-heading h3 {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: #e3f5ff;
  font-size: 15px;
  line-height: 1.35;
}

.project-document-heading .project-publish-state {
  position: static;
  flex: none;
  min-height: 22px;
  font-size: 8px;
}

.project-document-heading .project-publish-state.published {
  border-color: rgba(57, 242, 163, 0.26);
  background: rgba(12, 70, 52, 0.42);
}

.project-document-heading .project-publish-state.draft {
  border-color: rgba(255, 210, 139, 0.24);
  background: rgba(86, 57, 21, 0.4);
}

.project-document-cover,
.project-document-placeholder {
  width: 100%;
  height: 132px;
  border: 1px solid rgba(74, 131, 204, 0.24);
  border-radius: 5px;
}

.project-document-cover {
  display: block;
  object-fit: cover;
}

.project-document-placeholder {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(19, 70, 97, 0.28), rgba(83, 48, 130, 0.24));
  color: #8dc9df;
}

.project-document-placeholder span {
  font: 9px var(--mono);
}

.project-document-description {
  display: -webkit-box;
  min-height: 42px;
  margin: 0;
  overflow: hidden;
  color: #a9bfd2;
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.project-document-footer {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid rgba(74, 131, 204, 0.18);
}

.project-document-tags {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #89b7d1;
  font: 8px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-document-order {
  color: #718ba5;
  font: 9px var(--mono);
}

.project-document-footer .admin-actions {
  flex: none;
}

@media (max-width: 720px) {
  .project-document-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  }
}

.project-visual img {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.project-cover-admin {
  grid-template-columns: minmax(0, 1.35fr) minmax(230px, 1fr);
}

.project-cover-admin > img,
.project-cover-admin > span {
  width: 100%;
  max-height: none;
  aspect-ratio: 16 / 9;
}

.project-cover-admin > img {
  object-fit: contain;
  background: linear-gradient(135deg, rgba(12, 27, 49, 0.94), rgba(5, 11, 24, 0.98));
}

.project-cover-admin > span {
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(4, 12, 28, 0.45);
}

.project-image-guidance {
  line-height: 1.55;
}

.gallery-editor-heading > div {
  display: grid;
  gap: 5px;
}

.gallery-editor-preview {
  grid-template-columns: minmax(130px, 220px) minmax(0, 1fr);
}

.gallery-editor-preview img {
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
}

.project-preview-overlay {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 36px);
  background: rgba(1, 4, 12, 0.84);
  backdrop-filter: blur(8px);
}

.project-preview-dialog {
  display: flex;
  flex-direction: column;
  width: min(1080px, 100%);
  max-height: 94vh;
  max-height: 94dvh;
  overflow: hidden;
}

.project-preview-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 10, 23, 0.96);
}

.project-preview-header > div {
  display: grid;
  gap: 4px;
}

.project-preview-header small {
  color: var(--muted);
  font-size: 11px;
}

.project-preview-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 26px clamp(16px, 4vw, 52px);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(25, 230, 239, 0.7) rgba(5, 13, 31, 0.9);
  scrollbar-width: thin;
}

.project-preview-content::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.project-preview-content::-webkit-scrollbar-track {
  background: rgba(5, 13, 31, 0.9);
  border-left: 1px solid rgba(39, 187, 255, 0.16);
}

.project-preview-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  border: 3px solid rgba(5, 13, 31, 0.9);
  border-radius: 99px;
}

.project-preview-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--cyan-soft), #a986ff);
}

.project-preview-content .project-detail {
  width: min(100%, 900px);
  margin: 0 auto;
}

html[data-theme='light'] .project-preview-dialog {
  color: var(--text);
  background: rgba(198, 213, 232, 0.96);
}

html[data-theme='light'] .project-preview-header {
  color: var(--text);
  background: rgba(183, 201, 224, 0.96);
}

html[data-theme='light'] .project-preview-content :is(
  .project-detail h1,
  .project-detail-description,
  .project-detail-content,
  .case-detail-block h2,
  .case-detail-block p,
  .case-detail-block li,
  .project-gallery h2,
  .project-gallery-item figcaption
) {
  color: #17243a;
}

html[data-theme='light'] .project-preview-content .project-detail-content,
html[data-theme='light'] .project-preview-content .project-gallery-item {
  background: rgba(198, 213, 232, 0.88);
}

html[data-theme='light'] .project-preview-content {
  scrollbar-color: rgba(8, 126, 139, 0.72) rgba(222, 231, 243, 0.95);
}

html[data-theme='light'] .project-preview-content::-webkit-scrollbar-track {
  background: rgba(222, 231, 243, 0.95);
  border-left-color: rgba(24, 94, 145, 0.16);
}

html[data-theme='light'] .project-preview-content::-webkit-scrollbar-thumb {
  border-color: rgba(222, 231, 243, 0.95);
}

@media (max-width: 720px) {
  .project-cover-admin {
    grid-template-columns: 1fr;
  }

  .project-cover-admin > img,
  .project-cover-admin > span {
    max-width: 100%;
  }

  .project-preview-overlay {
    padding: 0;
  }

  .project-preview-dialog {
    width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .project-preview-header {
    padding: 12px 15px;
  }

  .project-preview-content {
    padding: 22px 15px;
  }
}

@media (max-width: 480px) {
  .project-document-grid {
    grid-template-columns: 1fr;
  }
}

.project-folder-card {
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 380px;
  overflow: hidden;
  border: 1px solid rgba(74, 131, 204, 0.25);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(9, 24, 44, 0.88), rgba(4, 12, 25, 0.9));
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.19);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.project-folder-card:hover {
  transform: translateY(-4px);
  border-color: rgba(25, 230, 239, 0.54);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.29), 0 0 24px rgba(25, 230, 239, 0.08);
}

.project-folder-art {
  position: relative;
  height: 152px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(19, 70, 97, 0.5), rgba(83, 48, 130, 0.44));
}

.project-folder-art::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 9, 20, 0.04), rgba(3, 9, 20, 0.55));
  content: '';
  pointer-events: none;
}

.project-folder-art > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms ease;
}

.project-folder-card:hover .project-folder-art > img {
  transform: scale(1.045);
}

.project-folder-tab,
.project-publish-state {
  position: absolute;
  z-index: 1;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(194, 232, 255, 0.24);
  border-radius: 999px;
  background: rgba(3, 12, 27, 0.76);
  color: #d9f4ff;
  font: 9px var(--mono);
  backdrop-filter: blur(8px);
}

.project-folder-tab { left: 10px; }
.project-publish-state { right: 10px; }
.project-publish-state.published { color: #80f4bf; }
.project-publish-state.draft { color: #ffd28b; }

.project-folder-placeholder {
  display: grid;
  height: 100%;
  align-content: center;
  justify-items: center;
  gap: 8px;
  color: rgba(194, 238, 248, 0.78);
}

.project-folder-placeholder span {
  font: 9px var(--mono);
  letter-spacing: 0.12em;
}

.project-folder-copy {
  display: grid;
  gap: 8px;
  padding: 13px;
}

.project-folder-copy > div:first-child,
.project-folder-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.project-folder-year,
.project-folder-order {
  color: var(--muted);
  font: 9px var(--mono);
}

.project-folder-order { color: rgba(25, 230, 239, 0.75); }
.project-folder-copy h3 { margin: 0; font-size: 16px; line-height: 1.3; }

.project-folder-copy p {
  display: -webkit-box;
  min-height: 38px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-folder-footer > span {
  min-width: 0;
  overflow: hidden;
  color: #b9cee2;
  font: 9px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-view {
  display: grid;
  gap: 8px;
}

.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: var(--muted);
  font: 10px var(--mono);
}

.admin-pagination > div {
  display: flex;
  gap: 8px;
}

.project-list-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 94px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border: 1px solid rgba(74, 131, 204, 0.2);
  border-radius: 9px;
  background: rgba(4, 12, 25, 0.48);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.project-list-row:hover {
  border-color: rgba(25, 230, 239, 0.42);
  background: rgba(8, 28, 48, 0.68);
}

.project-list-row > img,
.project-list-placeholder {
  width: 76px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
}

.project-list-placeholder {
  display: grid;
  place-items: center;
  background: rgba(25, 230, 239, 0.08);
  color: var(--cyan);
}

.project-list-row > div:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.project-list-row > div:nth-child(2) span,
.project-list-row > div:nth-child(2) small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-row > div:nth-child(2) span { font: 9px var(--mono); }
.project-list-row > div:nth-child(2) small { font-size: 10px; }

.gallery-dropzone {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 14px;
  border: 1px dashed rgba(55, 193, 221, 0.4);
  border-radius: 8px;
  background: rgba(14, 111, 143, 0.07);
  color: #b7eaf2;
  text-align: center;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.gallery-dropzone:hover {
  border-color: var(--cyan);
  background: rgba(14, 111, 143, 0.13);
}

.gallery-dropzone small { color: var(--muted); font-size: 10px; }
.gallery-editor-item { transition: opacity 180ms ease, border-color 180ms ease, transform 180ms ease; }
.gallery-editor-item.is-dragging { opacity: 0.45; transform: scale(0.985); }
.gallery-editor-item.is-drop-target { border-color: var(--cyan); box-shadow: 0 0 0 2px rgba(25, 230, 239, 0.13); }
.gallery-editor-toolbar > strong { display: inline-flex; align-items: center; gap: 5px; }
.gallery-drag-handle { color: var(--muted); }

.catalog-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.catalog-status .button { flex: 0 0 auto; min-height: 34px; }

.catalog-loading,
.upload-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #b8d9e8;
  font-size: 11px;
}

.catalog-loading {
  margin: 8px 0 12px;
  padding: 11px 12px;
  border: 1px solid rgba(39, 187, 255, 0.19);
  border-radius: 7px;
  background: rgba(10, 35, 55, 0.32);
}

.catalog-loading-indicator {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(25, 230, 239, 0.25);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: admin-spinner 800ms linear infinite;
}

.admin-spinner { animation: admin-spinner 800ms linear infinite; }

.upload-status {
  margin: 0;
  padding: 8px 0;
  color: var(--cyan);
}

@keyframes admin-spinner {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .project-folder-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
  .project-list-row { grid-template-columns: 56px minmax(0, 1fr) auto; gap: 8px; }
  .project-list-row > img,
  .project-list-placeholder { width: 56px; height: 48px; }
  .project-list-row > .project-publish-state { display: none; }
  .catalog-status { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 480px) {
  .maze-mode-toggle { right: 12px; bottom: 12px; min-height: 36px; }
  .admin-page--immersive .maze-mode-toggle { top: 12px; right: 12px; }
  .project-view-toolbar { align-items: flex-start; flex-direction: column; }
  .project-folder-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-spinner,
  .catalog-loading-indicator { animation: none; }

  .admin-shell,
  .maze-mode-toggle,
  .project-folder-card,
  .project-document-window,
  .project-folder-art > img,
  .project-list-row,
  .gallery-editor-item { transition: none; }
}

.admin-page::before {
  position: fixed;
  z-index: 1;
  inset: 0;
  background:
    radial-gradient(ellipse at 18% 36%, rgba(17, 179, 205, 0.22), transparent 37%),
    radial-gradient(ellipse at 78% 74%, rgba(112, 78, 212, 0.18), transparent 40%);
  content: '';
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.admin-page--ambient::before {
  opacity: var(--admin-ambient-intensity, 0.65);
}

.admin-page--no-image {
  background: #030711 !important;
  background-image: none !important;
}

.admin-visual-controls {
  position: fixed;
  z-index: 35;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-visual-controls .maze-mode-toggle {
  position: static;
}

.admin-backdrop-settings {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  display: grid;
  width: min(340px, calc(100vw - 28px));
  gap: 10px;
  padding: 15px;
  border: 1px solid rgba(90, 208, 232, 0.34);
  border-radius: 13px;
  background: rgba(3, 12, 27, 0.94);
  color: #d9f4ff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.46);
  backdrop-filter: none;
}

.admin-backdrop-settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 4px;
  color: #c6f6ff;
  font-size: 13px;
}

.admin-backdrop-settings-heading button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(90, 208, 232, 0.24);
  border-radius: 7px;
  background: rgba(25, 230, 239, 0.08);
  color: #c6f6ff;
  cursor: pointer;
}

.backdrop-toggle-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 1px 9px;
  cursor: pointer;
  font-size: 12px;
}

.backdrop-toggle-option input {
  grid-row: span 2;
  width: 16px;
  height: 16px;
  accent-color: var(--cyan);
}

.backdrop-toggle-option small {
  color: #91aabd;
  font-size: 10px;
}

.backdrop-range-option {
  display: grid;
  gap: 4px;
  color: #b9d6e6;
  font-size: 10px;
}

.backdrop-range-option > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.backdrop-range-option strong { color: var(--cyan); font: 10px var(--mono); }
.backdrop-range-option input { width: 100%; accent-color: var(--cyan); }

.backdrop-reset-button {
  min-height: 34px;
  border: 1px solid rgba(90, 208, 232, 0.22);
  border-radius: 7px;
  background: rgba(25, 230, 239, 0.07);
  color: #b9e7ef;
  cursor: pointer;
  font: 10px var(--mono);
}

.backdrop-reset-button:hover {
  border-color: rgba(25, 230, 239, 0.58);
  background: rgba(25, 230, 239, 0.12);
}

.admin-maze-canvas { opacity: var(--admin-maze-intensity, 0.72); }
.admin-maze-canvas { z-index: 2; }
.public-maze-canvas { z-index: 1; }
.admin-shell { z-index: 3; }

.admin-page--immersive .admin-visual-controls {
  top: 18px;
  right: 20px;
  bottom: auto;
}

.admin-page--immersive .admin-backdrop-settings {
  top: calc(100% + 10px);
  bottom: auto;
}

@media (max-width: 520px) {
  .admin-visual-controls { right: 12px; bottom: 12px; gap: 6px; }
  .admin-visual-controls .maze-mode-toggle { gap: 6px; min-height: 36px; padding: 0 10px; font-size: 10px; }
  .admin-page--immersive .admin-visual-controls { top: 12px; right: 12px; bottom: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-page::before,
  .backdrop-range-option input { transition: none; }
}

.admin-page .window {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.theme-toggle {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(5, 13, 31, 0.42);
  color: var(--cyan);
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--cyan);
  background: rgba(25, 230, 239, 0.12);
}

.topbar .nav-links {
  transition: opacity 220ms ease, transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), max-height 300ms ease, visibility 220ms;
}

.route-enter-active,
.route-leave-active {
  transform-origin: center top;
  transition:
    opacity 360ms ease,
    transform 480ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 360ms ease;
  backface-visibility: hidden;
  will-change: opacity, transform, filter;
}

.route-enter-from {
  opacity: 0;
  filter: blur(10px);
  transform: perspective(1200px) translate3d(56px, 22px, 0) rotateY(-3deg) scale(0.97);
}

.route-leave-to {
  opacity: 0;
  filter: blur(8px);
  transform: perspective(1200px) translate3d(-36px, -10px, 0) rotateY(2deg) scale(1.015);
}

.site-shell .window,
.site-shell .project-card,
.site-shell .project-feature,
.site-shell .achievement-card {
  background: linear-gradient(135deg, rgba(8, 18, 34, 0.48), rgba(5, 12, 25, 0.34));
  backdrop-filter: blur(10px) saturate(125%);
  -webkit-backdrop-filter: blur(10px) saturate(125%);
}

.site-shell .project-card {
  background-color: rgba(2, 8, 20, 0.12);
}

.site-shell .project-card:hover {
  background-color: rgba(13, 38, 70, 0.3);
}

.site-shell .window-bar {
  background: rgba(4, 10, 21, 0.12);
}

.theme-toggle,
.project-card,
.project-feature,
.achievement-card,
.timeline-card,
.technology-card,
.certification-card,
.ai-tool-card {
  transition-property: color, background-color, border-color, box-shadow, transform, opacity;
  transition-duration: 220ms;
  transition-timing-function: ease;
}

.site-scroll-progress {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left center;
  background: linear-gradient(90deg, var(--cyan), #367afa 62%, var(--violet));
  box-shadow: 0 0 14px rgba(25, 230, 239, 0.55);
  pointer-events: none;
}

html[data-theme='light'] {
  color-scheme: light;
  --bg: #f2f6fc;
  --panel: rgba(250, 252, 255, 0.72);
  --panel-2: rgba(244, 248, 255, 0.84);
  --cyan: #087e8b;
  --cyan-soft: #0b98a5;
  --violet: #7450bc;
  --blue: #2469c9;
  --ink: #eaf0f8;
  --text: #1b2940;
  --muted: #596b82;
  --line: rgba(24, 94, 145, 0.3);
  --line-violet: rgba(116, 80, 188, 0.32);
  --green: #16804e;
  --danger: #bf3654;
  --shadow: 0 16px 50px rgba(34, 62, 96, 0.14), 0 0 24px rgba(35, 111, 174, 0.08);
  scrollbar-color: rgba(8, 126, 139, 0.72) rgba(222, 231, 243, 0.95);
}

html[data-theme='light']::-webkit-scrollbar-track {
  background: rgba(222, 231, 243, 0.95);
  border-left-color: rgba(24, 94, 145, 0.16);
}

html[data-theme='light']::-webkit-scrollbar-thumb {
  border-color: rgba(222, 231, 243, 0.95);
}

html[data-theme='light'] body,
html[data-theme='light'] .site-shell {
  color: var(--text);
  background-color: var(--bg);
}

html[data-theme='light'] .site-shell {
  background-image: radial-gradient(ellipse at 75% 17%, rgba(70, 128, 204, 0.13), transparent 36%), radial-gradient(ellipse at 5% 58%, rgba(133, 95, 194, 0.1), transparent 30%);
}

html[data-theme='light'] .site-shell:before {
  opacity: 0.12;
  background-image: linear-gradient(rgba(49, 102, 157, 0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(49, 102, 157, 0.12) 1px, transparent 1px);
}

html[data-theme='light'] .site-shell:after {
  background-image: linear-gradient(90deg, rgba(241, 246, 253, 0.56), rgba(241, 246, 253, 0.18) 48%, rgba(241, 246, 253, 0.56)), linear-gradient(0deg, rgba(241, 246, 253, 0.46), rgba(241, 246, 253, 0.02) 55%, rgba(241, 246, 253, 0.3)), url('/images/neon-workspace-light.webp');
  filter: saturate(0.78) brightness(1.04);
  opacity: 0.7;
}

html[data-theme='light'] .site-shell .window,
html[data-theme='light'] .site-shell .project-feature,
html[data-theme='light'] .site-shell .achievement-card {
  background: linear-gradient(135deg, rgba(184, 201, 222, 0.82), rgba(171, 190, 214, 0.78));
  border-color: rgba(37, 73, 112, 0.34);
  box-shadow: 0 14px 38px rgba(34, 62, 96, 0.2), 0 1px 0 rgba(255, 255, 255, 0.38) inset;
  backdrop-filter: blur(10px) saturate(125%);
  -webkit-backdrop-filter: blur(10px) saturate(125%);
}

html[data-theme='light'] .site-shell .project-card {
  background: rgba(166, 188, 214, 0.86);
}

html[data-theme='light'] .site-shell .project-card:hover {
  background: rgba(145, 173, 205, 0.94);
}

html[data-theme='light'] .topbar {
  background: rgba(198, 211, 229, 0.96);
  border-bottom-color: rgba(37, 73, 112, 0.34);
  box-shadow: 0 8px 28px rgba(34, 62, 96, 0.16);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

html[data-theme='light'] .nav-links,
html[data-theme='light'] .nav-links a,
html[data-theme='light'] .brand,
html[data-theme='light'] .hero-main h1 .greeting,
html[data-theme='light'] .hero-main .lead,
html[data-theme='light'] .window-body,
html[data-theme='light'] .contact-line,
html[data-theme='light'] .project-name,
html[data-theme='light'] .project-feature-body,
html[data-theme='light'] .timeline-card,
html[data-theme='light'] .achievement-card,
html[data-theme='light'] .certification-card,
html[data-theme='light'] .ai-tool-card h3,
html[data-theme='light'] .ai-tool-card > span,
html[data-theme='light'] .case-detail-block h2,
html[data-theme='light'] .project-detail-description {
  color: var(--text);
}

html[data-theme='light'] .window-bar {
  background: rgba(241, 246, 253, 0.35);
  color: var(--text);
}

html[data-theme='light'] .nav-links a:hover,
html[data-theme='light'] .nav-links a.active,
html[data-theme='light'] .theme-toggle {
  color: var(--cyan);
}

html[data-theme='light'] .topbar .nav-links {
  background: rgba(190, 205, 224, 0.99);
  border-bottom-color: rgba(37, 73, 112, 0.34);
  box-shadow: 0 14px 30px rgba(34, 62, 96, 0.14);
}

html[data-theme='light'] .info-body,
html[data-theme='light'] .section-sub,
html[data-theme='light'] .project-desc,
html[data-theme='light'] .tech-item,
html[data-theme='light'] .ai-intro,
html[data-theme='light'] .ai-tool-description,
html[data-theme='light'] .ai-tool-meta,
html[data-theme='light'] .achievement-card p,
html[data-theme='light'] .case-detail-block ul,
html[data-theme='light'] .project-back,
html[data-theme='light'] .project-gallery-item figcaption,
html[data-theme='light'] .certification-copy p {
  color: #4d6078;
}

html[data-theme='light'] .button.secondary,
html[data-theme='light'] .theme-toggle {
  color: #24425d;
  background: rgba(190, 205, 224, 0.78);
  border-color: rgba(24, 94, 145, 0.38);
}

html[data-theme='light'] .project-filters input,
html[data-theme='light'] .project-filters select,
html[data-theme='light'] .message-filters input,
html[data-theme='light'] .message-filters select,
html[data-theme='light'] .icon-editor > select,
html[data-theme='light'] .social-editor-row select {
  color: var(--text);
  background: rgba(248, 251, 255, 0.84);
}

html[data-theme='light'] .nav-mobile {
  color: var(--cyan);
}

@media (max-width: 1080px) {
  .topbar .nav-links {
    display: flex !important;
    visibility: hidden;
    position: absolute;
    z-index: 2;
    top: 62px;
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    background: rgba(3, 8, 20, 0.96);
    backdrop-filter: blur(18px);
  }

  .topbar .nav-links.open {
    visibility: visible;
    max-height: min(75vh, 560px);
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .topbar .nav-links.open > a {
    animation: nav-link-enter 220ms ease both;
  }

  .topbar .nav-links.open > a:nth-child(2) { animation-delay: 30ms; }
  .topbar .nav-links.open > a:nth-child(3) { animation-delay: 60ms; }
  .topbar .nav-links.open > a:nth-child(4) { animation-delay: 90ms; }
  .topbar .nav-links.open > a:nth-child(5) { animation-delay: 120ms; }
  .topbar .nav-links.open > a:nth-child(6) { animation-delay: 150ms; }
  .topbar .nav-links.open > a:nth-child(7) { animation-delay: 180ms; }
  .topbar .nav-links.open > a:nth-child(8) { animation-delay: 210ms; }
}

@media (max-width: 720px) {
  .topbar .nav-links {
    top: 58px;
  }

  .topbar .status-chip {
    width: 8px;
    overflow: hidden;
    gap: 0;
  }

  .topbar .status-chip > span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .route-enter-active,
  .route-leave-active,
  .topbar .nav-links,
  .theme-toggle {
    transition-duration: 0.01ms !important;
  }

  .topbar .nav-links.open > a {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
}

html:not([data-theme='light'])[data-public-site='true'] .site-shell main :is(
  .window,
  .project-card,
  .project-feature,
  .content-panel,
  .timeline-card,
  .technology-card,
  .ai-tool-card,
  .achievement-card,
  .certification-card,
  .contact-card,
  .testimonial-card
) {
  background: linear-gradient(
    135deg,
    rgba(8, 18, 34, var(--public-card-opacity, 0.58)),
    rgba(5, 12, 25, var(--public-card-opacity, 0.58))
  ) !important;
}

.public-light-veil {
  position: fixed;
  z-index: 10;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

html[data-theme='light'][data-public-site='true'] .public-light-veil {
  opacity: 0.12;
}

.project-technology-picker > p {
  margin: 4px 0 10px;
  font-size: 12px;
}

.project-github-repository-picker {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.project-github-repository-picker > p {
  margin: 0;
  font-size: 11px;
}

.project-github-repository-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
}

.project-github-repository-controls > input,
.project-github-repository-controls > select,
.project-github-repository-picker > input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(3, 9, 21, .78);
  color: var(--text);
}

.project-github-repository-controls > input {
  grid-column: 1 / -1;
}

.project-github-repository-controls > .button {
  justify-content: center;
  white-space: nowrap;
}

.project-github-repository-picker > label:not(:first-child) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

html[data-theme='light'] .project-github-repository-controls > input,
html[data-theme='light'] .project-github-repository-controls > select,
html[data-theme='light'] .project-github-repository-picker > input {
  background: rgba(255, 255, 255, .88);
}

.project-technology-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
  padding: 2px;
}

.project-technology-option {
  display: grid;
  grid-template-columns: 18px 26px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.project-technology-option:hover,
.project-technology-option:focus-visible {
  border-color: var(--cyan);
}

.project-technology-option.is-selected {
  border-color: var(--cyan);
  background: color-mix(in srgb, var(--cyan) 12%, var(--bg));
}

.project-technology-check {
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid var(--muted);
  border-radius: 50%;
  color: var(--cyan);
}

.project-technology-option.is-selected .project-technology-check {
  border-color: var(--cyan);
}

.project-technology-name {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-technology-option small {
  grid-column: 3;
  overflow: hidden;
  color: var(--muted);
  font: 10px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-technology-legacy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-size: 11px;
}

.project-technology-legacy button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 480px) {
  .project-github-repository-controls {
    grid-template-columns: minmax(0, 1fr);
  }
  .project-github-repository-controls > .button {
    width: 100%;
  }
  .project-technology-options {
    grid-template-columns: 1fr;
    max-height: 250px;
  }
}

.editor-dialog {
  width: min(920px, 100%);
  max-height: min(92dvh, 900px);
  overscroll-behavior: contain;
}

.record-section-guide {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  border-radius: 8px;
  background: color-mix(in srgb, var(--cyan) 5%, var(--bg));
}
.record-section-guide-heading { display: flex; align-items: center; gap: 8px; color: var(--cyan); }
.record-section-guide-heading h2 { margin: 0; color: var(--text); font-size: 15px; }
.record-section-guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.record-section-guide-grid > div { min-width: 0; }
.record-section-guide-grid h3 { margin: 0 0 4px; color: var(--text); font-size: 12px; }
.record-section-guide-grid p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.admin-gemini-prompt-help { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.editor-actions {
  position: sticky;
  bottom: -20px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px -20px -20px;
  padding: 12px 20px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.editor-actions-spacer { flex: 1 1 auto; }
.editor-actions .button { min-height: 40px; }
.project-category-options {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  max-height: min(38vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px;
}
.project-category-options > label {
  min-width: 0;
  justify-content: flex-start !important;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid rgba(74, 131, 204, .24);
  border-radius: 7px;
  background: rgba(4, 12, 28, .42);
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
  cursor: pointer;
}
.project-category-options > label.is-selected {
  border-color: rgba(25, 230, 239, .62);
  background: rgba(25, 230, 239, .09);
  color: var(--cyan);
}
.project-category-options > label input {
  width: 18px !important;
  min-width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 0;
  accent-color: var(--cyan);
}
.project-category-options > label input:disabled {
  cursor: not-allowed;
}
.admin-inline-fields { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.admin-inline-fields > label { display: grid; flex: 1 1 180px; gap: 5px; min-width: 0; color: var(--muted); font-size: 12px; }
.admin-option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 7px; margin-top: 12px; }
.admin-option-grid > label { display: flex; min-width: 0; align-items: center; gap: 8px; padding: 8px; border: 1px solid rgba(74, 131, 204, .2); border-radius: 6px; color: var(--text); font-size: 11px; }
.admin-option-grid > label input { flex: 0 0 auto; accent-color: var(--cyan); }
.admin-option-grid > label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.technology-slot-editor { display: grid; gap: 8px; margin: 12px 0; padding: 12px; border: 1px solid rgba(74, 131, 204, .25); border-radius: 8px; }
.technology-slot-editor legend { padding: 0 5px; color: var(--cyan); font: 11px var(--mono); }
.technology-slot-apply { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.technology-slot-apply .button { min-height: 34px; padding: 7px 10px; font-size: 11px; }
.admin-chip-list { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.admin-chip-list .tag { display: inline-flex; align-items: center; gap: 5px; }
.admin-chip-list .tag button { display: grid; place-items: center; padding: 2px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.project-layout-controls details { padding: 12px; border: 1px solid rgba(74, 131, 204, .25); border-radius: 8px; }
.project-layout-controls summary { color: var(--cyan); cursor: pointer; font: 12px var(--mono); }
.project-layout-controls details > label { display: grid; gap: 6px; margin: 10px 0; color: var(--muted); font-size: 12px; }
.project-layout-controls input[type='color'] { width: 52px; min-height: 38px; padding: 3px; }
.project-detail { --case-accent: var(--cyan); }
.project-detail > .eyebrow,
.project-detail .case-detail-block h2,
.project-detail .project-gallery > h2 { color: var(--case-accent); }
.project-detail--editorial { max-width: 1080px; }
.project-detail--editorial > .eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 12px;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--case-accent) 42%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--case-accent) 9%, transparent);
}
.project-detail--editorial > h1 {
  max-width: 980px;
  padding-bottom: 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--case-accent) 38%, transparent);
  font-size: clamp(36px, 6vw, 68px);
  letter-spacing: -.045em;
}
.project-detail--editorial > .project-detail-description { max-width: 820px; padding-left: 16px; border-left: 2px solid var(--case-accent); }
.project-detail--editorial .project-detail-image,
.project-detail--editorial .project-detail-placeholder {
  border-color: color-mix(in srgb, var(--case-accent) 45%, var(--line));
  box-shadow: 0 18px 55px color-mix(in srgb, var(--case-accent) 10%, transparent);
}
.project-detail--editorial .project-detail-content {
  border-top: 2px solid var(--case-accent);
  background: linear-gradient(135deg, color-mix(in srgb, var(--case-accent) 5%, var(--panel)), var(--panel));
}
.project-detail--editorial .case-detail-block {
  padding-left: 14px;
  border-left: 1px solid color-mix(in srgb, var(--case-accent) 42%, transparent);
}
.project-detail--editorial .project-metrics > div,
.project-detail--editorial .project-gallery-item {
  border-color: color-mix(in srgb, var(--case-accent) 34%, var(--line));
}
.project-detail--editorial .project-detail-actions .button { border-color: color-mix(in srgb, var(--case-accent) 55%, transparent); }

.project-layout-controls details > p { margin: 8px 0 14px; font-size: 12px; }
.project-layout-controls .project-accent-picker > span { display: flex; align-items: center; gap: 10px; }
.project-layout-controls .project-accent-picker code { color: var(--text); font: 11px var(--mono); }

.gallery-editor-item.has-preview {
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.25fr);
  align-items: start;
  gap: 12px 16px;
}
.gallery-editor-item.has-preview > .gallery-editor-preview {
  grid-column: 1;
  grid-row: 1 / span 2;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}
.gallery-editor-item.has-preview > .gallery-editor-preview img {
  height: clamp(150px, 20vw, 250px);
  object-fit: contain;
  background: rgba(2, 8, 18, .72);
}
.gallery-editor-item > .gallery-editor-toolbar { min-width: 0; flex-wrap: wrap; }
.gallery-editor-toolbar > div { min-width: 0; flex-wrap: wrap; align-items: center; }
.gallery-editor-toolbar .button { min-height: 34px; padding: 6px 9px; font-size: 10px; }
.gallery-editor-fields { display: grid; min-width: 0; grid-column: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.gallery-editor-fields .field:first-child { grid-column: 1 / -1; }
.gallery-editor-fields .field { min-width: 0; }
.gallery-editor-item:not(.has-preview) .gallery-editor-fields { grid-column: 1; }

.public-backdrop-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
.public-backdrop-controls > label {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(74, 131, 204, .18);
  border-radius: 8px;
  background: rgba(4, 12, 28, .34);
}
.public-backdrop-controls > label select { width: 100%; min-width: 0; }
.floating-icon-tuners { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.floating-icon-tuning {
  align-content: start;
  padding: 10px;
  border: 1px solid rgba(74, 131, 204, .18);
  border-radius: 7px;
  background: rgba(4, 12, 28, .26);
}
.admin-option-grid > label :is(.technology-icon, .technology-icon-fallback) { flex: 0 0 22px; }
.admin-chip-list .technology-icon,
.admin-chip-list .technology-icon-fallback { flex: 0 0 16px; }

@media (max-width: 720px) {
  .public-backdrop-controls,
  .floating-icon-tuners { grid-template-columns: minmax(0, 1fr); }
  .gallery-editor-item.has-preview { grid-template-columns: minmax(0, 1fr); }
  .gallery-editor-item.has-preview > .gallery-editor-preview,
  .gallery-editor-fields { grid-column: 1; grid-row: auto; }
  .gallery-editor-item.has-preview > .gallery-editor-preview img { height: clamp(170px, 52vw, 280px); }
}

@media (max-width: 520px) {
  .gallery-editor-fields { grid-template-columns: minmax(0, 1fr); }
  .gallery-editor-fields .field:first-child { grid-column: 1; }
  .gallery-editor-toolbar > div { width: 100%; }
}

.admin-gemini-assistant {
  display: grid;
  min-width: 0;
  grid-column: 1 / -1;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(138, 92, 255, .34);
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(28, 24, 58, .55), rgba(4, 12, 28, .56));
}
.admin-gemini-heading { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 12px; }
.admin-gemini-heading h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 4px; color: var(--text); font-size: 14px; }
.admin-gemini-heading h3 svg { color: #b89aff; }
.admin-gemini-heading p,
.admin-gemini-privacy { margin: 0; color: var(--muted); font-size: 11px; }
.admin-gemini-model { flex: 0 0 auto; padding: 4px 8px; border: 1px solid rgba(184, 154, 255, .3); border-radius: 99px; color: #c9b8ff; font: 10px var(--mono); }
.admin-gemini-prompt { display: grid; min-width: 0; gap: 6px; color: var(--muted); font-size: 12px; }
.admin-gemini-prompt textarea { width: 100%; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(3, 9, 21, .78); color: var(--text); resize: vertical; }
.admin-gemini-provider { display: grid; min-width: 0; gap: 6px; color: var(--muted); font-size: 12px; }
.admin-gemini-provider select { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(3, 9, 21, .78); color: var(--text); }
.admin-gemini-consent { display: flex !important; width: 100% !important; max-width: 100% !important; min-width: 0 !important; align-items: flex-start; gap: 8px; box-sizing: border-box; margin: 0 !important; padding: 0 !important; color: var(--text) !important; font: 11px/1.55 var(--mono) !important; overflow-wrap: anywhere; white-space: normal !important; }
.admin-gemini-consent input { flex: 0 0 16px !important; width: 16px !important; height: 16px !important; margin: 1px 0 0 !important; padding: 0 !important; accent-color: #9c7aff; }
.admin-gemini-consent > span { display: block !important; flex: 1 1 auto !important; width: auto !important; max-width: calc(100% - 24px) !important; min-width: 0 !important; color: inherit !important; font: inherit !important; overflow-wrap: anywhere; white-space: normal !important; }
.admin-gemini-assistant > .admin-alert { margin: 0; overflow-wrap: anywhere; }
.admin-gemini-draft { display: grid; min-width: 0; gap: 8px; padding: 12px; border: 1px solid rgba(57, 242, 163, .25); border-radius: 7px; background: rgba(8, 94, 55, .08); }
.admin-gemini-draft > strong { color: #82f6c1; font-size: 12px; }
.admin-gemini-draft dl { display: grid; gap: 6px; margin: 0; }
.admin-gemini-draft dl > div { display: grid; grid-template-columns: minmax(100px, .35fr) minmax(0, 1fr); gap: 10px; padding-bottom: 6px; border-bottom: 1px solid rgba(78, 128, 178, .18); }
.admin-gemini-draft dt { color: var(--muted); font-size: 11px; }
.admin-gemini-draft dd { min-width: 0; margin: 0; color: var(--text); font-size: 11px; overflow-wrap: anywhere; white-space: pre-wrap; }
.admin-gemini-draft-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-gemini-history { display: grid; min-width: 0; gap: 6px; padding-top: 8px; border-top: 1px solid rgba(120, 130, 170, .22); }
.admin-gemini-history > strong { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.admin-gemini-history > button { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(3, 9, 21, .3); color: var(--text); text-align: left; cursor: pointer; }
.admin-gemini-history > button.is-selected { border-color: rgba(184, 154, 255, .6); background: rgba(138, 92, 255, .12); }
.admin-gemini-history > button span { min-width: 0; overflow-wrap: anywhere; font-size: 11px; }
.admin-gemini-history > button small { flex: 0 0 auto; color: var(--muted); font-size: 10px; }

.admin-ai-provider-panel { display: grid; min-width: 0; gap: 14px; margin: 14px 0; padding: 15px; }
.admin-ai-provider-panel > header { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 12px; }
.admin-ai-provider-panel > header h2 { margin: 0; font-size: 15px; }
.admin-ai-provider-panel > header p { margin: 4px 0 0; font-size: 11px; }
.admin-ai-provider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-ai-provider-card { display: grid; min-width: 0; align-content: start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(4, 12, 28, .4); }
.admin-ai-provider-card__heading > div { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.admin-ai-provider-card h3 { margin: 0; font-size: 13px; }
.admin-ai-provider-card > p { margin: 0; color: var(--muted); font-size: 11px; }
.admin-ai-provider-card label { display: grid; min-width: 0; gap: 4px; color: var(--muted); font-size: 11px; }
.admin-ai-provider-card input,
.admin-ai-provider-card select { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: rgba(3, 9, 21, .78); color: var(--text); }
.admin-ai-model-description { display: grid; gap: 4px; padding: 9px 10px; border-left: 2px solid rgba(25, 230, 239, .55); border-radius: 4px; background: rgba(25, 230, 239, .055); }
.admin-ai-model-description strong { color: var(--text); font-size: 11px; }
.admin-ai-model-description p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.admin-ai-provider-card small { overflow-wrap: anywhere; font-size: 10px; }
.admin-ai-provider-card .status-chip { font-size: 9px; }
.admin-ai-provider-card .status-chip.is-configured { color: #83f4bf; }
.admin-secret-input { display: flex; min-width: 0; align-items: center; gap: 6px; }
.admin-secret-input input { flex: 1 1 auto; }
.admin-secret-input .icon-button { flex: 0 0 34px; width: 34px; height: 34px; }
.admin-ai-provider-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.admin-ai-provider-test { display: flex; align-items: flex-start; gap: 5px; color: #83f4bf; }
.admin-ai-provider-footnote { margin: 0; font-size: 10px; }
.admin-ai-cover-generator { display: grid; min-width: 0; grid-column: 1 / -1; gap: 9px; padding: 12px; border: 1px solid rgba(25, 230, 239, .25); border-radius: 8px; background: rgba(7, 29, 42, .42); }
.admin-ai-cover-generator h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 3px; font-size: 12px; }
.admin-ai-cover-generator p { margin: 0; color: var(--muted); font-size: 11px; }
.admin-ai-cover-generator > .admin-alert { margin: 0; }
.admin-ai-cover-preview { display: grid; justify-items: start; gap: 8px; }
.admin-ai-cover-preview img { width: min(100%, 560px); aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; }
.admin-ai-site-capture { display: grid; width: 100%; max-width: 100%; min-width: 0; grid-column: 1 / -1; justify-self: stretch; gap: 9px; margin: 8px 0 !important; padding: 12px; box-sizing: border-box; border: 1px solid rgba(138, 92, 255, .28); border-radius: 8px; background: rgba(26, 19, 51, .32); overflow: hidden; }
.admin-ai-site-capture h3 { display: flex; align-items: center; gap: 7px; margin: 0 0 3px; font-size: 12px; }
.admin-ai-site-capture p { margin: 0; color: var(--muted); font-size: 11px; }
.admin-ai-site-capture > .admin-gemini-consent { width: 100%; max-width: 100%; grid-column: 1 / -1; box-sizing: border-box; } .admin-ai-site-capture-controls { display: flex; width: 100%; max-width: 100%; flex-wrap: wrap; align-items: end; gap: 9px; }
.admin-ai-site-capture-controls label { display: grid; width: 100%; max-width: 100%; min-width: 0; gap: 4px; color: var(--muted); font-size: 11px; }
.admin-ai-site-capture-controls select { min-height: 36px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: rgba(3, 9, 21, .78); color: var(--text); }
.admin-ai-site-capture-preview { display: grid; justify-items: start; gap: 8px; }
.admin-ai-site-capture-preview img { width: min(100%, 720px); max-height: 70vh; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: rgba(2, 8, 18, .72); }
.admin-ai-site-capture-preview small { max-width: 100%; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.admin-github-accounts { display: grid; min-width: 0; gap: 9px; padding: 10px; border: 1px solid rgba(74, 131, 204, .22); border-radius: 7px; background: rgba(4, 12, 28, .3); }
.admin-github-accounts > p { margin: 0; font-size: 10px; }
.admin-github-accounts label { display: grid; min-width: 0; gap: 4px; color: var(--muted); font-size: 11px; }
.admin-github-accounts input { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: rgba(3, 9, 21, .78); color: var(--text); }
.admin-github-account-list { display: grid; gap: 6px; }
.admin-github-account { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: rgba(3, 9, 21, .3); }
.admin-github-account > span { display: inline-flex; min-width: 0; align-items: center; gap: 7px; overflow-wrap: anywhere; font-size: 11px; }
.analytics-table { max-width: 100%; margin: 14px 0; overflow-x: auto; }
.analytics-table > h2 { font-size: 13px; }

html[data-theme='light'] .admin-gemini-assistant {
  border-color: rgba(111, 76, 182, .28);
  background: linear-gradient(135deg, rgba(237, 232, 249, .92), rgba(220, 229, 241, .92));
}
html[data-theme='light'] .admin-gemini-prompt textarea { background: rgba(255, 255, 255, .86); }
html[data-theme='light'] .admin-gemini-model-description { display: grid; gap: 4px; padding: 8px 10px; border-left: 2px solid rgba(184,154,255,.6); border-radius: 4px; background: rgba(138,92,255,.08); }
.admin-gemini-model-description strong { font-size: 11px; }
.admin-gemini-model-description p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.admin-gemini-model { color: #5e439a; }
html[data-theme='light'] .admin-gemini-draft { background: rgba(220, 245, 232, .85); }
html[data-theme='light'] .admin-gemini-history > button { background: rgba(255, 255, 255, .7); }
html[data-theme='light'] .admin-gemini-provider select,
html[data-theme='light'] .admin-ai-provider-card input,
html[data-theme='light'] .admin-ai-provider-card select { background: rgba(255, 255, 255, .88); }
html[data-theme='light'] .admin-ai-provider-card { background: rgba(255, 255, 255, .58); }
html[data-theme='light'] .admin-ai-cover-generator { background: rgba(223, 244, 246, .7); }
html[data-theme='light'] .admin-ai-site-capture { background: rgba(237, 232, 249, .7); }
html[data-theme='light'] .admin-ai-site-capture-controls select { background: rgba(255, 255, 255, .88); }
html[data-theme='light'] .admin-github-accounts { background: rgba(255, 255, 255, .35); }
html[data-theme='light'] .admin-github-accounts input { background: rgba(255, 255, 255, .88); }
html[data-theme='light'] .admin-github-account { background: rgba(255, 255, 255, .65); }

@media (max-width: 560px) {
  .admin-gemini-assistant { padding: 11px; }
  .record-section-guide { padding: 12px; }
  .record-section-guide-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .admin-gemini-consent { width: 100% !important; max-width: 100% !important; grid-column: 1 / -1; }
  .admin-gemini-consent > span { flex: 1 1 0 !important; width: auto !important; max-width: calc(100% - 24px) !important; min-width: 0 !important; }
  .admin-ai-provider-panel { padding: 11px; }
  .admin-ai-provider-panel > header { display: grid; }
  .admin-ai-provider-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-ai-provider-actions > .button { flex: 1 1 auto; justify-content: center; }
  .admin-ai-site-capture-controls { align-items: stretch; flex-direction: column; }
  .admin-ai-site-capture-controls label { min-width: 0; }
  .admin-ai-site-capture-controls > .button { justify-content: center; }
  .admin-gemini-draft dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .admin-gemini-history > button { display: grid; gap: 3px; }
  .admin-gemini-history > button small { white-space: normal; }
  .gallery-editor-toolbar > div > .button { flex: 1 1 auto; }
}

@media (max-width: 560px) {
  .editor-dialog { width: 100%; max-height: 96dvh; padding: 14px; }
  .editor-actions { bottom: -14px; margin: 8px -14px -14px; padding: 10px 14px max(10px, env(safe-area-inset-bottom)); }
  .editor-actions-spacer { display: none; }
  .editor-actions .button { flex: 1 1 auto; justify-content: center; }
  .project-category-options { grid-template-columns: minmax(0, 1fr); max-height: min(30dvh, 240px); }
  .technology-slot-apply { align-items: stretch; }
  .technology-slot-apply > * { flex: 1 1 100%; }
  .project-detail--editorial > .project-detail-description { padding-left: 12px; }
}

.admin-toolbar-actions { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.admin-identity-chip { max-width: min(320px, 42vw); overflow: hidden; }
.admin-identity-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.admin-greeting {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid rgba(39, 187, 255, .28);
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(14, 42, 75, .72), rgba(30, 20, 67, .5));
}
.admin-greeting h2 { margin: 7px 0 4px; color: var(--text); font-size: clamp(22px, 3vw, 30px); line-height: 1.2; overflow-wrap: anywhere; }
.admin-greeting p { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.admin-greeting p strong { color: var(--text); }
.admin-greeting-role { flex: 0 0 auto; padding: 5px 9px; border: 1px solid rgba(25, 230, 239, .27); border-radius: 99px; color: var(--cyan); font: 10px var(--mono); white-space: nowrap; }

html[data-theme='light'] .admin-greeting {
  border-color: rgba(8, 126, 139, .25);
  background: linear-gradient(120deg, rgba(230, 243, 249, .96), rgba(238, 233, 250, .96));
}
html[data-theme='light'] .admin-greeting h2,
html[data-theme='light'] .admin-greeting p strong { color: #17233a; }
html[data-theme='light'] .admin-greeting-role { color: #087e8b; }

@media (max-width: 720px) {
  .admin-toolbar-actions { width: 100%; justify-content: flex-start; }
}
@media (max-width: 520px) {
  .admin-greeting { flex-direction: column; gap: 10px; padding: 15px; }
  .admin-identity-chip { max-width: min(240px, 62vw); }
}

@keyframes nav-link-enter {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.site-shell {
  background: transparent !important;
}

.site-shell::before {
  display: none !important;
}

.site-shell::after {
  background: url('/images/neon-workspace-dark.webp') center / cover no-repeat !important;
  filter: none !important;
  opacity: 1 !important;
}

.rich-text-editor {
  --rte-surface: rgba(3, 9, 21, 0.9);
  --rte-toolbar: rgba(7, 17, 35, 0.96);
  --rte-border: rgba(74, 134, 193, 0.42);
  display: grid;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--rte-border);
  border-radius: 9px;
  background: var(--rte-surface);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.rich-text-editor:focus-within,
.rich-text-editor.is-focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 15%, transparent), 0 12px 30px rgba(0, 0, 0, 0.2);
}

.rich-text-editor.is-dragover {
  border-color: var(--cyan);
  background: color-mix(in srgb, var(--rte-surface) 82%, var(--cyan));
}

.rich-text-editor__label {
  margin: 0;
  padding: 11px 13px 9px;
  color: var(--text);
  font: 600 13px/1.45 var(--sans);
}

.rich-text-editor__required {
  margin-left: 3px;
  color: var(--danger);
}

.rich-text-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border-block: 1px solid rgba(74, 134, 193, 0.2);
  background: var(--rte-toolbar);
}

.rich-text-editor__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.rich-text-editor__divider {
  width: 1px;
  height: 23px;
  margin-inline: 2px;
  background: rgba(120, 157, 195, 0.28);
}

.rich-text-editor__btn {
  display: inline-grid;
  flex: 0 0 34px;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #b7c8dc;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.rich-text-editor__btn svg {
  width: 16px;
  height: 16px;
}

.rich-text-editor__btn:hover:not(:disabled),
.rich-text-editor__btn.is-active {
  border-color: rgba(25, 230, 239, 0.34);
  background: rgba(25, 230, 239, 0.11);
  color: var(--cyan-soft);
}

.rich-text-editor__btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 1px;
}

.rich-text-editor__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.rich-text-editor__btn--text {
  display: inline-flex;
  flex: 0 0 auto;
  width: auto;
  min-width: 68px;
  padding-inline: 10px;
  border-color: var(--rte-border);
  color: var(--text);
  font-size: 11px;
}

.rich-text-editor__popover {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(74, 134, 193, 0.2);
  background: rgba(7, 17, 35, 0.78);
}

.rich-text-editor__input {
  flex: 1 1 210px;
  width: min(100%, 360px);
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--rte-border);
  border-radius: 6px;
  background: var(--rte-surface);
  color: var(--text);
  font-size: 12px;
}

.rich-text-editor__palette {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.rich-text-editor__swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.rich-text-editor__content {
  width: 100%;
  min-width: 0;
  min-height: var(--rte-min-height, 160px);
  max-height: min(42vh, 380px);
  overflow: auto;
  padding: 13px 15px;
  outline: none;
  background: transparent;
  color: var(--text);
  font: 14px/1.75 var(--sans);
  overflow-wrap: anywhere;
  cursor: text;
  scrollbar-color: color-mix(in srgb, var(--cyan) 68%, var(--violet)) var(--rte-toolbar);
  scrollbar-width: thin;
}

.rich-text-editor__content::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.rich-text-editor__content::-webkit-scrollbar-track {
  background: var(--rte-toolbar);
}

.rich-text-editor__content::-webkit-scrollbar-thumb {
  border: 2px solid var(--rte-toolbar);
  border-radius: 99px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
}

.rich-text-editor__content > :first-child {
  margin-top: 0;
}

.rich-text-editor__content > :last-child {
  margin-bottom: 0;
}

.rich-text-editor__content p,
.rich-text-editor__content ul,
.rich-text-editor__content ol,
.rich-text-editor__content blockquote,
.rich-text-editor__content pre {
  margin-block: 0 0.8em;
}

.rich-text-editor__content h2,
.rich-text-editor__content h3,
.rich-text-editor__content h4 {
  margin-block: 1em 0.45em;
  color: var(--text);
  line-height: 1.35;
}

.rich-text-editor__content h2 { font-size: 1.35em; }
.rich-text-editor__content h3 { font-size: 1.18em; }
.rich-text-editor__content h4 { font-size: 1.05em; }

.rich-text-editor__content ul,
.rich-text-editor__content ol {
  padding-left: 1.5em;
}

.rich-text-editor__content blockquote {
  padding: 7px 12px;
  border-left: 3px solid var(--cyan);
  color: var(--muted);
}

.rich-text-editor__content pre {
  overflow-x: auto;
  padding: 11px 13px;
  border: 1px solid var(--rte-border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  font: 12px/1.6 var(--mono);
}

.rich-text-editor__content a {
  color: var(--cyan-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.rich-text-editor__content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-block: 10px;
  border: 1px solid var(--rte-border);
  border-radius: 6px;
}

.rich-text-editor__content p.is-editor-empty:first-child::before {
  float: left;
  height: 0;
  color: var(--muted);
  content: attr(data-placeholder);
  opacity: 0.78;
  pointer-events: none;
}

.rich-text-editor__content .has-focus {
  border-radius: 2px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--cyan) 24%, transparent);
}

.rich-text-editor__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  min-width: 0;
  padding: 8px 12px;
  border-top: 1px solid rgba(74, 134, 193, 0.2);
  background: rgba(7, 17, 35, 0.52);
  color: var(--muted);
  font: 10px/1.5 var(--mono);
}

.rich-text-editor__footer > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.rich-text-editor__hint {
  color: var(--muted);
}

.rich-text-editor__counter--over {
  color: var(--danger);
}

.rich-text-editor.is-disabled {
  opacity: 0.72;
}

.rich-text-editor.is-disabled .rich-text-editor__content {
  cursor: default;
}

.rich-text-editor.is-focus {
  position: fixed;
  z-index: 45;
  inset: clamp(12px, 4vh, 42px) clamp(12px, 6vw, 80px);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  max-height: none;
  overflow: auto;
  background: var(--bg);
  box-shadow: 0 0 0 100vmax rgba(1, 5, 14, 0.78), 0 24px 80px rgba(0, 0, 0, 0.45);
}

.rich-text-editor.is-focus .rich-text-editor__content {
  max-height: none;
  min-height: 0;
}

html[data-theme='light'] .rich-text-editor {
  --rte-surface: rgba(255, 255, 255, 0.96);
  --rte-toolbar: rgba(235, 242, 250, 0.96);
  --rte-border: rgba(24, 94, 145, 0.28);
  box-shadow: 0 8px 24px rgba(34, 62, 96, 0.08);
}

html[data-theme='light'] .rich-text-editor__btn {
  color: #40546c;
}

html[data-theme='light'] .rich-text-editor__btn:hover:not(:disabled),
html[data-theme='light'] .rich-text-editor__btn.is-active {
  color: #07596e;
}

html[data-theme='light'] .rich-text-editor__content pre {
  background: rgba(226, 234, 244, 0.72);
}

@media (max-width: 720px) {
  .rich-text-editor__toolbar {
    gap: 5px;
    padding: 7px;
  }

  .rich-text-editor__group {
    gap: 2px;
  }

  .rich-text-editor__btn {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
  }
}

@media (max-width: 480px) {
  .rich-text-editor__label {
    padding: 10px 11px 8px;
  }

  .rich-text-editor__toolbar {
    gap: 4px;
    padding: 6px;
  }

  .rich-text-editor__divider {
    height: 19px;
    margin-inline: 1px;
  }

  .rich-text-editor__btn {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
  }

  .rich-text-editor__content {
    min-height: max(148px, var(--rte-min-height, 160px));
    max-height: 30vh;
    padding: 11px 12px;
    font-size: 13px;
  }

  .rich-text-editor__popover {
    align-items: stretch;
  }

  .rich-text-editor__input {
    flex-basis: 100%;
    width: 100%;
  }

  .rich-text-editor__footer {
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rich-text-editor,
  .rich-text-editor__btn {
    transition: none;
  }
}

.hero-stage::before,
.hero-stage::after {
  display: none !important;
}

html[data-theme='light'] .site-shell {
  background: transparent !important;
}

html[data-theme='light'] .site-shell::after {
  background: url('/images/neon-workspace-light.webp') center / cover no-repeat !important;
  filter: none !important;
  opacity: 1 !important;
}

.admin-page {
  background: url('/images/neon-workspace-dark.webp') center / cover fixed no-repeat !important;
}

html[data-theme='light'] .admin-page {
  background: url('/images/neon-workspace-light.webp') center / cover fixed no-repeat !important;
}

html[data-theme='light'] .site-shell .window,
html[data-theme='light'] .site-shell .project-card,
html[data-theme='light'] .site-shell .project-feature,
html[data-theme='light'] .site-shell .content-panel,
html[data-theme='light'] .site-shell .timeline-card,
html[data-theme='light'] .site-shell .technology-card,
html[data-theme='light'] .site-shell .ai-tool-card,
html[data-theme='light'] .site-shell .achievement-card,
html[data-theme='light'] .site-shell .certification-card,
html[data-theme='light'] .site-shell .contact-card,
html[data-theme='light'] .site-shell .tech-window,
html[data-theme='light'] .site-shell .info-window {
  background: rgba(198, 213, 232, 0.78) !important;
}

html[data-theme='light'] .site-shell .project-card {
  background: rgba(177, 198, 223, 0.82) !important;
}

html[data-theme='light'] .site-shell .project-card:hover {
  background: rgba(160, 186, 216, 0.92) !important;
}

html[data-theme='light'] .site-shell .window-bar {
  background: rgba(183, 201, 224, 0.78);
}

html[data-theme='light'] .site-shell :is(
  main h1,
  main h2,
  main h3,
  main h4,
  main p,
  main span:not(.gradient-text),
  main small,
  main strong,
  main em,
  main li,
  main dt,
  main dd,
  main label,
  main a,
  main button,
  main figcaption,
  main blockquote,
  main time
) {
  color: #17243a !important;
}

html[data-theme='light'] .site-shell main :is(
  .eyebrow,
  .prompt,
  .file-icon,
  .ai-type-heading,
  .certification-icon,
  .certification-issuer,
  .privacy-copy a,
  .privacy-notice a,
  .button.secondary:hover,
  .project-back:hover,
  .gallery-cover-badge,
  .latest-activity > strong,
  .ai-tool-meta a,
  .ai-tool-type,
  .hero-main .lead strong
) {
  color: #006b75 !important;
}

html[data-theme='light'] .site-shell main :is(a.button, button, input, textarea, select) {
  color: #17243a !important;
}

html[data-theme='light'] .topbar .status-chip {
  color: #166534;
}

html[data-theme='light'] .site-shell main .route-page :is(.section-head, .section-sub, .ai-intro) {
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.92), 0 0 6px rgba(255, 255, 255, 0.68);
}

html[data-theme='light'] .site-shell main .gradient-text {
  color: transparent !important;
  -webkit-text-stroke: 0 !important;
  text-shadow: none !important;
}

html[data-theme='light'] .topbar .nav-links a {
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

html[data-theme='light'] .topbar .nav-links a:hover,
html[data-theme='light'] .topbar .nav-links a.active {
  background: rgba(111, 145, 184, 0.24);
  border-color: rgba(37, 73, 112, 0.18);
  color: #07596e;
}

html[data-theme='light'] .topbar .theme-toggle,
html[data-theme='light'] .topbar .nav-mobile {
  background: rgba(177, 196, 219, 0.82);
  border: 1px solid rgba(37, 73, 112, 0.3);
  border-radius: 9px;
  color: #24425d;
}

html[data-theme='light'] .topbar .nav-mobile {
  padding: 5px;
}

@media (max-width: 720px) {
  .site-shell::after {
    position: fixed !important;
    inset: 0 !important;
    z-index: 0 !important;
    background: url('/images/fond_mobile/fond_mobile_sombre.webp') center / cover no-repeat !important;
    background-attachment: fixed !important;
    transform: none !important;
    pointer-events: none;
  }

  html[data-theme='light'] .site-shell::after {
    background-image: url('/images/fond_mobile/fond_mobile_clair.webp') !important;
    background-attachment: fixed !important;
  }
}

@media (max-width: 560px) {
  .admin-settings-group { padding: 12px; }
  .admin-settings-group > summary {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding-right: 24px;
  }
  .admin-settings-group > summary::after { position: absolute; top: 0; right: 0; }
  .floating-icon-tuners { grid-template-columns: minmax(0, 1fr); padding: 10px; }
}

@keyframes adminPageEnter {
  from { opacity: 0; transform: translate3d(12px, 8px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes adminBoxEnter {
  from { opacity: 0; transform: translate3d(0, 10px, 0) scale(.992); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

html.admin-smooth-scroll { scroll-behavior: smooth; }
html.admin-motion-disabled .route-enter-active,
html.admin-motion-disabled .route-leave-active { transition-duration: .01ms !important; }
.admin-page--smooth-scroll { scroll-behavior: smooth; }
.admin-page:not(.admin-page--no-page-motion) .admin-content {
  animation: adminPageEnter 260ms cubic-bezier(.2,.75,.25,1) both;
}
.admin-page:not(.admin-page--no-box-motion) :is(.stat-card,.project-folder-card,.project-list-row,.project-document-window,.admin-stats > *,.admin-gemini-draft,.admin-settings-group,.admin-empty) {
  animation: adminBoxEnter 280ms cubic-bezier(.2,.75,.25,1) both;
}
.admin-page:not(.admin-page--no-box-motion) :is(.project-folder-card,.project-list-row,.project-document-window,.stat-card):nth-child(2) { animation-delay: 40ms; }
.admin-page:not(.admin-page--no-box-motion) :is(.project-folder-card,.project-list-row,.project-document-window,.stat-card):nth-child(3) { animation-delay: 80ms; }
.admin-page:not(.admin-page--no-box-motion) :is(.project-folder-card,.project-list-row,.project-document-window,.stat-card):nth-child(4) { animation-delay: 120ms; }
.admin-page .admin-pagination { position: sticky; bottom: 10px; z-index: 3; background: rgba(3, 7, 17, .94); backdrop-filter: blur(12px); }
.admin-pagination .icon-button.selected { border-color: var(--cyan); color: var(--cyan); background: rgba(25,230,239,.12); }
.admin-page--no-page-motion .admin-content,
.admin-page--no-page-motion .admin-content *,
.admin-page--no-box-motion .admin-content,
.admin-page--no-box-motion .admin-content * { animation: none !important; transition-duration: .01ms !important; }
html.admin-motion-disabled .route-enter-from,
html.admin-motion-disabled .route-leave-to { opacity: 1; filter: none; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .admin-page .admin-content,
  .admin-page :is(.stat-card,.project-folder-card,.project-list-row,.project-document-window,.admin-gemini-draft,.admin-settings-group,.admin-empty) { animation: none !important; }
  html.admin-smooth-scroll { scroll-behavior: auto; }
}

select {
  color-scheme: dark;
}

select option,
select optgroup {
  background-color: #071329;
  color: #e5f2ff;
}

select option:checked {
  background-color: #0b5967;
  color: #f0feff;
}

@media (max-width: 720px) {
  .site-shell:not(.admin-page) .eyebrow::before {
    animation: none;
  }

  .site-shell:after {
    filter: none;
    background-attachment: scroll !important;
  }

  .hero-stage:before {
    background-image:
      linear-gradient(90deg, rgba(3, 7, 17, 0.72), rgba(3, 7, 17, 0.48) 45%, rgba(3, 7, 17, 0.74)),
      linear-gradient(0deg, #030711, rgba(3, 7, 17, 0.25) 55%, #030711);
    filter: none;
  }

  html[data-public-site='true'] .public-ambient-backdrop,
  html[data-public-site='true'] .public-maze-canvas,
  html[data-public-site='true'] .floating-tech-icons,
  html[data-public-site='true'] .public-light-veil {
    display: none !important;
  }

  .site-shell .window,
  .site-shell .project-card,
  .site-shell .project-feature,
  .site-shell .achievement-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  html[data-public-site='true'] .route-enter-active,
  html[data-public-site='true'] .route-leave-active {
    will-change: auto;
    transition: none !important;
  }

  html[data-public-site='true'] .route-enter-from,
  html[data-public-site='true'] .route-leave-to {
    filter: none;
    transform: none;
  }

  html[data-theme='light'] .site-shell:after {
    background-attachment: scroll !important;
  }

  html[data-theme='light'] .hero-stage:before {
    background-image:
      linear-gradient(90deg, rgba(241, 246, 253, 0.72), rgba(241, 246, 253, 0.45) 45%, rgba(241, 246, 253, 0.74)),
      linear-gradient(0deg, #f2f6fc, rgba(241, 246, 253, 0.22) 55%, #f2f6fc);
  }
}

html[data-theme='light'] select {
  color-scheme: light;
}

html[data-theme='light'] select option,
html[data-theme='light'] select optgroup {
  background-color: #edf3fa;
  color: #17243a;
}

html[data-theme='light'] select option:checked {
  background-color: #c5e8eb;
  color: #123d48;
}
