@charset "UTF-8";@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;800;900&family=Newsreader:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');/*!
 * animate.css - https://animate.style/
 * Version - 4.1.1
 * Licensed under the MIT license - http://opensource.org/licenses/MIT
 *
 * Copyright (c) 2020 Animate.css
 */
:root {
  --animate-duration: 1s;
  --animate-delay: 1s;
  --animate-repeat: 1;
}
.animate__animated {
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
  -webkit-animation-duration: var(--animate-duration);
  animation-duration: var(--animate-duration);
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}
.animate__animated.animate__infinite {
  -webkit-animation-iteration-count: infinite;
  animation-iteration-count: infinite;
}
.animate__animated.animate__repeat-1 {
  -webkit-animation-iteration-count: 1;
  animation-iteration-count: 1;
  -webkit-animation-iteration-count: var(--animate-repeat);
  animation-iteration-count: var(--animate-repeat);
}
.animate__animated.animate__repeat-2 {
  -webkit-animation-iteration-count: calc(1 * 2);
  animation-iteration-count: calc(1 * 2);
  -webkit-animation-iteration-count: calc(var(--animate-repeat) * 2);
  animation-iteration-count: calc(var(--animate-repeat) * 2);
}
.animate__animated.animate__repeat-3 {
  -webkit-animation-iteration-count: calc(1 * 3);
  animation-iteration-count: calc(1 * 3);
  -webkit-animation-iteration-count: calc(var(--animate-repeat) * 3);
  animation-iteration-count: calc(var(--animate-repeat) * 3);
}
.animate__animated.animate__delay-1s {
  -webkit-animation-delay: 1s;
  animation-delay: 1s;
  -webkit-animation-delay: var(--animate-delay);
  animation-delay: var(--animate-delay);
}
.animate__animated.animate__delay-2s {
  -webkit-animation-delay: calc(1s * 2);
  animation-delay: calc(1s * 2);
  -webkit-animation-delay: calc(var(--animate-delay) * 2);
  animation-delay: calc(var(--animate-delay) * 2);
}
.animate__animated.animate__delay-3s {
  -webkit-animation-delay: calc(1s * 3);
  animation-delay: calc(1s * 3);
  -webkit-animation-delay: calc(var(--animate-delay) * 3);
  animation-delay: calc(var(--animate-delay) * 3);
}
.animate__animated.animate__delay-4s {
  -webkit-animation-delay: calc(1s * 4);
  animation-delay: calc(1s * 4);
  -webkit-animation-delay: calc(var(--animate-delay) * 4);
  animation-delay: calc(var(--animate-delay) * 4);
}
.animate__animated.animate__delay-5s {
  -webkit-animation-delay: calc(1s * 5);
  animation-delay: calc(1s * 5);
  -webkit-animation-delay: calc(var(--animate-delay) * 5);
  animation-delay: calc(var(--animate-delay) * 5);
}
.animate__animated.animate__faster {
  -webkit-animation-duration: calc(1s / 2);
  animation-duration: calc(1s / 2);
  -webkit-animation-duration: calc(var(--animate-duration) / 2);
  animation-duration: calc(var(--animate-duration) / 2);
}
.animate__animated.animate__fast {
  -webkit-animation-duration: calc(1s * 0.8);
  animation-duration: calc(1s * 0.8);
  -webkit-animation-duration: calc(var(--animate-duration) * 0.8);
  animation-duration: calc(var(--animate-duration) * 0.8);
}
.animate__animated.animate__slow {
  -webkit-animation-duration: calc(1s * 2);
  animation-duration: calc(1s * 2);
  -webkit-animation-duration: calc(var(--animate-duration) * 2);
  animation-duration: calc(var(--animate-duration) * 2);
}
.animate__animated.animate__slower {
  -webkit-animation-duration: calc(1s * 3);
  animation-duration: calc(1s * 3);
  -webkit-animation-duration: calc(var(--animate-duration) * 3);
  animation-duration: calc(var(--animate-duration) * 3);
}
@media print, (prefers-reduced-motion: reduce) {
  .animate__animated {
    -webkit-animation-duration: 1ms !important;
    animation-duration: 1ms !important;
    -webkit-transition-duration: 1ms !important;
    transition-duration: 1ms !important;
    -webkit-animation-iteration-count: 1 !important;
    animation-iteration-count: 1 !important;
  }

  .animate__animated[class*='Out'] {
    opacity: 0;
  }
}
/* Attention seekers  */
@-webkit-keyframes bounce {
  from,
  20%,
  53%,
  to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  40%,
  43% {
    -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    -webkit-transform: translate3d(0, -30px, 0) scaleY(1.1);
    transform: translate3d(0, -30px, 0) scaleY(1.1);
  }

  70% {
    -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    -webkit-transform: translate3d(0, -15px, 0) scaleY(1.05);
    transform: translate3d(0, -15px, 0) scaleY(1.05);
  }

  80% {
    -webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    -webkit-transform: translate3d(0, 0, 0) scaleY(0.95);
    transform: translate3d(0, 0, 0) scaleY(0.95);
  }

  90% {
    -webkit-transform: translate3d(0, -4px, 0) scaleY(1.02);
    transform: translate3d(0, -4px, 0) scaleY(1.02);
  }
}
@keyframes bounce {
  from,
  20%,
  53%,
  to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  40%,
  43% {
    -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    -webkit-transform: translate3d(0, -30px, 0) scaleY(1.1);
    transform: translate3d(0, -30px, 0) scaleY(1.1);
  }

  70% {
    -webkit-animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
    -webkit-transform: translate3d(0, -15px, 0) scaleY(1.05);
    transform: translate3d(0, -15px, 0) scaleY(1.05);
  }

  80% {
    -webkit-transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    -webkit-transform: translate3d(0, 0, 0) scaleY(0.95);
    transform: translate3d(0, 0, 0) scaleY(0.95);
  }

  90% {
    -webkit-transform: translate3d(0, -4px, 0) scaleY(1.02);
    transform: translate3d(0, -4px, 0) scaleY(1.02);
  }
}
.animate__bounce {
  -webkit-animation-name: bounce;
  animation-name: bounce;
  -webkit-transform-origin: center bottom;
  transform-origin: center bottom;
}
@-webkit-keyframes flash {
  from,
  50%,
  to {
    opacity: 1;
  }

  25%,
  75% {
    opacity: 0;
  }
}
@keyframes flash {
  from,
  50%,
  to {
    opacity: 1;
  }

  25%,
  75% {
    opacity: 0;
  }
}
.animate__flash {
  -webkit-animation-name: flash;
  animation-name: flash;
}
/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
@-webkit-keyframes pulse {
  from {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }

  50% {
    -webkit-transform: scale3d(1.05, 1.05, 1.05);
    transform: scale3d(1.05, 1.05, 1.05);
  }

  to {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}
@keyframes pulse {
  from {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }

  50% {
    -webkit-transform: scale3d(1.05, 1.05, 1.05);
    transform: scale3d(1.05, 1.05, 1.05);
  }

  to {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}
.animate__pulse {
  -webkit-animation-name: pulse;
  animation-name: pulse;
  -webkit-animation-timing-function: ease-in-out;
  animation-timing-function: ease-in-out;
}
@-webkit-keyframes rubberBand {
  from {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }

  30% {
    -webkit-transform: scale3d(1.25, 0.75, 1);
    transform: scale3d(1.25, 0.75, 1);
  }

  40% {
    -webkit-transform: scale3d(0.75, 1.25, 1);
    transform: scale3d(0.75, 1.25, 1);
  }

  50% {
    -webkit-transform: scale3d(1.15, 0.85, 1);
    transform: scale3d(1.15, 0.85, 1);
  }

  65% {
    -webkit-transform: scale3d(0.95, 1.05, 1);
    transform: scale3d(0.95, 1.05, 1);
  }

  75% {
    -webkit-transform: scale3d(1.05, 0.95, 1);
    transform: scale3d(1.05, 0.95, 1);
  }

  to {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}
@keyframes rubberBand {
  from {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }

  30% {
    -webkit-transform: scale3d(1.25, 0.75, 1);
    transform: scale3d(1.25, 0.75, 1);
  }

  40% {
    -webkit-transform: scale3d(0.75, 1.25, 1);
    transform: scale3d(0.75, 1.25, 1);
  }

  50% {
    -webkit-transform: scale3d(1.15, 0.85, 1);
    transform: scale3d(1.15, 0.85, 1);
  }

  65% {
    -webkit-transform: scale3d(0.95, 1.05, 1);
    transform: scale3d(0.95, 1.05, 1);
  }

  75% {
    -webkit-transform: scale3d(1.05, 0.95, 1);
    transform: scale3d(1.05, 0.95, 1);
  }

  to {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}
.animate__rubberBand {
  -webkit-animation-name: rubberBand;
  animation-name: rubberBand;
}
@-webkit-keyframes shakeX {
  from,
  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    -webkit-transform: translate3d(-10px, 0, 0);
    transform: translate3d(-10px, 0, 0);
  }

  20%,
  40%,
  60%,
  80% {
    -webkit-transform: translate3d(10px, 0, 0);
    transform: translate3d(10px, 0, 0);
  }
}
@keyframes shakeX {
  from,
  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    -webkit-transform: translate3d(-10px, 0, 0);
    transform: translate3d(-10px, 0, 0);
  }

  20%,
  40%,
  60%,
  80% {
    -webkit-transform: translate3d(10px, 0, 0);
    transform: translate3d(10px, 0, 0);
  }
}
.animate__shakeX {
  -webkit-animation-name: shakeX;
  animation-name: shakeX;
}
@-webkit-keyframes shakeY {
  from,
  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    -webkit-transform: translate3d(0, -10px, 0);
    transform: translate3d(0, -10px, 0);
  }

  20%,
  40%,
  60%,
  80% {
    -webkit-transform: translate3d(0, 10px, 0);
    transform: translate3d(0, 10px, 0);
  }
}
@keyframes shakeY {
  from,
  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  10%,
  30%,
  50%,
  70%,
  90% {
    -webkit-transform: translate3d(0, -10px, 0);
    transform: translate3d(0, -10px, 0);
  }

  20%,
  40%,
  60%,
  80% {
    -webkit-transform: translate3d(0, 10px, 0);
    transform: translate3d(0, 10px, 0);
  }
}
.animate__shakeY {
  -webkit-animation-name: shakeY;
  animation-name: shakeY;
}
@-webkit-keyframes headShake {
  0% {
    -webkit-transform: translateX(0);
    transform: translateX(0);
  }

  6.5% {
    -webkit-transform: translateX(-6px) rotateY(-9deg);
    transform: translateX(-6px) rotateY(-9deg);
  }

  18.5% {
    -webkit-transform: translateX(5px) rotateY(7deg);
    transform: translateX(5px) rotateY(7deg);
  }

  31.5% {
    -webkit-transform: translateX(-3px) rotateY(-5deg);
    transform: translateX(-3px) rotateY(-5deg);
  }

  43.5% {
    -webkit-transform: translateX(2px) rotateY(3deg);
    transform: translateX(2px) rotateY(3deg);
  }

  50% {
    -webkit-transform: translateX(0);
    transform: translateX(0);
  }
}
@keyframes headShake {
  0% {
    -webkit-transform: translateX(0);
    transform: translateX(0);
  }

  6.5% {
    -webkit-transform: translateX(-6px) rotateY(-9deg);
    transform: translateX(-6px) rotateY(-9deg);
  }

  18.5% {
    -webkit-transform: translateX(5px) rotateY(7deg);
    transform: translateX(5px) rotateY(7deg);
  }

  31.5% {
    -webkit-transform: translateX(-3px) rotateY(-5deg);
    transform: translateX(-3px) rotateY(-5deg);
  }

  43.5% {
    -webkit-transform: translateX(2px) rotateY(3deg);
    transform: translateX(2px) rotateY(3deg);
  }

  50% {
    -webkit-transform: translateX(0);
    transform: translateX(0);
  }
}
.animate__headShake {
  -webkit-animation-timing-function: ease-in-out;
  animation-timing-function: ease-in-out;
  -webkit-animation-name: headShake;
  animation-name: headShake;
}
@-webkit-keyframes swing {
  20% {
    -webkit-transform: rotate3d(0, 0, 1, 15deg);
    transform: rotate3d(0, 0, 1, 15deg);
  }

  40% {
    -webkit-transform: rotate3d(0, 0, 1, -10deg);
    transform: rotate3d(0, 0, 1, -10deg);
  }

  60% {
    -webkit-transform: rotate3d(0, 0, 1, 5deg);
    transform: rotate3d(0, 0, 1, 5deg);
  }

  80% {
    -webkit-transform: rotate3d(0, 0, 1, -5deg);
    transform: rotate3d(0, 0, 1, -5deg);
  }

  to {
    -webkit-transform: rotate3d(0, 0, 1, 0deg);
    transform: rotate3d(0, 0, 1, 0deg);
  }
}
@keyframes swing {
  20% {
    -webkit-transform: rotate3d(0, 0, 1, 15deg);
    transform: rotate3d(0, 0, 1, 15deg);
  }

  40% {
    -webkit-transform: rotate3d(0, 0, 1, -10deg);
    transform: rotate3d(0, 0, 1, -10deg);
  }

  60% {
    -webkit-transform: rotate3d(0, 0, 1, 5deg);
    transform: rotate3d(0, 0, 1, 5deg);
  }

  80% {
    -webkit-transform: rotate3d(0, 0, 1, -5deg);
    transform: rotate3d(0, 0, 1, -5deg);
  }

  to {
    -webkit-transform: rotate3d(0, 0, 1, 0deg);
    transform: rotate3d(0, 0, 1, 0deg);
  }
}
.animate__swing {
  -webkit-transform-origin: top center;
  transform-origin: top center;
  -webkit-animation-name: swing;
  animation-name: swing;
}
@-webkit-keyframes tada {
  from {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }

  10%,
  20% {
    -webkit-transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
    transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
  }

  30%,
  50%,
  70%,
  90% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
  }

  40%,
  60%,
  80% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
  }

  to {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}
@keyframes tada {
  from {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }

  10%,
  20% {
    -webkit-transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
    transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
  }

  30%,
  50%,
  70%,
  90% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
  }

  40%,
  60%,
  80% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
  }

  to {
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}
.animate__tada {
  -webkit-animation-name: tada;
  animation-name: tada;
}
/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
@-webkit-keyframes wobble {
  from {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  15% {
    -webkit-transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
    transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
  }

  30% {
    -webkit-transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
    transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
  }

  45% {
    -webkit-transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
    transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
  }

  60% {
    -webkit-transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
    transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
  }

  75% {
    -webkit-transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
    transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes wobble {
  from {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  15% {
    -webkit-transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
    transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg);
  }

  30% {
    -webkit-transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
    transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg);
  }

  45% {
    -webkit-transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
    transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg);
  }

  60% {
    -webkit-transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
    transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg);
  }

  75% {
    -webkit-transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
    transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__wobble {
  -webkit-animation-name: wobble;
  animation-name: wobble;
}
@-webkit-keyframes jello {
  from,
  11.1%,
  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  22.2% {
    -webkit-transform: skewX(-12.5deg) skewY(-12.5deg);
    transform: skewX(-12.5deg) skewY(-12.5deg);
  }

  33.3% {
    -webkit-transform: skewX(6.25deg) skewY(6.25deg);
    transform: skewX(6.25deg) skewY(6.25deg);
  }

  44.4% {
    -webkit-transform: skewX(-3.125deg) skewY(-3.125deg);
    transform: skewX(-3.125deg) skewY(-3.125deg);
  }

  55.5% {
    -webkit-transform: skewX(1.5625deg) skewY(1.5625deg);
    transform: skewX(1.5625deg) skewY(1.5625deg);
  }

  66.6% {
    -webkit-transform: skewX(-0.78125deg) skewY(-0.78125deg);
    transform: skewX(-0.78125deg) skewY(-0.78125deg);
  }

  77.7% {
    -webkit-transform: skewX(0.390625deg) skewY(0.390625deg);
    transform: skewX(0.390625deg) skewY(0.390625deg);
  }

  88.8% {
    -webkit-transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
    transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
  }
}
@keyframes jello {
  from,
  11.1%,
  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  22.2% {
    -webkit-transform: skewX(-12.5deg) skewY(-12.5deg);
    transform: skewX(-12.5deg) skewY(-12.5deg);
  }

  33.3% {
    -webkit-transform: skewX(6.25deg) skewY(6.25deg);
    transform: skewX(6.25deg) skewY(6.25deg);
  }

  44.4% {
    -webkit-transform: skewX(-3.125deg) skewY(-3.125deg);
    transform: skewX(-3.125deg) skewY(-3.125deg);
  }

  55.5% {
    -webkit-transform: skewX(1.5625deg) skewY(1.5625deg);
    transform: skewX(1.5625deg) skewY(1.5625deg);
  }

  66.6% {
    -webkit-transform: skewX(-0.78125deg) skewY(-0.78125deg);
    transform: skewX(-0.78125deg) skewY(-0.78125deg);
  }

  77.7% {
    -webkit-transform: skewX(0.390625deg) skewY(0.390625deg);
    transform: skewX(0.390625deg) skewY(0.390625deg);
  }

  88.8% {
    -webkit-transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
    transform: skewX(-0.1953125deg) skewY(-0.1953125deg);
  }
}
.animate__jello {
  -webkit-animation-name: jello;
  animation-name: jello;
  -webkit-transform-origin: center;
  transform-origin: center;
}
@-webkit-keyframes heartBeat {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }

  14% {
    -webkit-transform: scale(1.3);
    transform: scale(1.3);
  }

  28% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }

  42% {
    -webkit-transform: scale(1.3);
    transform: scale(1.3);
  }

  70% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}
@keyframes heartBeat {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }

  14% {
    -webkit-transform: scale(1.3);
    transform: scale(1.3);
  }

  28% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }

  42% {
    -webkit-transform: scale(1.3);
    transform: scale(1.3);
  }

  70% {
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}
.animate__heartBeat {
  -webkit-animation-name: heartBeat;
  animation-name: heartBeat;
  -webkit-animation-duration: calc(1s * 1.3);
  animation-duration: calc(1s * 1.3);
  -webkit-animation-duration: calc(var(--animate-duration) * 1.3);
  animation-duration: calc(var(--animate-duration) * 1.3);
  -webkit-animation-timing-function: ease-in-out;
  animation-timing-function: ease-in-out;
}
/* Back entrances */
@-webkit-keyframes backInDown {
  0% {
    -webkit-transform: translateY(-1200px) scale(0.7);
    transform: translateY(-1200px) scale(0.7);
    opacity: 0.7;
  }

  80% {
    -webkit-transform: translateY(0px) scale(0.7);
    transform: translateY(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes backInDown {
  0% {
    -webkit-transform: translateY(-1200px) scale(0.7);
    transform: translateY(-1200px) scale(0.7);
    opacity: 0.7;
  }

  80% {
    -webkit-transform: translateY(0px) scale(0.7);
    transform: translateY(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
}
.animate__backInDown {
  -webkit-animation-name: backInDown;
  animation-name: backInDown;
}
@-webkit-keyframes backInLeft {
  0% {
    -webkit-transform: translateX(-2000px) scale(0.7);
    transform: translateX(-2000px) scale(0.7);
    opacity: 0.7;
  }

  80% {
    -webkit-transform: translateX(0px) scale(0.7);
    transform: translateX(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes backInLeft {
  0% {
    -webkit-transform: translateX(-2000px) scale(0.7);
    transform: translateX(-2000px) scale(0.7);
    opacity: 0.7;
  }

  80% {
    -webkit-transform: translateX(0px) scale(0.7);
    transform: translateX(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
}
.animate__backInLeft {
  -webkit-animation-name: backInLeft;
  animation-name: backInLeft;
}
@-webkit-keyframes backInRight {
  0% {
    -webkit-transform: translateX(2000px) scale(0.7);
    transform: translateX(2000px) scale(0.7);
    opacity: 0.7;
  }

  80% {
    -webkit-transform: translateX(0px) scale(0.7);
    transform: translateX(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes backInRight {
  0% {
    -webkit-transform: translateX(2000px) scale(0.7);
    transform: translateX(2000px) scale(0.7);
    opacity: 0.7;
  }

  80% {
    -webkit-transform: translateX(0px) scale(0.7);
    transform: translateX(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
}
.animate__backInRight {
  -webkit-animation-name: backInRight;
  animation-name: backInRight;
}
@-webkit-keyframes backInUp {
  0% {
    -webkit-transform: translateY(1200px) scale(0.7);
    transform: translateY(1200px) scale(0.7);
    opacity: 0.7;
  }

  80% {
    -webkit-transform: translateY(0px) scale(0.7);
    transform: translateY(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes backInUp {
  0% {
    -webkit-transform: translateY(1200px) scale(0.7);
    transform: translateY(1200px) scale(0.7);
    opacity: 0.7;
  }

  80% {
    -webkit-transform: translateY(0px) scale(0.7);
    transform: translateY(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }
}
.animate__backInUp {
  -webkit-animation-name: backInUp;
  animation-name: backInUp;
}
/* Back exits */
@-webkit-keyframes backOutDown {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }

  20% {
    -webkit-transform: translateY(0px) scale(0.7);
    transform: translateY(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: translateY(700px) scale(0.7);
    transform: translateY(700px) scale(0.7);
    opacity: 0.7;
  }
}
@keyframes backOutDown {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }

  20% {
    -webkit-transform: translateY(0px) scale(0.7);
    transform: translateY(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: translateY(700px) scale(0.7);
    transform: translateY(700px) scale(0.7);
    opacity: 0.7;
  }
}
.animate__backOutDown {
  -webkit-animation-name: backOutDown;
  animation-name: backOutDown;
}
@-webkit-keyframes backOutLeft {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }

  20% {
    -webkit-transform: translateX(0px) scale(0.7);
    transform: translateX(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: translateX(-2000px) scale(0.7);
    transform: translateX(-2000px) scale(0.7);
    opacity: 0.7;
  }
}
@keyframes backOutLeft {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }

  20% {
    -webkit-transform: translateX(0px) scale(0.7);
    transform: translateX(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: translateX(-2000px) scale(0.7);
    transform: translateX(-2000px) scale(0.7);
    opacity: 0.7;
  }
}
.animate__backOutLeft {
  -webkit-animation-name: backOutLeft;
  animation-name: backOutLeft;
}
@-webkit-keyframes backOutRight {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }

  20% {
    -webkit-transform: translateX(0px) scale(0.7);
    transform: translateX(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: translateX(2000px) scale(0.7);
    transform: translateX(2000px) scale(0.7);
    opacity: 0.7;
  }
}
@keyframes backOutRight {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }

  20% {
    -webkit-transform: translateX(0px) scale(0.7);
    transform: translateX(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: translateX(2000px) scale(0.7);
    transform: translateX(2000px) scale(0.7);
    opacity: 0.7;
  }
}
.animate__backOutRight {
  -webkit-animation-name: backOutRight;
  animation-name: backOutRight;
}
@-webkit-keyframes backOutUp {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }

  20% {
    -webkit-transform: translateY(0px) scale(0.7);
    transform: translateY(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: translateY(-700px) scale(0.7);
    transform: translateY(-700px) scale(0.7);
    opacity: 0.7;
  }
}
@keyframes backOutUp {
  0% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 1;
  }

  20% {
    -webkit-transform: translateY(0px) scale(0.7);
    transform: translateY(0px) scale(0.7);
    opacity: 0.7;
  }

  100% {
    -webkit-transform: translateY(-700px) scale(0.7);
    transform: translateY(-700px) scale(0.7);
    opacity: 0.7;
  }
}
.animate__backOutUp {
  -webkit-animation-name: backOutUp;
  animation-name: backOutUp;
}
/* Bouncing entrances  */
@-webkit-keyframes bounceIn {
  from,
  20%,
  40%,
  60%,
  80%,
  to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  0% {
    opacity: 0;
    -webkit-transform: scale3d(0.3, 0.3, 0.3);
    transform: scale3d(0.3, 0.3, 0.3);
  }

  20% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1);
    transform: scale3d(1.1, 1.1, 1.1);
  }

  40% {
    -webkit-transform: scale3d(0.9, 0.9, 0.9);
    transform: scale3d(0.9, 0.9, 0.9);
  }

  60% {
    opacity: 1;
    -webkit-transform: scale3d(1.03, 1.03, 1.03);
    transform: scale3d(1.03, 1.03, 1.03);
  }

  80% {
    -webkit-transform: scale3d(0.97, 0.97, 0.97);
    transform: scale3d(0.97, 0.97, 0.97);
  }

  to {
    opacity: 1;
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}
@keyframes bounceIn {
  from,
  20%,
  40%,
  60%,
  80%,
  to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  0% {
    opacity: 0;
    -webkit-transform: scale3d(0.3, 0.3, 0.3);
    transform: scale3d(0.3, 0.3, 0.3);
  }

  20% {
    -webkit-transform: scale3d(1.1, 1.1, 1.1);
    transform: scale3d(1.1, 1.1, 1.1);
  }

  40% {
    -webkit-transform: scale3d(0.9, 0.9, 0.9);
    transform: scale3d(0.9, 0.9, 0.9);
  }

  60% {
    opacity: 1;
    -webkit-transform: scale3d(1.03, 1.03, 1.03);
    transform: scale3d(1.03, 1.03, 1.03);
  }

  80% {
    -webkit-transform: scale3d(0.97, 0.97, 0.97);
    transform: scale3d(0.97, 0.97, 0.97);
  }

  to {
    opacity: 1;
    -webkit-transform: scale3d(1, 1, 1);
    transform: scale3d(1, 1, 1);
  }
}
.animate__bounceIn {
  -webkit-animation-duration: calc(1s * 0.75);
  animation-duration: calc(1s * 0.75);
  -webkit-animation-duration: calc(var(--animate-duration) * 0.75);
  animation-duration: calc(var(--animate-duration) * 0.75);
  -webkit-animation-name: bounceIn;
  animation-name: bounceIn;
}
@-webkit-keyframes bounceInDown {
  from,
  60%,
  75%,
  90%,
  to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  0% {
    opacity: 0;
    -webkit-transform: translate3d(0, -3000px, 0) scaleY(3);
    transform: translate3d(0, -3000px, 0) scaleY(3);
  }

  60% {
    opacity: 1;
    -webkit-transform: translate3d(0, 25px, 0) scaleY(0.9);
    transform: translate3d(0, 25px, 0) scaleY(0.9);
  }

  75% {
    -webkit-transform: translate3d(0, -10px, 0) scaleY(0.95);
    transform: translate3d(0, -10px, 0) scaleY(0.95);
  }

  90% {
    -webkit-transform: translate3d(0, 5px, 0) scaleY(0.985);
    transform: translate3d(0, 5px, 0) scaleY(0.985);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes bounceInDown {
  from,
  60%,
  75%,
  90%,
  to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  0% {
    opacity: 0;
    -webkit-transform: translate3d(0, -3000px, 0) scaleY(3);
    transform: translate3d(0, -3000px, 0) scaleY(3);
  }

  60% {
    opacity: 1;
    -webkit-transform: translate3d(0, 25px, 0) scaleY(0.9);
    transform: translate3d(0, 25px, 0) scaleY(0.9);
  }

  75% {
    -webkit-transform: translate3d(0, -10px, 0) scaleY(0.95);
    transform: translate3d(0, -10px, 0) scaleY(0.95);
  }

  90% {
    -webkit-transform: translate3d(0, 5px, 0) scaleY(0.985);
    transform: translate3d(0, 5px, 0) scaleY(0.985);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__bounceInDown {
  -webkit-animation-name: bounceInDown;
  animation-name: bounceInDown;
}
@-webkit-keyframes bounceInLeft {
  from,
  60%,
  75%,
  90%,
  to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  0% {
    opacity: 0;
    -webkit-transform: translate3d(-3000px, 0, 0) scaleX(3);
    transform: translate3d(-3000px, 0, 0) scaleX(3);
  }

  60% {
    opacity: 1;
    -webkit-transform: translate3d(25px, 0, 0) scaleX(1);
    transform: translate3d(25px, 0, 0) scaleX(1);
  }

  75% {
    -webkit-transform: translate3d(-10px, 0, 0) scaleX(0.98);
    transform: translate3d(-10px, 0, 0) scaleX(0.98);
  }

  90% {
    -webkit-transform: translate3d(5px, 0, 0) scaleX(0.995);
    transform: translate3d(5px, 0, 0) scaleX(0.995);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes bounceInLeft {
  from,
  60%,
  75%,
  90%,
  to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  0% {
    opacity: 0;
    -webkit-transform: translate3d(-3000px, 0, 0) scaleX(3);
    transform: translate3d(-3000px, 0, 0) scaleX(3);
  }

  60% {
    opacity: 1;
    -webkit-transform: translate3d(25px, 0, 0) scaleX(1);
    transform: translate3d(25px, 0, 0) scaleX(1);
  }

  75% {
    -webkit-transform: translate3d(-10px, 0, 0) scaleX(0.98);
    transform: translate3d(-10px, 0, 0) scaleX(0.98);
  }

  90% {
    -webkit-transform: translate3d(5px, 0, 0) scaleX(0.995);
    transform: translate3d(5px, 0, 0) scaleX(0.995);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__bounceInLeft {
  -webkit-animation-name: bounceInLeft;
  animation-name: bounceInLeft;
}
@-webkit-keyframes bounceInRight {
  from,
  60%,
  75%,
  90%,
  to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  from {
    opacity: 0;
    -webkit-transform: translate3d(3000px, 0, 0) scaleX(3);
    transform: translate3d(3000px, 0, 0) scaleX(3);
  }

  60% {
    opacity: 1;
    -webkit-transform: translate3d(-25px, 0, 0) scaleX(1);
    transform: translate3d(-25px, 0, 0) scaleX(1);
  }

  75% {
    -webkit-transform: translate3d(10px, 0, 0) scaleX(0.98);
    transform: translate3d(10px, 0, 0) scaleX(0.98);
  }

  90% {
    -webkit-transform: translate3d(-5px, 0, 0) scaleX(0.995);
    transform: translate3d(-5px, 0, 0) scaleX(0.995);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes bounceInRight {
  from,
  60%,
  75%,
  90%,
  to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  from {
    opacity: 0;
    -webkit-transform: translate3d(3000px, 0, 0) scaleX(3);
    transform: translate3d(3000px, 0, 0) scaleX(3);
  }

  60% {
    opacity: 1;
    -webkit-transform: translate3d(-25px, 0, 0) scaleX(1);
    transform: translate3d(-25px, 0, 0) scaleX(1);
  }

  75% {
    -webkit-transform: translate3d(10px, 0, 0) scaleX(0.98);
    transform: translate3d(10px, 0, 0) scaleX(0.98);
  }

  90% {
    -webkit-transform: translate3d(-5px, 0, 0) scaleX(0.995);
    transform: translate3d(-5px, 0, 0) scaleX(0.995);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__bounceInRight {
  -webkit-animation-name: bounceInRight;
  animation-name: bounceInRight;
}
@-webkit-keyframes bounceInUp {
  from,
  60%,
  75%,
  90%,
  to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  from {
    opacity: 0;
    -webkit-transform: translate3d(0, 3000px, 0) scaleY(5);
    transform: translate3d(0, 3000px, 0) scaleY(5);
  }

  60% {
    opacity: 1;
    -webkit-transform: translate3d(0, -20px, 0) scaleY(0.9);
    transform: translate3d(0, -20px, 0) scaleY(0.9);
  }

  75% {
    -webkit-transform: translate3d(0, 10px, 0) scaleY(0.95);
    transform: translate3d(0, 10px, 0) scaleY(0.95);
  }

  90% {
    -webkit-transform: translate3d(0, -5px, 0) scaleY(0.985);
    transform: translate3d(0, -5px, 0) scaleY(0.985);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes bounceInUp {
  from,
  60%,
  75%,
  90%,
  to {
    -webkit-animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }

  from {
    opacity: 0;
    -webkit-transform: translate3d(0, 3000px, 0) scaleY(5);
    transform: translate3d(0, 3000px, 0) scaleY(5);
  }

  60% {
    opacity: 1;
    -webkit-transform: translate3d(0, -20px, 0) scaleY(0.9);
    transform: translate3d(0, -20px, 0) scaleY(0.9);
  }

  75% {
    -webkit-transform: translate3d(0, 10px, 0) scaleY(0.95);
    transform: translate3d(0, 10px, 0) scaleY(0.95);
  }

  90% {
    -webkit-transform: translate3d(0, -5px, 0) scaleY(0.985);
    transform: translate3d(0, -5px, 0) scaleY(0.985);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__bounceInUp {
  -webkit-animation-name: bounceInUp;
  animation-name: bounceInUp;
}
/* Bouncing exits  */
@-webkit-keyframes bounceOut {
  20% {
    -webkit-transform: scale3d(0.9, 0.9, 0.9);
    transform: scale3d(0.9, 0.9, 0.9);
  }

  50%,
  55% {
    opacity: 1;
    -webkit-transform: scale3d(1.1, 1.1, 1.1);
    transform: scale3d(1.1, 1.1, 1.1);
  }

  to {
    opacity: 0;
    -webkit-transform: scale3d(0.3, 0.3, 0.3);
    transform: scale3d(0.3, 0.3, 0.3);
  }
}
@keyframes bounceOut {
  20% {
    -webkit-transform: scale3d(0.9, 0.9, 0.9);
    transform: scale3d(0.9, 0.9, 0.9);
  }

  50%,
  55% {
    opacity: 1;
    -webkit-transform: scale3d(1.1, 1.1, 1.1);
    transform: scale3d(1.1, 1.1, 1.1);
  }

  to {
    opacity: 0;
    -webkit-transform: scale3d(0.3, 0.3, 0.3);
    transform: scale3d(0.3, 0.3, 0.3);
  }
}
.animate__bounceOut {
  -webkit-animation-duration: calc(1s * 0.75);
  animation-duration: calc(1s * 0.75);
  -webkit-animation-duration: calc(var(--animate-duration) * 0.75);
  animation-duration: calc(var(--animate-duration) * 0.75);
  -webkit-animation-name: bounceOut;
  animation-name: bounceOut;
}
@-webkit-keyframes bounceOutDown {
  20% {
    -webkit-transform: translate3d(0, 10px, 0) scaleY(0.985);
    transform: translate3d(0, 10px, 0) scaleY(0.985);
  }

  40%,
  45% {
    opacity: 1;
    -webkit-transform: translate3d(0, -20px, 0) scaleY(0.9);
    transform: translate3d(0, -20px, 0) scaleY(0.9);
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(0, 2000px, 0) scaleY(3);
    transform: translate3d(0, 2000px, 0) scaleY(3);
  }
}
@keyframes bounceOutDown {
  20% {
    -webkit-transform: translate3d(0, 10px, 0) scaleY(0.985);
    transform: translate3d(0, 10px, 0) scaleY(0.985);
  }

  40%,
  45% {
    opacity: 1;
    -webkit-transform: translate3d(0, -20px, 0) scaleY(0.9);
    transform: translate3d(0, -20px, 0) scaleY(0.9);
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(0, 2000px, 0) scaleY(3);
    transform: translate3d(0, 2000px, 0) scaleY(3);
  }
}
.animate__bounceOutDown {
  -webkit-animation-name: bounceOutDown;
  animation-name: bounceOutDown;
}
@-webkit-keyframes bounceOutLeft {
  20% {
    opacity: 1;
    -webkit-transform: translate3d(20px, 0, 0) scaleX(0.9);
    transform: translate3d(20px, 0, 0) scaleX(0.9);
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(-2000px, 0, 0) scaleX(2);
    transform: translate3d(-2000px, 0, 0) scaleX(2);
  }
}
@keyframes bounceOutLeft {
  20% {
    opacity: 1;
    -webkit-transform: translate3d(20px, 0, 0) scaleX(0.9);
    transform: translate3d(20px, 0, 0) scaleX(0.9);
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(-2000px, 0, 0) scaleX(2);
    transform: translate3d(-2000px, 0, 0) scaleX(2);
  }
}
.animate__bounceOutLeft {
  -webkit-animation-name: bounceOutLeft;
  animation-name: bounceOutLeft;
}
@-webkit-keyframes bounceOutRight {
  20% {
    opacity: 1;
    -webkit-transform: translate3d(-20px, 0, 0) scaleX(0.9);
    transform: translate3d(-20px, 0, 0) scaleX(0.9);
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(2000px, 0, 0) scaleX(2);
    transform: translate3d(2000px, 0, 0) scaleX(2);
  }
}
@keyframes bounceOutRight {
  20% {
    opacity: 1;
    -webkit-transform: translate3d(-20px, 0, 0) scaleX(0.9);
    transform: translate3d(-20px, 0, 0) scaleX(0.9);
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(2000px, 0, 0) scaleX(2);
    transform: translate3d(2000px, 0, 0) scaleX(2);
  }
}
.animate__bounceOutRight {
  -webkit-animation-name: bounceOutRight;
  animation-name: bounceOutRight;
}
@-webkit-keyframes bounceOutUp {
  20% {
    -webkit-transform: translate3d(0, -10px, 0) scaleY(0.985);
    transform: translate3d(0, -10px, 0) scaleY(0.985);
  }

  40%,
  45% {
    opacity: 1;
    -webkit-transform: translate3d(0, 20px, 0) scaleY(0.9);
    transform: translate3d(0, 20px, 0) scaleY(0.9);
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(0, -2000px, 0) scaleY(3);
    transform: translate3d(0, -2000px, 0) scaleY(3);
  }
}
@keyframes bounceOutUp {
  20% {
    -webkit-transform: translate3d(0, -10px, 0) scaleY(0.985);
    transform: translate3d(0, -10px, 0) scaleY(0.985);
  }

  40%,
  45% {
    opacity: 1;
    -webkit-transform: translate3d(0, 20px, 0) scaleY(0.9);
    transform: translate3d(0, 20px, 0) scaleY(0.9);
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(0, -2000px, 0) scaleY(3);
    transform: translate3d(0, -2000px, 0) scaleY(3);
  }
}
.animate__bounceOutUp {
  -webkit-animation-name: bounceOutUp;
  animation-name: bounceOutUp;
}
/* Fading entrances  */
@-webkit-keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}
.animate__fadeIn {
  -webkit-animation-name: fadeIn;
  animation-name: fadeIn;
}
@-webkit-keyframes fadeInDown {
  from {
    opacity: 0;
    -webkit-transform: translate3d(0, -100%, 0);
    transform: translate3d(0, -100%, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes fadeInDown {
  from {
    opacity: 0;
    -webkit-transform: translate3d(0, -100%, 0);
    transform: translate3d(0, -100%, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__fadeInDown {
  -webkit-animation-name: fadeInDown;
  animation-name: fadeInDown;
}
@-webkit-keyframes fadeInDownBig {
  from {
    opacity: 0;
    -webkit-transform: translate3d(0, -2000px, 0);
    transform: translate3d(0, -2000px, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes fadeInDownBig {
  from {
    opacity: 0;
    -webkit-transform: translate3d(0, -2000px, 0);
    transform: translate3d(0, -2000px, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__fadeInDownBig {
  -webkit-animation-name: fadeInDownBig;
  animation-name: fadeInDownBig;
}
@-webkit-keyframes fadeInLeft {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes fadeInLeft {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__fadeInLeft {
  -webkit-animation-name: fadeInLeft;
  animation-name: fadeInLeft;
}
@-webkit-keyframes fadeInLeftBig {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-2000px, 0, 0);
    transform: translate3d(-2000px, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes fadeInLeftBig {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-2000px, 0, 0);
    transform: translate3d(-2000px, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__fadeInLeftBig {
  -webkit-animation-name: fadeInLeftBig;
  animation-name: fadeInLeftBig;
}
@-webkit-keyframes fadeInRight {
  from {
    opacity: 0;
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes fadeInRight {
  from {
    opacity: 0;
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__fadeInRight {
  -webkit-animation-name: fadeInRight;
  animation-name: fadeInRight;
}
@-webkit-keyframes fadeInRightBig {
  from {
    opacity: 0;
    -webkit-transform: translate3d(2000px, 0, 0);
    transform: translate3d(2000px, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes fadeInRightBig {
  from {
    opacity: 0;
    -webkit-transform: translate3d(2000px, 0, 0);
    transform: translate3d(2000px, 0, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__fadeInRightBig {
  -webkit-animation-name: fadeInRightBig;
  animation-name: fadeInRightBig;
}
@-webkit-keyframes fadeInUp {
  from {
    opacity: 0;
    -webkit-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    -webkit-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__fadeInUp {
  -webkit-animation-name: fadeInUp;
  animation-name: fadeInUp;
}
@-webkit-keyframes fadeInUpBig {
  from {
    opacity: 0;
    -webkit-transform: translate3d(0, 2000px, 0);
    transform: translate3d(0, 2000px, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes fadeInUpBig {
  from {
    opacity: 0;
    -webkit-transform: translate3d(0, 2000px, 0);
    transform: translate3d(0, 2000px, 0);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__fadeInUpBig {
  -webkit-animation-name: fadeInUpBig;
  animation-name: fadeInUpBig;
}
@-webkit-keyframes fadeInTopLeft {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-100%, -100%, 0);
    transform: translate3d(-100%, -100%, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes fadeInTopLeft {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-100%, -100%, 0);
    transform: translate3d(-100%, -100%, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__fadeInTopLeft {
  -webkit-animation-name: fadeInTopLeft;
  animation-name: fadeInTopLeft;
}
@-webkit-keyframes fadeInTopRight {
  from {
    opacity: 0;
    -webkit-transform: translate3d(100%, -100%, 0);
    transform: translate3d(100%, -100%, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes fadeInTopRight {
  from {
    opacity: 0;
    -webkit-transform: translate3d(100%, -100%, 0);
    transform: translate3d(100%, -100%, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__fadeInTopRight {
  -webkit-animation-name: fadeInTopRight;
  animation-name: fadeInTopRight;
}
@-webkit-keyframes fadeInBottomLeft {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 100%, 0);
    transform: translate3d(-100%, 100%, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes fadeInBottomLeft {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 100%, 0);
    transform: translate3d(-100%, 100%, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__fadeInBottomLeft {
  -webkit-animation-name: fadeInBottomLeft;
  animation-name: fadeInBottomLeft;
}
@-webkit-keyframes fadeInBottomRight {
  from {
    opacity: 0;
    -webkit-transform: translate3d(100%, 100%, 0);
    transform: translate3d(100%, 100%, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes fadeInBottomRight {
  from {
    opacity: 0;
    -webkit-transform: translate3d(100%, 100%, 0);
    transform: translate3d(100%, 100%, 0);
  }
  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__fadeInBottomRight {
  -webkit-animation-name: fadeInBottomRight;
  animation-name: fadeInBottomRight;
}
/* Fading exits */
@-webkit-keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}
@keyframes fadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}
.animate__fadeOut {
  -webkit-animation-name: fadeOut;
  animation-name: fadeOut;
}
@-webkit-keyframes fadeOutDown {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
  }
}
@keyframes fadeOutDown {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
  }
}
.animate__fadeOutDown {
  -webkit-animation-name: fadeOutDown;
  animation-name: fadeOutDown;
}
@-webkit-keyframes fadeOutDownBig {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(0, 2000px, 0);
    transform: translate3d(0, 2000px, 0);
  }
}
@keyframes fadeOutDownBig {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(0, 2000px, 0);
    transform: translate3d(0, 2000px, 0);
  }
}
.animate__fadeOutDownBig {
  -webkit-animation-name: fadeOutDownBig;
  animation-name: fadeOutDownBig;
}
@-webkit-keyframes fadeOutLeft {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }
}
@keyframes fadeOutLeft {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }
}
.animate__fadeOutLeft {
  -webkit-animation-name: fadeOutLeft;
  animation-name: fadeOutLeft;
}
@-webkit-keyframes fadeOutLeftBig {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(-2000px, 0, 0);
    transform: translate3d(-2000px, 0, 0);
  }
}
@keyframes fadeOutLeftBig {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(-2000px, 0, 0);
    transform: translate3d(-2000px, 0, 0);
  }
}
.animate__fadeOutLeftBig {
  -webkit-animation-name: fadeOutLeftBig;
  animation-name: fadeOutLeftBig;
}
@-webkit-keyframes fadeOutRight {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
  }
}
@keyframes fadeOutRight {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
  }
}
.animate__fadeOutRight {
  -webkit-animation-name: fadeOutRight;
  animation-name: fadeOutRight;
}
@-webkit-keyframes fadeOutRightBig {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(2000px, 0, 0);
    transform: translate3d(2000px, 0, 0);
  }
}
@keyframes fadeOutRightBig {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(2000px, 0, 0);
    transform: translate3d(2000px, 0, 0);
  }
}
.animate__fadeOutRightBig {
  -webkit-animation-name: fadeOutRightBig;
  animation-name: fadeOutRightBig;
}
@-webkit-keyframes fadeOutUp {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(0, -100%, 0);
    transform: translate3d(0, -100%, 0);
  }
}
@keyframes fadeOutUp {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(0, -100%, 0);
    transform: translate3d(0, -100%, 0);
  }
}
.animate__fadeOutUp {
  -webkit-animation-name: fadeOutUp;
  animation-name: fadeOutUp;
}
@-webkit-keyframes fadeOutUpBig {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(0, -2000px, 0);
    transform: translate3d(0, -2000px, 0);
  }
}
@keyframes fadeOutUpBig {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(0, -2000px, 0);
    transform: translate3d(0, -2000px, 0);
  }
}
.animate__fadeOutUpBig {
  -webkit-animation-name: fadeOutUpBig;
  animation-name: fadeOutUpBig;
}
@-webkit-keyframes fadeOutTopLeft {
  from {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    -webkit-transform: translate3d(-100%, -100%, 0);
    transform: translate3d(-100%, -100%, 0);
  }
}
@keyframes fadeOutTopLeft {
  from {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    -webkit-transform: translate3d(-100%, -100%, 0);
    transform: translate3d(-100%, -100%, 0);
  }
}
.animate__fadeOutTopLeft {
  -webkit-animation-name: fadeOutTopLeft;
  animation-name: fadeOutTopLeft;
}
@-webkit-keyframes fadeOutTopRight {
  from {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    -webkit-transform: translate3d(100%, -100%, 0);
    transform: translate3d(100%, -100%, 0);
  }
}
@keyframes fadeOutTopRight {
  from {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    -webkit-transform: translate3d(100%, -100%, 0);
    transform: translate3d(100%, -100%, 0);
  }
}
.animate__fadeOutTopRight {
  -webkit-animation-name: fadeOutTopRight;
  animation-name: fadeOutTopRight;
}
@-webkit-keyframes fadeOutBottomRight {
  from {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    -webkit-transform: translate3d(100%, 100%, 0);
    transform: translate3d(100%, 100%, 0);
  }
}
@keyframes fadeOutBottomRight {
  from {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    -webkit-transform: translate3d(100%, 100%, 0);
    transform: translate3d(100%, 100%, 0);
  }
}
.animate__fadeOutBottomRight {
  -webkit-animation-name: fadeOutBottomRight;
  animation-name: fadeOutBottomRight;
}
@-webkit-keyframes fadeOutBottomLeft {
  from {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 100%, 0);
    transform: translate3d(-100%, 100%, 0);
  }
}
@keyframes fadeOutBottomLeft {
  from {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 100%, 0);
    transform: translate3d(-100%, 100%, 0);
  }
}
.animate__fadeOutBottomLeft {
  -webkit-animation-name: fadeOutBottomLeft;
  animation-name: fadeOutBottomLeft;
}
/* Flippers */
@-webkit-keyframes flip {
  from {
    -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, -360deg);
    transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, -360deg);
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }

  40% {
    -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)
      rotate3d(0, 1, 0, -190deg);
    transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)
      rotate3d(0, 1, 0, -190deg);
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }

  50% {
    -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)
      rotate3d(0, 1, 0, -170deg);
    transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)
      rotate3d(0, 1, 0, -170deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  80% {
    -webkit-transform: perspective(400px) scale3d(0.95, 0.95, 0.95) translate3d(0, 0, 0)
      rotate3d(0, 1, 0, 0deg);
    transform: perspective(400px) scale3d(0.95, 0.95, 0.95) translate3d(0, 0, 0)
      rotate3d(0, 1, 0, 0deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  to {
    -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, 0deg);
    transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, 0deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }
}
@keyframes flip {
  from {
    -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, -360deg);
    transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, -360deg);
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }

  40% {
    -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)
      rotate3d(0, 1, 0, -190deg);
    transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)
      rotate3d(0, 1, 0, -190deg);
    -webkit-animation-timing-function: ease-out;
    animation-timing-function: ease-out;
  }

  50% {
    -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)
      rotate3d(0, 1, 0, -170deg);
    transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 150px)
      rotate3d(0, 1, 0, -170deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  80% {
    -webkit-transform: perspective(400px) scale3d(0.95, 0.95, 0.95) translate3d(0, 0, 0)
      rotate3d(0, 1, 0, 0deg);
    transform: perspective(400px) scale3d(0.95, 0.95, 0.95) translate3d(0, 0, 0)
      rotate3d(0, 1, 0, 0deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  to {
    -webkit-transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, 0deg);
    transform: perspective(400px) scale3d(1, 1, 1) translate3d(0, 0, 0) rotate3d(0, 1, 0, 0deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }
}
.animate__animated.animate__flip {
  -webkit-backface-visibility: visible;
  backface-visibility: visible;
  -webkit-animation-name: flip;
  animation-name: flip;
}
@-webkit-keyframes flipInX {
  from {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
    opacity: 0;
  }

  40% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  60% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
    transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
    opacity: 1;
  }

  80% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
    transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
  }

  to {
    -webkit-transform: perspective(400px);
    transform: perspective(400px);
  }
}
@keyframes flipInX {
  from {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
    opacity: 0;
  }

  40% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  60% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
    transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
    opacity: 1;
  }

  80% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
    transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
  }

  to {
    -webkit-transform: perspective(400px);
    transform: perspective(400px);
  }
}
.animate__flipInX {
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
  -webkit-animation-name: flipInX;
  animation-name: flipInX;
}
@-webkit-keyframes flipInY {
  from {
    -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
    transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
    opacity: 0;
  }

  40% {
    -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
    transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  60% {
    -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
    transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
    opacity: 1;
  }

  80% {
    -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
    transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
  }

  to {
    -webkit-transform: perspective(400px);
    transform: perspective(400px);
  }
}
@keyframes flipInY {
  from {
    -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
    transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
    opacity: 0;
  }

  40% {
    -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
    transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
    -webkit-animation-timing-function: ease-in;
    animation-timing-function: ease-in;
  }

  60% {
    -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
    transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
    opacity: 1;
  }

  80% {
    -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
    transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
  }

  to {
    -webkit-transform: perspective(400px);
    transform: perspective(400px);
  }
}
.animate__flipInY {
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
  -webkit-animation-name: flipInY;
  animation-name: flipInY;
}
@-webkit-keyframes flipOutX {
  from {
    -webkit-transform: perspective(400px);
    transform: perspective(400px);
  }

  30% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    opacity: 1;
  }

  to {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    opacity: 0;
  }
}
@keyframes flipOutX {
  from {
    -webkit-transform: perspective(400px);
    transform: perspective(400px);
  }

  30% {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    opacity: 1;
  }

  to {
    -webkit-transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    opacity: 0;
  }
}
.animate__flipOutX {
  -webkit-animation-duration: calc(1s * 0.75);
  animation-duration: calc(1s * 0.75);
  -webkit-animation-duration: calc(var(--animate-duration) * 0.75);
  animation-duration: calc(var(--animate-duration) * 0.75);
  -webkit-animation-name: flipOutX;
  animation-name: flipOutX;
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
}
@-webkit-keyframes flipOutY {
  from {
    -webkit-transform: perspective(400px);
    transform: perspective(400px);
  }

  30% {
    -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -15deg);
    transform: perspective(400px) rotate3d(0, 1, 0, -15deg);
    opacity: 1;
  }

  to {
    -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
    transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
    opacity: 0;
  }
}
@keyframes flipOutY {
  from {
    -webkit-transform: perspective(400px);
    transform: perspective(400px);
  }

  30% {
    -webkit-transform: perspective(400px) rotate3d(0, 1, 0, -15deg);
    transform: perspective(400px) rotate3d(0, 1, 0, -15deg);
    opacity: 1;
  }

  to {
    -webkit-transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
    transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
    opacity: 0;
  }
}
.animate__flipOutY {
  -webkit-animation-duration: calc(1s * 0.75);
  animation-duration: calc(1s * 0.75);
  -webkit-animation-duration: calc(var(--animate-duration) * 0.75);
  animation-duration: calc(var(--animate-duration) * 0.75);
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
  -webkit-animation-name: flipOutY;
  animation-name: flipOutY;
}
/* Lightspeed */
@-webkit-keyframes lightSpeedInRight {
  from {
    -webkit-transform: translate3d(100%, 0, 0) skewX(-30deg);
    transform: translate3d(100%, 0, 0) skewX(-30deg);
    opacity: 0;
  }

  60% {
    -webkit-transform: skewX(20deg);
    transform: skewX(20deg);
    opacity: 1;
  }

  80% {
    -webkit-transform: skewX(-5deg);
    transform: skewX(-5deg);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes lightSpeedInRight {
  from {
    -webkit-transform: translate3d(100%, 0, 0) skewX(-30deg);
    transform: translate3d(100%, 0, 0) skewX(-30deg);
    opacity: 0;
  }

  60% {
    -webkit-transform: skewX(20deg);
    transform: skewX(20deg);
    opacity: 1;
  }

  80% {
    -webkit-transform: skewX(-5deg);
    transform: skewX(-5deg);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__lightSpeedInRight {
  -webkit-animation-name: lightSpeedInRight;
  animation-name: lightSpeedInRight;
  -webkit-animation-timing-function: ease-out;
  animation-timing-function: ease-out;
}
@-webkit-keyframes lightSpeedInLeft {
  from {
    -webkit-transform: translate3d(-100%, 0, 0) skewX(30deg);
    transform: translate3d(-100%, 0, 0) skewX(30deg);
    opacity: 0;
  }

  60% {
    -webkit-transform: skewX(-20deg);
    transform: skewX(-20deg);
    opacity: 1;
  }

  80% {
    -webkit-transform: skewX(5deg);
    transform: skewX(5deg);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes lightSpeedInLeft {
  from {
    -webkit-transform: translate3d(-100%, 0, 0) skewX(30deg);
    transform: translate3d(-100%, 0, 0) skewX(30deg);
    opacity: 0;
  }

  60% {
    -webkit-transform: skewX(-20deg);
    transform: skewX(-20deg);
    opacity: 1;
  }

  80% {
    -webkit-transform: skewX(5deg);
    transform: skewX(5deg);
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__lightSpeedInLeft {
  -webkit-animation-name: lightSpeedInLeft;
  animation-name: lightSpeedInLeft;
  -webkit-animation-timing-function: ease-out;
  animation-timing-function: ease-out;
}
@-webkit-keyframes lightSpeedOutRight {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: translate3d(100%, 0, 0) skewX(30deg);
    transform: translate3d(100%, 0, 0) skewX(30deg);
    opacity: 0;
  }
}
@keyframes lightSpeedOutRight {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: translate3d(100%, 0, 0) skewX(30deg);
    transform: translate3d(100%, 0, 0) skewX(30deg);
    opacity: 0;
  }
}
.animate__lightSpeedOutRight {
  -webkit-animation-name: lightSpeedOutRight;
  animation-name: lightSpeedOutRight;
  -webkit-animation-timing-function: ease-in;
  animation-timing-function: ease-in;
}
@-webkit-keyframes lightSpeedOutLeft {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: translate3d(-100%, 0, 0) skewX(-30deg);
    transform: translate3d(-100%, 0, 0) skewX(-30deg);
    opacity: 0;
  }
}
@keyframes lightSpeedOutLeft {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: translate3d(-100%, 0, 0) skewX(-30deg);
    transform: translate3d(-100%, 0, 0) skewX(-30deg);
    opacity: 0;
  }
}
.animate__lightSpeedOutLeft {
  -webkit-animation-name: lightSpeedOutLeft;
  animation-name: lightSpeedOutLeft;
  -webkit-animation-timing-function: ease-in;
  animation-timing-function: ease-in;
}
/* Rotating entrances */
@-webkit-keyframes rotateIn {
  from {
    -webkit-transform: rotate3d(0, 0, 1, -200deg);
    transform: rotate3d(0, 0, 1, -200deg);
    opacity: 0;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
@keyframes rotateIn {
  from {
    -webkit-transform: rotate3d(0, 0, 1, -200deg);
    transform: rotate3d(0, 0, 1, -200deg);
    opacity: 0;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
.animate__rotateIn {
  -webkit-animation-name: rotateIn;
  animation-name: rotateIn;
  -webkit-transform-origin: center;
  transform-origin: center;
}
@-webkit-keyframes rotateInDownLeft {
  from {
    -webkit-transform: rotate3d(0, 0, 1, -45deg);
    transform: rotate3d(0, 0, 1, -45deg);
    opacity: 0;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
@keyframes rotateInDownLeft {
  from {
    -webkit-transform: rotate3d(0, 0, 1, -45deg);
    transform: rotate3d(0, 0, 1, -45deg);
    opacity: 0;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
.animate__rotateInDownLeft {
  -webkit-animation-name: rotateInDownLeft;
  animation-name: rotateInDownLeft;
  -webkit-transform-origin: left bottom;
  transform-origin: left bottom;
}
@-webkit-keyframes rotateInDownRight {
  from {
    -webkit-transform: rotate3d(0, 0, 1, 45deg);
    transform: rotate3d(0, 0, 1, 45deg);
    opacity: 0;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
@keyframes rotateInDownRight {
  from {
    -webkit-transform: rotate3d(0, 0, 1, 45deg);
    transform: rotate3d(0, 0, 1, 45deg);
    opacity: 0;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
.animate__rotateInDownRight {
  -webkit-animation-name: rotateInDownRight;
  animation-name: rotateInDownRight;
  -webkit-transform-origin: right bottom;
  transform-origin: right bottom;
}
@-webkit-keyframes rotateInUpLeft {
  from {
    -webkit-transform: rotate3d(0, 0, 1, 45deg);
    transform: rotate3d(0, 0, 1, 45deg);
    opacity: 0;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
@keyframes rotateInUpLeft {
  from {
    -webkit-transform: rotate3d(0, 0, 1, 45deg);
    transform: rotate3d(0, 0, 1, 45deg);
    opacity: 0;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
.animate__rotateInUpLeft {
  -webkit-animation-name: rotateInUpLeft;
  animation-name: rotateInUpLeft;
  -webkit-transform-origin: left bottom;
  transform-origin: left bottom;
}
@-webkit-keyframes rotateInUpRight {
  from {
    -webkit-transform: rotate3d(0, 0, 1, -90deg);
    transform: rotate3d(0, 0, 1, -90deg);
    opacity: 0;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
@keyframes rotateInUpRight {
  from {
    -webkit-transform: rotate3d(0, 0, 1, -90deg);
    transform: rotate3d(0, 0, 1, -90deg);
    opacity: 0;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
.animate__rotateInUpRight {
  -webkit-animation-name: rotateInUpRight;
  animation-name: rotateInUpRight;
  -webkit-transform-origin: right bottom;
  transform-origin: right bottom;
}
/* Rotating exits */
@-webkit-keyframes rotateOut {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: rotate3d(0, 0, 1, 200deg);
    transform: rotate3d(0, 0, 1, 200deg);
    opacity: 0;
  }
}
@keyframes rotateOut {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: rotate3d(0, 0, 1, 200deg);
    transform: rotate3d(0, 0, 1, 200deg);
    opacity: 0;
  }
}
.animate__rotateOut {
  -webkit-animation-name: rotateOut;
  animation-name: rotateOut;
  -webkit-transform-origin: center;
  transform-origin: center;
}
@-webkit-keyframes rotateOutDownLeft {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: rotate3d(0, 0, 1, 45deg);
    transform: rotate3d(0, 0, 1, 45deg);
    opacity: 0;
  }
}
@keyframes rotateOutDownLeft {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: rotate3d(0, 0, 1, 45deg);
    transform: rotate3d(0, 0, 1, 45deg);
    opacity: 0;
  }
}
.animate__rotateOutDownLeft {
  -webkit-animation-name: rotateOutDownLeft;
  animation-name: rotateOutDownLeft;
  -webkit-transform-origin: left bottom;
  transform-origin: left bottom;
}
@-webkit-keyframes rotateOutDownRight {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: rotate3d(0, 0, 1, -45deg);
    transform: rotate3d(0, 0, 1, -45deg);
    opacity: 0;
  }
}
@keyframes rotateOutDownRight {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: rotate3d(0, 0, 1, -45deg);
    transform: rotate3d(0, 0, 1, -45deg);
    opacity: 0;
  }
}
.animate__rotateOutDownRight {
  -webkit-animation-name: rotateOutDownRight;
  animation-name: rotateOutDownRight;
  -webkit-transform-origin: right bottom;
  transform-origin: right bottom;
}
@-webkit-keyframes rotateOutUpLeft {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: rotate3d(0, 0, 1, -45deg);
    transform: rotate3d(0, 0, 1, -45deg);
    opacity: 0;
  }
}
@keyframes rotateOutUpLeft {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: rotate3d(0, 0, 1, -45deg);
    transform: rotate3d(0, 0, 1, -45deg);
    opacity: 0;
  }
}
.animate__rotateOutUpLeft {
  -webkit-animation-name: rotateOutUpLeft;
  animation-name: rotateOutUpLeft;
  -webkit-transform-origin: left bottom;
  transform-origin: left bottom;
}
@-webkit-keyframes rotateOutUpRight {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: rotate3d(0, 0, 1, 90deg);
    transform: rotate3d(0, 0, 1, 90deg);
    opacity: 0;
  }
}
@keyframes rotateOutUpRight {
  from {
    opacity: 1;
  }

  to {
    -webkit-transform: rotate3d(0, 0, 1, 90deg);
    transform: rotate3d(0, 0, 1, 90deg);
    opacity: 0;
  }
}
.animate__rotateOutUpRight {
  -webkit-animation-name: rotateOutUpRight;
  animation-name: rotateOutUpRight;
  -webkit-transform-origin: right bottom;
  transform-origin: right bottom;
}
/* Specials */
@-webkit-keyframes hinge {
  0% {
    -webkit-animation-timing-function: ease-in-out;
    animation-timing-function: ease-in-out;
  }

  20%,
  60% {
    -webkit-transform: rotate3d(0, 0, 1, 80deg);
    transform: rotate3d(0, 0, 1, 80deg);
    -webkit-animation-timing-function: ease-in-out;
    animation-timing-function: ease-in-out;
  }

  40%,
  80% {
    -webkit-transform: rotate3d(0, 0, 1, 60deg);
    transform: rotate3d(0, 0, 1, 60deg);
    -webkit-animation-timing-function: ease-in-out;
    animation-timing-function: ease-in-out;
    opacity: 1;
  }

  to {
    -webkit-transform: translate3d(0, 700px, 0);
    transform: translate3d(0, 700px, 0);
    opacity: 0;
  }
}
@keyframes hinge {
  0% {
    -webkit-animation-timing-function: ease-in-out;
    animation-timing-function: ease-in-out;
  }

  20%,
  60% {
    -webkit-transform: rotate3d(0, 0, 1, 80deg);
    transform: rotate3d(0, 0, 1, 80deg);
    -webkit-animation-timing-function: ease-in-out;
    animation-timing-function: ease-in-out;
  }

  40%,
  80% {
    -webkit-transform: rotate3d(0, 0, 1, 60deg);
    transform: rotate3d(0, 0, 1, 60deg);
    -webkit-animation-timing-function: ease-in-out;
    animation-timing-function: ease-in-out;
    opacity: 1;
  }

  to {
    -webkit-transform: translate3d(0, 700px, 0);
    transform: translate3d(0, 700px, 0);
    opacity: 0;
  }
}
.animate__hinge {
  -webkit-animation-duration: calc(1s * 2);
  animation-duration: calc(1s * 2);
  -webkit-animation-duration: calc(var(--animate-duration) * 2);
  animation-duration: calc(var(--animate-duration) * 2);
  -webkit-animation-name: hinge;
  animation-name: hinge;
  -webkit-transform-origin: top left;
  transform-origin: top left;
}
@-webkit-keyframes jackInTheBox {
  from {
    opacity: 0;
    -webkit-transform: scale(0.1) rotate(30deg);
    transform: scale(0.1) rotate(30deg);
    -webkit-transform-origin: center bottom;
    transform-origin: center bottom;
  }

  50% {
    -webkit-transform: rotate(-10deg);
    transform: rotate(-10deg);
  }

  70% {
    -webkit-transform: rotate(3deg);
    transform: rotate(3deg);
  }

  to {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}
@keyframes jackInTheBox {
  from {
    opacity: 0;
    -webkit-transform: scale(0.1) rotate(30deg);
    transform: scale(0.1) rotate(30deg);
    -webkit-transform-origin: center bottom;
    transform-origin: center bottom;
  }

  50% {
    -webkit-transform: rotate(-10deg);
    transform: rotate(-10deg);
  }

  70% {
    -webkit-transform: rotate(3deg);
    transform: rotate(3deg);
  }

  to {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}
.animate__jackInTheBox {
  -webkit-animation-name: jackInTheBox;
  animation-name: jackInTheBox;
}
/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
@-webkit-keyframes rollIn {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg);
    transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes rollIn {
  from {
    opacity: 0;
    -webkit-transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg);
    transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg);
  }

  to {
    opacity: 1;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__rollIn {
  -webkit-animation-name: rollIn;
  animation-name: rollIn;
}
/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */
@-webkit-keyframes rollOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg);
    transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg);
  }
}
@keyframes rollOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    -webkit-transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg);
    transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg);
  }
}
.animate__rollOut {
  -webkit-animation-name: rollOut;
  animation-name: rollOut;
}
/* Zooming entrances */
@-webkit-keyframes zoomIn {
  from {
    opacity: 0;
    -webkit-transform: scale3d(0.3, 0.3, 0.3);
    transform: scale3d(0.3, 0.3, 0.3);
  }

  50% {
    opacity: 1;
  }
}
@keyframes zoomIn {
  from {
    opacity: 0;
    -webkit-transform: scale3d(0.3, 0.3, 0.3);
    transform: scale3d(0.3, 0.3, 0.3);
  }

  50% {
    opacity: 1;
  }
}
.animate__zoomIn {
  -webkit-animation-name: zoomIn;
  animation-name: zoomIn;
}
@-webkit-keyframes zoomInDown {
  from {
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  60% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}
@keyframes zoomInDown {
  from {
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -1000px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  60% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}
.animate__zoomInDown {
  -webkit-animation-name: zoomInDown;
  animation-name: zoomInDown;
}
@-webkit-keyframes zoomInLeft {
  from {
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(-1000px, 0, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(-1000px, 0, 0);
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  60% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0);
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}
@keyframes zoomInLeft {
  from {
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(-1000px, 0, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(-1000px, 0, 0);
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  60% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(10px, 0, 0);
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}
.animate__zoomInLeft {
  -webkit-animation-name: zoomInLeft;
  animation-name: zoomInLeft;
}
@-webkit-keyframes zoomInRight {
  from {
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0);
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  60% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0);
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}
@keyframes zoomInRight {
  from {
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(1000px, 0, 0);
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  60% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(-10px, 0, 0);
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}
.animate__zoomInRight {
  -webkit-animation-name: zoomInRight;
  animation-name: zoomInRight;
}
@-webkit-keyframes zoomInUp {
  from {
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  60% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}
@keyframes zoomInUp {
  from {
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  60% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}
.animate__zoomInUp {
  -webkit-animation-name: zoomInUp;
  animation-name: zoomInUp;
}
/* Zooming exits */
@-webkit-keyframes zoomOut {
  from {
    opacity: 1;
  }

  50% {
    opacity: 0;
    -webkit-transform: scale3d(0.3, 0.3, 0.3);
    transform: scale3d(0.3, 0.3, 0.3);
  }

  to {
    opacity: 0;
  }
}
@keyframes zoomOut {
  from {
    opacity: 1;
  }

  50% {
    opacity: 0;
    -webkit-transform: scale3d(0.3, 0.3, 0.3);
    transform: scale3d(0.3, 0.3, 0.3);
  }

  to {
    opacity: 0;
  }
}
.animate__zoomOut {
  -webkit-animation-name: zoomOut;
  animation-name: zoomOut;
}
@-webkit-keyframes zoomOutDown {
  40% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  to {
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 2000px, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 2000px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}
@keyframes zoomOutDown {
  40% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  to {
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 2000px, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 2000px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}
.animate__zoomOutDown {
  -webkit-animation-name: zoomOutDown;
  animation-name: zoomOutDown;
  -webkit-transform-origin: center bottom;
  transform-origin: center bottom;
}
@-webkit-keyframes zoomOutLeft {
  40% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(42px, 0, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(42px, 0, 0);
  }

  to {
    opacity: 0;
    -webkit-transform: scale(0.1) translate3d(-2000px, 0, 0);
    transform: scale(0.1) translate3d(-2000px, 0, 0);
  }
}
@keyframes zoomOutLeft {
  40% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(42px, 0, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(42px, 0, 0);
  }

  to {
    opacity: 0;
    -webkit-transform: scale(0.1) translate3d(-2000px, 0, 0);
    transform: scale(0.1) translate3d(-2000px, 0, 0);
  }
}
.animate__zoomOutLeft {
  -webkit-animation-name: zoomOutLeft;
  animation-name: zoomOutLeft;
  -webkit-transform-origin: left center;
  transform-origin: left center;
}
@-webkit-keyframes zoomOutRight {
  40% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(-42px, 0, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(-42px, 0, 0);
  }

  to {
    opacity: 0;
    -webkit-transform: scale(0.1) translate3d(2000px, 0, 0);
    transform: scale(0.1) translate3d(2000px, 0, 0);
  }
}
@keyframes zoomOutRight {
  40% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(-42px, 0, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(-42px, 0, 0);
  }

  to {
    opacity: 0;
    -webkit-transform: scale(0.1) translate3d(2000px, 0, 0);
    transform: scale(0.1) translate3d(2000px, 0, 0);
  }
}
.animate__zoomOutRight {
  -webkit-animation-name: zoomOutRight;
  animation-name: zoomOutRight;
  -webkit-transform-origin: right center;
  transform-origin: right center;
}
@-webkit-keyframes zoomOutUp {
  40% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  to {
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -2000px, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -2000px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}
@keyframes zoomOutUp {
  40% {
    opacity: 1;
    -webkit-transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, 60px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }

  to {
    opacity: 0;
    -webkit-transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -2000px, 0);
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, -2000px, 0);
    -webkit-animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1);
  }
}
.animate__zoomOutUp {
  -webkit-animation-name: zoomOutUp;
  animation-name: zoomOutUp;
  -webkit-transform-origin: center bottom;
  transform-origin: center bottom;
}
/* Sliding entrances */
@-webkit-keyframes slideInDown {
  from {
    -webkit-transform: translate3d(0, -100%, 0);
    transform: translate3d(0, -100%, 0);
    visibility: visible;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes slideInDown {
  from {
    -webkit-transform: translate3d(0, -100%, 0);
    transform: translate3d(0, -100%, 0);
    visibility: visible;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__slideInDown {
  -webkit-animation-name: slideInDown;
  animation-name: slideInDown;
}
@-webkit-keyframes slideInLeft {
  from {
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
    visibility: visible;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes slideInLeft {
  from {
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
    visibility: visible;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__slideInLeft {
  -webkit-animation-name: slideInLeft;
  animation-name: slideInLeft;
}
@-webkit-keyframes slideInRight {
  from {
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
    visibility: visible;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes slideInRight {
  from {
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
    visibility: visible;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__slideInRight {
  -webkit-animation-name: slideInRight;
  animation-name: slideInRight;
}
@-webkit-keyframes slideInUp {
  from {
    -webkit-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
    visibility: visible;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes slideInUp {
  from {
    -webkit-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
    visibility: visible;
  }

  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
.animate__slideInUp {
  -webkit-animation-name: slideInUp;
  animation-name: slideInUp;
}
/* Sliding exits */
@-webkit-keyframes slideOutDown {
  from {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  to {
    visibility: hidden;
    -webkit-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
  }
}
@keyframes slideOutDown {
  from {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  to {
    visibility: hidden;
    -webkit-transform: translate3d(0, 100%, 0);
    transform: translate3d(0, 100%, 0);
  }
}
.animate__slideOutDown {
  -webkit-animation-name: slideOutDown;
  animation-name: slideOutDown;
}
@-webkit-keyframes slideOutLeft {
  from {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  to {
    visibility: hidden;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }
}
@keyframes slideOutLeft {
  from {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  to {
    visibility: hidden;
    -webkit-transform: translate3d(-100%, 0, 0);
    transform: translate3d(-100%, 0, 0);
  }
}
.animate__slideOutLeft {
  -webkit-animation-name: slideOutLeft;
  animation-name: slideOutLeft;
}
@-webkit-keyframes slideOutRight {
  from {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  to {
    visibility: hidden;
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
  }
}
@keyframes slideOutRight {
  from {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  to {
    visibility: hidden;
    -webkit-transform: translate3d(100%, 0, 0);
    transform: translate3d(100%, 0, 0);
  }
}
.animate__slideOutRight {
  -webkit-animation-name: slideOutRight;
  animation-name: slideOutRight;
}
@-webkit-keyframes slideOutUp {
  from {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  to {
    visibility: hidden;
    -webkit-transform: translate3d(0, -100%, 0);
    transform: translate3d(0, -100%, 0);
  }
}
@keyframes slideOutUp {
  from {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }

  to {
    visibility: hidden;
    -webkit-transform: translate3d(0, -100%, 0);
    transform: translate3d(0, -100%, 0);
  }
}
.animate__slideOutUp {
  -webkit-animation-name: slideOutUp;
  animation-name: slideOutUp;
}


/* =========================================================================
   Ellie Academic Ally — Design System foundations  (Master spec, May 2026)
   ------------------------------------------------------------------------
   Drop this <link> into the head of any prototype:
       <link rel="stylesheet" href="/colors_and_type.css">

   Authoritative rules (do not deviate):
     - 6-color canonical palette. No mint, no purple, no amber as primary.
     - Type triad: Playfair Display (logotype only) · Newsreader (marketing) ·
       Inter (app UI) · JetBrains Mono (data/compute).
       Never mix Serif and Monospace in the same view.
     - Borders are always 1 px solid #0A0A0A (Onyx). No softened greys.
     - Primary buttons are hard-cornered squares (radius 0).
     - Rely on padding and 1 px grid lines for depth — not drop shadows.
   ========================================================================= */
/* ---------------------------------------------------------------------------
   1. Webfonts — strict Google triad + a Serif for marketing.
       Playfair Display    → ELLIE logotype only
       Newsreader          → marketing / editorial / TipTap canvas
       Inter               → app & UI workhorse
       JetBrains Mono      → data, token counts, timestamps
   --------------------------------------------------------------------------- */
/* ---------------------------------------------------------------------------
   2. Foundation primitives — raw values. Always consume via the semantic
   layer below, never these directly in component CSS.
   --------------------------------------------------------------------------- */
:root {
  /* Type stacks ------------------------------------------------------------ */
  --ellie-font-brand:   "Playfair Display", "Newsreader", Georgia, "Times New Roman", serif;
  --ellie-font-display: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --ellie-font-ui:      "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ellie-font-editor:  "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --ellie-font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;

  /* The Canvas — backgrounds --------------------------------------------- */
  --ellie-color-bright-snow:     #fafbfd;  /* Workspace SPA canvas */
  --ellie-color-soft-linen:      #f5f1e6;  /* Marketing canvas + app sidebars */
  --ellie-color-paper:           #ffffff;  /* Card / panel fill */

  /* The Ink — structural & branding -------------------------------------- */
  --ellie-color-onyx:            #0a0a0a;  /* Universal text, 1 px borders */
  --ellie-color-shadow-fjord:    #21294c;  /* Editorial headers, footers, global nav */

  /* The Actions — highlights & CTAs -------------------------------------- */
  --ellie-color-punch-red:       #e63946;  /* Primary CTAs, token badges, danger */
  --ellie-color-cool-blue:       #d8effd;  /* Active states, text highlights, wayfinding */

  /* Functional status colors — used sparingly inside the workspace ------- */
  --ellie-status-pending:        #94a3b8;
  --ellie-status-processing:     #1e3a8a;
  --ellie-status-complete:       #0a0a0a;            /* Onyx — completion is just "done", not green */
  --ellie-status-complete-bg:    var(--ellie-color-cool-blue);
  --ellie-status-warning:        #b7791f;
  --ellie-status-warning-bg:     #fffaf0;
  --ellie-status-error:          var(--ellie-color-punch-red);
  --ellie-status-error-bg:       #fdebee;

  /* Legacy accents — kept ONLY for token migration & the credit card art.
     New work must not consume these. Flagged with a comment in every site. */
  --ellie-legacy-mint:           #2dd4bf;
  --ellie-legacy-purple:         #7c3aed;
  --ellie-legacy-amber:          #f59e0b;

  /* Radii — primary surfaces hard-corner. Pills exist for chips only. */
  --ellie-radius-0:    0;
  --ellie-radius-xs:   2px;
  --ellie-radius-sm:   4px;
  --ellie-radius-md:   6px;
  --ellie-radius-pill: 9999px;

  /* Spacing — 8 px linear, two tighter steps for inline rhythm ------------ */
  --ellie-space-2xs: 2px;
  --ellie-space-xs:  4px;
  --ellie-space-sm:  8px;
  --ellie-space-md:  12px;
  --ellie-space-lg:  16px;
  --ellie-space-xl:  24px;
  --ellie-space-2xl: 32px;
  --ellie-space-3xl: 48px;
  --ellie-space-4xl: 64px;
  --ellie-space-5xl: 80px;
  --ellie-space-gutter: 24px;
  --ellie-space-margin: 32px;

  /* Borders — there is ONE border. Use it. */
  --ellie-border:       1px solid var(--ellie-color-onyx);
  --ellie-border-hair:  1px solid rgba(10, 10, 10, 0.12); /* reserved for tabular inner rules only */

  /* Radii — softening the aesthetic --------------------------------------- */
  --ellie-radius-xs:    4px;
  --ellie-radius-sm:    6px;
  --ellie-radius-md:    8px;  /* Floor for inputs and small buttons */
  --ellie-radius-lg:    12px;
  --ellie-radius-xl:    16px;
  --ellie-radius-2xl:   24px;
  --ellie-radius-pill:  9999px;

  /* Shadows — used only on editorial marketing. Never inside the workspace. */
  --ellie-shadow-editorial: 8px 8px 0 var(--ellie-color-onyx);

  /* Focus ring — Punch Red, always visible on tab */
  --ellie-focus-ring: 2px solid var(--ellie-color-punch-red);

  /* Motion ---------------------------------------------------------------- */
  --ellie-ease:       cubic-bezier(0.2, 0.8, 0.2, 1);
  --ellie-ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ellie-dur-fast:   140ms;
  --ellie-dur-base:   220ms;
  --ellie-dur-slow:   520ms;

  /* ---------------------------------------------------------------------
     3. Semantic tokens — what components consume. One mode only.
     --------------------------------------------------------------------- */
  --c-canvas:           var(--ellie-color-bright-snow);
  --c-canvas-warm:      var(--ellie-color-soft-linen);
  --c-surface:          var(--ellie-color-paper);

  --c-fg:               var(--ellie-color-onyx);
  --c-fg-strong:        var(--ellie-color-onyx);
  --c-heading:          var(--ellie-color-onyx);
  --c-heading-editorial: var(--ellie-color-shadow-fjord);
  --c-fg-muted:         #44464a;
  --c-fg-subtle:        #6b6d72;
  --c-on-dark:          #ffffff;

  --c-border:           var(--ellie-color-onyx);
  --c-border-strong:    var(--ellie-color-onyx);
  --c-border-hair:      rgba(10, 10, 10, 0.12);

  --c-action-primary:        var(--ellie-color-punch-red);
  --c-action-primary-hover:  #d22f3c;
  --c-action-secondary:      var(--ellie-color-paper);
  --c-action-secondary-fg:   var(--ellie-color-onyx);
  --c-action-danger:         var(--ellie-color-punch-red);

  --c-selected:         var(--ellie-color-onyx);
  --c-selected-bg:      var(--ellie-color-cool-blue);
  --c-highlight:        var(--ellie-color-cool-blue);
}
/* ---------------------------------------------------------------------------
   4. Element baselines — the smallest set of resets so prototypes look on-
   brand without classes. Add `.ellie-prose` to opt long-form text in.
   --------------------------------------------------------------------------- */
html, body {
  background: var(--c-canvas);
  color: var(--c-fg);
  font-family: var(--ellie-font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ellie-font-ui);
  color: var(--c-heading);
  letter-spacing: -0.005em;
  margin: 0;
}
/* Editorial / marketing headings — explicit class. Lands you in Newsreader. */
.ellie-editorial h1, .ellie-editorial h2, .ellie-editorial h3,
.ellie-editorial-heading {
  font-family: var(--ellie-font-display);
  color: var(--c-heading-editorial);
  font-weight: 700;
  letter-spacing: -0.015em;
}
h1 { font-size: 48px; font-weight: 700; line-height: 1.05; }
h2 { font-size: 32px; font-weight: 600; line-height: 1.15; }
h3 { font-size: 22px; font-weight: 600; line-height: 1.25; }
h4 { font-size: 18px; font-weight: 600; line-height: 1.3; }
h5 { font-size: 15px; font-weight: 600; line-height: 1.35; }
p { margin: 0; }
code, pre, kbd, samp {
  font-family: var(--ellie-font-mono);
  font-size: 0.92em;
}
/* Brand wordmark — ONE place Playfair Display lives. Render the SVG; if you
   must use type, you may use this class for the literal string "ELLIE". */
.ellie-logotype {
  font-family: var(--ellie-font-brand);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--c-fg);
  font-style: normal;
}
/* Kicker — the small-caps eyebrow used everywhere in marketing + product */
.ellie-kicker {
  font-family: var(--ellie-font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-fg-muted);
}
/* Mono numeric label — day labels, token counts, deltas, timestamps */
.ellie-mono {
  font-family: var(--ellie-font-mono);
  font-weight: 700;
  letter-spacing: 0.02em;
}
/* Editor / journal canvas — Newsreader, the marketing & manuscript serif */
.ellie-editor {
  font-family: var(--ellie-font-editor);
  font-size: 18px;
  line-height: 1.55;
  color: var(--c-fg);
}
/* The citation pill — Cool Blue wash, Onyx text, hard-corner. Iconic. */
.ellie-citation-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--ellie-radius-0);
  background: var(--ellie-color-cool-blue);
  color: var(--ellie-color-onyx);
  border: 1px solid var(--ellie-color-onyx);
  font-family: var(--ellie-font-ui);
  font-size: 0.78em;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--ellie-dur-fast) var(--ellie-ease);
  cursor: pointer;
}
.ellie-citation-pill:hover {
  background: var(--ellie-color-onyx);
  color: var(--ellie-color-cool-blue);
}
/* Primary button — hard-cornered, square, Punch Red */
.ellie-btn,
.ellie-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ellie-font-ui);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 10px 18px;
  border-radius: var(--ellie-radius-0);
  border: 1px solid var(--ellie-color-onyx);
  background: var(--ellie-color-punch-red);
  color: var(--c-on-dark);
  cursor: pointer;
  transition: background var(--ellie-dur-fast) var(--ellie-ease);
}
.ellie-btn-primary:hover { background: var(--c-action-primary-hover); }
.ellie-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ellie-font-ui);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 10px 18px;
  border-radius: var(--ellie-radius-0);
  border: 1px solid var(--ellie-color-onyx);
  background: var(--c-action-secondary);
  color: var(--c-action-secondary-fg);
  cursor: pointer;
  transition: background var(--ellie-dur-fast) var(--ellie-ease);
}
.ellie-btn-secondary:hover { background: var(--ellie-color-cool-blue); }
/* Focus visible — applied site-wide for keyboard users */
:focus-visible {
  outline: var(--ellie-focus-ring);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
:root {
  --primary-color: /* ===== Lock Screen ===== */
  --secondary-color: #666;
  --hover-color: #e60000;
  --lock-font-family: "Lobster", cursive;
  /* Safe area CSS variables for notched iPhones */
  --sai-top: env(safe-area-inset-top, 0px);
  --sai-bottom: env(safe-area-inset-bottom, 0px);
  --sai-left: env(safe-area-inset-left, 0px);
  --sai-right: env(safe-area-inset-right, 0px);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #eef2f5;
}

/* Root app container — must fill viewport */
.App {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}

/* Root app container â€” must fill viewport */
.App {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

/* ===== Lock Screen ===== */
.lock-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0515 0%, #1a0a2e 25%, #2d1230 50%, #1a0820 75%, #050210 100%);
  background-size: 400% 400%;
  animation: lockBg 12s ease infinite;
  overflow: hidden;
  z-index: 50;
  font-family: var(--lock-font-family);
  text-align: center;
  /* Prevent overscroll bounce in iOS WebViews (FB Messenger) */
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

/* Subtle star overlay for lock screen */
.lock-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 8% 15%, rgba(255,200,220,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 55%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 10%, rgba(255,180,200,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 40%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 80% 75%, rgba(255,200,230,0.3) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 15% 80%, rgba(255,180,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 85%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 8%, rgba(255,180,220,0.3) 0%, transparent 100%);
  pointer-events: none;
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes lockBg {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes twinkle {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

/* Vignette for lock screen */
.lock-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
}

.lock-icon {
  font-size: 48px;
  margin-bottom: 24px;
  animation: lockPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(255, 150, 180, 0.5));
  position: relative;
  z-index: 2;
}

@keyframes lockPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.lock-input {
  width: 200px;
  padding: 14px 20px;
  font-size: 24px;
  text-align: center;
  border: 2px solid rgba(255, 180, 200, 0.4);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  color: #f8c8dc;
  outline: none;
  letter-spacing: 8px;
  transition: border-color 0.3s, box-shadow 0.3s;
  font-family: var(--lock-font-family);
  position: relative;
  z-index: 2;
}

.lock-input:focus {
  border-color: rgba(255, 180, 200, 0.7);
  box-shadow: 0 0 20px rgba(255, 150, 180, 0.3);
}

.lock-input::placeholder {
  color: transparent;
}

.lock-input.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}


/* ===== Lock Screen Responsive ===== */
@media (max-width: 768px) {
  .lock-icon {
    font-size: 64px;
    margin-bottom: 30px;
  }
  .lock-input {
    width: 220px;
    padding: 16px 24px;
    font-size: 28px; /* > 16px prevents iOS auto-zoom */
  }
}

/* Landscape lock screen */
@media (max-height: 500px) and (orientation: landscape) {
  .lock-icon {
    font-size: 36px;
    margin-bottom: 12px;
  }
  .lock-input {
    width: 180px;
    padding: 10px 16px;
    font-size: 22px;
  }
}

/* Safe area for notched iPhones — lock screen */
@supports (padding: env(safe-area-inset-bottom)) {
  .lock-screen {
    padding-top: env(safe-area-inset-top);
  }
}

/* iPhone PWA — lock screen */
@media only screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2) {
  .lock-screen {
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
  }
}

/*
 * Legacy 2103 journal tokens.
 *
 * These values used to live on html/:root in JournalApp.css. Keep them scoped to
 * the restored journal shell so the lockscreen, marketing page, and future app
 * shells are not resized by importing JournalApp.
 */
.notebook-container {
  --fs-xs: clamp(8.4px, 0.5vw + 5.6px, 10.08px);
  --fs-sm: clamp(10.08px, 0.6vw + 6.3px, 11.9px);
  --fs-base: clamp(11.9px, 0.7vw + 7px, 14px);
  --fs-md: clamp(13.3px, 0.8vw + 7px, 16.1px);
  --fs-lg: clamp(15.4px, 1vw + 7px, 19.6px);
  --fs-xl: clamp(18.2px, 1.2vw + 7px, 23.8px);
  --fs-2xl: clamp(21px, 1.5vw + 7px, 30.8px);
  --sp-xs: clamp(2px, 0.3vw, 4px);
  --sp-sm: clamp(4px, 0.5vw, 8px);
  --sp-md: clamp(8px, 1vw, 16px);
  --sp-lg: clamp(12px, 1.5vw, 24px);

  --bg-primary: #fdfdfd;
  --bg-secondary: #faf8f5;
  --bg-tertiary: #f5f1ec;
  --bg-hover: #ebe6df;
  --bg-input: #fff;
  --bg-card: #fff;
  --bg-overlay: rgba(250, 248, 245, 0.95);

  --text-primary: #1a1a1a;
  --text-secondary: #2c1810;
  --text-muted: #555;
  --text-faint: #888;
  --text-placeholder: #c0b8a8;

  --border-primary: #e8e3db;
  --border-secondary: #d1cdc5;
  --border-accent: #8b7355;

  --accent-primary: #8b7355;
  --accent-warm: #c9a96e;
  --accent-success: #22c55e;
  --accent-error: #ef4444;
  --accent-warning: #f59e0b;
  --accent-info: #3b82f6;
  --accent-purple: #8b5cf6;

  --citation-bg: #f0ecff;
  --citation-bg-end: #e8e0ff;
  --citation-text: #6d28d9;
  --citation-border: rgba(139, 92, 246, 0.2);
  --citation-bg-hover: #e8e0ff;
  --citation-bg-hover-end: #ddd4ff;
  --citation-border-hover: rgba(139, 92, 246, 0.35);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.10), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Safe fallback styles for legacy modals/dashboards */
  --border: var(--border-primary);
  --border-color: var(--border-primary);
  --card-bg: var(--bg-secondary);
  --text-tertiary: var(--text-muted);
}

.export-overlay,
.lit-modal-overlay,
.focus-log-modal,
.meta-analysis-workspace-overlay,
.reviewer-card-overlay,
.action-drawer-overlay,
.lit-graph-overlay,
.manuscript-overlay,
.manuscript-ai-overlay,
.wm-canvas-overlay,
.wm-madlibs-overlay,
.cta-overlay,
.nexus-panel {
  --fs-xs: clamp(8.4px, 0.5vw + 5.6px, 10.08px);
  --fs-sm: clamp(10.08px, 0.6vw + 6.3px, 11.9px);
  --fs-base: clamp(11.9px, 0.7vw + 7px, 14px);
  --fs-md: clamp(13.3px, 0.8vw + 7px, 16.1px);
  --fs-lg: clamp(15.4px, 1vw + 7px, 19.6px);
  --fs-xl: clamp(18.2px, 1.2vw + 7px, 23.8px);
  --fs-2xl: clamp(21px, 1.5vw + 7px, 30.8px);
  --sp-xs: clamp(2px, 0.3vw, 4px);
  --sp-sm: clamp(4px, 0.5vw, 8px);
  --sp-md: clamp(8px, 1vw, 16px);
  --sp-lg: clamp(12px, 1.5vw, 24px);

  --bg-primary: #fdfdfd;
  --bg-secondary: #faf8f5;
  --bg-tertiary: #f5f1ec;
  --bg-hover: #ebe6df;
  --bg-input: #fff;
  --bg-card: #fff;
  --bg-overlay: rgba(250, 248, 245, 0.95);

  --text-primary: #1a1a1a;
  --text-secondary: #2c1810;
  --text-muted: #555;
  --text-faint: #888;
  --text-placeholder: #c0b8a8;

  --border-primary: #e8e3db;
  --border-secondary: #d1cdc5;
  --border-accent: #8b7355;

  --accent-primary: #8b7355;
  --accent-warm: #c9a96e;
  --accent-success: #22c55e;
  --accent-error: #ef4444;
  --accent-warning: #f59e0b;
  --accent-info: #3b82f6;
  --accent-purple: #8b5cf6;

  --citation-bg: #f0ecff;
  --citation-bg-end: #e8e0ff;
  --citation-text: #6d28d9;
  --citation-border: rgba(139, 92, 246, 0.2);
  --citation-bg-hover: #e8e0ff;
  --citation-bg-hover-end: #ddd4ff;
  --citation-border-hover: rgba(139, 92, 246, 0.35);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.10), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Safe fallback styles for legacy modals/dashboards */
  --border: var(--border-primary);
  --border-color: var(--border-primary);
  --card-bg: var(--bg-secondary);
  --text-tertiary: var(--text-muted);
}
/*
 * Transitional CSS aggregator for the restored legacy journal shell.
 *
 * Keep imports here while JournalApp.js is being split into feature slices so
 * the component entrypoint only owns one legacy stylesheet import.
 */
/* =========================================
   CLEAN NOTEBOOK – Private Journal (2103)
   Ivory Tower Desktop · Clean Mobile
   ========================================= */
.notebook-container {
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: var(--sp-md) 20px 0;
  padding-top: calc(var(--sp-md) + env(safe-area-inset-top, 0px));
  font-family: 'Georgia', 'Times New Roman', serif;
  text-align: left;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
/* ── Mobile container: full bleed, no dark gaps ── */
.notebook-container.mobile-layout {
  max-width: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  padding: 6px 12px 0;
  padding-top: calc(6px + env(safe-area-inset-top, 0px));
}
/* ── Header ── */
.notebook-header {
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: var(--sp-sm);
  padding-bottom: var(--sp-xs);
  flex-shrink: 0;
}
.notebook-header h1 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: var(--fs-xl);
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}
.notebook-header p {
  margin: 4px 0 0;
  font-size: var(--fs-xs);
  color: var(--text-faint);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
}
/* ── Composer ── */
.notebook-composer {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--sp-md);
  margin-bottom: var(--sp-sm);
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}
.notebook-composer:focus-within {
  box-shadow: var(--shadow-md);
}
.notebook-composer textarea {
  width: 100%;
  border: none;
  font-family: 'Times New Roman', Times, serif;
  font-size: 12pt;
  resize: none;
  min-height: 200px;
  outline: none;
  line-height: 1.15;
  color: var(--text-primary);
  box-sizing: border-box;
  overflow-y: hidden; /* auto-grow handles scrolling */
  flex: 1;
  min-height: 0;
  /* paragraph spacing: 0 before, 6pt after — simulated via padding */
  padding-bottom: 6pt;
}
.notebook-composer textarea::placeholder {
  color: var(--text-placeholder);
}
.notebook-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-top: 6px;
  border-top: 1px solid var(--border-primary);
  padding-top: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  min-height: 0;
}
.copyright-watermark {
  white-space: nowrap;
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0.5;
  margin-left: auto;
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.2px;
}
.attach-btn {
  cursor: pointer;
  font-size: calc(var(--fs-sm) * 1.15);
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: color 0.2s;
  padding: 4px 0;
  flex-shrink: 0;
}
.attach-btn:hover {
  color: var(--text-primary);
}
/* ── PDF Extract Button ── */
.pdf-extract-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
.pdf-extract-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.pdf-extract-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
/* ── Feed ── */
.notebook-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 24px;
}
/* Mobile scrollable area below composer */
.mobile-scroll-area {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.mobile-scroll-area .notebook-feed {
  overflow-y: visible;
  flex: none;
}
/* Desktop scrollable area below composer */
.desktop-scroll-area {
  flex: 1;
  overflow-y: auto !important;
  min-height: 0 !important; /* Magic rule to ensure flexbox scrolling works */
  padding-bottom: 80px;
}
.desktop-scroll-area .notebook-feed {
  overflow-y: visible;
  flex: none;
}
.notebook-empty {
  text-align: center;
  color: var(--text-placeholder);
  font-size: var(--fs-md);
  margin-top: 40px;
  font-style: italic;
}
.notebook-empty strong,
.notebook-empty span {
  display: block;
}
.notebook-empty strong {
  color: var(--text-secondary);
  font-style: normal;
  margin-bottom: 4px;
}
/* ── Entry ── */
.notebook-entry {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-primary);
}
.notebook-entry:first-child {
  padding-top: 0;
}
.notebook-entry time {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-faint);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.entry-content p {
  font-size: var(--fs-md);
  line-height: 1.85;
  color: var(--text-primary);
  margin: 0;
  white-space: pre-wrap;
}
.notebook-entry img {
  max-width: 100%;
  border-radius: 4px;
  margin-top: 18px;
}
/* ── Mobile adjustments ── */
@media (max-width: 768px) {
  .notebook-container {
    padding: 12px 16px 0;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }
  .notebook-header h1 {
    font-size: var(--fs-xl);
  }
  .notebook-composer textarea {
    font-size: 16px; /* >= 16px prevents iOS auto-zoom on focus */
    min-height: 120px;
  }
  .entry-content p {
    font-size: var(--fs-base);
    line-height: 1.75;
  }
}
/* ── Header row (date + save indicator) ── */
.notebook-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.save-indicator {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition: opacity 0.3s;
}
/* ── Daily Composer tweaks ── */
.notebook-composer--daily textarea {
  min-height: 260px; /* base; desktop override in DESKTOP COMPOSER-FIRST section */
}
.composer-hint {
  font-size: var(--fs-xs);
  color: var(--text-placeholder);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.5px;
}
/* ═════════════════════════════════════════
   BUJO PARSER (NoteParser.js)
   ═════════════════════════════════════════ */
.bujo-parsed {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bujo-bullet,
.bujo-task,
.bujo-task-done,
.bujo-task-migrated,
.bujo-insight,
.bujo-plain {
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--text-primary);
  margin: 0;
}
.bujo-symbol {
  display: inline-block;
  width: 22px;
  font-size: var(--fs-sm);
  text-align: center;
  margin-right: 6px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.bujo-bullet {
  display: flex;
  align-items: baseline;
  padding-left: 8px;
}
.bujo-task {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-primary);
  padding-left: 8px;
  margin-bottom: 4px;
}
.bujo-task-done {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-decoration: line-through;
  opacity: 0.55;
  color: var(--text-faint);
  padding-left: 8px;
  margin-bottom: 4px;
}
.bujo-task-migrated {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-faint);
  font-style: italic;
  text-decoration: line-through;
  padding-left: 8px;
  margin-bottom: 4px;
}
.bujo-insight {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-left: 3px solid #ffd700;
  padding: 8px 12px;
  font-weight: 600;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 0 4px 4px 0;
  margin: 10px 0;
  color: var(--text-secondary);
}
.bujo-exclaim {
  flex-shrink: 0;
  font-size: var(--fs-sm);
}
/* Interactive checkboxes */
.bujo-box.clickable {
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}
.bujo-box.clickable:hover {
  color: var(--text-secondary);
}
.bujo-task.completed {
  color: var(--text-faint);
}
.bujo-image {
  max-width: 100%;
  border-radius: 4px;
  margin: 12px 0;
}
.bujo-file-link {
  display: inline-block;
  color: #0056b3;
  text-decoration: none;
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-tertiary);
  padding: 6px 14px;
  border-radius: 6px;
  margin: 6px 0;
  transition: background 0.15s;
}
.bujo-file-link:hover {
  background: var(--bg-hover);
  text-decoration: underline;
}
.bujo-spacer {
  height: 8px;
}
.bujo-tag {
  color: #0056b3;
  font-weight: 600;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s;
}
.bujo-tag:hover {
  background: rgba(0, 86, 179, 0.08);
}
.bujo-wikilink {
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-style: dotted;
  cursor: pointer;
}
.clickable-wikilink {
  color: var(--text-secondary);
  text-decoration: underline dotted;
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 3px;
  padding: 0 2px;
}
.clickable-wikilink:hover {
  background-color: rgba(74, 44, 42, 0.1);
}
.clickable-wikilink:focus-visible {
  outline: 2px solid #4a2c2a;
  outline-offset: 1px;
}
/* Sprint 43: Invalid citation in plain-text renderer */
.citation-invalid {
  color: #991b1b;
  background: #fee2e2;
  border-radius: 3px;
  padding: 0 4px;
  font-style: italic;
  cursor: help;
  text-decoration: none;
}
/* ═════════════════════════════════════════
   DISCOVERY ENGINE (Search + Tag Cloud)
   ═════════════════════════════════════════ */
.journal-discovery {
  margin-bottom: 0;
  border-top: none;
  padding-top: 0;
  flex-shrink: 0;
}
.journal-search {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-secondary);
  font-family: 'Georgia', serif;
  font-size: var(--fs-md);
  padding: 4px 0;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.journal-search:focus {
  border-bottom-color: var(--text-faint);
}
.journal-search::placeholder {
  color: var(--text-placeholder);
  font-style: italic;
}
/* ── Search Row: flex container for search + synthesize button ── */
.search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
}
.search-row .journal-search {
  flex: 1;
  margin-bottom: 0;
}
.search-scope-toggle {
  display: flex;
  background: var(--bg-tertiary);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  margin-left: 4px;
}
.scope-btn {
  padding: 5px 12px;
  border-radius: calc(var(--radius-md) - 2px);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.scope-btn:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(0,0,0,0.03);
}
.scope-btn.active {
  background: var(--bg-card);
  color: var(--accent-purple);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.scope-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.import-btn {
  margin-left: auto;
  font-size: 0.82em;
  padding: 4px 10px !important;
  border: 1px solid var(--accent-purple) !important;
  border-radius: 6px;
  color: var(--accent-purple) !important;
  background: transparent !important;
}
.import-btn:hover {
  background: rgba(139, 92, 246, 0.08) !important;
}
/* ── Weekly Insight Tracker ── */
.weekly-insight-tracker {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 4px 0;
}
.weekly-insight-tracker.tracker-ready {
  color: #4a7c59;
}
.tracker-bar {
  height: 3px;
  background: var(--border-primary);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.tracker-fill {
  height: 100%;
  background: #8b5cf6;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.tracker-ready .tracker-fill {
  background: #4a7c59;
}
/* ── Omnibar Autocomplete ── */
.autocomplete-wrapper {
  position: relative;
  flex: 1;
  display: flex;
}
.autocomplete-wrapper .journal-search {
  flex: 1;
  margin-bottom: 0;
}
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  z-index: 1000;
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.autocomplete-item {
  padding: 6px 14px;
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
  transition: background .12s;
}
.autocomplete-item:hover,
.autocomplete-item:focus {
  background: var(--accent-light, #f5ebe0);
}
.synthesize-btn {
  padding: 2px 8px;
  font-size: var(--fs-sm);
  white-space: nowrap;
  line-height: 1.2;
}
.journal-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tag-pill {
  display: inline-block;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: none;
  border-radius: 14px;
  padding: 3px 10px;
  font-size: var(--fs-xs);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.tag-pill:hover {
  background: var(--bg-hover);
}
.tag-pill--active {
  background: var(--accent-primary);
  color: #fff;
}
.tag-pill--active:hover {
  background: var(--accent-primary);
}
.tag-pill--excluded {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
}
.tag-pill-group {
  display: inline-flex;
  align-items: center;
  border-radius: 16px;
  overflow: hidden;
}
.tag-pill-group .tag-pill {
  border-radius: 14px 0 0 14px;
}
.tag-pill-exclude {
  border: none;
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: pointer;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 0 14px 14px 0;
}
.tag-pill-exclude:hover {
  background: #fff1f2;
  color: #9f1239;
}
.search-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.search-filter-mode,
.search-filter-chip,
.search-filter-clear {
  border: 1px solid var(--border-secondary);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  padding: 3px 9px;
  cursor: pointer;
}
.search-filter-mode {
  font-weight: 700;
  color: var(--text-primary);
}
.search-filter-chip {
  background: rgba(108, 99, 255, 0.1);
  border-color: rgba(108, 99, 255, 0.25);
}
.search-filter-chip-excluded {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
.search-filter-clear {
  background: transparent;
  color: var(--text-muted);
}
.project-panel-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}
.project-panel-active-scope {
  margin-left: auto;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.project-panel-search {
  flex: 1 1 150px;
  min-width: 130px;
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  padding: 5px 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: var(--fs-xs);
}
.project-panel-tool-btn {
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  padding: 5px 8px;
  cursor: pointer;
}
.project-panel-tool-btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}
.project-panel-tool-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.project-panel-scope-note {
  margin: 2px 0 6px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.35;
}
.project-panel-merge {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(108, 99, 255, 0.2);
  background: rgba(108, 99, 255, 0.07);
  border-radius: 8px;
  padding: 8px;
  margin-top: 6px;
  font-size: var(--fs-xs);
}
.project-panel-merge select {
  border: 1px solid var(--border-secondary);
  border-radius: 7px;
  padding: 5px 8px;
  background: var(--bg-card);
  color: var(--text-primary);
}
.project-panel-merge-actions {
  display: flex;
  gap: 6px;
}
.project-panel-merge p,
.project-panel-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.project-tagger {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  position: relative;
}
.project-tagger-label {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  margin-right: 2px;
}
.project-tagger-empty {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-style: italic;
  opacity: 0.75;
}
.project-tagger-add {
  border: 1px dashed var(--border-secondary);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 2px 8px;
}
.project-tagger-compact {
  margin-top: 8px;
}
.lit-project-assign {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.lit-project-assign select {
  border: 1px solid var(--border-secondary);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: var(--fs-xs);
  padding: 4px 8px;
  max-width: 220px;
}
/* ── History separator ── */
.journal-history {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
/* ═════════════════════════════════════════
   DAILY SPARK (Zettelkasten resurface)
   ═════════════════════════════════════════ */
.daily-spark {
  margin-top: 60px;
  padding: 24px;
  border-top: 1px solid var(--border-primary);
  text-align: center;
}
.daily-spark .spark-label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-placeholder);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.daily-spark p {
  font-family: 'Georgia', serif;
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--text-faint);
  font-style: italic;
  margin: 0;
}
.daily-spark .spark-date {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-placeholder);
  margin-top: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
/* ── Mobile adjustments for new journal features ── */
@media (max-width: 768px) {
  .notebook-composer--daily textarea {
    min-height: 160px;
  }
  .journal-tag-cloud {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .journal-search {
    font-size: var(--fs-sm);
  }
  .bujo-bullet,
  .bujo-task,
  .bujo-task-done,
  .bujo-task-migrated,
  .bujo-insight,
  .bujo-plain {
    font-size: var(--fs-sm);
    line-height: 1.65;
  }
  .daily-spark {
    margin-top: 40px;
    padding: 20px 12px;
  }
}
/* ═════════════════════════════════════════
   IDENTITY ANCHOR & HELP MODAL (Cheat Sheet)
   ═════════════════════════════════════════ */
.identity-anchor {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-align: center;
  margin-top: 0;
  margin-bottom: var(--sp-sm);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  border-bottom: 1px solid var(--border-primary);
  padding-bottom: var(--sp-xs);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}
.help-toggle-btn {
  color: var(--text-faint);
  font-family: 'Georgia', serif;
  font-style: italic;
}
.principles-toggle-btn {
  color: #8b5cf6;
  font-family: 'Georgia', serif;
  font-weight: 700;
}
.principles-toggle-btn:hover {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple);
  transform: scale(1.1);
}
.help-toggle-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--text-secondary);
  transform: scale(1.1);
}
.help-modal {
  position: fixed;
  bottom: 116px;
  right: max(16px, 2vw);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-primary);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 20px 24px;
  width: min(580px, 90vw);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  z-index: 1000;
  animation: helpFadeIn 0.2s ease-out;
}
@keyframes helpFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.help-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: var(--fs-xl);
  line-height: 1;
  cursor: pointer;
  color: var(--text-faint);
  transition: color 0.2s;
}
.help-close-btn:hover { color: var(--text-primary); }
.help-header {
  margin: 0 0 14px 0;
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-secondary);
}
.help-manual-modal {
  width: min(760px, 92vw);
  padding: 22px 24px 18px;
}
.help-manual-head {
  padding-right: 28px;
}
.help-kicker {
  margin: 0 0 4px;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
}
.help-manual-head .help-header {
  margin-bottom: 6px;
  font-size: var(--fs-lg);
  color: var(--text-primary);
}
.help-subtitle {
  margin: 0 0 14px;
  color: var(--text-muted);
  line-height: 1.5;
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.help-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-primary);
  padding-bottom: 10px;
}
.help-mode-tabs button {
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: var(--fs-xs);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  cursor: pointer;
}
.help-mode-tabs button.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}
.help-manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.help-manual-section {
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 14px;
  background: rgba(250, 249, 247, 0.72);
  margin-bottom: 0;
}
.help-section-summary {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  line-height: 1.45;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.help-limit-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.help-limit-card {
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  background: rgba(250, 249, 247, 0.72);
  padding: 13px 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.help-limit-card h4 {
  margin: 0 0 6px;
  color: var(--text-primary);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.help-limit-card p {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.55;
}
.help-limit-card p:last-child {
  margin-bottom: 0;
}
.help-manual-footer {
  margin-top: 14px;
  border-top: 1px solid var(--border-primary);
  padding-top: 12px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.help-user-guide-panel .help-manual-grid {
  margin-bottom: 14px;
}
.help-user-guide-limits {
  margin-top: 2px;
}
.help-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.help-column {}
.help-section { margin-bottom: 14px; }
.help-section h4 {
  margin: 0 0 6px 0;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.help-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.help-list li {
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.help-list code {
  background: var(--bg-tertiary);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: 600;
}
/* ── Mobile: stack help grid ── */
@media (max-width: 768px) {
  .help-modal {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 64px;
    max-height: 70vh;
  }
  .help-grid-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .help-manual-grid {
    grid-template-columns: 1fr;
  }
  .help-mode-tabs {
    flex-wrap: wrap;
  }
}
/* ═════════════════════════════════════════
   SLIP-BOX VIEW TOGGLE
   ═════════════════════════════════════════ */
.journal-view-toggle {
  display: flex;
  gap: 12px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-primary);
  padding-bottom: 0;
  align-items: center;
}
.journal-view-toggle button {
  background: none;
  border: none;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px 2px 6px;
  transition: color 0.2s;
}
.journal-view-toggle button.active {
  color: var(--text-primary);
  font-weight: bold;
  border-bottom: 2px solid var(--accent-primary);
}
/* Analytics & Export buttons inline with view-toggle */
.view-toggle-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}
.view-toggle-action-btn {
  background: none;
  border: none;
  font-size: calc(var(--fs-sm) * 1.2);
  cursor: pointer;
  padding: 2px 4px;
  color: var(--text-faint);
  transition: color 0.15s;
  line-height: 1;
}
.view-toggle-action-btn:hover {
  color: #4a2080;
}
/* ═════════════════════════════════════════
   GHOST GRAPH (Unlinked Mentions)
   ═════════════════════════════════════════ */
.ghost-mention {
  border-bottom: 1px dashed var(--border-secondary);
  cursor: help;
  transition: border-color 0.2s;
}
.ghost-mention:hover {
  border-bottom-color: var(--text-faint);
}
/* ═════════════════════════════════════════
   SPOTLIGHT HIGHLIGHTING (Search)
   ═════════════════════════════════════════ */
.search-highlight {
  background-color: rgba(255, 215, 0, 0.4);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}
/* ═════════════════════════════════════════
   WIKILINK AUTO-COMPLETE DROPDOWN
   ═════════════════════════════════════════ */
.suggestion-dropdown {
  position: fixed;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
  min-width: 200px;
}
.suggestion-item {
  padding: 8px 14px;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-family: 'Georgia', serif;
  color: var(--text-secondary);
  transition: background 0.15s;
}
.suggestion-item:hover {
  background: rgba(74, 44, 42, 0.08);
}
.suggestion-item:first-child {
  border-radius: 8px 8px 0 0;
}
.suggestion-item:last-child {
  border-radius: 0 0 8px 8px;
}
/* ═════════════════════════════════════════
   DEADLINE COUNTDOWN BANNER
   ═════════════════════════════════════════ */
.deadline-banner {
  text-align: center;
  padding: 8px 16px;
  background: rgba(44, 24, 16, 0.05);
  border: 1px solid rgba(44, 24, 16, 0.12);
  border-radius: 8px;
  font-size: var(--fs-base);
  color: var(--text-secondary);
  font-family: 'Georgia', serif;
  margin-bottom: 10px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.deadline-banner:hover {
  background: rgba(44, 24, 16, 0.09);
}
.deadline-edit-icon {
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: var(--fs-xs);
}
.deadline-banner:hover .deadline-edit-icon {
  opacity: 1;
}
.deadline-banner.deadline-editing {
  cursor: default;
  padding: 12px 16px;
}
.deadline-banner.deadline-add {
  opacity: 0.5;
  font-style: italic;
  border-style: dashed;
}
.deadline-banner.deadline-add:hover {
  opacity: 0.8;
}
/* Compact deadline in left panel */
.deadline-banner.deadline-compact {
  font-size: calc(var(--fs-xs) * 1.2);
  padding: 2px 8px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: rgba(44, 24, 16, 0.03);
  border-color: rgba(44, 24, 16, 0.08);
  color: #4a2080;
}
.deadline-edit-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.deadline-input-name {
  flex: 1;
  min-width: 140px;
  padding: 6px 10px;
  border: 1px solid rgba(44, 24, 16, 0.2);
  border-radius: 6px;
  background: var(--bg-card);
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.deadline-input-date {
  padding: 6px 10px;
  border: 1px solid rgba(44, 24, 16, 0.2);
  border-radius: 6px;
  background: var(--bg-card);
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.deadline-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.deadline-btn {
  padding: 4px 14px;
  border: none;
  border-radius: 6px;
  font-size: var(--fs-xs);
  font-family: 'Georgia', serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.deadline-btn:active { transform: scale(0.96); }
.deadline-btn.save {
  background: #4a7c59;
  color: #fff;
}
.deadline-btn.save:hover { background: #3a6a49; }
.deadline-btn.cancel {
  background: rgba(44, 24, 16, 0.1);
  color: var(--text-secondary);
}
.deadline-btn.cancel:hover { background: rgba(44, 24, 16, 0.18); }
.deadline-btn.remove {
  background: rgba(180, 40, 40, 0.1);
  color: #b42828;
}
.deadline-btn.remove:hover { background: rgba(180, 40, 40, 0.2); }
/* ═════════════════════════════════════════
   BACKLINKS PANEL
   ═════════════════════════════════════════ */
.backlinks-panel {
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent-primary);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 0 8px 8px 0;
}
.backlinks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.backlinks-header h4 {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-family: 'Georgia', serif;
}
.backlinks-close {
  background: none;
  border: none;
  font-size: var(--fs-lg);
  cursor: pointer;
  color: var(--text-faint);
  transition: color 0.2s;
}
.backlinks-close:hover {
  color: var(--text-primary);
}
.backlinks-empty {
  font-size: var(--fs-sm);
  color: var(--text-faint);
  font-style: italic;
}
.backlink-snippet {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-primary);
}
.backlink-snippet:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.backlink-snippet time {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-faint);
  margin-bottom: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.backlink-snippet p {
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
}
/* ═════════════════════════════════════════
   BUJO HEADING (### lines rendered)
   ═════════════════════════════════════════ */
.bujo-heading {
  font-size: var(--fs-sm);
  font-family: 'Georgia', serif;
  margin: 12px 0 6px 0;
  color: var(--text-secondary);
}
/* ═════════════════════════════════════════
   EXPORT BUTTON (header)
   ═════════════════════════════════════════ */
.export-btn {
  background: none;
  border: none;
  font-size: var(--fs-lg);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.2s;
  margin-left: 8px;
}
.export-btn:hover { background: rgba(44, 24, 16, 0.08); }
/* ═════════════════════════════════════════
   EXPORT MODAL
   ═════════════════════════════════════════ */
.export-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.export-modal {
  background: var(--bg-card);
  padding: 28px;
  border-radius: 14px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  font-family: 'Georgia', serif;
  color: var(--text-secondary);
  max-height: 90vh;
  overflow-y: auto;
}
.export-modal h3 {
  margin: 0 0 20px 0;
  font-size: var(--fs-md);
  border-bottom: 2px solid var(--border-primary);
  padding-bottom: 12px;
}
.export-group {
  margin-bottom: 18px;
}
.export-label {
  display: block;
  font-weight: bold;
  font-size: var(--fs-sm);
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.export-dates {
  display: flex;
  align-items: center;
  gap: 10px;
}
.export-dates input[type="date"] {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.export-dates span {
  color: var(--text-faint);
  font-size: var(--fs-sm);
}
.export-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.export-cat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}
.export-cat-label:hover { background: rgba(0,0,0,0.03); }
.export-cat-label input[type="checkbox"] {
  accent-color: var(--text-secondary);
  width: 16px;
  height: 16px;
}
.export-cat-self { color: #2e7d32; }
.export-cat-success { color: #1565c0; }
.export-cat-social { color: #e65100; }
.export-cat-service { color: #6a1b9a; }
.export-query {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  box-sizing: border-box;
}
.export-query::placeholder { color: var(--text-placeholder); }
.export-format-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.export-format-btn {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  background: var(--bg-card);
  font-family: 'Georgia', serif;
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
  text-align: center;
  min-width: 0;
}
.export-format-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--text-secondary);
}
.export-format-btn:hover:not(.active) {
  background: rgba(44, 24, 16, 0.06);
}
.export-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 22px;
}
.export-go {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.export-go:hover { background: var(--accent-primary); }
.export-go:active { transform: scale(0.97); }
.export-cancel {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.export-cancel:hover { background: var(--bg-hover); }
.export-preview-count {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  margin-right: auto;
  align-self: center;
  font-style: italic;
}
/* ── Sprint 26B: New Project Gateway Modal ── */
.new-project-modal {
  background: var(--bg-card);
  padding: 32px;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  font-family: 'Georgia', serif;
  color: var(--text-secondary);
}
.new-project-title {
  margin: 0 0 6px 0;
  font-size: var(--fs-lg);
  color: var(--text-primary);
}
.new-project-subtitle {
  margin: 0 0 24px 0;
  font-size: var(--fs-sm);
  color: var(--text-faint);
}
.new-project-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.new-project-card {
  background: var(--bg-secondary, #faf8f5);
  border: 2px solid var(--border-primary, #e8e3db);
  border-radius: 12px;
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
}
.new-project-card:hover {
  border-color: var(--accent-primary, #8b7355);
  box-shadow: 0 4px 16px rgba(44, 24, 16, 0.08);
  transform: translateY(-2px);
}
.new-project-card-accent {
  border-color: #d4b8ff;
  background: #faf8ff;
}
.new-project-card-accent:hover {
  border-color: #8b5cf6;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
}
.new-project-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 10px;
}
.new-project-card h4 {
  margin: 0 0 8px 0;
  font-size: var(--fs-base);
  color: var(--text-primary);
}
.new-project-card p {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.5;
}
.new-project-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: white;
  font-size: 9.1px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
@media (max-width: 640px) {
  .new-project-options { grid-template-columns: 1fr; }
  .new-project-modal { padding: 20px; }
}
@media (max-width: 480px) {
  .export-modal { padding: 20px; }
  .export-checkboxes { grid-template-columns: 1fr; }
  .export-format-btns { flex-direction: column; }
}
/* ═════════════════════════════════════════
   INLINE SAVE BUTTON (iMessage-style)
   ═════════════════════════════════════════ */
.notebook-composer {
  position: relative;
}
.inline-save-btn {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  font-size: calc(var(--fs-xs) * 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(44, 24, 16, 0.25);
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  margin-left: auto;
}
.inline-save-btn:hover {
  background: var(--accent-primary);
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(44, 24, 16, 0.4);
}
.inline-save-btn:active {
  transform: scale(0.9);
  background: var(--accent-primary);
}
/* ═════════════════════════════════════════
   ACTION DRAWER TOGGLE + MODE BUTTONS
   (formerly zen mode — kept for drawer/manuscript UI)
   ═════════════════════════════════════════ */
.zen-toggle-btn {
  background: none;
  border: none;
  font-size: var(--fs-md);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.2s;
  margin-left: 4px;
}
.zen-toggle-btn:hover {
  background: rgba(44, 24, 16, 0.08);
}
.mode-btn {
  background: none;
  border: 1px solid transparent;
  font-size: var(--fs-xs);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 6px;
  color: var(--text-faint);
  transition: all 0.2s;
  white-space: nowrap;
}
.mode-btn:hover {
  background: rgba(44, 24, 16, 0.06);
  color: var(--text-muted);
}
/* ═════════════════════════════════════════
   RESEARCH MODE (Desktop split-screen)
   Container-query aware panes
   ═════════════════════════════════════════ */
.notebook-container.research-mode-on {
  display: grid !important;
  max-width: 100% !important;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: 0 !important;
  transition: all 0.3s ease;
}
.research-split {
  grid-template-columns: 60fr 8px 40fr;
  gap: 0;
}
/* ── Left Pane: Writing ── */
.research-left {
  container-type: inline-size;
  container-name: left-pane;
  padding: 4px var(--sp-md) var(--sp-sm) var(--sp-md) !important;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}
.research-left.research-left-manuscript {
  padding: 0 !important;
}
.research-left .mode-toggle-row {
  margin-bottom: var(--sp-sm);
  flex-shrink: 0;
}
.research-left .notebook-composer {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: none;
  background: transparent;
  padding: 2px 0 0;
  box-shadow: none;
  margin-bottom: 0;
  min-height: 0;
  overflow: visible;
  width: 100% !important;
  max-width: 100% !important;
}
.research-left .notebook-composer textarea {
  flex: 1;
  font-family: 'Times New Roman', Times, serif !important;
  font-size: 12pt;
  line-height: 1.15;
  min-height: 0;
  color: var(--text-secondary);
  overflow-y: auto !important;
  resize: none;
  width: 100% !important;
  max-width: 100%;
}
/* Ensure controls never vanish */
.research-left .notebook-controls {
  flex-shrink: 0 !important;
  min-height: 28px;
  overflow: visible !important;
}
.research-left .notebook-composer:focus-within {
  box-shadow: none;
}
/* Container-query shrink rules for left pane */
@container left-pane (max-width: 450px) {
  .notebook-composer textarea { font-size: 10pt !important; line-height: 1.15 !important; }
  .format-toolbar button { font-size: 9.8px !important; padding: 2px 5px !important; }
  .composer-top-bar { gap: 4px !important; padding: 4px 6px !important; }
  .composer-hint { display: none !important; }
  .word-count { font-size: 9.1px !important; }
}
/* ── Right Pane: Reference ── */
.research-right {
  container-type: inline-size;
  container-name: right-pane;
  padding: 4px var(--sp-md) 0 var(--sp-md);
  overflow-y: auto;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-primary);
}
.research-right .notebook-header {
  margin-bottom: 0;
  padding-bottom: 4px;
  border-bottom: none;
  flex-shrink: 0;
}
/* Inline header: everything on one row */
.notebook-header-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 14px 10px;
  margin: 0;
  min-height: 52px;
}
.notebook-header-inline h1 {
  margin-right: 4px;
  white-space: nowrap;
  font-size: var(--fs-lg);
  color: #4a2080;
}
.notebook-header-inline p {
  margin: 0;
  margin-right: auto;
  white-space: nowrap;
  font-size: var(--fs-base);
  color: #f5b731;
  font-weight: 700;
}
/* Deadline counter centered in the header row */
.deadline-header-center {
  flex: 1;
  text-align: center;
  font-size: var(--fs-md);
  padding: 6px 12px;
  margin: 0;
  border-radius: 6px;
  background: rgba(44, 24, 16, 0.03);
  border: 1px solid rgba(44, 24, 16, 0.08);
  cursor: pointer;
  white-space: nowrap;
}
.deadline-header-center:hover { background: rgba(44, 24, 16, 0.06); }
.deadline-header-inline {
  flex: 1;
}
/* Action drawer button matching deadline height */
.action-drawer-header {
  font-size: calc(var(--fs-sm) * 1.2) !important;
  padding: 3px 8px !important;
  flex-shrink: 0;
  align-self: center;
}
.notebook-header-inline .icon-btn,
.notebook-header-inline .zen-toggle-btn,
.notebook-header-inline .export-btn {
  font-size: var(--fs-md);
  color: #4a2080;
}
.research-right .notebook-header h1 {
  font-size: var(--fs-lg);
  color: #4a2080;
}
.research-right .notebook-entry {
  padding: var(--sp-md) 0;
}
.research-right .entry-content p {
  font-size: var(--fs-base);
  line-height: 1.7;
}
.research-right .notebook-feed {
  flex: none;
  overflow-y: visible;
  min-height: 0;
}
/* Container-query shrink rules for right pane */
@container right-pane (max-width: 400px) {
  .notebook-header h1 { font-size: 14px !important; }
  .notebook-header p { font-size: 9.1px !important; }
  .journal-search { font-size: 11.9px !important; }
  .tag-pill { font-size: 9.8px !important; padding: 3px 8px !important; }
  .notebook-entry { padding: 10px 0 !important; }
  .entry-content p { font-size: 11.9px !important; line-height: 1.6 !important; }
  .notebook-entry time { font-size: 8.4px !important; }
}
/* ═════════════════════════════════════════
   PRIORITY TASK (NoteParser)
   ═════════════════════════════════════════ */
.bujo-task-priority {
  border-left: 3px solid #e53935;
  padding-left: 12px;
  background: rgba(229, 57, 53, 0.04);
  border-radius: 0 4px 4px 0;
}
/* ═════════════════════════════════════════
   TASK PROGRESS BAR (NoteParser)
   ═════════════════════════════════════════ */
.task-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-primary);
}
.task-progress-bar {
  flex: 1;
  height: 5px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}
.task-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a7c59, #2e7d32);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.task-progress-label {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  white-space: nowrap;
}
/* ═════════════════════════════════════════
   DRAG-AND-DROP HIGHLIGHT
   ═════════════════════════════════════════ */
.notebook-composer.drag-over {
  border-color: var(--accent-success);
  background: rgba(74, 124, 89, 0.03);
}
/* ═════════════════════════════════════════
   MOBILE-SPECIFIC OVERRIDES
   ═════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Tighter padding on mobile */
  .notebook-composer {
    padding: 16px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    position: relative;
    flex-shrink: 0;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .notebook-composer textarea {
    min-height: 120px;
    overflow-y: auto; /* mobile: allow scroll instead of auto-grow */
    flex: 1;
  }

  /* Float the inline save button over the textarea bottom-right on mobile */
  .mobile-layout .inline-save-btn {
    position: absolute;
    bottom: 56px; /* above the controls row */
    right: 16px;
    z-index: 10;
    width: 40px;
    height: 40px;
    box-shadow: 0 3px 12px rgba(44, 24, 16, 0.35);
  }

  /* Simplified controls row on mobile */
  .notebook-controls {
    flex-wrap: wrap;
    gap: 8px;
  }
  .composer-hint {
    display: none;
  }

  /* Stack header row elements */
  .notebook-header-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Full-width view toggle on mobile */
  .journal-view-toggle {
    justify-content: space-around;
  }
  .journal-view-toggle button {
    font-size: var(--fs-sm);
  }

  /* Deadline banner compact */
  .deadline-banner {
    font-size: var(--fs-xs);
    padding: 6px 12px;
  }
  .deadline-edit-row {
    flex-direction: column;
    gap: 6px;
  }

  /* Hide action drawer toggle + mode buttons on mobile */
  .zen-toggle-btn {
    display: none;
  }
}
/* ═════════════════════════════════════════
   FOLDABLE SECTIONS (NoteParser heading collapse)
   ═════════════════════════════════════════ */
.foldable-section {
  margin: 0;
}
.foldable-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}
.foldable-header:hover {
  opacity: 0.7;
}
.fold-arrow {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  transition: transform 0.2s;
  flex-shrink: 0;
  line-height: 1;
}
.fold-arrow.collapsed {
  transform: rotate(-90deg);
}
.foldable-body {
  animation: foldOpen 0.15s ease-out;
}
@keyframes foldOpen {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 2000px; }
}
.foldable-header .bujo-heading {
  margin: 0;
}
/* ═════════════════════════════════════════
   SUB-TASK INDENTATION
   ═════════════════════════════════════════ */
.bujo-indent {
  border-left: 1px solid var(--border-primary);
  padding-left: 4px;
}
/* ═════════════════════════════════════════
   PIN BUTTON & PINNED ENTRIES
   ═════════════════════════════════════════ */
.entry-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.entry-header-row time {
  margin-bottom: 0;
}
.pin-btn {
  background: none;
  border: none;
  font-size: var(--fs-sm);
  cursor: pointer;
  opacity: 0.25;
  transition: opacity 0.2s, transform 0.15s;
  padding: 2px 4px;
}
.pin-btn:hover {
  opacity: 0.6;
  transform: scale(1.15);
}
.pin-btn.pinned {
  opacity: 1;
  color: #b7791f;
}
.entry-pinned {
  background: rgba(255, 215, 0, 0.04);
  border-left: 3px solid rgba(255, 215, 0, 0.5);
  padding-left: 16px;
  border-radius: 0 4px 4px 0;
}
/* ═════════════════════════════════════════
   WORD COUNT / READING TIME
   ═════════════════════════════════════════ */
.word-count {
  font-size: calc(var(--fs-xs) * 1.15);
  color: var(--text-placeholder);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
/* ═════════════════════════════════════════
   ENTRY ACTIONS (Edit / Delete / Copy)
   ═════════════════════════════════════════ */
.entry-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.entry-action-btn {
  background: none;
  border: none;
  font-size: var(--fs-xs);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  opacity: 0.35;
  transition: opacity 0.2s, background 0.15s, transform 0.1s;
  pointer-events: auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.entry-action-btn:hover {
  opacity: 1;
  background: rgba(44, 24, 16, 0.06);
}
.entry-action-btn:active {
  opacity: 1;
  transform: scale(0.92);
}
.entry-delete-btn:hover {
  background: rgba(220, 40, 40, 0.08);
}
/* ── Inline Delete Confirmation Bar ── */
.delete-confirm-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 4px 0 8px;
  background: rgba(220, 40, 40, 0.06);
  border: 1px solid rgba(220, 40, 40, 0.15);
  border-radius: 10px;
  animation: slideDown 0.2s ease-out;
}
.delete-confirm-msg {
  flex: 1;
  font-size: var(--fs-xs);
  color: #8b4040;
  font-weight: 500;
}
.delete-confirm-yes {
  background: #c62828;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.delete-confirm-yes:hover {
  background: #b71c1c;
}
.delete-confirm-yes:active {
  transform: scale(0.95);
}
.delete-confirm-no {
  background: transparent;
  color: #8b7355;
  border: 1px solid rgba(139, 115, 85, 0.25);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.delete-confirm-no:hover {
  background: var(--bg-tertiary);
}
/* ═══════════════════════════════════════════════════════════════
   FLOATING HIGHLIGHT TOOLBAR — appears on text selection (BubbleMenu)
   ═══════════════════════════════════════════════════════════════ */
.floating-highlight-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--accent-primary);
  border-radius: 8px;
  padding: 4px 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  animation: highlightFadeIn 0.15s ease;
}
@keyframes highlightFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.floating-highlight-toolbar button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: var(--fs-xs);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: background 0.15s;
}
.floating-highlight-toolbar button.is-active {
  background: rgba(255, 255, 255, 0.25);
}
.floating-highlight-toolbar button:hover {
  background: rgba(255, 255, 255, 0.15);
}
.floating-highlight-toolbar .toolbar-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.3);
  margin: 0 2px;
}
/* ═══════════════════════════════════════════════════════════════
   COMMAND MENU DROPDOWN — Notion-style / command palette
   ═══════════════════════════════════════════════════════════════ */
.command-menu-dropdown {
  position: absolute;
  z-index: 100;
  bottom: 100%;
  left: 12px;
  right: 12px;
  max-height: 280px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 6px 0;
  animation: cmdMenuIn 0.12s ease;
}
@keyframes cmdMenuIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.command-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.1s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.command-item:hover {
  background: #f5f0eb;
}
.command-icon {
  font-size: var(--fs-sm);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.command-label {
  font-size: var(--fs-sm);
  color: var(--text-primary);
}
.command-menu-empty {
  text-align: center;
  padding: 16px;
  color: var(--text-faint);
  font-size: var(--fs-xs);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
/* ═══════════════════════════════════════════════════════════════
   DESKTOP COMPOSER-FIRST LAYOUT — prioritise the writing surface
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  /* Compact the chrome above the composer */
  .desktop-layout .identity-anchor {
    margin-bottom: 10px;
    padding-bottom: 8px;
    font-size: var(--fs-xs);
  }
  .desktop-layout .notebook-header {
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom-width: 1px;
  }
  .desktop-layout .notebook-header h1 {
    font-size: var(--fs-xl);
  }
  .desktop-layout .deadline-banner {
    margin-bottom: 10px;
    padding: 6px 14px;
    font-size: var(--fs-xs);
  }
  .desktop-layout .sticky-mit-banner {
    margin-bottom: 6px;
  }

  /* HERO COMPOSER — the main writing surface */
  .desktop-layout .notebook-composer {
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 8px;
    border-color: var(--border-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s, border-color 0.3s;
    flex-shrink: 0;
    max-height: 40vh !important; /* STRICT LIMIT: Never consume the whole screen */
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .desktop-layout .notebook-composer:focus-within {
    border-color: var(--border-secondary);
    box-shadow: 0 2px 12px rgba(44, 24, 16, 0.08);
  }
  .desktop-layout .notebook-composer textarea {
    font-family: 'Times New Roman', Times, serif;
    font-size: 12pt;
    line-height: 1.15;
    min-height: 150px;
    max-height: 100%;
    overflow-y: auto !important; /* Force internal scrolling */
    resize: none;
    flex: 1;
  }
  .desktop-layout .notebook-composer--daily textarea {
    min-height: 280px;
  }

  /* Compact the discovery/search block */
  .desktop-layout .journal-discovery {
    margin-bottom: 0;
    padding-top: 0;
    flex-shrink: 0;
  }
  .desktop-layout .journal-view-toggle {
    margin-bottom: 2px;
    padding-bottom: 2px;
  }
  .desktop-layout .journal-search {
    font-size: var(--fs-sm);
  }
  .desktop-layout .journal-tag-cloud {
    margin-top: 2px;
  }

  /* Tighten entry spacing */
  .desktop-layout .notebook-entry {
    padding: 24px 0;
  }

  /* Daily spark tighter */
  .desktop-layout .daily-spark {
    margin-top: 40px;
    padding: 20px;
  }
}
/* ═══════════════════════════════════════════════════════════════
   DESKTOP FULL-SCREEN FIX — viewport-locked, no browser scroll
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  .notebook-container.desktop-layout {
    max-width: 100% !important;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 16px 28px 0;
    display: flex;
    flex-direction: column;
  }
  .desktop-layout .desktop-main {
    max-width: 1200px !important; /* Expanded from 960px to breathe */
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: visible;
  }
  .desktop-layout.ivory-right-only {
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(auto, 860px) minmax(320px, 1fr);
    flex-direction: unset;
    gap: 0;
  }
  .desktop-layout.ivory-right-only .desktop-main {
    overflow-y: auto;
  }
  .ivory-sidebar-right {
    width: 100%;
    max-width: 100%;
    overflow-y: auto;
    height: 100vh;
    height: 100dvh;
    box-sizing: border-box;
  }
}
/* ════════════════════════════════════════════
   GTD Action Drawer + ZTD Sticky MITs
   ════════════════════════════════════════════ */
/* Action Drawer Button Badge */
.action-drawer-btn {
  position: relative;
}
.action-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 3px;
}
/* ── Sticky MIT Banner ── */
.sticky-mit-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #fdf6e3 0%, #fef9ef 100%);
  border: 1px solid #f0d87030;
  border-radius: 8px;
  padding: 8px 14px;
  margin: 0 0 8px 0;
  font-size: 13px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.mit-banner-label {
  font-weight: 700;
  color: #b8860b;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.mit-banner-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mit-banner-item {
  background: var(--bg-card);
  border: 1px solid #f0d87050;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12.5px;
  color: #4a3c1a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mit-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #c0a050;
  padding: 0;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.mit-remove-btn:hover {
  opacity: 1;
  color: #e74c3c;
}
/* ── Action Drawer Overlay ── */
.action-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
  animation: fadeInOverlay 0.2s ease-out;
}
@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* ── Action Drawer (sliding panel) ── */
.zen-action-drawer {
  width: 380px;
  max-width: 90vw;
  height: 100%;
  background: #fafaf8;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  animation: slideInDrawer 0.25s ease-out;
  overflow: hidden;
}
@keyframes slideInDrawer {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.drawer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-card);
}
.drawer-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.drawer-count {
  font-size: 12px;
  color: var(--text-faint);
  margin-left: auto;
  margin-right: 8px;
}
.drawer-empty {
  text-align: center;
  color: var(--text-faint);
  padding: 40px 20px;
  font-size: 14px;
}
/* ── Drawer Task List ── */
.drawer-task-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
}
.drawer-task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-primary);
  transition: background 0.12s;
}
.drawer-task-item:hover {
  background: #f5f5f0;
}
.drawer-task-urgent {
  border-left: 3px solid #e74c3c;
  padding-left: 17px;
}
.drawer-task-text {
  flex: 1;
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.4;
}
.drawer-task-date {
  font-size: 11px;
  color: var(--text-placeholder);
  white-space: nowrap;
}
.drawer-task-check {
  background: none;
  border: 1.5px solid #ccc;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.drawer-task-check:hover {
  background: #27ae60;
  color: #fff;
  border-color: #27ae60;
}
/* ── MIT Star Button ── */
.mit-star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.15s, transform 0.15s;
}
.mit-star:hover {
  opacity: 1;
  transform: scale(1.15);
}
.mit-star-active {
  opacity: 1;
}
.mit-star:disabled {
  opacity: 0.15;
  cursor: default;
}
/* ── Drawer MIT Summary Section ── */
.drawer-mit-section {
  border-top: 1px solid var(--border-primary);
  padding: 14px 20px;
  background: #fdf6e3;
}
.drawer-mit-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #b8860b;
}
.drawer-mit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  color: #4a3c1a;
}
/* ══════════════════════════════════════════════
   ZOOM RESILIENCE — prevent layout breakage at browser zoom
   ══════════════════════════════════════════════ */
.notebook-container,
.notebook-container.desktop-layout,
.notebook-container.research-mode-on {
  box-sizing: border-box;
}
/* Prevent fixed elements from going off-screen at high zoom */
.help-toggle-btn,
.principles-toggle-btn,
.quick-dump-fab {
  position: fixed;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  font-size: var(--fs-md);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  z-index: 1000;
  transition: all 0.2s;
}
.help-toggle-btn {
  bottom: 20px;
}
.principles-toggle-btn {
  bottom: 68px;
}
/* Sprint 44: Token balance pill — positioned above principles button */
.token-balance-pill {
  position: fixed;
  right: 14px;
  bottom: 118px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  white-space: nowrap;
  line-height: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
/* Sprint 52.1: Wallet pulse — flash green on reward claim */
.token-balance-pill.wallet-pulse {
  animation: walletPulse 0.7s ease;
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}
@keyframes walletPulse {
  0% { transform: scale(1); }
  25% { transform: scale(1.12); border-color: #10b981; box-shadow: 0 0 16px rgba(16, 185, 129, 0.5); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.quick-dump-fab {
  bottom: 152px;
}
.quick-dump-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
/* Ensure modals scale and stay visible at any zoom level */
.export-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.export-modal,
.analytics-modal,
.principles-modal,
.audit-modal {
  max-height: 90vh;
  max-width: 95vw;
  overflow-y: auto;
}
/* ══════════════════════════════════════════════
   PHASE 1 – Master Principles Modal
   ══════════════════════════════════════════════ */
.principles-modal {
  max-width: 640px;
  width: 90vw;
}
.principles-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e8e4dc;
}
.principles-modal-header h3 {
  margin: 0;
  font-size: var(--fs-md);
  color: #2d2a24;
}
.principles-textarea {
  width: 100%;
  min-height: 360px;
  padding: 16px 20px;
  border: none;
  outline: none;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  line-height: 1.7;
  resize: vertical;
  color: #2d2a24;
  background: #fdfcfa;
  box-sizing: border-box;
}
.principles-textarea::placeholder {
  color: #b0a898;
}
.principles-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e8e4dc;
  display: flex;
  justify-content: flex-end;
}
.principles-modal-footer .export-go.saving {
  background: #10b981;
  pointer-events: none;
}
/* ══════════════════════════════════════════════
   PHASE 4 – Analytics Dashboard Modal
   ══════════════════════════════════════════════ */
.analytics-modal {
  max-width: 1400px !important; /* Much wider for charts */
  width: 90vw !important;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
}
.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e8e4dc;
  flex-wrap: wrap;
  gap: 8px;
}
.analytics-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.analytics-title-group h3 {
  margin: 0;
  font-size: var(--fs-md);
  color: #2d2a24;
}
.analytics-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.timeframe-select {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-secondary);
  font-size: 13px;
  background: white;
  color: #2d2a24;
  cursor: pointer;
}
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); /* Auto-wrapping grid */
  gap: 30px;
  padding: 20px 0;
}
.analytics-widget {
  background: #fdfcfa;
  border: 1px solid #e8e4dc;
  border-radius: 12px;
  padding: 16px;
}
.analytics-widget.full-width {
  grid-column: 1 / -1;
}
.analytics-widget h4 {
  margin: 0 0 12px 0;
  font-size: var(--fs-sm);
  color: #6b6455;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chart-container {
  height: 350px !important; /* Taller charts */
  width: 100%;
}
.pie-container {
  display: flex;
  align-items: center;
  gap: 20px;
}
.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}
.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}
/* Analytics responsive — single column on small screens */
@media (max-width: 800px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .analytics-modal {
    max-height: 90vh;
    width: 95vw;
  }
}
/* ══════════════════════════════════════════════
   REALITY ENGINE – Tab Bar & New Visualizations
   ══════════════════════════════════════════════ */
.re-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e8e4dc;
  padding: 0 16px;
  background: #fdfcfa;
}
.re-tab {
  padding: 10px 18px;
  border: none;
  background: none;
  font-size: var(--fs-md);
  font-weight: 600;
  color: #9b9488;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.re-tab:hover { color: #6b6455; }
.re-tab.active {
  color: #8b5cf6;
  border-bottom-color: #8b5cf6;
}
.weekly-insight-tracker {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  padding: 4px 0;
  font-family: 'Georgia', serif;
}
.weekly-insight-tracker.tracker-ready {
  color: #4a7c59;
}
/* ── Momentum Heatmap ── */
.re-heatmap-container {
  padding: 8px 0;
}
.re-heatmap-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.re-heatmap-cell {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: default;
  transition: transform 0.1s;
}
.re-heatmap-cell:hover {
  transform: scale(1.2);
  z-index: 2;
}
.re-heatmap-label {
  font-size: 9px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}
.re-heatmap-legend {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.re-heatmap-legend .legend-item {
  font-size: 12px;
}
/* ── Constellation SVG ── */
.re-constellation-container {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.re-constellation-svg {
  width: 100%;
  height: 400px;
  max-height: 50vh;
}
/* ── Top Tags & Commands bars ── */
.re-tag-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.re-tag-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 3px 0;
  overflow: hidden;
}
.re-tag-item:hover .re-tag-name { color: #8b5cf6; }
.re-tag-name {
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  min-width: 80px;
  transition: color 0.15s;
}
.re-tag-bar {
  height: 6px;
  background: linear-gradient(90deg, #8b5cf6, #c4b5fd);
  border-radius: 3px;
  flex-shrink: 1;
  max-width: calc(100% - 120px);
  transition: width 0.3s ease;
}
.re-cmd-bar {
  background: linear-gradient(90deg, #10b981, #6ee7b7);
}
.re-tag-count {
  font-size: 12px;
  color: #9b9488;
  min-width: 24px;
  text-align: right;
}
/* ── Smart Brief Tab ── */
.re-brief-container {
  padding: 20px;
}
.re-brief-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.re-lens-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.re-lens-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  background: white;
  font-size: 12px;
  font-weight: 500;
  color: #6b6455;
  cursor: pointer;
  transition: all 0.15s;
}
.re-lens-btn:hover { border-color: var(--accent-purple); color: #8b5cf6; }
.re-lens-btn.active {
  background: var(--accent-purple);
  color: white;
  border-color: var(--accent-purple);
}
.re-brief-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #9b9488;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 6px;
}
.re-lens-desc {
  font-style: italic;
  color: #b0a896;
}
.re-brief-output {
  background: #fdfcfa;
  border: 1px solid #e8e4dc;
  border-radius: 12px;
  padding: 20px;
  min-height: 200px;
  max-height: 50vh;
  overflow-y: auto;
}
.re-brief-text {
  line-height: 1.7;
  font-size: var(--fs-sm);
  color: #3b3a36;
}
.re-brief-text h2 {
  font-size: var(--fs-md);
  color: #2d2a24;
  margin: 18px 0 8px 0;
  border-bottom: 1px solid #e8e4dc;
  padding-bottom: 4px;
}
.re-brief-text h3 {
  font-size: var(--fs-base);
  color: #4b5563;
  margin: 14px 0 6px 0;
}
.re-brief-text h4 {
  font-size: var(--fs-sm);
  color: #6b6455;
  margin: 10px 0 4px 0;
}
.re-brief-text p {
  margin: 4px 0;
}
.re-brief-text li {
  margin-left: 20px;
  margin-bottom: 3px;
}
.re-brief-placeholder {
  color: #9b9488;
  text-align: center;
  padding: 30px 20px;
}
.re-brief-placeholder ul {
  text-align: left;
  max-width: 420px;
  margin: 16px auto 0;
  list-style: none;
  padding: 0;
}
.re-brief-placeholder li {
  padding: 6px 0;
  border-bottom: 1px solid #f0ece4;
  font-size: 13px;
}
.re-brief-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}
/* ══════════════════════════════════════════════
   PHASE 5 – Reviewer Card (full overlay modal matching lit modal)
   ══════════════════════════════════════════════ */
.reviewer-card-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reviewer-card {
  position: relative;
  max-width: 850px;
  width: 90vw;
  max-height: 85vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Times New Roman", Times, serif;
  font-size: 16.1px;
  text-align: justify;
  padding: 30px;
  animation: litModalIn 0.25s ease;
}
.reviewer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8e4dc;
}
.reviewer-card-header h4 {
  margin: 0;
  font-size: 18.2px;
  color: #2d2a24;
  font-family: "Times New Roman", Times, serif;
}
/* Sprint 42: Critique mode badge — academic labels only */
.rc-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 10.08px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: 0.03em;
  vertical-align: middle;
  white-space: nowrap;
}
.rc-badge--red      { background: #fee2e2; color: #991b1b; }
.rc-badge--blue     { background: #dbeafe; color: #1e40af; }
.rc-badge--green    { background: #dcfce7; color: #166534; }
.rc-badge--amber    { background: #fef3c7; color: #92400e; }
.rc-badge--purple   { background: #ede9fe; color: #5b21b6; }
.reviewer-card-body {
  padding: 20px 0;
  overflow-y: auto;
  flex: 1;
  font-size: 16.1px;
  line-height: 1.75;
  color: #3b3a36;
  font-family: "Times New Roman", Times, serif;
}
.reviewer-card-body p {
  margin: 0 0 8px 0;
}
.reviewer-card-footer {
  padding-top: 14px;
  border-top: 1px solid #e8e4dc;
  font-size: 11.9px;
  color: #9b9488;
  text-align: center;
}
/* ── Streaming Typing Cursor ── */
.typing-cursor {
  display: inline-block;
  color: #3b82f6;
  font-weight: bold;
  animation: blink 0.7s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
/* ══════════════════════════════════════════════
   PHASE 6 – Nexus Side Panel
   ══════════════════════════════════════════════ */
.nexus-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  background: white;
  box-shadow: -6px 0 24px rgba(0,0,0,0.12);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.nexus-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e8e4dc;
  background: #f8f7f4;
}
.nexus-header h3 {
  margin: 0;
  font-size: var(--fs-md);
  color: #2d2a24;
}
.nexus-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.nexus-spinner {
  text-align: center;
  padding: 40px 0;
  color: #8b5cf6;
  font-style: italic;
}
.nexus-section {
  margin-bottom: 24px;
}
.nexus-section h4 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b6455;
  margin: 0 0 8px 0;
}
.nexus-section p {
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: #3b3a36;
  margin: 0;
}
.link-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.suggested-link {
  display: inline-block;
  background: #ede9fe;
  color: #7c3aed;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.suggested-link:hover {
  background: #ddd6fe;
}
/* ══════════════════════════════════════════════
   PHASE 6 – Audit Modal
   ══════════════════════════════════════════════ */
.audit-modal {
  max-width: 640px;
  width: 90vw;
}
.audit-results {
  padding: 20px;
  min-height: 120px;
  max-height: 50vh;
  overflow-y: auto;
  color: #3b3a36;
}
.audit-results-content {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: var(--fs-base);
}
/* ══════════════════════════════════════════════
   PHASE 5 – AI Scalpel Toolbar
   ══════════════════════════════════════════════ */
.ai-scalpel-toolbar button {
  font-size: 14px;
}
.ai-scalpel-toolbar button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ai-spinner {
  font-size: 13px;
  color: #8b5cf6;
  font-style: italic;
  padding: 4px 0;
}
/* ══════════════════════════════════════════════
   PHASE 3/6 – Drawer Upgrades (Slice, Audit, Sections)
   ══════════════════════════════════════════════ */
.audit-btn {
  background: none;
  border: 1px solid var(--border-secondary);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  color: #6b6455;
  transition: all 0.15s;
}
.audit-btn:hover {
  background: #ece9e1;
}
.slice-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.slice-btn:hover {
  opacity: 1;
}
.nexus-trigger-btn {
  background: none;
  border: 1px solid #ddd6fe;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  color: #7c3aed;
  transition: all 0.15s;
  margin-left: auto;
}
.nexus-trigger-btn:hover {
  background: #ede9fe;
}
.drawer-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e8e4dc;
}
.drawer-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9b9488;
  margin: 0 0 6px 0;
  font-weight: 600;
}
.drawer-task-deferred {
  opacity: 0.5;
  font-style: italic;
}
.error-text {
  color: #ef4444;
  font-size: var(--fs-sm);
}
/* ══════════════════════════════════════════════
   Responsive – Analytics & Nexus
   ══════════════════════════════════════════════ */
@media (max-width: 700px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .analytics-modal {
    width: 98vw;
    max-height: 90vh;
  }
  .nexus-panel {
    width: 100vw;
  }
  .reviewer-card {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 16px;
  }
  .pie-container {
    flex-direction: column;
  }
}
/* ══════════════════════════════════════════════
   MARKDOWN FORMATTING TOOLBAR & COMPOSER TOP BAR
   ══════════════════════════════════════════════ */
.composer-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f7f4;
  border-bottom: 1px solid #e8e4dc;
  padding: 4px 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.format-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
}
/* Sprint 52: Utility controls (Sort, Font size) — right-aligned cluster */
.utility-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.utility-controls button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: 'Georgia', serif;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.utility-controls button:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.format-toolbar button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: 'Georgia', serif;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.format-toolbar button:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.format-toolbar button.is-active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}
.toolbar-divider {
  width: 1px;
  height: 16px;
  background: #d1cdc5;
  margin: 0 4px;
}
/* ── Font Size Controls ── */
.font-size-btn {
  font-family: 'Georgia', serif !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: -0.5px;
}
.font-size-label {
  font-size: 11px;
  color: var(--text-faint);
  min-width: 20px;
  text-align: center;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  user-select: none;
}
/* ── Sort Select (Discovery) ── */
.sort-select {
  background: transparent;
  border: 1px solid var(--border-secondary);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 10.5px;
  padding: 3px 6px;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.sort-select:hover,
.sort-select:focus {
  border-color: #8b7355;
  color: var(--text-secondary);
}
/* ═════════════════════════════════════════
   LITERATURE BROWSER
   ═════════════════════════════════════════ */
.lit-browser {
  padding: 0;
  animation: fadeIn 0.2s ease;
}
/* ── Literature Sort Bar ── */
.lit-sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  margin-top: 0;
}
.lit-sort-label {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.lit-sort-pills {
  display: flex;
  background: #f5f4f1;
  border-radius: 6px;
  padding: 3px;
}
.lit-sort-btn {
  background: transparent;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: var(--fs-xs);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.lit-sort-btn.active {
  background: var(--bg-card);
  color: #111;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
/* ── Search row ── */
.lit-search-row {
  position: relative;
  margin-bottom: 16px;
}
.lit-panel-search-row {
  position: relative;
  margin-bottom: 10px;
}
.lit-search {
  width: 100%;
  box-sizing: border-box;
}
.lit-clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: var(--fs-lg);
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.lit-clear-search:hover {
  color: var(--text-primary);
}
/* ── Card list ── */
.lit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lit-card {
  background: var(--bg-card);
  border: 1px solid #e8e4dc;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.lit-card:hover {
  border-color: #c4b5a0;
  box-shadow: 0 2px 12px rgba(44, 24, 16, 0.06);
  transform: translateY(-1px);
}
.lit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.lit-card-ref {
  font-family: 'Georgia', serif;
  font-size: var(--fs-xs);
  color: #8b5cf6;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.lit-card-title {
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  margin: 0 0 2px 0;
  line-height: 1.3;
  font-weight: 600;
}
.lit-card-keywords {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  margin: 0;
  font-style: italic;
}
.lit-card-snippet {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
/* ── Sprint 26A: Literature Review Synthesizer ── */
.lit-card-selected {
  border-color: #8b5cf6;
  background: #faf8ff;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}
.lit-card-checkbox {
  accent-color: #8b5cf6;
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.lit-synth-panel {
  background: #faf8ff;
  border: 1px solid #e0d4f5;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lit-synth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: #6d28d9;
  font-weight: 600;
}
.lit-synth-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.lit-synth-thesis {
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  border: 1px solid #e0d4f5;
  border-radius: 6px;
  padding: 8px 12px;
  resize: vertical;
  background: var(--bg-card);
  color: var(--text-primary);
  line-height: 1.5;
}
.lit-synth-thesis::placeholder {
  color: var(--text-faint);
  font-style: italic;
}
.lit-synth-result {
  background: var(--bg-card);
  border: 1px solid #e0d4f5;
  border-radius: 8px;
  overflow: hidden;
}
.lit-synth-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f5f0ff;
  border-bottom: 1px solid #e0d4f5;
  font-size: var(--fs-sm);
  color: #6d28d9;
}
.lit-synth-result-body {
  padding: 14px 16px;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  line-height: 1.7;
  max-height: 400px;
  overflow-y: auto;
}
.lit-synth-result-body .bujo-parsed,
.lit-synth-modal-body .bujo-parsed {
  background: #fffdf8;
  border: 1px solid #ebe2d6;
  border-radius: 8px;
  color: #29231c;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.78;
  padding: 18px 20px;
}
.lit-synth-result-body .bujo-parsed {
  max-height: 320px;
  overflow: hidden;
}
.lit-synth-result-body .bujo-heading,
.lit-synth-modal-body .bujo-heading {
  color: #22170f;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0.85em 0 0.35em;
}
.lit-synth-result-body .bujo-heading:first-child,
.lit-synth-modal-body .bujo-heading:first-child {
  margin-top: 0;
}
.lit-synth-result-body .bujo-heading-1,
.lit-synth-modal-body .bujo-heading-1 {
  font-size: 18.9px;
}
.lit-synth-result-body .bujo-heading-2,
.lit-synth-modal-body .bujo-heading-2 {
  font-size: 15.68px;
}
.lit-synth-result-body .bujo-plain,
.lit-synth-modal-body .bujo-plain {
  margin: 0 0 0.7em;
}
.lit-synth-result-body .bujo-wikilink,
.lit-synth-modal-body .bujo-wikilink {
  white-space: nowrap;
}
.lit-synth-modal {
  max-width: min(920px, 92vw);
  width: 920px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.lit-synth-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e4dc;
}
.lit-synth-modal-header h3 {
  margin: 0;
}
.lit-synth-modal-header p {
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: var(--fs-sm);
}
.lit-synth-modal-body {
  flex: 1;
  overflow-y: auto;
  line-height: 1.72;
  padding: 16px 4px;
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
}
.lit-synth-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #e8e4dc;
}
/* ── Detail view ── */
.lit-detail {
  animation: fadeIn 0.2s ease;
}
.lit-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e4dc;
}
.lit-back-btn {
  background: none;
  border: none;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: #8b5cf6;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s;
}
.lit-back-btn:hover {
  color: #6d28d9;
}
.lit-detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.lit-detail-title {
  font-family: 'Georgia', serif;
  font-size: var(--fs-lg);
  color: #8b5cf6;
  margin: 0 0 20px 0;
  font-weight: 700;
}
.lit-detail-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lit-field-label {
  font-family: 'Georgia', serif;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lit-field-value {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: pre-wrap;
}
.lit-field-empty {
  color: var(--text-placeholder);
  font-style: italic;
}
.lit-field-edit {
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid #c4b5a0;
  border-radius: 6px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.lit-field-edit:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.1);
}
/* ── Lit Note Quick-Edit Popup (right panel) ── */
.lit-popup-panel {
  background: var(--bg-secondary);
  border: 1px solid #e0dbd5;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  max-height: 60vh;
  overflow-y: auto;
}
.lit-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px solid #e8e4dc;
  padding-bottom: 8px;
}
.lit-popup-header h4 {
  margin: 0;
  font-size: var(--fs-base);
  color: var(--text-secondary);
  font-family: 'Georgia', serif;
}
.lit-popup-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lit-popup-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lit-popup-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lit-popup-field .lit-field-label {
  font-size: var(--fs-xs);
}
.lit-popup-field .lit-field-value {
  font-size: var(--fs-sm);
  padding: 2px 0;
}
.lit-popup-field .lit-field-edit {
  font-size: var(--fs-sm);
  padding: 4px 8px;
  min-height: unset;
}
/* ── Citing entries section ── */
.lit-citing-entries {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e8e4dc;
}
.lit-citing-entries h4 {
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0 0 12px 0;
}
.lit-citing-entries .backlink-snippet {
  cursor: pointer;
  transition: background 0.2s;
  padding: 8px 12px;
  border-radius: 6px;
}
.lit-citing-entries .backlink-snippet:hover {
  background: #f5f0ea;
}
/* ── Mobile responsiveness for lit browser ── */
@media (max-width: 768px) {
  .lit-card {
    padding: 12px 14px;
  }

  .lit-detail-title {
    font-size: var(--fs-md);
  }

  .lit-field-edit {
    font-size: var(--fs-sm);
  }

  .lit-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
/* ══════════════════════════════════════════
   MOBILE TAB SWITCHER (Write / Browse)
   ══════════════════════════════════════════ */
.mobile-tab-switcher {
  display: none;
}
/* ══════════════════════════════════════════
   MOBILE AI BAR (runs on full note)
   ══════════════════════════════════════════ */
.mobile-ai-bar {
  display: none;
}
/* ══════════════════════════════════════════
   MOBILE SUBMIT ROW (center bottom)
   ══════════════════════════════════════════ */
.mobile-submit-row {
  display: none;
}
@media (max-width: 768px) {
  .mobile-tab-switcher {
    display: flex;
    gap: 0;
    margin: 4px 0 8px;
    border: 1px solid #d6cfc5;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f0eb;
  }
  .mobile-tab-btn {
    flex: 1;
    padding: 8px 0;
    font-size: 11.9px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #8b8478;
    cursor: pointer;
    transition: all 0.2s;
  }
  .mobile-tab-btn.mobile-tab-active {
    background: var(--bg-card);
    color: #2c2825;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  }

  /* ── Mobile AI Action Bar ── */
  .mobile-ai-bar {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    background: #f9f7f5;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    margin: 4px 0;
    justify-content: center;
    flex-wrap: wrap;
  }
  .mobile-ai-bar button {
    background: var(--bg-card);
    border: 1px solid #d6cfc5;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11.2px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-secondary);
  }
  .mobile-ai-bar button:hover {
    background: #f0ebe5;
  }
  .mobile-ai-bar button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  /* ── Mobile Submit Row ── */
  .mobile-submit-row {
    display: flex;
    justify-content: center;
    padding: 8px 0 16px;
  }
  .mobile-submit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 24px;
    font-size: 12.6px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(44, 24, 16, 0.3);
    transition: all 0.15s;
  }
  .mobile-submit-btn:hover {
    background: var(--accent-primary);
    transform: scale(1.02);
  }
  .mobile-submit-btn:active {
    transform: scale(0.96);
  }

  /* ── Mobile Lit Popup Bottom Sheet ── */
  .lit-popup-bottom-sheet {
    max-height: 80vh;
    overflow-y: auto;
  }
  .lit-popup-bottom-sheet .lit-popup-header {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-primary);
  }
  .lit-popup-bottom-sheet .lit-popup-body {
    padding-top: 8px;
  }
}
/* ══════════════════════════════════════════
   MOBILE COMPACT HEADER (1-line)
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .mobile-anchor {
    font-size: 8.4px !important;
    letter-spacing: 1.5px !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    border: none !important;
    opacity: 0.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary) !important;
  }
  .mobile-header-compact {
    padding: 4px 0 !important;
    margin: 0 !important;
  }
  .mobile-header-compact h1 {
    font-size: 14px !important;
    margin: 0 !important;
    color: var(--text-primary) !important;
  }
  .mobile-header-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .mobile-header-line p {
    font-size: 10.5px !important;
    margin: 0 !important;
    color: #9b9488;
  }
  .mobile-header-line .save-indicator {
    font-size: 9.8px !important;
  }
  .mobile-header-line .icon-btn,
  .mobile-header-line .action-drawer-btn {
    font-size: 11.9px !important;
    padding: 2px !important;
  }

  /* ── Hide export button on mobile ── */
  .mobile-layout .export-btn {
    display: none !important;
  }

  /* ── Hide deadline on mobile ── */
  .mobile-layout .deadline-banner {
    display: none !important;
  }

  /* ── Composer compaction ── */
  .mobile-layout .composer-top-bar {
    flex-wrap: nowrap !important;
    gap: 4px !important;
    padding: 4px 8px !important;
  }
  .mobile-layout .format-toolbar button {
    font-size: 10.5px !important;
    padding: 3px 6px !important;
    min-width: unset !important;
  }

  /* ── Textarea: TNR 12pt, 16 lines × 40 chars ── */
  .mobile-layout .notebook-composer textarea {
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 12pt !important;
    line-height: 1.15 !important;
    min-height: calc(16 * 12pt * 1.15) !important;
    max-height: none !important;
    flex: 1 !important;
    overflow-y: auto !important;
  }

  /* ── Controls row: shrink attach, hide word count, reposition submit ── */
  .mobile-layout .attach-btn {
    font-size: 10.5px !important;
    padding: 3px 8px !important;
  }
  .mobile-layout .word-count {
    display: none !important;
  }
  .mobile-layout .composer-hint {
    display: none !important;
  }
  .mobile-layout .notebook-controls {
    flex-wrap: nowrap !important;
    gap: 4px !important;
  }
  .mobile-layout .inline-save-btn {
    display: none !important;
  }
}
/* ══════════════════════════════════════════
   DRAGGABLE SPLIT DIVIDER (Desktop Research)
   ══════════════════════════════════════════ */
.split-divider {
  width: 8px;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  margin: 0 -4px;
}
.split-divider:hover .split-divider-line,
.split-divider:active .split-divider-line {
  background: var(--accent-purple);
  width: 3px;
}
.split-divider-line {
  width: 2px;
  height: 60px;
  background: #d6cfc5;
  border-radius: 2px;
  transition: all 0.15s;
}
/* ══════════════════════════════════════════
   RESEARCH LEFT HEADER (Desktop)
   ══════════════════════════════════════════ */
.research-left-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 2px;
  gap: 2px;
  padding: 2px 0;
}
.research-left-header .identity-anchor {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  font-size: clamp(9.1px, 2cqi, 11.9px);
  color: #4a2080;
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  text-align: center;
  line-height: 1.4;
  font-weight: 700;
}
/* Row 2: toolbars left, mode icons right */
.research-left-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.research-left-toolbars {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.format-toolbar--header {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.format-toolbar--header button {
  background: none;
  border: none;
  font-size: calc(var(--fs-xs) * 1.2);
  cursor: pointer;
  color: var(--text-faint);
  padding: 3px 6px;
  border-radius: 3px;
  transition: background 0.15s;
}
.format-toolbar--header button:hover { background: rgba(44,24,16,0.06); }
.research-left-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.mode-btn-icon {
  font-size: calc(var(--fs-sm) * 1.2) !important;
  padding: 3px 7px !important;
  line-height: 1;
}
.mode-btn-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.research-left-controls .save-indicator {
  font-size: calc(var(--fs-xs) * 0.9);
  color: #4a2080;
  white-space: nowrap;
}
/* ── Research split: use CSS grid with dynamic columns (inline style overrides) ── */
.research-split {
  display: grid !important;
  gap: 0 !important;
  align-items: start;
}
/* =========================================
   COMPACT NOTE CARDS (Timeline Trays)
   ========================================= */
.note-tray-collapsed {
  cursor: pointer;
  padding: 12px 16px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e8e4dc);
  border-radius: 8px;
  margin-bottom: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.note-tray-collapsed:hover {
  border-color: var(--accent-primary, #8b5cf6);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.05));
  transform: translateY(-1px);
}
.note-tray-snippet {
  font-size: 14.7px;
  color: var(--text-secondary, #555);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
  margin-bottom: 8px;
}
.note-tray-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.note-tray-tags .tag-pill {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-tag, #f3f0eb);
  color: var(--text-secondary, #6b6455);
  cursor: pointer;
  transition: background 0.15s ease;
}
.note-tray-tags .tag-pill:hover {
  background: var(--accent-primary, #8b5cf6);
  color: #fff;
}
/* When expanded, mark with accent border */
.notebook-entry.is-expanded {
  border-left: 3px solid var(--accent-primary, #8b5cf6);
  padding-left: 13px;
}
/* ══════════════════════════════════════════════
   TRUE MODAL: Literature Detail / Edit Popup
   Times New Roman, 1.2x scale, justify
   ══════════════════════════════════════════════ */
.lit-modal-overlay {
  z-index: 9999 !important;
}
.lit-modal {
  max-width: 850px !important;
  width: 90vw !important;
  max-height: 85vh !important;
  display: flex !important;
  flex-direction: column !important;
  font-family: "Times New Roman", Times, serif !important;
  font-size: 16.1px !important;
  text-align: justify !important;
  padding: 30px !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3) !important;
  animation: litModalIn 0.25s ease;
}
@keyframes litModalIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.lit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--border-primary, #e8e4dc);
  padding-bottom: 15px;
  margin-bottom: 20px;
}
.lit-modal-title {
  margin: 0;
  font-size: 19.6px;
  color: var(--accent-primary, #8b5cf6);
  text-align: left;
  font-family: "Times New Roman", Times, serif;
}
.lit-modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}
.lit-modal-save-btn {
  background: var(--color-success, #10b981);
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: background 0.15s;
}
.lit-modal-save-btn:hover { background: #059669; }
.lit-modal-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.lit-modal-cancel-btn,
.lit-modal-edit-btn {
  background: var(--bg-hover, #f0eee8);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary, #2d2a24);
  transition: background 0.15s;
}
.lit-modal-cancel-btn:hover,
.lit-modal-edit-btn:hover {
  background: var(--border-primary, #e8e4dc);
}
.lit-modal-close-btn {
  background: none;
  border: none;
  font-size: 21px;
  cursor: pointer;
  color: var(--text-muted, #9b9488);
  margin-left: 10px;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.lit-modal-close-btn:hover { color: var(--text-primary); }
.lit-modal-body {
  overflow-y: auto;
  padding-right: 15px;
  flex: 1;
}
.lit-modal-field {
  margin-bottom: 20px;
}
.lit-modal-field-label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--text-secondary, #6b6860);
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-align: left;
}
.lit-modal-field-edit {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--accent-primary, #8b5cf6);
  background: var(--bg-main, #faf9f6);
  color: var(--text-primary, #2d2a24);
  resize: vertical;
  font-family: "Times New Roman", Times, serif;
  font-size: 16.1px;
  line-height: 1.6;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.lit-modal-field-edit:focus {
  outline: none;
  border-color: var(--accent-secondary, #7c3aed);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.lit-modal-field-value {
  line-height: 1.6;
  color: var(--text-primary, #2d2a24);
  font-family: "Times New Roman", Times, serif;
  font-size: 16.1px;
}
/* ── AI Thinking Indicator (Normal Mode) ── */
.ai-thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border-radius: 12px;
  font-size: 11.2px;
  font-weight: 600;
  animation: aiThinkPulse 1.5s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes aiThinkPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
/* ── Mobile responsive for lit modal ── */
@media (max-width: 768px) {
  .lit-modal {
    max-width: 100vw !important;
    width: 96vw !important;
    max-height: 92vh !important;
    padding: 18px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
  }
  .lit-modal-title {
    font-size: 16.8px;
  }
  .lit-modal-field-edit {
    font-size: 14px;
    padding: 10px;
  }
  .lit-modal-field-value {
    font-size: 14px;
  }
}
/* ══════════════════════════════════════════
   TIME SLICER (Pomodoro/Deep Work)
   ══════════════════════════════════════════ */
/* ── Sticky Focus Banner ── */
.focus-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 2px solid #e94560;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  animation: focusBannerSlide 0.3s ease-out;
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.3);
}
.focus-banner-timer {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 28px;
  font-weight: 700;
  color: #e94560;
  letter-spacing: 2px;
  min-width: 100px;
  text-align: center;
}
.focus-banner-task {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13.3px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.focus-banner-actions {
  display: flex;
  gap: 8px;
}
.focus-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  font-size: 11.9px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.focus-btn-pause {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.focus-btn-pause:hover {
  background: rgba(255, 255, 255, 0.25);
}
.focus-btn-finish {
  background: #e94560;
  color: #fff;
}
.focus-btn-finish:hover {
  background: #d63851;
}
@keyframes focusBannerSlide {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
/* ── Focus Log Modal ── */
.focus-log-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.focus-log-modal > div {
  background: #1e1e2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.focus-log-title {
  font-size: 15.4px;
  font-weight: 600;
  color: #e94560;
  margin-bottom: 4px;
}
.focus-log-task {
  font-size: 11.9px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 14px;
}
.focus-log-textarea {
  width: 100%;
  min-height: 120px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  font-size: 13.3px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 14px;
}
.focus-log-textarea:focus {
  outline: none;
  border-color: #e94560;
}
.focus-log-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.focus-log-cancel {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 11.9px;
}
.focus-log-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
}
.focus-log-save {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: #e94560;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 11.9px;
}
.focus-log-save:hover {
  background: #d63851;
}
/* ── Mobile responsive for focus banner ── */
@media (max-width: 768px) {
  .focus-banner {
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
  }
  .focus-banner-timer {
    font-size: 22.4px;
  }
  .focus-banner-task {
    max-width: 90vw;
    font-size: 11.9px;
  }
}
/* ══════════════════════════════════════════
   MANUSCRIPT EDITOR — Isolated 3-Pane Layout
   Phase 4: Manuscript Mode
   Sprint 25: Harmonised with JournalApp.css token system
   ══════════════════════════════════════════ */

/* ── Full-screen overlay ── */
.manuscript-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-secondary, #faf8f5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: msSlideIn 0.3s ease;
}

@keyframes msSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Top Bar ── */
.manuscript-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  background: var(--bg-secondary, #faf8f5);
  gap: 14px;
  flex-shrink: 0;
  min-height: 48px;
}

.manuscript-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.manuscript-close-btn {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: var(--radius-md, 8px);
  padding: 6px 14px;
  color: var(--text-secondary, #4a3f35);
  cursor: pointer;
  font-size: 0.82rem;
  white-space: nowrap;
  transition: all 0.2s;
  font-weight: 500;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.manuscript-close-btn:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
  border-color: var(--accent-primary, #8b7355);
  box-shadow: var(--shadow-md, 0 2px 8px rgba(0,0,0,0.10));
}

.manuscript-title-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 1.15rem;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: 600;
  color: var(--text-primary, #2c1810);
  padding: 4px 0;
  flex: 1;
  min-width: 0;
  outline: none;
  transition: border-color 0.2s;
}

.manuscript-title-input:focus {
  border-bottom-color: #8b7355;
}

.manuscript-topbar-center {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.manuscript-wordcount {
  font-size: 0.82rem;
  color: var(--text-faint, #888);
  font-family: 'SF Mono', 'Cascadia Code', monospace;
}

.manuscript-save-status {
  font-size: 0.72rem;
  font-weight: 500;
}

.manuscript-save-status.saved { color: #22c55e; }
.manuscript-save-status.saving { color: #f59e0b; }
.manuscript-save-status.error { color: #ef4444; }
.manuscript-save-status.editing { color: var(--text-faint, #888); }

.manuscript-topbar-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.ms-toolbar-btn {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid transparent;
  color: var(--text-secondary, #4a3f35);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: 'Georgia', serif;
  font-size: 13px;
  transition: all 0.15s;
}

.ms-toolbar-btn:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
  border-color: var(--border-secondary, #d1cdc5);
}

.ms-toolbar-btn.active {
  background: var(--bg-hover, #ebe6df);
  border-color: var(--border-accent, #8b7355);
  color: var(--text-primary, #2c1810);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.ms-toolbar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ms-font-label {
  font-size: 11px;
  color: var(--text-faint, #888);
  min-width: 20px;
  text-align: center;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
}

.ms-toolbar-divider {
  width: 1px;
  height: 18px;
  background: #d1cdc5;
  margin: 0 4px;
}

/* ── 3-Pane Body ── */
.manuscript-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Left Pane: ToC ── */
.manuscript-toc {
  width: 220px;
  min-width: 180px;
  border-right: 1px solid var(--border-primary, #e8e3db);
  padding: 16px 14px;
  overflow-y: auto;
  flex-shrink: 0;
  background: var(--bg-tertiary, #f7f3ee);
}

.toc-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary, #4a3f35);
  margin: 0 0 14px 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.toc-empty {
  font-size: 0.82rem;
  color: var(--text-faint, #999);
  font-style: italic;
  line-height: 1.6;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  line-height: 1.4;
  transition: all 0.15s;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-item:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
}

.toc-level-1 { font-weight: 600; padding-left: 10px; }
.toc-level-2 { padding-left: 22px; }
.toc-level-3 { padding-left: 34px; font-size: 0.82rem; }
.toc-level-4 { padding-left: 46px; font-size: 0.72rem; color: var(--text-faint, #888); }

.toc-stats {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--border-primary, #e8e3db);
}

.toc-stat {
  font-size: 0.72rem;
  color: var(--text-faint, #999);
  margin-bottom: 4px;
}

/* ── Center Pane: Editor ── */
.manuscript-editor-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
}

.manuscript-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 32px 48px;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-primary, #2c1810);
  background: var(--bg-secondary, #faf8f5);
  overflow-y: auto;
  tab-size: 4;
}

.manuscript-textarea::placeholder {
  color: var(--text-placeholder, #c0b8a8);
  font-style: italic;
}

.manuscript-textarea:focus {
  background: #fffdf9;
}

.manuscript-graveyard-float {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: #f5f1ec;
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  color: var(--text-faint, #888);
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.6;
}

.manuscript-graveyard-float:hover {
  opacity: 1;
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
  border-color: var(--border-accent, #8b7355);
}

/* ── Right Pane: Graveyard + AI ── */
.manuscript-right-pane {
  width: 300px;
  min-width: 240px;
  border-left: 1px solid var(--border-primary, #e8e3db);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-tertiary, #f7f3ee);
}

/* ── AI Result Card ── */
.manuscript-ai-result {
  padding: 12px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  max-height: 40%;
  overflow-y: auto;
}

.ai-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ai-result-header h4 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-primary, #2c1810);
}

.ai-result-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-faint, #888);
  padding: 2px 6px;
}

.ai-result-close:hover { color: #ef4444; }

.ai-result-body p {
  font-size: 0.82rem;
  color: var(--text-muted, #555);
  line-height: 1.5;
  margin: 4px 0;
}

.ai-result-insert {
  margin-top: 8px;
  background: #2c1810;
  color: #faf8f5;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.ai-result-insert:hover {
  background: #8b7355;
}

/* ── Graveyard ── */
.manuscript-graveyard {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.graveyard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  background: var(--bg-tertiary, #f3efe9);
}

.graveyard-header h4 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary, #4a3f35);
  font-weight: 700;
}

.graveyard-count {
  font-size: 0.72rem;
  color: var(--text-faint, #999);
  font-weight: 400;
  margin-left: 6px;
}

.graveyard-restore-btn {
  background: transparent;
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--text-muted, #555);
  cursor: pointer;
  transition: all 0.15s;
}

.graveyard-restore-btn:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
}

.graveyard-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 12px;
  font-family: 'Georgia', serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-faint, #888);
  background: transparent;
  overflow-y: auto;
}

.graveyard-textarea::placeholder {
  color: var(--text-placeholder, #c0b8a8);
  font-style: italic;
}

/* ── AI Processing Overlay ── */
.manuscript-ai-overlay {
  position: absolute;
  inset: 0;
  background: rgba(250, 248, 245, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.manuscript-ai-spinner {
  background: var(--bg-card, #fff);
  padding: 16px 32px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  font-size: 1rem;
  color: var(--text-primary, #2c1810);
  animation: msPulse 1.5s infinite;
}

@keyframes msPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Focus Mode ── */
.manuscript-overlay.focus-mode .manuscript-topbar {
  opacity: 0.3;
  transition: opacity 0.3s;
}

.manuscript-overlay.focus-mode .manuscript-topbar:hover {
  opacity: 1;
}

.manuscript-overlay.focus-mode .manuscript-textarea {
  padding: 48px 20%;
  max-width: 100%;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .manuscript-toc { display: none; }
  .manuscript-right-pane { 
    position: fixed;
    right: 0;
    top: 48px;
    bottom: 0;
    width: 85vw;
    max-width: 320px;
    z-index: 10;
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  }
  .manuscript-textarea {
    padding: 16px;
  }
  .manuscript-topbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;
  }
  .manuscript-topbar-right {
    flex-wrap: wrap;
  }
}

/* ── Manuscript Dashboard Grid (in JournalApp) ── */
.manuscripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 8px 0;
}

.manuscript-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: var(--radius-lg, 12px);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.manuscript-card:hover {
  border-color: var(--accent-primary, #8b7355);
  box-shadow: var(--shadow-md, 0 2px 8px rgba(0,0,0,0.10));
  transform: translateY(-1px);
}

.manuscript-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #2c1810);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manuscript-card-meta {
  font-size: 0.72rem;
  color: var(--text-faint, #999);
  display: flex;
  gap: 12px;
}

.manuscript-card-preview {
  font-size: 0.82rem;
  color: #777;
  line-height: 1.4;
  max-height: 3.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.manuscript-new-card {
  background: transparent;
  border: 2px dashed #d1cdc5;
  border-radius: 10px;
  padding: 24px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint, #999);
  font-size: 0.88rem;
  transition: all 0.2s;
}

.manuscript-new-card:hover {
  border-color: var(--border-accent, #8b7355);
  color: var(--text-primary, #2c1810);
  background: #f5f1ec;
}

.manuscript-delete-btn {
  background: transparent;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 0.82rem;
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-end;
  transition: color 0.15s;
}

.manuscript-delete-btn:hover {
  color: #ef4444;
}

/* ══════════════════════════════════════════════════════════
   NATIVE MANUSCRIPT EDITOR  (integrated into left pane)
   ══════════════════════════════════════════════════════════ */

.manuscript-native-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Top Bar ── */
.ms-native-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary, #faf8f5);
  border-bottom: 1px solid #e8e2d9;
  flex-shrink: 0;
  flex-wrap: wrap;
  min-height: 44px;
}

/* ── Manuscript Format Toolbar ── */
.ms-format-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 10px;
  background: #f5f2ed;
  border-bottom: 1px solid #e8e2d9;
  flex-shrink: 0;
  overflow-x: auto;
  flex-wrap: wrap;
  gap: 6px;
}
.ms-format-toolbar .format-toolbar {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-wrap: wrap;
  min-width: 0;
}
.ms-format-toolbar .format-toolbar button {
  background: transparent;
  border: 1px solid transparent;
  color: #4a3a2e;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-weight: 500;
}
.ms-format-toolbar .format-toolbar button:hover {
  background: rgba(139, 115, 85, 0.08);
  border-color: #d4cdc4;
}
.ms-format-toolbar .format-toolbar button.is-active {
  background: #4a3a2e;
  border-color: #4a3a2e;
  color: #fffdf8;
}
.ms-format-toolbar .toolbar-divider {
  width: 1px;
  height: 14px;
  background: #d4cdc4;
  margin: 0 3px;
}
.ms-format-toolbar .font-size-label {
  font-size: 10px;
  color: #8a7a6a;
  min-width: 18px;
  text-align: center;
}
/* Sprint 52: Utility controls (Sort, Font size) — right-aligned in manuscript toolbar */
.ms-format-toolbar .utility-controls {
  display: flex;
  align-items: center;
  gap: 1px;
}
.ms-format-toolbar .utility-controls button {
  background: transparent;
  border: 1px solid transparent;
  color: #4a3a2e;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-weight: 500;
}
.ms-format-toolbar .utility-controls button:hover {
  background: rgba(139, 115, 85, 0.08);
  border-color: #d4cdc4;
}

/* ── Permanent AI Scalpel Buttons (own row) ── */
.ms-scalpel-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px 4px;
  border-bottom: 1px solid #e8e0d6;
  background: rgba(176, 137, 104, 0.04);
  flex-wrap: wrap;
}
.ms-scalpel-divider {
  border-left: 2px solid #b08968 !important;
  background: #b08968 !important;
  width: 2px !important;
  margin: 0 8px !important;
}
.ms-scalpel-btn {
  color: #8b6914 !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  padding: 3px 6px !important;
  white-space: nowrap !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
  border-radius: 5px !important;
  background: rgba(176, 137, 104, 0.06) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.ms-scalpel-btn:hover {
  background: rgba(176, 137, 104, 0.15) !important;
  border-color: #b08968 !important;
}
.ms-scalpel-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
}
.ms-scalpel-row > button,
.ms-tool-select {
  border: 1px solid #ded4c8;
  border-radius: 6px;
  background: #fffdf8;
  color: #5f4a35;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 7px;
}
.ms-tool-select {
  max-width: 112px;
}
.ms-save-indicator.ai {
  color: #b08968;
  font-weight: 600;
}

.ms-native-topbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.ms-native-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.ms-back-btn {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.ms-back-btn:hover {
  background: var(--bg-hover, #ebe6df);
  border-color: var(--border-accent, #8b7355);
  color: var(--text-primary, #2c1810);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.ms-toc-toggle {
  background: transparent;
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  color: #6b5b47;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.ms-toc-toggle:hover {
  background: #f0ebe4;
  border-color: var(--border-accent, #8b7355);
}

.ms-native-title {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #2c1810);
  font-family: 'EB Garamond', 'Crimson Text', Georgia, serif;
  padding: 4px 8px;
  border-radius: 4px;
  outline: none;
  transition: background 0.15s;
}

.ms-native-title:focus {
  background: var(--bg-card, #fff);
  box-shadow: 0 0 0 2px rgba(139, 115, 85, 0.2);
}

.ms-native-title::placeholder {
  color: #b8ad9e;
  font-weight: 400;
}

.ms-wordcount {
  font-size: 0.72rem;
  color: var(--text-faint, #a09080);
  white-space: nowrap;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.ms-nexus-btn {
  background: linear-gradient(135deg, #f0ebe4, #e8e2d9);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  color: #6b5b47;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.ms-nexus-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #e8e2d9, #d1cdc5);
  border-color: var(--border-accent, #8b7355);
  color: var(--text-primary, #2c1810);
}

.ms-nexus-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ms-tool-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.ms-tool-btn:hover {
  background: #f0ebe4;
  border-color: var(--border-secondary, #d1cdc5);
}

.ms-tool-btn.active {
  background: #e8e2d9;
  border-color: var(--border-accent, #8b7355);
}

.ms-tool-btn.ms-delete-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.ms-save-indicator {
  font-size: 0.72rem;
  color: var(--text-faint, #a09080);
  transition: color 0.3s;
  white-space: nowrap;
  flex-shrink: 0;
}

.ms-save-indicator.saving { color: #d97706; }
.ms-save-indicator.saved  { color: #16a34a; }
.ms-save-indicator.error  { color: #ef4444; }

/* ── Nexus Result Banner ── */
.ms-nexus-result {
  background: linear-gradient(135deg, #fefce8, #fef9c3);
  border: 1px solid #fde68a;
  border-radius: 8px;
  margin: 8px 12px;
  padding: 0;
  overflow: hidden;
  animation: ms-nexus-fade-in 0.3s ease;
}

@keyframes ms-nexus-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ms-nexus-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 4px;
  font-size: 0.82rem;
  color: #92400e;
}

.ms-nexus-close {
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-faint, #a09080);
  padding: 0 4px;
  line-height: 1;
}

.ms-nexus-close:hover { color: #2c1810; }

.ms-nexus-result-body {
  padding: 4px 12px 10px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #44403c;
  white-space: pre-wrap;
}

/* ── Body: ToC + Canvas + Manuscript Research Panel ── */
.ms-native-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.ms-native-body.ms-has-toc {
  grid-template-columns: 180px minmax(0, 1fr);
}
.ms-native-body.ms-has-right-panel {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
}
.ms-native-body.ms-has-toc.ms-has-right-panel {
  grid-template-columns: 180px minmax(0, 1fr) minmax(320px, 380px);
}

/* ── Table of Contents Sidebar ── */
.ms-native-toc {
  width: 180px;
  min-width: 140px;
  max-width: 220px;
  background: var(--bg-secondary, #faf8f5);
  border-right: 1px solid #e8e2d9;
  padding: 12px 10px;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ms-toc-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-primary, #8b7355);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

.ms-toc-empty {
  font-size: 0.72rem;
  color: #b8ad9e;
  font-style: italic;
  margin: 0;
}

.ms-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ms-toc-item {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #6b5b47;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-toc-item:hover {
  background: #f0ebe4;
  color: var(--text-primary, #2c1810);
}

.ms-toc-item.ms-toc-level-1 { padding-left: 6px; font-weight: 600; }
.ms-toc-item.ms-toc-level-2 { padding-left: 16px; }
.ms-toc-item.ms-toc-level-3 { padding-left: 26px; font-size: 0.78rem; }
.ms-toc-item.ms-toc-level-4 { padding-left: 36px; font-size: 0.75rem; color: var(--text-faint, #a09080); }

.ms-toc-stats {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #e8e2d9;
  font-size: 0.75rem;
  color: var(--text-faint, #a09080);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Canvas (textarea + scalpels) ── */
.ms-native-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.ms-native-textarea {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  background: #fffdf8;
  color: var(--text-primary, #2c1810);
  font-family: 'EB Garamond', 'Crimson Text', Georgia, serif;
  font-size: 15px;
  line-height: 1.8;
  padding: 16px 20px;
  resize: none;
  overflow-y: auto;
  tab-size: 4;
}

.ms-native-textarea::placeholder {
  color: #c8bfb0;
  font-style: italic;
}

.ms-native-textarea:focus {
  background: #fffef9;
}

.ms-confidence-score {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 12px;
  border-top: 1px solid #e8e2d9;
  background: #fffaf2;
  color: #4a3a2e;
  font-size: 0.78rem;
  line-height: 1.3;
}

.ms-confidence-label {
  white-space: nowrap;
  color: #6b5b47;
}

.ms-confidence-value,
.ms-confidence-label strong {
  color: #2c1810;
  font-weight: 800;
}

.ms-confidence-bar {
  width: 72px;
  height: 5px;
  border-radius: 999px;
  background: #eadfd2;
  overflow: hidden;
  flex-shrink: 0;
}

.ms-confidence-fill {
  height: 100%;
  border-radius: inherit;
  background: #8b7355;
}

.ms-confidence-gold .ms-confidence-fill {
  background: #b7791f;
}

.ms-confidence-solid .ms-confidence-fill {
  background: #3f7d58;
}

.ms-confidence-muted .ms-confidence-fill {
  background: #8b7355;
}

.ms-confidence-hint {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7a6a5a;
}

@media (max-width: 900px) {
  .ms-confidence-hint {
    display: none;
  }
}

/* ── Graveyard Pane ── */
.ms-graveyard-pane {
  border-top: 1px solid #e8e2d9;
  background: var(--bg-secondary, #faf8f5);
  display: flex;
  flex-direction: column;
  max-height: 200px;
  min-height: 100px;
  flex-shrink: 0;
}

.ms-graveyard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid #e8e2d9;
}

.ms-graveyard-header h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-primary, #8b7355);
  margin: 0;
}

.ms-graveyard-count {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-faint, #a09080);
  margin-left: 6px;
}

.ms-graveyard-action {
  background: transparent;
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: #6b5b47;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.15s;
}

.ms-graveyard-action:hover {
  background: #f0ebe4;
  border-color: var(--border-accent, #8b7355);
}

.ms-graveyard-textarea {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  background: #faf6f0;
  color: #78716c;
  font-family: 'EB Garamond', 'Crimson Text', Georgia, serif;
  font-size: 13px;
  line-height: 1.7;
  padding: 10px 14px;
  resize: none;
  overflow-y: auto;
  font-style: italic;
}

.ms-graveyard-textarea::placeholder {
  color: #c8bfb0;
}

/* ── Trash Banner (soft-delete view) ── */
.ms-trash-banner {
  grid-column: 1 / -1;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.82rem;
  color: #b91c1c;
  text-align: center;
}

.ms-card-deleted {
  opacity: 0.7;
  border-style: dashed !important;
}

/* ══════════════════════════════════════════
   WRITE MODE — Phase 9: Tri-Panel Assembly Engine
   Deterministic Academic Compiler UI
   ══════════════════════════════════════════ */

/* ── Container ── */
.wm-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--bg-secondary, #faf8f5);
}

/* ── Top Bar ── */
.wm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  background: var(--bg-secondary, #faf8f5);
  gap: 12px;
  flex-shrink: 0;
  min-height: 48px;
}

.wm-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.wm-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.wm-title-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 1.15rem;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: 600;
  color: var(--text-primary, #2c1810);
  padding: 4px 0;
  flex: 1;
  min-width: 0;
  outline: none;
  transition: border-color 0.2s;
}

.wm-title-input:focus {
  border-bottom-color: #8b7355;
}

.wm-action-btn {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.wm-action-btn:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
  border-color: var(--border-accent, #8b7355);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.wm-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wm-export-btn {
  background: #e8f5e8;
  border-color: #a3d9a3;
  color: #2d6a2d;
}

.wm-export-btn:hover {
  background: #d4edd4;
  border-color: #6bbb6b;
}

/* ── Tri-Panel Body ── */
.wm-body {
  display: grid;
  grid-template-columns: 220px 1fr 340px;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Left Panel: Outline ── */
.wm-panel-left {
  border-right: 1px solid var(--border-primary, #e8e3db);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-tertiary, #f7f3ee);
  padding-bottom: 8px;
}

.wm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
}

.wm-panel-header h4 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary, #4a3f35);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.wm-small-btn {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--text-muted, #6b5c4d);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.wm-small-btn:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
}

.wm-block-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.wm-block-item {
  padding: 10px 12px;
  border-radius: var(--radius-md, 8px);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  position: relative;
  background: rgba(255,255,255,0.6);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.wm-block-item:hover {
  background: var(--bg-hover, #f0ebe4);
  border-color: var(--border-primary, #e8e3db);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.wm-block-active {
  background: #B2FFFF;
  border-color: #4fb7c7;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

.wm-block-new {
  background: rgba(252, 138, 45, 0.18);
  border-color: #FC8A2D;
  box-shadow: 0 1px 8px rgba(252, 138, 45, 0.22);
}

.wm-block-dragging {
  opacity: 0.55;
}

.wm-block-locked {
  opacity: 0.8;
}

.wm-block-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.wm-block-status {
  font-size: 0.72rem;
}

.wm-block-type {
  color: var(--accent-primary, #8b7355);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.8px;
}

.wm-block-idx {
  color: var(--text-faint, #b0a090);
  font-size: 0.68rem;
  margin-left: auto;
}

.wm-block-goal {
  font-size: 0.82rem;
  color: var(--text-secondary, #3a3228);
  line-height: 1.35;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.wm-block-name {
  color: var(--text-primary, #2c1810);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm-block-goal em {
  color: var(--text-faint, #b0a090);
}

.wm-block-meta {
  display: flex;
  gap: 8px;
  font-size: 0.68rem;
  color: var(--text-faint, #a09080);
  margin-top: 3px;
  flex-wrap: wrap;
}

.wm-readiness-pill {
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #f8fafc;
  color: #475569;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm-readiness-pill.wm-readiness-ready {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.wm-readiness-pill.wm-readiness-may-lack-evidence {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

.wm-readiness-pill.wm-readiness-too-much-noise {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.wm-readiness-pill.wm-readiness-needs-papers,
.wm-readiness-pill.wm-readiness-needs-data,
.wm-readiness-pill.wm-readiness-needs-policy,
.wm-readiness-pill.wm-readiness-finish-linked-blocks,
.wm-readiness-pill.wm-readiness-needs-user-specification {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.wm-block-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.wm-block-actions button {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: var(--radius-sm, 4px);
  padding: 4px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted, #6b5c4d);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.wm-block-actions button:hover {
  background: var(--bg-hover, #e0d8cf);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.wm-block-actions button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.wm-job-badge {
  font-size: 0.72rem;
  animation: wmPulse 1.5s infinite;
}

@keyframes wmPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Center Panel: Workbench ── */
.wm-panel-center {
  display: flex;
  flex-direction: column;
  padding: 18px 24px;
  overflow-y: auto;
  min-height: 0;
}

.wm-workbench-header {
  flex-shrink: 0;
  margin-bottom: 12px;
}

.wm-workbench-type-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.wm-type-select {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  cursor: pointer;
}

.wm-status-badge {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wm-status-empty { background: var(--bg-tertiary, #f3f0ec); color: var(--text-faint, #a09080); }
.wm-status-armed { background: #fef3c7; color: #92400e; }
.wm-status-drafted { background: #d1fae5; color: #065f46; }
.wm-status-locked { background: #e0e7ff; color: #3730a3; }

.wm-goal-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  padding: 8px 0;
  font-size: 0.95rem;
  color: var(--text-primary, #2c1810);
  outline: none;
  font-family: 'Georgia', serif;
  transition: border-color 0.2s;
}

.wm-goal-input:focus {
  border-bottom-color: #8b7355;
}

.wm-goal-input::placeholder {
  color: var(--text-placeholder, #c0b8a8);
  font-style: italic;
}

/* ── Attached Note Chips ── */
.wm-attached-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.wm-note-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--text-muted, #6b5c4d);
}

.wm-note-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint, #b0a090);
  font-size: 0.88rem;
  padding: 0 2px;
  line-height: 1;
}

.wm-note-chip button:hover {
  color: #ef4444;
}

/* ── S06 Block Readiness ── */
.wm-readiness-card {
  border: 1px solid #e5ded2;
  border-radius: 12px;
  background: #fffdf8;
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(70, 52, 33, 0.06);
}

.wm-readiness-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #5f5143;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wm-readiness-card-head strong {
  color: #2f281f;
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
  text-align: right;
}

.wm-readiness-card p {
  margin: 8px 0 0;
  color: #51483c;
  font-size: 0.84rem;
  line-height: 1.45;
}

.wm-readiness-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.wm-readiness-card-meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f6f1eb;
  color: #66594d;
  font-size: 0.68rem;
  font-weight: 700;
}

.wm-readiness-ready,
.wm-compile-ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.wm-readiness-may-lack-evidence,
.wm-compile-may-lack-evidence {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.wm-readiness-too-much-noise,
.wm-compile-too-much-noise {
  border-color: #fed7aa;
  background: #fff7ed;
}

.wm-readiness-needs-papers,
.wm-readiness-needs-data,
.wm-readiness-needs-policy,
.wm-readiness-finish-linked-blocks,
.wm-readiness-needs-user-specification {
  border-color: #fecaca;
  background: #fff7f7;
}

/* ── Compile Row ── */
.wm-compile-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.wm-compile-btn,
.wm-revise-btn {
  background: linear-gradient(135deg, #8b7355, #6b5c4d);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wm-compile-btn:hover,
.wm-revise-btn:hover {
  background: linear-gradient(135deg, #6b5c4d, #4a3f35);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.wm-compile-btn:disabled,
.wm-revise-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.wm-compile-btn.wm-compile-ready {
  background: linear-gradient(135deg, #166534, #15803d);
}

.wm-compile-btn.wm-compile-may-lack-evidence {
  background: linear-gradient(135deg, #315f9e, #1d4ed8);
}

.wm-compile-btn.wm-compile-too-much-noise {
  background: linear-gradient(135deg, #9a5b18, #c2410c);
}

.wm-compile-btn.wm-compile-needs-papers,
.wm-compile-btn.wm-compile-needs-data,
.wm-compile-btn.wm-compile-needs-policy,
.wm-compile-btn.wm-compile-finish-linked-blocks,
.wm-compile-btn.wm-compile-needs-user-specification {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
}

.wm-lock-btn, .wm-unlock-btn {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted, #6b5c4d);
}

.wm-lock-btn:hover {
  background: #e0e7ff;
  border-color: #818cf8;
  color: #3730a3;
}

.wm-unlock-btn:hover {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #92400e;
}

.wm-version-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--accent-primary, #8b7355);
  margin-left: auto;
}

.wm-version-nav button {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 3px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--text-muted, #6b5c4d);
}

.wm-version-nav button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.wm-stream-card {
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--bg-tertiary, #f5f0ea);
}

.wm-stream-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.wm-stream-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary, #4a3f35);
  letter-spacing: 0.2px;
}

.wm-stream-status {
  font-size: 0.72rem;
  color: var(--accent-primary, #8b7355);
  font-weight: 600;
}

.wm-stream-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-faint, #9f907f);
  margin-bottom: 8px;
}

.wm-stream-preview {
  max-height: 140px;
  overflow: auto;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-primary, #2c1810);
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.wm-stream-hint {
  margin: 0 0 8px 0;
  font-size: 0.78rem;
  color: var(--text-faint, #9f907f);
}

.wm-stream-error {
  margin: 0 0 8px 0;
  font-size: 0.78rem;
  color: #b91c1c;
}

.wm-stream-actions {
  display: flex;
  gap: 6px;
}

.wm-stream-btn {
  border: 1px solid var(--border-secondary, #d1cdc5);
  background: var(--bg-card, #fff);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.74rem;
  cursor: pointer;
  color: var(--text-secondary, #4a3f35);
}

.wm-stream-btn-stop {
  border-color: #fca5a5;
  color: #991b1b;
}

.wm-stream-btn-resume {
  border-color: #86efac;
  color: #065f46;
}

.wm-stream-btn-dismiss {
  border-color: #cbd5e1;
  color: #334155;
}

/* ── Draft Textarea ── */
.wm-draft-textarea {
  flex: 1;
  min-height: 250px;
  width: 100%;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 10px;
  padding: 16px 18px;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary, #2c1810);
  resize: none;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.wm-draft-textarea:focus {
  border-color: var(--border-accent, #8b7355);
  box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.wm-draft-textarea:disabled {
  background: var(--bg-tertiary, #f7f3ee);
  color: var(--accent-primary, #8b7355);
  cursor: not-allowed;
}

.wm-draft-textarea::placeholder {
  color: var(--text-placeholder, #c0b8a8);
  font-style: italic;
}

.wm-empty-workbench {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-faint, #b0a090);
  font-style: italic;
}

/* ── Right Panel: Intelligence Hub ── */
.wm-panel-right {
  border-left: 1px solid var(--border-primary, #e8e3db);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-tertiary, #f7f3ee);
  min-width: 0;
}

.ms-workspace-panel {
  min-height: 0;
}

.ms-workspace-panel:not(.wm-drawer-open) {
  display: none;
}

.wm-hub-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  flex-shrink: 0;
  background: var(--bg-tertiary, #f3efe9);
}

.wm-hub-tabs button {
  flex: 1;
  padding: 9px 6px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--accent-primary, #8b7355);
  transition: all 0.2s;
  white-space: nowrap;
  font-weight: 500;
}

.wm-hub-tabs button:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-secondary, #4a3f35);
}

.wm-hub-tabs button.active {
  color: var(--text-primary, #2c1810);
  border-bottom-color: #8b7355;
  font-weight: 700;
  background: var(--bg-tertiary, #f7f3ee);
}

.wm-hub-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

.wm-hub-section-title {
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  margin: 0 0 10px 0;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.wm-hub-empty {
  color: var(--text-faint, #b0a090);
  font-size: 0.82rem;
  font-style: italic;
  text-align: center;
  padding: 32px 12px;
  line-height: 1.6;
}
.wm-data-coming-soon {
  background: #f8fafc;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  padding: 18px;
  color: #334155;
  line-height: 1.6;
}
.wm-data-coming-soon h4 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 1rem;
}
.wm-data-coming-soon p {
  margin: 0 0 10px;
  font-size: 0.86rem;
}
.wm-data-coming-soon span {
  display: inline-flex;
  margin-top: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 0.72rem;
  font-weight: 700;
}

.wm-zettel-hub {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wm-zettel-header h4 {
  margin: 0 0 4px;
  color: #1f2937;
}
.wm-zettel-helper {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
}
.wm-zettel-list {
  display: grid;
  gap: 8px;
}
.wm-zettel-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border: 1px solid #eee4d7;
  border-radius: 8px;
  background: #fffdf8;
}
.wm-zettel-item.is-starred {
  border-color: #d69b2d;
  background: #fff8e7;
}
.wm-zettel-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
}
.wm-zettel-card-body {
  min-width: 0;
}
.wm-zettel-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  color: #7c6f62;
  font-size: 0.76rem;
}
.wm-zettel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.wm-zettel-tags span {
  border-radius: 999px;
  background: #f3eee7;
  color: #5f4f3e;
  font-size: 0.72rem;
  padding: 2px 7px;
}
.wm-zettel-item label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.wm-zettel-star {
  background: transparent;
  border: 0;
  color: #8b7355;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
}
.wm-zettel-text {
  color: #374151;
  font-size: 0.82rem;
  line-height: 1.45;
  flex: 1;
  min-width: 0;
}
.wm-zettel-source {
  color: #64748b;
  flex: 0 0 100%;
  font-size: 0.78rem;
  line-height: 1.3;
  margin-left: 26px;
}
.wm-zettel-empty {
  margin: 12px 0;
  padding: 22px 16px;
  border: 1px dashed #d9c8b5;
  border-radius: 12px;
  background: #fffdf8;
  color: #6b5b47;
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: center;
}
.wm-zettel-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0 4px;
  text-align: center;
}
.wm-zettel-btn {
  border: 1px solid #d7c8f6;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.wm-zettel-btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  min-width: min(100%, 240px);
}
.wm-zettel-btn-link {
  background: transparent;
  color: #6d28d9;
}
.wm-zettel-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.wm-insight-chip {
  background: #fef3c7;
  border-color: #facc15;
  color: #78350f;
}

/* Suggest tab items */
.wm-suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  border-bottom: 1px solid #f0ebe4;
  transition: background 0.15s;
}

.wm-suggest-item:hover {
  background: rgba(139,115,85,0.04);
}

.wm-suggest-item:last-child {
  border-bottom: none;
}
.wm-rag-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.wm-rag-suggest-card {
  align-items: flex-start;
  background: #fffdf8;
  border: 1px solid #efe7dc;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(44, 24, 16, 0.04);
}
.wm-rag-suggest-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.wm-rag-suggest-main strong {
  color: #1f2937;
  font-size: 0.88rem;
}
.wm-rag-suggest-title {
  color: #475569;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wm-rag-suggest-main p,
.wm-rag-cost-note {
  margin: 0;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.45;
}
.wm-missing-label {
  color: #9ca3af;
  font-size: 0.72rem;
  white-space: nowrap;
}
.wm-rag-cost-note {
  margin-top: 8px;
  text-align: left;
}

.wm-attach-btn {
  background: #d1fae5;
  border: 1px solid #86efac;
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: #065f46;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-weight: 500;
}

.wm-attach-btn:hover {
  background: #a7f3d0;
}

.wm-detach-btn {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.68rem;
  color: #b91c1c;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.wm-detach-btn:hover {
  background: #fecaca;
}

.wm-attached-label {
  font-size: 0.68rem;
  color: #065f46;
  font-weight: 600;
}

/* Notes tab */
.wm-note-search {
  width: 100%;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: var(--text-primary, #2c1810);
  outline: none;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.wm-note-search:focus {
  border-color: var(--border-accent, #8b7355);
}

.wm-note-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wm-note-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 4px;
  gap: 6px;
  transition: background 0.15s;
}

.wm-note-item:hover {
  background: #f0ebe4;
}

.wm-note-attached {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.wm-note-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.wm-note-item-info strong {
  font-size: 0.78rem;
  color: var(--text-muted, #6b5c4d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wm-note-title {
  display: -webkit-box;
  font-size: 0.76rem;
  line-height: 1.32;
  color: var(--text-faint, #a09080);
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Audit tab */
.wm-audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wm-audit-item {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 6px;
  padding: 8px 10px;
}

.wm-audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.wm-audit-block {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #6b5c4d);
}

.wm-audit-time {
  font-size: 0.68rem;
  color: var(--text-faint, #b0a090);
}

.wm-audit-body {
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ── Manuscript Card badge for Write Mode ── */
.wm-new-card {
  background: linear-gradient(135deg, #f5f0ea, #ebe6df) !important;
  border-color: #8b7355 !important;
  color: #6b5c4d !important;
}

.wm-card-write {
  border-left: 3px solid #8b7355 !important;
}

.wm-card-badge {
  margin-right: 4px;
}

/* ══════════════════════════════════════════
   SPRINT 4-5: Polish Engine v2, Memory Loop,
   Auto-Injector, Export Engine
   ══════════════════════════════════════════ */

/* ── Polish Mode: Back to Write Mode button ── */
.wm-polish-return-btn {
  background: linear-gradient(135deg, #7c3aed22, #6366f122);
  border: 1px solid #7c3aed44;
  color: #7c3aed;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.wm-polish-return-btn:hover {
  background: linear-gradient(135deg, #7c3aed33, #6366f133);
  border-color: #7c3aed66;
}

/* ── Audit Checklist Panel (Polish Mode) ── */
.ms-audit-checklist-pane {
  border-top: 1px solid var(--border-primary, #e8e3db);
  padding: 12px 16px;
  background: var(--bg-secondary, #faf8f5);
  max-height: 280px;
  overflow-y: auto;
}
.ms-audit-checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ms-audit-checklist-header h4 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted, #555);
}
.ms-audit-count {
  font-size: 0.72rem;
  color: var(--text-faint, #888);
  margin-left: 6px;
}
.ms-audit-checklist-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ms-audit-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.82rem;
  color: #444;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
}
.ms-audit-check-item:hover {
  background: #f0eee9;
}
.ms-audit-check-item.ms-audit-resolved {
  opacity: 0.5;
  text-decoration: line-through;
  order: 999;
}
.ms-audit-checkbox {
  flex-shrink: 0;
  font-size: 0.88rem;
}
.ms-audit-check-text {
  flex: 1;
  line-height: 1.4;
}
.ms-audit-dismiss-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  opacity: 0.5;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity 0.15s;
}
.ms-audit-dismiss-btn:hover {
  opacity: 1;
  background: #fee2e2;
}

/* ── Auto-Injector: PDF upload row ── */
.wm-auto-inject-row {
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  margin-bottom: 8px;
}
.wm-inject-btn {
  width: 100%;
  padding: 8px 12px;
  border: 1px dashed #7c3aed44;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed08, #6366f108);
  color: #7c3aed;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.wm-inject-btn:hover {
  background: linear-gradient(135deg, #7c3aed18, #6366f118);
  border-color: #7c3aed66;
}
.wm-inject-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════
   Sprint 46: Co-Pilot UI — Banners & Action Items
   ══════════════════════════════════════════ */

/* Inline Co-Pilot Banner — appears below compiled draft text */
.wm-copilot-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0f9ff 100%);
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: copilotSlideIn 0.3s ease-out;
}
.wm-copilot-banner-outline {
  margin-bottom: 8px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 50%, #faf5ff 100%);
  border-color: #93c5fd;
}
.wm-copilot-banner-text {
  font-size: 0.85rem;
  color: #166534;
  font-weight: 500;
  line-height: 1.4;
}
.wm-copilot-banner-outline .wm-copilot-banner-text {
  color: #1e40af;
}
.wm-copilot-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wm-copilot-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.wm-copilot-btn-primary {
  background: #16a34a;
  color: #fff;
}
.wm-copilot-btn-primary:hover {
  background: #15803d;
}
.wm-copilot-btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}
.wm-copilot-btn-secondary {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
}
.wm-copilot-btn-secondary:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Action Items Tab Cards */
.wm-action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wm-action-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
  border-left: 3px solid #16a34a;
  border-radius: 6px;
  padding: 10px 12px;
}
.wm-action-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.wm-action-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  font-weight: 500;
  line-height: 1.4;
}
.wm-action-card-cost {
  font-size: 0.75rem;
  font-weight: 700;
  color: #d97706;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.wm-action-card-actions {
  display: flex;
  gap: 6px;
}

@keyframes copilotSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  .wm-copilot-banner {
    background: linear-gradient(135deg, #052e16 0%, #064e3b 50%, #0c2937 100%);
    border-color: #166534;
  }
  .wm-copilot-banner-text { color: #86efac; }
  .wm-copilot-banner-outline {
    background: linear-gradient(135deg, #172554 0%, #0c2937 50%, #1e1b4b 100%);
    border-color: #1e40af;
  }
  .wm-copilot-banner-outline .wm-copilot-banner-text { color: #93c5fd; }
  .wm-copilot-btn-primary { background: #15803d; }
  .wm-copilot-btn-secondary { color: #9ca3af; border-color: #4b5563; }
  .wm-copilot-btn-secondary:hover { background: #1f2937; color: #d1d5db; }
}

/* ── Audit item dismiss button ── */
.wm-audit-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  opacity: 0.4;
  padding: 2px;
  margin-left: 4px;
  border-radius: 3px;
  transition: all 0.15s;
}
.wm-audit-dismiss:hover {
  opacity: 1;
  background: #fee2e2;
}

/* ── Export Tab ── */
.wm-export-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wm-export-action-btn {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 8px;
  background: var(--bg-card, #fff);
  color: #444;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.wm-export-action-btn:hover {
  background: #f0eee9;
  border-color: var(--border-secondary, #d1cdc5);
}
.wm-export-action-btn select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
}

/* ── Memory Loop stats ── */
.wm-memory-loop-info {
  font-size: 0.82rem;
  color: var(--text-faint, #888);
  margin: 4px 0 8px;
  line-height: 1.4;
}
.wm-dismissed-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wm-dismissed-item {
  font-size: 0.72rem;
  color: #666;
  padding: 4px 8px;
  background: #fef2f2;
  border-radius: 6px;
  border: 1px solid #fee2e2;
}
.wm-dismissed-text {
  display: block;
}
.wm-dismissed-reason {
  display: block;
  font-style: italic;
  color: var(--text-faint, #999);
  font-size: 0.72rem;
  margin-top: 2px;
}

/* ══════════════════════════════════════════
   Sprint 16 – Vector 3: iPad / Tablet Responsive Drawers
   Breakpoint: 901px–1024px → drawer-based tri-panel
   ══════════════════════════════════════════ */

/* Drawer toggle buttons – hidden on desktop */
.wm-drawer-toggle {
  display: none;
}

/* Drawer backdrop – hidden by default */
.wm-drawer-backdrop {
  display: none;
}

@media (min-width: 901px) and (max-width: 1024px) {
  /* ── Grid: single column, panels become drawers ── */
  .wm-body {
    grid-template-columns: 1fr;
    position: relative;
    overflow: hidden;
  }

  /* ── Center panel takes full width ── */
  .wm-panel-center {
    grid-column: 1 / -1;
  }

  /* ── Drawer toggle buttons – visible on tablet ── */
  .wm-drawer-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 64px;
    border: 1px solid var(--border-primary, #e8e3db);
    background: var(--bg-tertiary, #f7f3ee);
    color: var(--text-muted, #6b5c4d);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 110;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  .wm-drawer-toggle:hover {
    background: #f0ebe4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  }
  .wm-drawer-toggle:active {
    transform: translateY(-50%) scale(0.96);
  }

  .wm-drawer-toggle-left {
    left: 0;
    border-radius: 0 10px 10px 0;
    border-left: none;
  }
  .wm-drawer-toggle-right {
    right: 0;
    border-radius: 10px 0 0 10px;
    border-right: none;
  }

  /* ── Left panel as sliding drawer ── */
  .wm-panel-left {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100vh;
    z-index: 120;
    background: var(--bg-tertiary, #f7f3ee);
    border-right: 1px solid var(--border-primary, #e8e3db);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
  }
  .wm-panel-left.wm-drawer-open {
    left: 0;
  }

  /* ── Right panel as sliding drawer ── */
  .wm-panel-right {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    z-index: 120;
    background: var(--bg-tertiary, #f7f3ee);
    border-left: 1px solid var(--border-primary, #e8e3db);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
  }
  .wm-panel-right.wm-drawer-open {
    right: 0;
  }

  /* ── Semi-transparent backdrop ── */
  .wm-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 115;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: drawerBackdropIn 0.2s ease-out;
  }

  @keyframes drawerBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
}

/* ── Responsive: Collapse panels on phone (≤900px) ── */
@media (max-width: 900px) {
  .wm-body {
    grid-template-columns: 1fr;
  }
  .wm-panel-left {
    display: none;
  }
  .wm-panel-right {
    border-left: none;
    border-top: 1px solid var(--border-primary, #e8e3db);
    max-height: 250px;
  }
  .wm-drawer-toggle {
    display: none;
  }
  .wm-drawer-backdrop {
    display: none;
  }
}

/* ══════════════════════════════════════════
   Sprint 6: Ghost Job, Context Weight, Retry UI
   ══════════════════════════════════════════ */

/* ── Ghost Job Retry Button ── */
.wm-retry-btn {
  padding: 6px 14px;
  border: 1px solid #f97316;
  border-radius: 8px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.wm-retry-btn:hover {
  background: #fed7aa;
  border-color: #ea580c;
}

/* ── Context Weight Indicator ── */
.wm-context-weight {
  font-size: 0.72rem;
  color: #78716c;
  font-weight: 600;
  padding: 2px 8px;
  background: #f5f0eb;
  border-radius: 10px;
  white-space: nowrap;
}
.wm-context-full {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fca5a5;
}

/* ── Timeout badge in compile button ── */
.wm-compile-btn[disabled],
.wm-revise-btn[disabled] {
  opacity: 0.6;
}

/* ── Keyboard shortcut hint ── */
.wm-shortcut-hint {
  font-size: 0.68rem;
  color: #a8a29e;
  margin-left: 8px;
}

/* ══════════════════════════════════════════
   Sprint 7: Parachute Export Button
   ══════════════════════════════════════════ */
.wm-parachute-btn {
  width: 100%;
  padding: 12px 14px;
  border: 2px dashed #e8e3db;
  border-radius: 10px;
  background: linear-gradient(135deg, #fefce8, #fef9c3);
  color: #854d0e;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  margin-top: 12px;
}
.wm-parachute-btn:hover {
  background: linear-gradient(135deg, #fef9c3, #fde68a);
  border-color: #f59e0b;
}
.wm-parachute-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════
   Sprint 8: Spatial Canvas Overlay
   ══════════════════════════════════════════ */
.wm-canvas-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: #faf9f7;
  border-radius: 12px;
  overflow: hidden;
}

.spatial-canvas-shell {
  width: 100%;
  height: 100%;
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(215, 198, 173, 0.38), transparent 34%),
    linear-gradient(135deg, #fffaf2 0%, #f3ede4 100%);
  color: #2f281f;
}

.spatial-canvas-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e2d6c6;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.94);
  box-shadow: 0 12px 32px rgba(47, 40, 31, 0.12);
  backdrop-filter: blur(10px);
}

.spatial-canvas-mode-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid #e4d8c9;
  border-radius: 12px;
  background: #f6efe5;
}

.spatial-canvas-mode-tab,
.spatial-canvas-button {
  min-height: 34px;
  border: 1px solid #d8c9b8;
  border-radius: 10px;
  background: #fffaf2;
  color: #4a3a2e;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.spatial-canvas-mode-tab {
  padding: 6px 10px;
  border-color: transparent;
  background: transparent;
}

.spatial-canvas-mode-tab:hover,
.spatial-canvas-button:hover {
  transform: translateY(-1px);
  border-color: #b89f7d;
}

.spatial-canvas-mode-tab.is-active,
.spatial-canvas-button.is-active {
  background: #4a3a2e;
  border-color: #4a3a2e;
  color: #fffaf2;
  box-shadow: 0 6px 16px rgba(74, 58, 46, 0.18);
}

.spatial-canvas-control {
  display: grid;
  gap: 3px;
}

.spatial-canvas-control label {
  color: #7a6a5a;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.spatial-canvas-control select {
  min-height: 34px;
  border: 1px solid #d8c9b8;
  border-radius: 10px;
  background: #fffaf2;
  color: #2f281f;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0 9px;
}

.spatial-canvas-button {
  padding: 7px 12px;
}

.spatial-canvas-close {
  margin-left: auto;
}

.spatial-canvas-status,
.spatial-canvas-cap-message {
  position: absolute;
  left: 18px;
  z-index: 95;
  max-width: min(760px, calc(100% - 36px));
  border: 1px solid #e2d6c6;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.94);
  color: #5d4d3e;
  font-size: 0.78rem;
  line-height: 1.35;
  padding: 8px 12px;
  box-shadow: 0 8px 20px rgba(47, 40, 31, 0.09);
}

.spatial-canvas-status {
  top: 82px;
}

.spatial-canvas-status[data-state="error"] {
  border-color: #f3c2a2;
  background: #fff7ed;
  color: #8a3b12;
}

.spatial-canvas-status button {
  margin-left: 8px;
  border: 1px solid #d8a27d;
  border-radius: 999px;
  background: #fffaf2;
  color: #8a3b12;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.spatial-canvas-cap-message {
  top: 122px;
  border-color: #d9c49d;
  background: #fffbeb;
  color: #725523;
}

.spatial-block-node {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid #dacdbc;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.96);
  box-shadow: 0 12px 28px rgba(47, 40, 31, 0.13);
  padding: 11px 13px;
  transition: opacity 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.spatial-block-node-container {
  min-height: 118px;
  border-color: #bca887;
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.98), rgba(245, 236, 223, 0.96));
}

.spatial-block-node-dimmed {
  opacity: 0.34;
  filter: grayscale(0.45);
  box-shadow: none;
}

.spatial-node-kicker,
.spatial-node-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.spatial-node-kicker {
  margin-bottom: 6px;
  color: #7a6a5a;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.spatial-node-status,
.spatial-node-meta span {
  border-radius: 999px;
  padding: 2px 7px;
  color: #3f3328;
  letter-spacing: 0;
  text-transform: none;
}

.spatial-node-title {
  color: #1f1a15;
  font-size: 0.86rem;
  font-weight: 820;
  line-height: 1.32;
}

.spatial-node-subtitle {
  margin-top: 6px;
  color: #66594d;
  font-size: 0.72rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spatial-node-meta {
  margin-top: 8px;
  color: #7a6a5a;
  font-size: 0.68rem;
  font-weight: 700;
}

.spatial-node-meta span {
  background: #f3ede4;
}

.spatial-note-node {
  max-width: 170px;
  border: 1px solid #e0bd68;
  border-radius: 10px;
  background: #fff8dc;
  color: #4d3b16;
  box-shadow: 0 8px 18px rgba(47, 40, 31, 0.1);
  padding: 8px 10px;
}

.spatial-note-title {
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.25;
}

.spatial-note-text {
  margin-top: 4px;
  color: #746036;
  font-size: 0.68rem;
  line-height: 1.3;
}

.spatial-node-handle {
  background: #7a6a5a;
}

@media (max-width: 860px) {
  .spatial-canvas-toolbar {
    max-height: 150px;
    overflow-y: auto;
  }

  .spatial-canvas-status {
    top: 172px;
  }

  .spatial-canvas-cap-message {
    top: 214px;
  }
}

/* ══════════════════════════════════════════
   Sprint 9: Writing Style Selector
   ══════════════════════════════════════════ */
.wm-style-select {
  padding: 5px 10px;
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 8px;
  background: #faf9f7;
  color: #44403c;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.15s;
}
.wm-style-select:hover {
  border-color: var(--border-secondary, #d1cdc5);
  background: #f0eee9;
}
.wm-style-select:focus {
  border-color: var(--accent-primary, #6366f1);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.wm-paper-spec-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  color: #6b5c4d;
  font-size: 0.72rem;
}
.wm-paper-spec-summary span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 7px;
  border: 1px solid #e5ded2;
  border-radius: 999px;
  background: #fffdf8;
}

/* ══════════════════════════════════════════
   Sprint 9: Mad Libs Architect Panel
   ══════════════════════════════════════════ */
.wm-madlibs-panel {
  padding: 12px 14px;
  background: linear-gradient(135deg, #f0f9ff, #eff6ff);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  margin: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wm-madlibs-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.wm-madlibs-modal {
  width: min(860px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  background: #fffdf8;
  border: 1px solid #e5ded2;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  padding: 22px;
}
.wm-madlibs-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #ebe2d6;
  margin-bottom: 16px;
}
.wm-madlibs-modal-header h3 {
  margin: 0;
  color: #1e293b;
  font-size: 1.35rem;
}
.wm-madlibs-modal-header p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
}
.wm-madlibs-modal-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px 16px;
  align-items: start;
}
.wm-madlibs-modal-grid .wm-madlibs-label {
  padding-top: 9px;
}
.wm-madlibs-textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.55;
}
.wm-madlibs-modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #ebe2d6;
}
@media (max-width: 720px) {
  .wm-madlibs-modal-grid {
    grid-template-columns: 1fr;
  }
  .wm-madlibs-modal-grid .wm-madlibs-label {
    padding-top: 0;
  }
}
.wm-madlibs-intro {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 4px;
  line-height: 1.4;
}
.wm-madlibs-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  margin-top: 2px;
}
.wm-madlibs-optional {
  font-weight: 400;
  color: #94a3b8;
  font-style: italic;
}
.wm-madlibs-select {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: var(--bg-card, #fff);
  font-size: 0.82rem;
  color: #1e293b;
}
.wm-madlibs-input {
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: var(--bg-card, #fff);
  font-size: 0.82rem;
  color: #1e293b;
  width: 100%;
  box-sizing: border-box;
}
.wm-madlibs-input::placeholder {
  color: #94a3b8;
  font-style: italic;
}
.wm-madlibs-input:focus,
.wm-madlibs-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.wm-madlibs-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.wm-madlibs-hint {
  grid-column: 1 / -1;
  border: 1px solid #d7c6ad;
  border-radius: 8px;
  background: #fff8ea;
  color: #6b4f2a;
  padding: 10px 12px;
  font-size: 0.84rem;
  line-height: 1.45;
}
@media (max-width: 720px) {
  .wm-madlibs-two-col {
    grid-template-columns: 1fr;
  }
}
.wm-madlibs-generate {
  margin-top: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.wm-madlibs-generate:hover {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.wm-madlibs-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ══════════════════════════════════════════
   Sprint 9: Playground / Empty State
   ══════════════════════════════════════════ */
.wm-playground-prompt {
  text-align: center;
  padding: 40px 24px;
  max-width: 480px;
  margin: 0 auto;
}
.wm-playground-prompt h3 {
  font-size: 1.3rem;
  color: #1c1917;
  margin: 0 0 8px;
  font-weight: 700;
}
.wm-playground-prompt > p {
  font-size: 0.88rem;
  color: #78716c;
  margin: 0 0 24px;
  line-height: 1.5;
}
.wm-playground-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wm-playground-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 24px;
  border: 2px solid #e8e3db;
  border-radius: 14px;
  background: var(--bg-card, #fff);
  color: #1c1917;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.wm-playground-btn:hover {
  border-color: #6366f1;
  background: #f0f0ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}
.wm-playground-example {
  border-style: dashed;
  background: linear-gradient(135deg, #fefce8, #fff);
}
.wm-playground-example:hover {
  border-color: #f59e0b;
  background: #fffbeb;
}
.wm-playground-subtitle {
  font-size: 0.72rem;
  font-weight: 400;
  color: #78716c;
  line-height: 1.3;
}

/* ══════════════════════════════════════════
   Sprint 21: Workspace Toggle — Dual-Lens Paradigm
   ══════════════════════════════════════════ */
.workspace-toggle {
  display: flex;
  align-items: center;
  background: #f0ece6;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
  border: 1px solid #e0dbd3;
}

.workspace-toggle-btn {
  background: transparent;
  border: none;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: 500;
  color: #78716c;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.25s ease;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.workspace-toggle-btn:hover:not(.workspace-toggle-active) {
  background: rgba(255, 255, 255, 0.6);
  color: #44403c;
}

.workspace-toggle-active {
  background: var(--bg-card, #fff);
  color: var(--text-primary, #2c1810);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
  cursor: default;
}

/* Responsive: stack toggle vertically on narrow screens */
@media (max-width: 768px) {
  .workspace-toggle {
    order: -1;
    width: 100%;
    justify-content: center;
  }
  .workspace-toggle-btn {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.82rem;
  }
  .wm-topbar {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Sprint 42: Nexus Action Drawer — unified validation results panel
   ══════════════════════════════════════════════════════════════════ */

.nexus-drawer {
  background: var(--bg-primary, #fffdf8);
  border: 1px solid #e8e2d9;
  border-radius: 8px;
  margin: 8px 12px;
  overflow: hidden;
  animation: ms-nexus-fade-in 0.3s ease;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
}

.nexus-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
  border-bottom: 1px solid #f0ebe3;
}
.nexus-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-primary, #2c1810);
}
.nexus-confidence {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}
.nexus-confidence.high { background: #dcfce7; color: #166534; }
.nexus-confidence.mid  { background: #fef3c7; color: #92400e; }
.nexus-confidence.low  { background: #fee2e2; color: #991b1b; }

.nexus-verdict {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-secondary, #78716c);
  border-bottom: 1px solid #f0ebe3;
}

.nexus-summary-strip {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  flex-wrap: wrap;
}
.nexus-chip {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.chip-ok    { background: #dcfce7; color: #166534; }
.chip-warn  { background: #fef3c7; color: #92400e; }
.chip-struct { background: #f3e8ff; color: #6b21a8; }
.chip-logic { background: #dbeafe; color: #1e40af; }
.chip-blind { background: #e0f2fe; color: #0c4a6e; }

.nexus-tabs {
  display: flex;
  border-bottom: 1px solid #e8e2d9;
  padding: 0 8px;
}
.nexus-tab {
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text-secondary, #78716c);
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}
.nexus-tab:hover { color: var(--text-primary, #2c1810); }
.nexus-tab.active {
  color: var(--accent-primary, #b45309);
  border-bottom-color: var(--accent-primary, #b45309);
  font-weight: 600;
}

.nexus-drawer-body {
  overflow-y: auto;
  padding: 10px 12px;
  flex: 1;
  min-height: 0;
}

.nexus-card {
  border-left: 3px solid #ccc;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
  transition: box-shadow 0.15s ease;
}
.nexus-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.nexus-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.nexus-card-emoji { font-size: 0.9rem; }
.nexus-card-severity {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.68rem;
}

.nexus-card-claim {
  color: var(--text-primary, #2c1810);
  margin-bottom: 4px;
}
.nexus-card-evidence {
  font-size: 0.75rem;
  color: var(--text-secondary, #78716c);
  font-style: italic;
  margin-bottom: 4px;
}
.nexus-card-fix {
  font-size: 0.75rem;
  color: #b45309;
  font-weight: 500;
}

.nexus-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary, #78716c);
  padding: 10px 0 4px;
  letter-spacing: 0.05em;
}

.nexus-empty {
  text-align: center;
  color: var(--text-secondary, #78716c);
  padding: 20px;
  font-size: 0.82rem;
  font-style: italic;
}

/* ═══════════════════════════════════════════════
   Sprint 48: Dashboard & Admin Panel Styles
   ═══════════════════════════════════════════════ */

/* ── Shared dashboard modal overrides ── */
.dashboard-modal,
.admin-modal {
  max-width: 680px;
  width: 95%;
}

.dashboard-header,
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.dashboard-header h3,
.admin-header h3 {
  margin: 0;
  font-size: 1.15rem;
}

/* ── Card grid ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.dash-card {
  background: var(--card-bg, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.dash-card-wallet {
  border-left: 3px solid #8b5cf6;
}
.dash-card-admin {
  border-left: 3px solid #f59e0b;
}
.dash-card-cost {
  border-left: 3px solid #ef4444;
}

.dash-card-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}
.dash-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.dash-card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
}
.dash-card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #6b7280);
  margin-top: 2px;
}
.dash-card-sub {
  font-size: 0.7rem;
  color: var(--text-tertiary, #9ca3af);
  margin-top: 4px;
}

/* ── Velocity snapshot ── */
.dash-velocity {
  margin-top: 12px;
}
.dash-velocity h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 8px;
}
.dash-vel-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border, #f3f4f6);
}
.dash-vel-row:last-child {
  border-bottom: none;
}

/* ── Admin: Tool usage breakdown ── */
.admin-tool-usage {
  margin-top: 18px;
}
.admin-tool-usage h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 8px;
}
.admin-tool-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-tool-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}
.admin-tool-row span:first-child {
  min-width: 120px;
  text-align: right;
  color: var(--text-secondary, #6b7280);
}
.admin-tool-bar-wrap {
  flex: 1;
  height: 14px;
  background: var(--border, #e5e7eb);
  border-radius: 7px;
  overflow: hidden;
}
.admin-tool-bar {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  border-radius: 7px;
  transition: width 0.3s ease;
}
.admin-tool-row span:last-child {
  min-width: 32px;
  font-weight: 600;
}

/* ── Admin days selector ── */
.admin-days-select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border, #d1d5db);
  font-size: 0.8rem;
  background: var(--card-bg, #fff);
}

/* ── Admin daily breakdown ── */
.admin-daily {
  margin-top: 18px;
}
.admin-daily h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 8px;
}
.admin-daily-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-daily-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border, #f3f4f6);
}

/* ── Loading / empty states ── */
.admin-loading,
.admin-empty {
  text-align: center;
  padding: 32px;
  font-size: 0.9rem;
  color: var(--text-secondary, #9ca3af);
}

/* ── Dark mode overrides ── */
@media (prefers-color-scheme: dark) {
  .dash-card {
    background: #1e1e2e;
    border-color: #313244;
  }
  .dash-card-value {
    color: #cdd6f4;
  }
  .admin-tool-bar-wrap {
    background: #313244;
  }
  .admin-days-select {
    background: #1e1e2e;
    border-color: #313244;
    color: #cdd6f4;
  }
}

/* ═══════════════════════════════════════════════
   Sprint 49: Zero-State Tutors
   ═══════════════════════════════════════════════ */

.zero-state-tutor {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px dashed var(--border, #d1d5db);
  border-radius: 14px;
  padding: 36px 24px;
  margin: 20px auto;
  max-width: 420px;
  background: var(--card-bg, #fafbfc);
}
.zero-state-tutor-lg {
  max-width: 520px;
  padding: 48px 32px;
}
.zero-state-icon {
  font-size: 2.6rem;
  opacity: 0.45;
  margin-bottom: 12px;
}
.zero-state-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin: 0 0 8px;
}
.zero-state-helper {
  font-size: 0.84rem;
  color: var(--text-secondary, #6b7280);
  line-height: 1.55;
  margin: 0 0 18px;
  max-width: 380px;
}
.zero-state-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.zero-state-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border, #d1d5db);
  background: var(--card-bg, #fff);
  color: var(--text-primary, #374151);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.zero-state-cta:hover:not(:disabled) {
  border-color: #8b5cf6;
  color: #8b5cf6;
  background: #f5f3ff;
}
.zero-state-cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.zero-state-cta-primary {
  background: #8b5cf6;
  color: #fff;
  border-color: #8b5cf6;
  animation: zero-state-pulse 2s infinite;
}
.zero-state-cta-primary:hover:not(:disabled) {
  background: #7c3aed;
  color: #fff;
}
.zero-state-cta-secondary {
  background: transparent;
}

@keyframes zero-state-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0); }
}

/* ═══════════════════════════════════════════════
   Sprint 49: Welcome Wizard Modal
   ═══════════════════════════════════════════════ */

.welcome-modal {
  max-width: 480px;
  width: 90%;
  text-align: center;
  padding: 40px 32px;
}
.welcome-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}
.welcome-modal h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text-primary, #1f2937);
}
.welcome-body {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary, #4b5563);
  margin: 0 0 24px;
}
.welcome-token-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border: 1px solid #c4b5fd;
  border-radius: 20px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 1rem;
  color: #7c3aed;
  margin: 0 0 8px;
}
.welcome-subtext {
  font-size: 0.78rem;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 20px;
  opacity: 0.85;
}
.welcome-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 32px;
  border-radius: 10px;
  border: none;
  background: #8b5cf6;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.welcome-cta:hover {
  background: #7c3aed;
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  .zero-state-tutor {
    background: #1e1e2e;
    border-color: #45475a;
  }
  .zero-state-cta {
    background: #1e1e2e;
    border-color: #45475a;
    color: #cdd6f4;
  }
  .zero-state-cta:hover:not(:disabled) {
    background: #2a2a3d;
  }
  .zero-state-cta-primary {
    background: #8b5cf6;
    color: #fff;
    border-color: #8b5cf6;
  }
  .welcome-token-badge {
    background: rgba(139, 92, 246, 0.15);
    border-color: #7c3aed;
  }
}

/* ═══════════════════════════════════════════════
   TUTORIAL COACH (Sprint 51)
   ═══════════════════════════════════════════════ */
.tutorial-coach {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  max-width: 380px;
  width: calc(100% - 48px);
  animation: tutorialSlideIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.tutorial-coach.left {
  right: auto;
  left: 24px;
}
.tutorial-coach.bottom-right {
  right: 60px;
  bottom: 60px;
}

@keyframes tutorialSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tutorial-coach.tutorial-just-advanced .tutorial-coach-card {
  animation: tutorialPulse 0.5s ease;
}
@keyframes tutorialPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.tutorial-coach-card {
  background: var(--bg-primary, #1a1a2e);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(139, 92, 246, 0.15);
  overflow: hidden;
}

/* Progress bar */
.tutorial-progress-bar {
  height: 3px;
  background: rgba(139, 92, 246, 0.12);
  width: 100%;
}
.tutorial-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #10b981);
  border-radius: 0 2px 2px 0;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Header */
.tutorial-coach-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 0;
}
.tutorial-step-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(139, 92, 246, 0.8);
}
.tutorial-reward-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}
.tutorial-coach-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tutorial-skip-btn {
  background: none;
  border: none;
  color: var(--text-secondary, #888);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.tutorial-skip-btn:hover {
  color: var(--text-primary, #e0e0e0);
  background: rgba(255, 255, 255, 0.06);
}
.tutorial-dismiss-btn {
  background: none;
  border: none;
  color: var(--text-secondary, #666);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.tutorial-dismiss-btn:hover {
  color: var(--text-primary, #e0e0e0);
}

/* Content */
.tutorial-coach-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px 8px;
}
.tutorial-coach-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}
.tutorial-coach-text {
  flex: 1;
  min-width: 0;
}
.tutorial-coach-text h4 {
  margin: 0 0 4px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary, #e0e0e0);
}
.tutorial-coach-text p {
  margin: 0 0 4px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary, #aaa);
}
.tutorial-hint {
  font-size: 0.73rem !important;
  font-style: italic;
  opacity: 0.6;
  margin-top: 2px !important;
}

/* Phase label */
.tutorial-phase-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 7px;
  border-radius: 8px;
}

/* Grind progress counter */
.tutorial-grind-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.tutorial-grind-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.tutorial-grind-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #f59e0b);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.tutorial-grind-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f59e0b;
  min-width: 28px;
  text-align: right;
}

/* Future phase dot — dimmer for quests in later phases */
.tutorial-dot-future-phase {
  opacity: 0.3;
}

/* Step dots */
.tutorial-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px 4px;
}

/* Next step teaser — open loop psychology */
.tutorial-next-teaser {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-secondary, #9ca3af);
  padding: 0 14px 10px;
  opacity: 0.7;
  font-style: italic;
  letter-spacing: 0.2px;
}
.tutorial-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.15);
  transition: background 0.3s, transform 0.3s;
}
.tutorial-dot-done {
  background: #10b981;
}
.tutorial-dot-active {
  background: #8b5cf6;
  transform: scale(1.3);
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

/* Celebration flash — contextual message */
.tutorial-celebrate-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 20px;
  border-radius: 20px;
  animation: celebrateFlash 1.2s ease forwards;
  pointer-events: none;
  z-index: 10;
  text-align: center;
  max-width: 280px;
  line-height: 1.4;
}
@keyframes celebrateFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  60% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.95); }
}

/* Celebrating state — dim card behind flash */
.tutorial-celebrating .tutorial-coach-card {
  opacity: 0.5;
  transition: opacity 0.3s;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .tutorial-coach {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
    width: auto;
  }
  .tutorial-coach.left {
    left: 12px;
    right: 12px;
  }
  .tutorial-coach.bottom-right {
    right: 12px;
    bottom: 12px;
  }
}

/* ── Sprint 51.2: Spotlight effect for tutorial targets ── */
@keyframes tutorialSpotlightPulse {
  0%   { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.5); }
  50%  { box-shadow: 0 0 16px 6px rgba(76, 175, 80, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.5); }
}
.tutorial-spotlight {
  animation: tutorialSpotlightPulse 1.6s ease-in-out infinite;
  border-radius: 8px;
  position: relative;
  z-index: 2;
}
/* Tab buttons inside the view toggle get a subtler variant */
.journal-view-toggle .tutorial-spotlight {
  border-radius: 6px;
}
/* The small icon buttons (principles, etc.) */
button.tutorial-spotlight {
  border-radius: 50%;
}
/* this gets exported as style.css and can be used for the default theming */
/* these are the necessary styles for React/Svelte Flow, they get used by base.css and style.css */
.react-flow {
  direction: ltr;

  --xy-edge-stroke-default: #b1b1b7;
  --xy-edge-stroke-width-default: 1;
  --xy-edge-stroke-selected-default: #555;

  --xy-connectionline-stroke-default: #b1b1b7;
  --xy-connectionline-stroke-width-default: 1;

  --xy-attribution-background-color-default: rgba(255, 255, 255, 0.5);

  --xy-minimap-background-color-default: #fff;
  --xy-minimap-mask-background-color-default: rgba(240, 240, 240, 0.6);
  --xy-minimap-mask-stroke-color-default: transparent;
  --xy-minimap-mask-stroke-width-default: 1;
  --xy-minimap-node-background-color-default: #e2e2e2;
  --xy-minimap-node-stroke-color-default: transparent;
  --xy-minimap-node-stroke-width-default: 2;

  --xy-background-color-default: transparent;
  --xy-background-pattern-dots-color-default: #91919a;
  --xy-background-pattern-lines-color-default: #eee;
  --xy-background-pattern-cross-color-default: #e2e2e2;
  background-color: var(--xy-background-color, var(--xy-background-color-default));
  --xy-node-color-default: inherit;
  --xy-node-border-default: 1px solid #1a192b;
  --xy-node-background-color-default: #fff;
  --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);
  --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, 0.08);
  --xy-node-boxshadow-selected-default: 0 0 0 0.5px #1a192b;
  --xy-node-border-radius-default: 3px;

  --xy-handle-background-color-default: #1a192b;
  --xy-handle-border-color-default: #fff;

  --xy-selection-background-color-default: rgba(0, 89, 220, 0.08);
  --xy-selection-border-default: 1px dotted rgba(0, 89, 220, 0.8);

  --xy-controls-button-background-color-default: #fefefe;
  --xy-controls-button-background-color-hover-default: #f4f4f4;
  --xy-controls-button-color-default: inherit;
  --xy-controls-button-color-hover-default: inherit;
  --xy-controls-button-border-color-default: #eee;
  --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);

  --xy-edge-label-background-color-default: #ffffff;
  --xy-edge-label-color-default: inherit;
  --xy-resize-background-color-default: #3367d9;
}
.react-flow.dark {
  --xy-edge-stroke-default: #3e3e3e;
  --xy-edge-stroke-width-default: 1;
  --xy-edge-stroke-selected-default: #727272;

  --xy-connectionline-stroke-default: #b1b1b7;
  --xy-connectionline-stroke-width-default: 1;

  --xy-attribution-background-color-default: rgba(150, 150, 150, 0.25);

  --xy-minimap-background-color-default: #141414;
  --xy-minimap-mask-background-color-default: rgba(60, 60, 60, 0.6);
  --xy-minimap-mask-stroke-color-default: transparent;
  --xy-minimap-mask-stroke-width-default: 1;
  --xy-minimap-node-background-color-default: #2b2b2b;
  --xy-minimap-node-stroke-color-default: transparent;
  --xy-minimap-node-stroke-width-default: 2;

  --xy-background-color-default: #141414;
  --xy-background-pattern-dots-color-default: #777;
  --xy-background-pattern-lines-color-default: #777;
  --xy-background-pattern-cross-color-default: #777;
  --xy-node-color-default: #f8f8f8;
  --xy-node-border-default: 1px solid #3c3c3c;
  --xy-node-background-color-default: #1e1e1e;
  --xy-node-group-background-color-default: rgba(240, 240, 240, 0.25);
  --xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, 0.08);
  --xy-node-boxshadow-selected-default: 0 0 0 0.5px #999;

  --xy-handle-background-color-default: #bebebe;
  --xy-handle-border-color-default: #1e1e1e;

  --xy-selection-background-color-default: rgba(200, 200, 220, 0.08);
  --xy-selection-border-default: 1px dotted rgba(200, 200, 220, 0.8);

  --xy-controls-button-background-color-default: #2b2b2b;
  --xy-controls-button-background-color-hover-default: #3e3e3e;
  --xy-controls-button-color-default: #f8f8f8;
  --xy-controls-button-color-hover-default: #fff;
  --xy-controls-button-border-color-default: #5b5b5b;
  --xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, 0.08);

  --xy-edge-label-background-color-default: #141414;
  --xy-edge-label-color-default: #f8f8f8;
}
.react-flow__background {
  background-color: var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));
  pointer-events: none;
  z-index: -1;
}
.react-flow__container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}
.react-flow__pane {
  z-index: 1;
}
.react-flow__pane.draggable {
    cursor: grab;
  }
.react-flow__pane.dragging {
    cursor: grabbing;
  }
.react-flow__pane.selection {
    cursor: pointer;
  }
.react-flow__viewport {
  transform-origin: 0 0;
  z-index: 2;
  pointer-events: none;
}
.react-flow__renderer {
  z-index: 4;
}
.react-flow__selection {
  z-index: 6;
}
.react-flow__nodesselection-rect:focus,
.react-flow__nodesselection-rect:focus-visible {
  outline: none;
}
.react-flow__edge-path {
  stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default));
  stroke-width: var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));
  fill: none;
}
.react-flow__connection-path {
  stroke: var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));
  stroke-width: var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));
  fill: none;
}
.react-flow .react-flow__edges {
  position: absolute;
}
.react-flow .react-flow__edges svg {
    overflow: visible;
    position: absolute;
    pointer-events: none;
  }
.react-flow__edge {
  pointer-events: visibleStroke;
}
.react-flow__edge.selectable {
    cursor: pointer;
  }
.react-flow__edge.animated path {
    stroke-dasharray: 5;
    animation: dashdraw 0.5s linear infinite;
  }
.react-flow__edge.animated path.react-flow__edge-interaction {
    stroke-dasharray: none;
    animation: none;
  }
.react-flow__edge.inactive {
    pointer-events: none;
  }
.react-flow__edge.selected,
  .react-flow__edge:focus,
  .react-flow__edge:focus-visible {
    outline: none;
  }
.react-flow__edge.selected .react-flow__edge-path,
  .react-flow__edge.selectable:focus .react-flow__edge-path,
  .react-flow__edge.selectable:focus-visible .react-flow__edge-path {
    stroke: var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default));
  }
.react-flow__edge-textwrapper {
    pointer-events: all;
  }
.react-flow__edge .react-flow__edge-text {
    pointer-events: none;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
  }
/* Arrowhead marker styles - use CSS custom properties as default */
.react-flow__arrowhead polyline {
  stroke: var(--xy-edge-stroke, var(--xy-edge-stroke-default));
}
.react-flow__arrowhead polyline.arrowclosed {
  fill: var(--xy-edge-stroke, var(--xy-edge-stroke-default));
}
.react-flow__connection {
  pointer-events: none;
}
.react-flow__connection .animated {
    stroke-dasharray: 5;
    animation: dashdraw 0.5s linear infinite;
  }
svg.react-flow__connectionline {
  z-index: 1001;
  overflow: visible;
  position: absolute;
}
.react-flow__nodes {
  pointer-events: none;
  transform-origin: 0 0;
}
.react-flow__node {
  position: absolute;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  pointer-events: all;
  transform-origin: 0 0;
  box-sizing: border-box;
  cursor: default;
}
.react-flow__node.selectable {
    cursor: pointer;
  }
.react-flow__node.draggable {
    cursor: grab;
    pointer-events: all;
  }
.react-flow__node.draggable.dragging {
      cursor: grabbing;
    }
.react-flow__nodesselection {
  z-index: 3;
  transform-origin: left top;
  pointer-events: none;
}
.react-flow__nodesselection-rect {
    position: absolute;
    pointer-events: all;
    cursor: grab;
  }
.react-flow__handle {
  position: absolute;
  pointer-events: none;
  min-width: 5px;
  min-height: 5px;
  width: 6px;
  height: 6px;
  background-color: var(--xy-handle-background-color, var(--xy-handle-background-color-default));
  border: 1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));
  border-radius: 100%;
}
.react-flow__handle.connectingfrom {
    pointer-events: all;
  }
.react-flow__handle.connectionindicator {
    pointer-events: all;
    cursor: crosshair;
  }
.react-flow__handle-bottom {
    top: auto;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 50%);
  }
.react-flow__handle-top {
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
  }
.react-flow__handle-left {
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
  }
.react-flow__handle-right {
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
  }
.react-flow__edgeupdater {
  cursor: move;
  pointer-events: all;
}
.react-flow__pane.selection .react-flow__panel {
  pointer-events: none;
}
.react-flow__panel {
  position: absolute;
  z-index: 5;
  margin: 15px;
}
.react-flow__panel.top {
    top: 0;
  }
.react-flow__panel.bottom {
    bottom: 0;
  }
.react-flow__panel.top.center, .react-flow__panel.bottom.center {
      left: 50%;
      transform: translateX(-15px) translateX(-50%);
    }
.react-flow__panel.left {
    left: 0;
  }
.react-flow__panel.right {
    right: 0;
  }
.react-flow__panel.left.center, .react-flow__panel.right.center {
      top: 50%;
      transform: translateY(-15px) translateY(-50%);
    }
.react-flow__attribution {
  font-size: 10px;
  background: var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));
  padding: 2px 3px;
  margin: 0;
}
.react-flow__attribution a {
    text-decoration: none;
    color: #999;
  }
@keyframes dashdraw {
  from {
    stroke-dashoffset: 10;
  }
}
.react-flow__edgelabel-renderer {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  left: 0;
  top: 0;
}
.react-flow__viewport-portal {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}
.react-flow__minimap {
  background: var(
    --xy-minimap-background-color-props,
    var(--xy-minimap-background-color, var(--xy-minimap-background-color-default))
  );
}
.react-flow__minimap-svg {
    display: block;
  }
.react-flow__minimap-mask {
    fill: var(
      --xy-minimap-mask-background-color-props,
      var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default))
    );
    stroke: var(
      --xy-minimap-mask-stroke-color-props,
      var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default))
    );
    stroke-width: var(
      --xy-minimap-mask-stroke-width-props,
      var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default))
    );
  }
.react-flow__minimap-node {
    fill: var(
      --xy-minimap-node-background-color-props,
      var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default))
    );
    stroke: var(
      --xy-minimap-node-stroke-color-props,
      var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default))
    );
    stroke-width: var(
      --xy-minimap-node-stroke-width-props,
      var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default))
    );
  }
.react-flow__background-pattern.dots {
    fill: var(
      --xy-background-pattern-color-props,
      var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default))
    );
  }
.react-flow__background-pattern.lines {
    stroke: var(
      --xy-background-pattern-color-props,
      var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default))
    );
  }
.react-flow__background-pattern.cross {
    stroke: var(
      --xy-background-pattern-color-props,
      var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default))
    );
  }
.react-flow__controls {
  display: flex;
  flex-direction: column;
  box-shadow: var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default));
}
.react-flow__controls.horizontal {
    flex-direction: row;
  }
.react-flow__controls-button {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 26px;
    width: 26px;
    padding: 4px;
    border: none;
    background: var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));
    border-bottom: 1px solid
      var(
        --xy-controls-button-border-color-props,
        var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default))
      );
    color: var(
      --xy-controls-button-color-props,
      var(--xy-controls-button-color, var(--xy-controls-button-color-default))
    );
    cursor: pointer;
    -webkit-user-select: none;
       -moz-user-select: none;
            user-select: none;
  }
.react-flow__controls-button svg {
      width: 100%;
      max-width: 12px;
      max-height: 12px;
      fill: currentColor;
    }
.react-flow__edge.updating .react-flow__edge-path {
      stroke: #777;
    }
.react-flow__edge-text {
    font-size: 10px;
  }
.react-flow__node.selectable:focus,
  .react-flow__node.selectable:focus-visible {
    outline: none;
  }
.react-flow__node-input,
.react-flow__node-default,
.react-flow__node-output,
.react-flow__node-group {
  padding: 10px;
  border-radius: var(--xy-node-border-radius, var(--xy-node-border-radius-default));
  width: 150px;
  font-size: 12px;
  color: var(--xy-node-color, var(--xy-node-color-default));
  text-align: center;
  border: var(--xy-node-border, var(--xy-node-border-default));
  background-color: var(--xy-node-background-color, var(--xy-node-background-color-default));
}
.react-flow__node-input.selectable:hover, .react-flow__node-default.selectable:hover, .react-flow__node-output.selectable:hover, .react-flow__node-group.selectable:hover {
      box-shadow: var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default));
    }
.react-flow__node-input.selectable.selected,
    .react-flow__node-input.selectable:focus,
    .react-flow__node-input.selectable:focus-visible,
    .react-flow__node-default.selectable.selected,
    .react-flow__node-default.selectable:focus,
    .react-flow__node-default.selectable:focus-visible,
    .react-flow__node-output.selectable.selected,
    .react-flow__node-output.selectable:focus,
    .react-flow__node-output.selectable:focus-visible,
    .react-flow__node-group.selectable.selected,
    .react-flow__node-group.selectable:focus,
    .react-flow__node-group.selectable:focus-visible {
      box-shadow: var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default));
    }
.react-flow__node-group {
  background-color: var(--xy-node-group-background-color, var(--xy-node-group-background-color-default));
}
.react-flow__nodesselection-rect,
.react-flow__selection {
  background: var(--xy-selection-background-color, var(--xy-selection-background-color-default));
  border: var(--xy-selection-border, var(--xy-selection-border-default));
}
.react-flow__nodesselection-rect:focus,
  .react-flow__nodesselection-rect:focus-visible,
  .react-flow__selection:focus,
  .react-flow__selection:focus-visible {
    outline: none;
  }
.react-flow__controls-button:hover {
      background: var(
        --xy-controls-button-background-color-hover-props,
        var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default))
      );
      color: var(
        --xy-controls-button-color-hover-props,
        var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default))
      );
    }
.react-flow__controls-button:disabled {
      pointer-events: none;
    }
.react-flow__controls-button:disabled svg {
        fill-opacity: 0.4;
      }
.react-flow__controls-button:last-child {
    border-bottom: none;
  }
.react-flow__controls.horizontal .react-flow__controls-button {
    border-bottom: none;
    border-right: 1px solid
      var(
        --xy-controls-button-border-color-props,
        var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default))
      );
  }
.react-flow__controls.horizontal .react-flow__controls-button:last-child {
    border-right: none;
  }
.react-flow__resize-control {
  position: absolute;
}
.react-flow__resize-control.left,
.react-flow__resize-control.right {
  cursor: ew-resize;
}
.react-flow__resize-control.top,
.react-flow__resize-control.bottom {
  cursor: ns-resize;
}
.react-flow__resize-control.top.left,
.react-flow__resize-control.bottom.right {
  cursor: nwse-resize;
}
.react-flow__resize-control.bottom.left,
.react-flow__resize-control.top.right {
  cursor: nesw-resize;
}
/* handle styles */
.react-flow__resize-control.handle {
  width: 5px;
  height: 5px;
  border: 1px solid #fff;
  border-radius: 1px;
  background-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));
  translate: -50% -50%;
}
.react-flow__resize-control.handle.left {
  left: 0;
  top: 50%;
}
.react-flow__resize-control.handle.right {
  left: 100%;
  top: 50%;
}
.react-flow__resize-control.handle.top {
  left: 50%;
  top: 0;
}
.react-flow__resize-control.handle.bottom {
  left: 50%;
  top: 100%;
}
.react-flow__resize-control.handle.top.left {
  left: 0;
}
.react-flow__resize-control.handle.bottom.left {
  left: 0;
}
.react-flow__resize-control.handle.top.right {
  left: 100%;
}
.react-flow__resize-control.handle.bottom.right {
  left: 100%;
}
/* line styles */
.react-flow__resize-control.line {
  border-color: var(--xy-resize-background-color, var(--xy-resize-background-color-default));
  border-width: 0;
  border-style: solid;
}
.react-flow__resize-control.line.left,
.react-flow__resize-control.line.right {
  width: 1px;
  transform: translate(-50%, 0);
  top: 0;
  height: 100%;
}
.react-flow__resize-control.line.left {
  left: 0;
  border-left-width: 1px;
}
.react-flow__resize-control.line.right {
  left: 100%;
  border-right-width: 1px;
}
.react-flow__resize-control.line.top,
.react-flow__resize-control.line.bottom {
  height: 1px;
  transform: translate(0, -50%);
  left: 0;
  width: 100%;
}
.react-flow__resize-control.line.top {
  top: 0;
  border-top-width: 1px;
}
.react-flow__resize-control.line.bottom {
  border-bottom-width: 1px;
  top: 100%;
}
.react-flow__edge-textbg {
  fill: var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default));
}
.react-flow__edge-text {
  fill: var(--xy-edge-label-color, var(--xy-edge-label-color-default));
}
/**
 * EllieText.css — Tiptap editor styling to match existing textarea aesthetics
 */

/* ── Core wrapper: inherits the parent class's layout (flex, sizing) ── */
.ellie-text-wrapper {
  display: flex;
  flex-direction: column;
}

/* ── Tiptap's contenteditable div: match textarea defaults ── */
.ellie-text-wrapper .tiptap {
  flex: 1;
  outline: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-y: auto;
}

/* ── Placeholder text (matches ::placeholder styling) ── */
.ellie-text-wrapper .tiptap p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: var(--text-placeholder, #c0b8a8);
  font-style: italic;
  pointer-events: none;
  height: 0;
}

/* ── When used as wm-draft-textarea replacement ── */
.ellie-text-wrapper.wm-draft-textarea {
  flex: 1;
  min-height: 250px;
  width: 100%;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 10px;
  padding: 16px 18px;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary, #2c2416);
  resize: none;
  padding: 16px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.ellie-text-wrapper.wm-draft-textarea:focus-within {
  border-color: var(--border-accent, #8b7355);
  box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.ellie-text-wrapper.wm-draft-textarea .tiptap {
  font-family: inherit;
  font-size: var(--ellie-document-font-size, 14pt);
  line-height: 1.5;
  color: inherit;
}

/* ── Sprint 28C: Capture Mode editor — matches old .notebook-composer textarea ── */
.ellie-text-wrapper.capture-editor {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
}
.ellie-text-wrapper.capture-editor .tiptap {
  font-family: 'Times New Roman', Times, serif;
  font-size: 14pt;
  line-height: 1.5;
  color: var(--text-primary, #2c2416);
  padding-bottom: 6pt;
  min-height: 200px;
  outline: none;
}

/* ── Disabled state ── */
.ellie-text-wrapper.wm-draft-textarea[data-disabled="true"] {
  background: var(--bg-tertiary, #f7f3ee);
  color: var(--accent-primary, #8b7355);
  cursor: not-allowed;
}

/* ── Sprint 29: Manuscript Mode editor — matches old .ms-native-textarea ── */
.ellie-text-wrapper.ms-native-textarea {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  padding: 0;
  background: #fffdf8;
}
.ellie-text-wrapper.ms-native-textarea .tiptap {
  font-family: 'Times New Roman', Times, serif;
  font-size: var(--ellie-document-font-size, 14pt);
  line-height: 1.5;
  color: var(--text-primary, #2c2416);
  padding: 44px 56px;
  min-height: 400px;
  outline: none;
}

.ellie-text-wrapper.commercial-manuscript-textarea {
  width: 100%;
  min-height: 500px;
  background: transparent;
  color: #1e293b;
}

.ellie-text-wrapper.commercial-manuscript-textarea .tiptap {
  min-height: 500px;
  font-family: 'Times New Roman', Times, serif;
  font-size: var(--ellie-document-font-size, 14pt);
  line-height: 1.5;
  color: #1e293b;
  outline: none;
}

/* ── Tiptap resets: remove default paragraph margins ── */
.ellie-text-wrapper .tiptap p {
  margin: 0;
}

/* ── Sprint 51: Rich text formatting styles ── */
.ellie-text-wrapper .tiptap strong { font-weight: 700; }
.ellie-text-wrapper .tiptap em { font-style: italic; }
.ellie-text-wrapper .tiptap u { text-decoration: underline; }
.ellie-text-wrapper .tiptap s { text-decoration: line-through; }
.ellie-text-wrapper .tiptap h1 { font-size: 1.6em; font-weight: 700; margin: 0.4em 0 0.2em; }
.ellie-text-wrapper .tiptap h2 { font-size: 1.35em; font-weight: 700; margin: 0.35em 0 0.15em; }
.ellie-text-wrapper .tiptap h3 { font-size: 1.15em; font-weight: 600; margin: 0.3em 0 0.1em; }
.ellie-text-wrapper .tiptap blockquote {
  border-left: 3px solid var(--accent-primary, #8b7355);
  padding-left: 12px;
  margin: 0.3em 0;
  color: var(--text-secondary, #6b5d4f);
  font-style: italic;
}
.ellie-text-wrapper .tiptap ul,
.ellie-text-wrapper .tiptap ol {
  padding-left: 24px;
  margin: 0.2em 0;
}
.ellie-text-wrapper .tiptap li { margin: 0.1em 0; }
.ellie-text-wrapper .tiptap hr {
  border: none;
  border-top: 1px solid var(--border-primary, #e8e3db);
  margin: 0.5em 0;
}

/* V4.1 S04: final-document manuscript display defaults. */
.ellie-text-wrapper.ms-native-textarea .tiptap p,
.ellie-text-wrapper.wm-draft-textarea .tiptap p,
.ellie-text-wrapper.commercial-manuscript-textarea .tiptap p {
  margin: 0 0 6pt;
  line-height: 1.5;
  text-align: justify;
}

.ellie-text-wrapper.ms-native-textarea .tiptap h1,
.ellie-text-wrapper.ms-native-textarea .tiptap h2,
.ellie-text-wrapper.ms-native-textarea .tiptap h3,
.ellie-text-wrapper.wm-draft-textarea .tiptap h1,
.ellie-text-wrapper.wm-draft-textarea .tiptap h2,
.ellie-text-wrapper.wm-draft-textarea .tiptap h3,
.ellie-text-wrapper.commercial-manuscript-textarea .tiptap h1,
.ellie-text-wrapper.commercial-manuscript-textarea .tiptap h2,
.ellie-text-wrapper.commercial-manuscript-textarea .tiptap h3 {
  font-family: 'Times New Roman', Times, serif;
  line-height: 1.3;
  text-align: left;
  margin: 12pt 0 6pt;
}

.ellie-text-wrapper.ms-native-textarea .tiptap h1,
.ellie-text-wrapper.wm-draft-textarea .tiptap h1,
.ellie-text-wrapper.commercial-manuscript-textarea .tiptap h1 {
  font-size: 1.28em;
}

.ellie-text-wrapper.ms-native-textarea .tiptap h2,
.ellie-text-wrapper.wm-draft-textarea .tiptap h2,
.ellie-text-wrapper.commercial-manuscript-textarea .tiptap h2 {
  font-size: 1.14em;
}

.ellie-text-wrapper.ms-native-textarea .tiptap ul,
.ellie-text-wrapper.ms-native-textarea .tiptap ol,
.ellie-text-wrapper.wm-draft-textarea .tiptap ul,
.ellie-text-wrapper.wm-draft-textarea .tiptap ol,
.ellie-text-wrapper.commercial-manuscript-textarea .tiptap ul,
.ellie-text-wrapper.commercial-manuscript-textarea .tiptap ol {
  margin: 0 0 6pt 24pt;
  padding-left: 18pt;
  line-height: 1.5;
}

/* ── Sprint 26B: Citation Pill Styling ── */
.ellie-citation-pill {
  display: inline;
  background: linear-gradient(135deg, var(--citation-bg, #f0ecff), var(--citation-bg-end, #e8e0ff));
  color: var(--citation-text, #6d28d9);
  font-family: 'Georgia', serif;
  font-size: 0.92em;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid var(--citation-border, rgba(139, 92, 246, 0.2));
  white-space: nowrap;
  cursor: default;
  user-select: all;
  transition: background 0.15s, border-color 0.15s;
}
.ellie-citation-pill:hover {
  background: linear-gradient(135deg, var(--citation-bg-hover, #e8e0ff), var(--citation-bg-hover-end, #ddd4ff));
  border-color: var(--citation-border-hover, rgba(139, 92, 246, 0.35));
}

/* Sprint 43: Invalid/deleted citation fallback styling */
.ellie-citation-pill.citation-invalid {
  background: #fee2e2;
  color: #991b1b;
  border-color: rgba(220, 38, 38, 0.25);
  font-style: italic;
  cursor: help;
}
.meta-analysis-panel {
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  background: var(--ellie-surface-subtle, #f8fafc);
  color: var(--ellie-ink, #0f172a);
}

.meta-analysis-panel--compact {
  padding: 0;
  background: transparent;
  overflow-x: hidden;
}

.meta-analysis-header,
.meta-analysis-compact-header,
.meta-analysis-saved-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.meta-analysis-header h2,
.meta-analysis-compact-header h3 {
  margin: 0;
  color: var(--ellie-ink, #0f172a);
}

.meta-analysis-header h2 {
  font-size: clamp(1.45rem, 2vw, 1.75rem);
}

.meta-analysis-compact-header h3 {
  font-size: 1.05rem;
}

.meta-analysis-header p,
.meta-analysis-compact-header p,
.meta-analysis-muted {
  margin: 4px 0 0;
  color: var(--ellie-muted, #64748b);
  font-size: 0.82rem;
  line-height: 1.45;
}

.meta-analysis-actions,
.meta-analysis-compact-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meta-analysis-header--actions-only {
  justify-content: flex-start;
}

.meta-analysis-actions--left {
  justify-content: flex-start;
}

.meta-analysis-workspace-chip {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.35;
  padding: 7px 10px;
}

.meta-analysis-workspace-select {
  display: grid;
  gap: 4px;
  min-width: min(260px, 100%);
  color: #334155;
  font-size: 0.76rem;
  font-weight: 800;
}

.meta-analysis-workspace-select select,
.meta-analysis-workspace-create input,
.meta-analysis-workspace-manager input,
.meta-analysis-workspace-manager select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  padding: 8px 10px;
}

.meta-analysis-workspace-manager {
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
  margin-bottom: 14px;
  display: grid;
  gap: 10px;
}

.meta-analysis-workspace-manager-row {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-analysis-workspace-create {
  display: flex;
  gap: 8px;
  flex: 1 1 380px;
}

.meta-analysis-workspace-source-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.meta-analysis-source-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}

.meta-analysis-source-card div {
  min-width: 0;
}

.meta-analysis-source-card strong,
.meta-analysis-source-card span,
.meta-analysis-source-card em {
  display: block;
}

.meta-analysis-source-card strong {
  color: #0f172a;
  font-size: 0.82rem;
}

.meta-analysis-source-card span {
  color: #334155;
  font-size: 0.8rem;
  line-height: 1.35;
  margin-top: 3px;
}

.meta-analysis-source-card em {
  color: #64748b;
  font-size: 0.74rem;
  font-style: normal;
  margin-top: 4px;
}

.meta-analysis-text-btn {
  border: 0;
  background: transparent;
  color: #0f766e;
  cursor: pointer;
  font-weight: 800;
  padding: 2px 0;
}

.meta-analysis-card,
.meta-analysis-empty-card {
  background: var(--ellie-card, #ffffff);
  border: 1px solid var(--ellie-border, #e2e8f0);
  border-radius: 10px;
  padding: 14px;
  box-sizing: border-box;
}

.meta-analysis-empty-card {
  text-align: center;
  padding: 32px 24px;
}

.meta-analysis-empty-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ellie-ink, #0f172a);
  margin-bottom: 8px;
}

.meta-analysis-metric-grid,
.meta-analysis-triple-grid,
.meta-analysis-double-grid,
.meta-analysis-compact-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.meta-analysis-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.meta-analysis-double-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-analysis-double-grid--weighted {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
}

.meta-analysis-compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-analysis-metric-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--ellie-muted, #64748b);
  font-weight: 800;
}

.meta-analysis-metric-value {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  color: var(--ellie-ink, #0f172a);
  font-weight: 850;
  line-height: 1.2;
  margin-top: 6px;
}

.meta-analysis-metric-detail {
  color: var(--ellie-muted, #64748b);
  font-size: 0.75rem;
  margin-top: 4px;
  line-height: 1.35;
}

.meta-analysis-card-title,
.meta-analysis-section-title {
  font-weight: 850;
  color: var(--ellie-ink, #0f172a);
  margin-bottom: 8px;
}

.meta-analysis-section-gap {
  margin-bottom: 12px;
}

.meta-analysis-risk-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
  margin-bottom: 12px;
}

.meta-analysis-risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.meta-analysis-risk-row {
  font-size: 0.76rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-analysis-risk-row span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.meta-analysis-stat-list {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 0.82rem;
}

.meta-analysis-warning-card {
  border-color: #fde68a;
  background: #fffbeb;
}

.meta-analysis-warning-list {
  margin: 0;
  padding-left: 18px;
  color: #78350f;
  font-size: 0.82rem;
  display: grid;
  gap: 6px;
}

.meta-analysis-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  font-size: 0.82rem;
}

.meta-analysis-plot-card {
  min-height: 340px;
}

.meta-analysis-primary-btn,
.meta-analysis-secondary-btn,
.meta-analysis-dark-btn,
.meta-analysis-teal-btn {
  border-radius: 8px;
  padding: 8px 11px;
  font-weight: 750;
  font-size: 0.82rem;
  cursor: pointer;
}

.meta-analysis-primary-btn {
  border: 0;
  background: #0f766e;
  color: #ffffff;
}

.meta-analysis-secondary-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
}

.meta-analysis-dark-btn {
  border: 0;
  background: #334155;
  color: #ffffff;
}

.meta-analysis-teal-btn {
  border: 0;
  background: #0f766e;
  color: #ffffff;
}

.meta-analysis-primary-btn:disabled,
.meta-analysis-secondary-btn:disabled,
.meta-analysis-dark-btn:disabled,
.meta-analysis-teal-btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.meta-analysis-status,
.meta-analysis-error {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #64748b;
}

.meta-analysis-status[data-tone="warning"],
.meta-analysis-saved-header span[data-tone="warning"],
.meta-analysis-error {
  color: #b45309;
}

.meta-analysis-saved-header span {
  font-size: 0.75rem;
  color: #64748b;
}

.meta-analysis-run-list,
.meta-analysis-correction-list,
.meta-analysis-link-list {
  display: grid;
  gap: 8px;
  max-height: 270px;
  overflow-y: auto;
}

.meta-analysis-run-row,
.meta-analysis-correction-row,
.meta-analysis-link-row {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  font-size: 0.8rem;
}

.meta-analysis-run-row div,
.meta-analysis-correction-row strong,
.meta-analysis-link-row strong {
  font-weight: 850;
  color: #0f172a;
}

.meta-analysis-run-row span,
.meta-analysis-correction-row span,
.meta-analysis-link-row span {
  display: block;
  color: #64748b;
  margin-top: 4px;
}

.meta-analysis-table-card {
  padding: 0;
  overflow: hidden;
}

.meta-analysis-wide-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.meta-analysis-table-shell {
  min-width: 760px;
}

.meta-analysis-table-header,
.meta-analysis-table-row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) 88px 88px 88px 112px;
  gap: 8px;
  align-items: center;
}

.meta-analysis-table-header {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.75rem;
  font-weight: 850;
  color: #475569;
}

.meta-analysis-table-viewport {
  overflow-y: auto;
  position: relative;
}

.meta-analysis-table-row {
  position: absolute;
  left: 0;
  right: 0;
  padding: 0 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.75rem;
  color: #334155;
  background: #ffffff;
}

.meta-analysis-table-row:nth-child(odd) {
  background: #fbfdff;
}

.meta-analysis-table-row span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-analysis-skeleton {
  min-height: 140px;
  overflow: hidden;
}

.meta-analysis-skeleton-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #475569;
  margin-bottom: 14px;
}

.analysis-skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e2e8f0, #f8fafc, #e2e8f0);
  animation: ellie-analysis-pulse 1.35s ease-in-out infinite;
  margin-bottom: 10px;
}

.analysis-skeleton-block {
  width: 100%;
  height: 72px;
  margin-bottom: 12px;
}

@keyframes ellie-analysis-pulse {
  0% { opacity: .55; transform: translateX(-4px); }
  50% { opacity: 1; transform: translateX(4px); }
  100% { opacity: .55; transform: translateX(-4px); }
}

.meta-analysis-workspace-overlay {
  position: fixed;
  inset: 18px;
  z-index: 2400;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.meta-analysis-workspace-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.meta-analysis-workspace-bar h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.meta-analysis-workspace-bar p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: .82rem;
}

.meta-analysis-workspace-body {
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 980px) {
  .meta-analysis-metric-grid,
  .meta-analysis-triple-grid,
  .meta-analysis-double-grid,
  .meta-analysis-double-grid--weighted {
    grid-template-columns: 1fr;
  }

  .meta-analysis-panel {
    padding: 16px;
  }

  .meta-analysis-workspace-overlay {
    inset: 8px;
    border-radius: 12px;
  }
}

@media (max-width: 460px) {
  .meta-analysis-compact-grid {
    grid-template-columns: 1fr;
  }

  .meta-analysis-compact-header,
  .meta-analysis-header,
  .meta-analysis-workspace-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .meta-analysis-actions,
  .meta-analysis-compact-actions {
    justify-content: stretch;
  }

  .meta-analysis-workspace-manager-row,
  .meta-analysis-workspace-create,
  .meta-analysis-source-card {
    align-items: stretch;
    flex-direction: column;
  }

  .meta-analysis-actions button,
  .meta-analysis-compact-actions button,
  .meta-analysis-primary-btn,
  .meta-analysis-secondary-btn {
    width: 100%;
  }
}

/* S2 & S4: Project Membership and Paper Type UI */
.meta-analysis-workspace-projects {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.meta-analysis-project-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-analysis-project-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s;
}

.meta-analysis-project-chip:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.meta-analysis-project-chip.active {
  border-color: #0f766e;
  background: #f0fdfa;
  color: #0f766e;
}

.project-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.paper-type-options-list button {
  text-align: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}

/* NexusCard.css — Stage 6 step 41 shared card styles. */

:root {
  /* Neutral palette for the "suggestion" severity (new in Stage 6). */
  --nexus-neutral-bg: #f3f4f6;
  --nexus-neutral-border: #6b7280;
}

.nexus-card {
  --nexus-card-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--nexus-card-bg, #f9fafb);
  border: 1px solid var(--nexus-card-border, rgba(0, 0, 0, 0.08));
  border-left-width: 4px;
  border-radius: var(--nexus-card-radius);
  transition: transform 80ms ease, box-shadow 80ms ease, opacity 120ms ease;
}

.nexus-card[role="button"]:hover,
.nexus-card[role="button"]:focus-visible {
  outline: 2px solid var(--nexus-card-border, #4b6cb7);
  outline-offset: 1px;
}

.nexus-card--muted .nexus-card__title--muted {
  text-decoration: line-through;
  color: var(--text-muted, #6b7280);
}

.nexus-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.nexus-card__select {
  margin-top: 4px;
}

.nexus-card__title-block {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nexus-card__title {
  font-weight: 600;
  font-size: 0.95em;
  line-height: 1.3;
  color: var(--text-primary, #111827);
  word-break: break-word;
}

.nexus-card__subtitle {
  font-size: 0.8em;
  color: var(--text-secondary, #4b5563);
  word-break: break-word;
}

.nexus-card__chip-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nexus-card__chip {
  font-size: 0.7em;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary, #374151);
  white-space: nowrap;
}

.nexus-card__chip--source { background: #4b6cb7; color: #fff; }
.nexus-card__chip--ai { background: #4b6cb7; color: #fff; }
.nexus-card__chip--severity-blocking { background: var(--nexus-contradicted-border, #dc2626); color: #fff; }
.nexus-card__chip--severity-strong { background: var(--nexus-supported-border, #16a34a); color: #fff; }
.nexus-card__chip--severity-moderate { background: var(--nexus-unsupported-border, #d97706); color: #fff; }
.nexus-card__chip--severity-suggestion { background: var(--nexus-neutral-border, #6b7280); color: #fff; }

.nexus-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.nexus-card__body {
  font-size: 0.85em;
  color: var(--text-secondary, #4b5563);
  line-height: 1.45;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  padding-top: 6px;
}

/* `bare` mode skips the divider + padding so the card surface can host
   pre-existing card-body markup (e.g. ResearchReviewPanel's
   .nexus-card-claim / .nexus-card-evidence rows) without visible drift. */
.nexus-card__body--bare {
  border-top: 0;
  padding-top: 0;
  font-size: inherit;
  color: inherit;
  line-height: inherit;
}

/* Tone-specific accent shadows (kept subtle so the existing nexus palette
   stays the dominant signal). */
.nexus-card--tone-contradicted { box-shadow: 0 1px 0 rgba(220, 38, 38, 0.12); }
.nexus-card--tone-supported    { box-shadow: 0 1px 0 rgba(22, 163, 74, 0.12); }
.nexus-card--tone-unsupported  { box-shadow: 0 1px 0 rgba(217, 119, 6, 0.12); }
.nexus-card--tone-sabotage     { box-shadow: 0 1px 0 rgba(219, 39, 119, 0.12); }
.nexus-card--tone-supports     { box-shadow: 0 1px 0 rgba(37, 99, 235, 0.12); }
.nexus-card--tone-neutral      { box-shadow: 0 1px 0 rgba(107, 114, 128, 0.10); }
.resizable-panel-shell {
  --rps-left-width: 240px;
  --rps-left-resizer: 8px;
  --rps-right-width: 360px;
  --rps-right-resizer: 8px;
  --rps-center-min: 520px;
  display: grid;
  grid-template-columns:
    var(--rps-left-width)
    var(--rps-left-resizer)
    minmax(min(var(--rps-center-min), 100%), 1fr)
    var(--rps-right-resizer)
    var(--rps-right-width);
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.resizable-panel-shell.wm-body,
.resizable-panel-shell.ms-native-body {
  display: grid;
  grid-template-columns:
    var(--rps-left-width)
    var(--rps-left-resizer)
    minmax(min(var(--rps-center-min), 100%), 1fr)
    var(--rps-right-resizer)
    var(--rps-right-width);
}

.resizable-panel-shell .rps-panel {
  min-height: 0;
  min-width: 0;
}

.resizable-panel-shell .rps-panel-left {
  grid-column: 1;
}

.resizable-panel-shell .rps-resizer-left {
  grid-column: 2;
}

.resizable-panel-shell .rps-panel-center {
  grid-column: 3;
}

.resizable-panel-shell .rps-resizer-right {
  grid-column: 4;
}

.resizable-panel-shell .rps-panel-right {
  grid-column: 5;
}

.resizable-panel-shell .rps-panel-left,
.resizable-panel-shell .rps-panel-right {
  width: auto;
  max-width: none;
}

.resizable-panel-shell .rps-panel-center {
  display: flex;
  flex-direction: column;
  min-width: min(var(--rps-center-min), 100%);
  min-height: 0;
  overflow: hidden;
}

.resizable-panel-shell .rps-panel-center > .wm-panel-center,
.resizable-panel-shell .rps-panel-center > .ms-native-canvas {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.rps-resizer {
  appearance: none;
  border: 0;
  border-left: 1px solid rgba(139, 115, 85, 0.18);
  border-right: 1px solid rgba(139, 115, 85, 0.18);
  background:
    linear-gradient(90deg, transparent 0, rgba(139, 115, 85, 0.12) 45%, rgba(139, 115, 85, 0.26) 50%, rgba(139, 115, 85, 0.12) 55%, transparent 100%);
  cursor: col-resize;
  min-width: 8px;
  padding: 0;
  position: relative;
  z-index: 4;
}

.rps-resizer:hover,
.rps-resizer:focus-visible {
  background:
    linear-gradient(90deg, transparent 0, rgba(75, 108, 183, 0.18) 42%, rgba(75, 108, 183, 0.55) 50%, rgba(75, 108, 183, 0.18) 58%, transparent 100%);
  outline: none;
}

.rps-is-resizing,
.rps-is-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.rps-drawer-toggle,
.rps-drawer-backdrop {
  display: none;
}

.resizable-panel-shell.rps-desktop-mode.rps-left-closed .rps-drawer-toggle-left,
.resizable-panel-shell.rps-desktop-mode.rps-right-closed .rps-drawer-toggle-right {
  align-items: center;
  background: rgba(247, 243, 238, 0.96);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 999px;
  color: var(--text-muted, #6b5c4d);
  cursor: pointer;
  display: flex;
  font-size: 0.72rem;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  padding: 0 10px;
  position: absolute;
  top: 10px;
  z-index: 20;
}

.resizable-panel-shell.rps-desktop-mode.rps-left-closed .rps-drawer-toggle-left {
  left: 10px;
}

.resizable-panel-shell.rps-desktop-mode.rps-right-closed .rps-drawer-toggle-right {
  right: 10px;
}

.resizable-panel-shell.rps-drawer-mode {
  display: block;
}

.resizable-panel-shell.rps-drawer-mode .rps-panel-center {
  height: 100%;
  min-width: 0;
}

.resizable-panel-shell.rps-drawer-mode .rps-drawer-toggle {
  align-items: center;
  background: var(--bg-tertiary, #f7f3ee);
  border: 1px solid var(--border-primary, #e8e3db);
  color: var(--text-muted, #6b5c4d);
  cursor: pointer;
  display: flex;
  font-size: 0.78rem;
  font-weight: 700;
  height: 64px;
  justify-content: center;
  letter-spacing: 0.02em;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  z-index: 130;
  writing-mode: vertical-rl;
}

.resizable-panel-shell.rps-drawer-mode .rps-drawer-toggle-left {
  border-left: 0;
  border-radius: 0 10px 10px 0;
  left: 0;
}

.resizable-panel-shell.rps-drawer-mode .rps-drawer-toggle-right {
  border-radius: 10px 0 0 10px;
  border-right: 0;
  right: 0;
}

.resizable-panel-shell.rps-drawer-mode .rps-drawer-backdrop {
  appearance: none;
  background: rgba(20, 16, 12, 0.26);
  border: 0;
  display: block;
  inset: 0;
  padding: 0;
  position: fixed;
  z-index: 120;
}

.resizable-panel-shell.rps-drawer-mode .rps-panel-left,
.resizable-panel-shell.rps-drawer-mode .rps-panel-right {
  bottom: 0;
  display: flex;
  max-height: none;
  position: fixed;
  top: 0;
  transition: transform 0.22s ease;
  width: min(84vw, 360px);
  z-index: 135;
}

.resizable-panel-shell.rps-drawer-mode .rps-panel-left {
  left: 0;
  transform: translateX(0);
}

.resizable-panel-shell.rps-drawer-mode .rps-panel-right {
  right: 0;
  transform: translateX(0);
}

@media (max-width: 700px) {
  .resizable-panel-shell .rps-panel-center {
    min-width: 0;
  }

  .resizable-panel-shell.rps-drawer-mode .rps-panel-left,
  .resizable-panel-shell.rps-drawer-mode .rps-panel-right {
    width: min(92vw, 360px);
  }
}
/**
 * ReviewerCard.css — Sprint 25C: Peer Review Card Styles
 * "No Red Ink" palette — academic colours only.
 */

/* ── Card Base ── */
.rc-card {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-left: 4px solid transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.35s ease-in-out;
  position: relative;
}

.rc-card--resolving {
  opacity: 0;
  transform: translateX(16px);
  background-color: #dcfce7 !important;
  border-left-color: #16a34a !important;
}

.rc-card--resolved {
  opacity: 0.6;
}

/* ── Card Header ── */
.rc-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.rc-card-type {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

.rc-card-block {
  font-size: 0.7rem;
  opacity: 0.5;
  font-style: italic;
}

/* ── Card Body ── */
.rc-card-body {
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 10px;
}

/* ── Card Actions ── */
.rc-card-actions {
  display: flex;
  gap: 8px;
}

.rc-resolve-btn {
  flex: 1;
  padding: 6px 10px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: background-color 0.2s;
}

.rc-resolve-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.95);
}

.rc-resolve-btn:disabled {
  cursor: default;
  color: #16a34a !important;
  font-weight: 700;
}

.rc-dismiss-btn {
  padding: 6px 10px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  opacity: 0.4;
  cursor: pointer;
  font-size: 0.75rem;
  transition: opacity 0.2s;
}

.rc-dismiss-btn:hover {
  opacity: 0.8;
}

/* ── Reviewer Drawer (slide-out panel in ManuscriptMode) ── */
.reviewer-drawer {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary, #f9faf8);
  border-left: 1px solid var(--border-primary, #e8e3db);
  width: 320px;
  min-width: 280px;
  max-width: 380px;
  overflow-y: auto;
  transition: width 0.3s ease;
}

.reviewer-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 1;
}

.reviewer-drawer-header h4 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.reviewer-drawer-count {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-left: 6px;
}

.reviewer-drawer-body {
  padding: 12px;
  flex: 1;
}

/* ── Empty State (Celebration) ── */
.reviewer-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-faint, #b0a090);
}

.reviewer-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.reviewer-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #2c2416);
  margin-bottom: 6px;
}

.reviewer-empty-text {
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 240px;
}
/**
 * LiteratureGraph.css — Sprint 31: Live Literature Graph Styling
 */

/* ── Overlay container ── */
.lit-graph-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg-primary, #faf8f4);
  display: flex;
  flex-direction: column;
  color: var(--text-primary, #2c2416);
}

/* ── Top bar ── */
.lit-graph-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  background: var(--bg-card, #fff);
  z-index: 1;
}
.lit-graph-topbar h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #2c2416);
}
.lit-graph-topbar p {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--text-secondary, #78716c);
}
.lit-graph-close-btn {
  background: none;
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-secondary, #78716c);
  transition: background 0.15s;
}
.lit-graph-close-btn:hover {
  background: var(--bg-tertiary, #f7f3ee);
}
.lit-graph-search {
  flex: 1;
  max-width: 360px;
  padding: 6px 12px;
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--bg-primary, #faf8f4);
  color: var(--text-primary, #2c2416);
}
.lit-graph-search::placeholder {
  color: var(--text-placeholder, #c0b8a8);
}
.lit-graph-stats {
  font-size: 0.75rem;
  color: var(--text-secondary, #78716c);
  margin-left: auto;
  white-space: nowrap;
}

.lit-graph-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(520px, 1fr) minmax(280px, 340px);
  background:
    radial-gradient(circle at 12% 16%, rgba(139, 115, 85, 0.08), transparent 28%),
    linear-gradient(135deg, #faf8f4 0%, #f5f0e8 100%);
}

.lit-graph-left-panel,
.lit-graph-right-panel {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  border-right: 1px solid var(--border-primary, #e8e3db);
}

.lit-graph-right-panel {
  border-right: 0;
  border-left: 1px solid var(--border-primary, #e8e3db);
}

.lit-graph-canvas-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ── Graph canvas ── */
.lit-graph-canvas {
  flex: 1;
  min-height: 0;
  background: rgba(255, 253, 248, 0.72);
}

.lit-graph-panel-card,
.lit-graph-detail-card {
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(44, 36, 22, 0.06);
  margin-bottom: 12px;
}

.lit-graph-section-title {
  font-size: 0.72rem;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-secondary, #6b5b47);
  margin-bottom: 10px;
}

.lit-graph-section-title.small {
  margin-top: 12px;
  margin-bottom: 8px;
}

.lit-graph-view-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.lit-graph-view-btn,
.lit-graph-primary-btn,
.lit-graph-secondary-btn,
.lit-graph-chip {
  font-family: inherit;
  cursor: pointer;
}

.lit-graph-view-btn {
  text-align: left;
  border: 1px solid var(--border-primary, #e8e3db);
  background: var(--bg-card, #fff);
  color: var(--text-primary, #2c2416);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.lit-graph-view-btn.active {
  background: #2c2416;
  color: #fffdf8;
  border-color: #2c2416;
}

.lit-graph-control-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.lit-graph-control-row.wrap {
  flex-wrap: wrap;
}

.lit-graph-board-name,
.lit-graph-select {
  width: 100%;
  border: 1px solid var(--border-primary, #e8e3db);
  background: #fffdf8;
  color: var(--text-primary, #2c2416);
  border-radius: 8px;
  padding: 7px 9px;
  font-family: inherit;
  font-size: 0.82rem;
}

.lit-graph-select.full {
  width: 100%;
}

.lit-graph-primary-btn,
.lit-graph-secondary-btn {
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 8px;
  padding: 7px 10px;
  font-weight: 800;
  font-size: 0.8rem;
}

.lit-graph-primary-btn {
  color: #fffdf8;
  background: #4a3a2e;
  border-color: #4a3a2e;
}

.lit-graph-primary-btn.full {
  width: 100%;
  margin-top: 10px;
}

.lit-graph-secondary-btn {
  color: var(--text-primary, #2c2416);
  background: #f5f2ed;
}

.lit-graph-secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.lit-graph-field-label {
  display: block;
  margin: 10px 0 5px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-secondary, #6b5b47);
}

.lit-graph-save-status {
  margin-top: 8px;
  color: #2f7d52;
  font-size: 0.76rem;
}

.lit-graph-filter-group {
  margin-top: 12px;
}

.lit-graph-filter-group > span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-secondary, #6b5b47);
  margin-bottom: 6px;
}

.lit-graph-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.lit-graph-chip {
  border: 1px solid #e8e2d9;
  background: #f5f2ed;
  color: #4a3a2e;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  line-height: 1.2;
}

.lit-graph-chip.active {
  background: #2f281f;
  color: #fffdf8;
  border-color: #2f281f;
}

.lit-graph-chip.readonly {
  cursor: default;
  background: #f1e9dd;
}

.lit-graph-notice {
  margin: 10px 12px 0;
  padding: 8px 12px;
  border-radius: 999px;
  color: #6b5b47;
  background: #fbf3df;
  border: 1px solid #ead7ad;
  font-size: 0.78rem;
  line-height: 1.25;
}

.lit-graph-notice.empty {
  border-radius: 12px;
  background: #fffdf8;
}

.lit-graph-summary-grid,
.lit-graph-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  font-size: 0.78rem;
}

.lit-graph-summary-grid span,
.lit-graph-detail-grid span {
  color: var(--text-secondary, #78716c);
}

.lit-graph-details-empty {
  background: rgba(255, 253, 248, 0.86);
  border: 1px dashed #d8cfc0;
  border-radius: 14px;
  padding: 16px;
  color: var(--text-secondary, #6b5b47);
  font-size: 0.9rem;
  line-height: 1.4;
}

.lit-graph-detail-kicker {
  font-size: 0.68rem;
  font-weight: 900;
  color: var(--text-muted, #8a7a6a);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lit-graph-detail-card h4 {
  margin: 4px 0 4px;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--text-primary, #2c2416);
}

.lit-graph-detail-card p {
  color: var(--text-secondary, #4a3a2e);
  font-size: 0.82rem;
  line-height: 1.42;
}

.lit-graph-detail-meta,
.lit-graph-detail-note {
  color: var(--text-muted, #8a7a6a) !important;
}

.lit-graph-detail-section {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  font-size: 0.8rem;
}

.lit-graph-detail-section strong {
  color: var(--text-primary, #2c2416);
}

.lit-graph-detail-section > span {
  color: var(--text-secondary, #4a3a2e);
}

.lit-graph-fallback {
  max-width: 560px;
  margin: 12vh auto;
  background: #fffdf8;
  border: 1px solid #e8e2d9;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(44, 36, 22, 0.12);
  text-align: center;
}

.lit-graph-fallback h3 {
  margin-top: 0;
  color: #2c2416;
}

.lit-graph-fallback p {
  color: #4a3a2e;
  line-height: 1.5;
}

/* ── Custom lit node ── */
.lit-graph-node {
  background: #fff;
  border: 2px solid var(--border-primary, #e8e3db);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 200px;
  max-width: 260px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lit-graph-node:hover {
  border-color: var(--accent-primary, #8b7355);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.lit-graph-node.highlighted {
  border-color: #6d28d9;
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}
.lit-graph-node.dimmed {
  opacity: 0.3;
}

.lit-node-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary, #2c2416);
  line-height: 1.3;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.lit-node-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.lit-node-author {
  font-size: 0.7rem;
  color: var(--text-secondary, #78716c);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.lit-node-year {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--accent-primary, #8b7355);
  color: #fff;
  white-space: nowrap;
}
.lit-node-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.lit-node-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 5px;
}
.lit-node-badge {
  font-size: 0.58rem;
  line-height: 1.1;
  padding: 2px 5px;
  border-radius: 999px;
  background: #f1e9dd;
  color: #6b5b47;
  text-transform: capitalize;
}
.lit-node-badge.pinned {
  background: #dcfce7;
  color: #166534;
}
.lit-node-keyword {
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f0ecff, #e8e0ff);
  color: #6d28d9;
  white-space: nowrap;
}

/* ── React Flow overrides ── */
.lit-graph-canvas .react-flow__minimap {
  border-radius: 8px;
  border: 1px solid var(--border-primary, #e8e3db);
}
.lit-graph-canvas .react-flow__controls {
  border-radius: 8px;
  border: 1px solid var(--border-primary, #e8e3db);
}

@media (max-width: 1100px) {
  .lit-graph-body {
    grid-template-columns: minmax(220px, 280px) minmax(420px, 1fr);
  }
  .lit-graph-right-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  .lit-graph-topbar {
    flex-wrap: wrap;
  }
  .lit-graph-search {
    max-width: none;
    flex-basis: 100%;
  }
  .lit-graph-body {
    grid-template-columns: 1fr;
  }
  .lit-graph-left-panel {
    max-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--border-primary, #e8e3db);
  }
}
.block-schema-editor {
  background: #fdfdfd;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.schema-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #f0f4f8;
  cursor: pointer;
  user-select: none;
}

.schema-header h4 {
  margin: 0;
  font-size: 14px;
  color: #333;
}

.toggle-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: #666;
  cursor: pointer;
}

.schema-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schema-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.schema-field label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
}

.schema-field input,
.schema-field select,
.schema-field textarea {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
}

.schema-field textarea {
  resize: vertical;
  min-height: 60px;
}

.logic-bridge-helper {
  background: #f9f9f9;
  border: 1px dashed #ddd;
  padding: 10px;
  border-radius: 4px;
}

.helper-text {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: #666;
}

.linked-blocks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.linked-block-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}
/* TasksTab.css — Stage 6 step 43 styles for the severity-grouped Tasks tab. */

.tasks-tab {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tasks-tab__compose {
  display: flex;
  gap: 8px;
}

.tasks-tab__filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tasks-tab__filter-chip {
  font-size: 0.78em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-popover, #f3f4f6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-secondary, #4b5563);
  cursor: pointer;
  transition: background 80ms ease, color 80ms ease, border-color 80ms ease;
}

.tasks-tab__filter-chip.is-on {
  background: #1f2937;
  color: #fff;
  border-color: #1f2937;
}

.tasks-tab__bulk-resolve {
  margin-left: auto;
}

.tasks-tab__groups {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tasks-tab__group {
  list-style: none;
}

.tasks-tab__group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.tasks-tab__group-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  font-weight: 600;
  font-size: 0.92em;
  color: var(--text-primary, #1f2937);
  cursor: pointer;
}

.tasks-tab__group-trigger[data-state="closed"] .tasks-tab__group-count {
  opacity: 0.6;
}

.tasks-tab__group-count {
  font-weight: 400;
  font-size: 0.85em;
  color: var(--text-secondary, #6b7280);
}

.tasks-tab__rows {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tasks-tab__row {
  list-style: none;
}

.tasks-tab__row--focused .nexus-card {
  box-shadow: 0 0 0 2px var(--nexus-card-border, #4b6cb7);
}

.tasks-tab__preview-trigger {
  background: transparent;
  border: 0;
  color: var(--text-link, #2563eb);
  font-size: 0.8em;
  padding: 0;
  cursor: pointer;
}

.tasks-tab__preview-body {
  margin-top: 6px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--text-secondary, #4b5563);
}
/**
 * EllieText.css — Onyx Editorial TipTap Editor Styling
 * Replaces legacy textarea styling with the strict .tt-canvas ruleset.
 */

.ellie-text-wrapper {
  display: flex;
  flex-direction: column;
}

.ellie-text-wrapper .tiptap {
  flex: 1;
  outline: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-y: auto;
  font-family: var(--ellie-font-ui);
  max-width: 65ch;
  width: 100%;
  margin: 0 auto;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ellie-color-onyx);
}

.ellie-text-wrapper .tiptap p {
  margin: 0 0 10px;
}

.ellie-text-wrapper .tiptap p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: var(--c-fg-subtle);
  font-style: italic;
  pointer-events: none;
  height: 0;
}

/* ── Rich text formatting styles ── */
.ellie-text-wrapper .tiptap strong { font-weight: 700; }
.ellie-text-wrapper .tiptap em { font-style: italic; }
.ellie-text-wrapper .tiptap u { text-decoration: underline; }
.ellie-text-wrapper .tiptap s { text-decoration: line-through; }
.ellie-text-wrapper .tiptap h1 { font-family: var(--ellie-font-brand); font-size: 1.6em; font-weight: 800; margin: 0.4em 0 0.2em; color: var(--ellie-color-onyx); }
.ellie-text-wrapper .tiptap h2 { font-family: var(--ellie-font-brand); font-size: 1.35em; font-weight: 800; margin: 0.35em 0 0.15em; color: var(--ellie-color-onyx); }
.ellie-text-wrapper .tiptap h3 { font-size: 1.15em; font-weight: 700; margin: 0.3em 0 0.1em; }
.ellie-text-wrapper .tiptap blockquote {
  border-left: 2px solid var(--ellie-color-onyx);
  padding-left: 12px;
  margin: 0.3em 0;
  color: var(--c-fg-muted);
  font-style: italic;
}
.ellie-text-wrapper .tiptap ul,
.ellie-text-wrapper .tiptap ol {
  padding-left: 24px;
  margin: 0.2em 0;
}
.ellie-text-wrapper .tiptap li { margin: 0.1em 0; }
.ellie-text-wrapper .tiptap hr {
  border: none;
  border-top: 1px solid var(--ellie-border-color);
  margin: 0.5em 0;
}

/* ── NewUI / Onyx Editorial Marks ── */
ul[data-type="taskList"] {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}
li[data-type="taskItem"] {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 4px;
}
li[data-type="taskItem"] > label {
  width: 18px;
  height: 18px;
  border: 1px solid var(--ellie-color-onyx);
  background: var(--c-surface);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  margin-top: 4px;
}
li[data-type="taskItem"] > label input[type="checkbox"] {
  display: none;
}
li[data-type="taskItem"][data-checked="true"] > label {
  background: var(--ellie-color-onyx);
}
li[data-type="taskItem"][data-checked="true"] > label::after {
  content: "✓";
  color: var(--ellie-color-cool-blue);
  font-family: var(--ellie-font-ui);
  font-size: 12px;
  font-weight: 800;
}
li[data-type="taskItem"][data-checked="true"] > div {
  text-decoration: line-through;
  color: var(--c-fg-muted);
}

.tt-tag {
  color: var(--ellie-color-punch-red);
  font-weight: 700;
  cursor: pointer;
  font-family: var(--ellie-font-ui);
  font-size: 0.92em;
}

.tt-wikilink {
  color: var(--c-fg);
  background: var(--ellie-color-cool-blue);
  padding: 0 4px;
  border: 1px solid var(--ellie-color-onyx);
  cursor: pointer;
  font-family: var(--ellie-font-ui);
  font-size: 0.88em;
  font-weight: 600;
}

.tt-wikilink.citation-invalid {
  background: transparent;
  color: var(--ellie-color-punch-red);
  border: 1px solid var(--ellie-color-punch-red);
  font-style: italic;
  cursor: help;
}
/* Workspace UI Kit — local styles only. Foundation tokens come from
   /colors_and_type.css. This file encodes the journal app's UX patterns —
   composer-first notebook, tag cloud, entry tray, BUJO — under the new spec's
   visual rules (1 px Onyx borders, hard corners, no shadows). */

* { box-sizing: border-box; }
html, body, #root { margin: 0; min-height: 100vh; background: var(--c-canvas); color: var(--c-fg); font-family: var(--ellie-font-ui); }

/* ─── Shell — 240 sidebar | 1fr main | optional 320 right ─────────────── */
.aa-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.aa-shell[data-with-right] { grid-template-columns: 240px minmax(0, 1fr) 320px; }

/* ─── Left rail ──────────────────────────────────────────────────────── */
.aa-rail {
  background: var(--ellie-color-soft-linen);
  border-right: 1px solid var(--ellie-color-onyx);
  padding: 32px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
}
.aa-brand { display: flex; gap: 16px; align-items: center; padding-bottom: 24px; border-bottom: 1px solid var(--ellie-color-onyx); }
.aa-brand img { width: 32px; }
.aa-brand strong { display: block; font-family: var(--ellie-font-brand); font-weight: 800; font-size: 22px; letter-spacing: 0.08em; color: var(--c-fg); line-height: 1; }
.aa-brand small { display: block; margin-top: 4px; font-family: var(--ellie-font-ui); font-size: 9px; letter-spacing: 0.24em; color: var(--c-fg-muted); font-weight: 800; }

.aa-newbtn {
  background: var(--ellie-color-punch-red); color: white;
  padding: 12px 16px; border: 1px solid var(--ellie-color-onyx);
  font: inherit; font-family: var(--ellie-font-ui); font-size: 13px; font-weight: 800;
  letter-spacing: 0.01em; border-radius: var(--ellie-radius-md);
  cursor: pointer; display: flex; gap: 8px; align-items: center; justify-content: center;
  white-space: nowrap;
  transition: background 150ms ease;
  min-height: 44px;
}
.aa-newbtn:hover { background: #d22f3c; }
.aa-newbtn:focus-visible { outline: 2px solid var(--ellie-color-onyx); outline-offset: 2px; }
.aa-newbtn i { font-size: 16px; }

.aa-nav { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.aa-nav button {
  display: flex; gap: 16px; align-items: center;
  padding: 12px 16px;
  border: 1px solid transparent; border-radius: var(--ellie-radius-md);
  background: transparent;
  font: inherit; font-family: var(--ellie-font-ui); font-size: 14px; font-weight: 600;
  color: var(--c-fg);
  cursor: pointer; text-align: left;
  transition: background 150ms ease, border-color 150ms ease;
  min-height: 44px;
}
.aa-nav button:hover { background: rgba(10, 10, 10, 0.04); }
.aa-nav button.is-active {
  background: var(--ellie-color-cool-blue);
  border-color: var(--ellie-color-onyx);
  font-weight: 700;
}
.aa-nav button:focus-visible { outline: 2px solid var(--ellie-color-onyx); outline-offset: -1px; }
.aa-nav .ic { width: 18px; display: inline-grid; place-items: center; }
.aa-nav .ic i { font-size: 18px; line-height: 1; }
.aa-nav .ic .ph-fill { color: var(--c-fg); }

.aa-rail-section { font-family: var(--ellie-font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--c-fg-muted); padding: 8px 12px 4px; }

.aa-rail-foot {
  margin-top: auto;
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 0 0; border-top: var(--ellie-border);
}
.aa-rail-foot button {
  display: flex; gap: 16px; align-items: center;
  padding: 12px 16px;
  background: transparent; border: 0;
  font: inherit; font-family: var(--ellie-font-ui); font-size: 13px; font-weight: 600;
  color: var(--c-fg-muted);
  cursor: pointer; text-align: left;
  min-height: 44px;
}
.aa-rail-foot button:hover { color: var(--c-fg); background: rgba(10,10,10,0.04); }
.aa-rail-foot i { font-size: 16px; }

/* Credit pill in rail */
.aa-rail-credit {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px;
  background: var(--ellie-color-onyx); color: white;
  border: 1px solid var(--ellie-color-onyx);
  border-radius: var(--ellie-radius-md);
}
.aa-rail-credit img { width: 22px; height: 22px; }
.aa-rail-credit .n { font-family: var(--ellie-font-mono); font-weight: 700; font-size: 14px; }
.aa-rail-credit .l { font-family: var(--ellie-font-ui); font-size: 10px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; color: rgba(255,255,255,0.65); }

/* ─── Main column ──────────────────────────────────────────────────── */
.aa-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

/* ─── Top bar ─────────────────────────────────────────────────────── */
.aa-top {
  position: sticky; top: 0; z-index: 10;
  background: var(--c-canvas);
  border-bottom: var(--ellie-border);
  padding: 16px 32px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px;
  align-items: center;
}
.aa-search { display: flex; align-items: center; gap: 16px; padding: 12px 16px; background: var(--ellie-color-paper); border: var(--ellie-border); max-width: 640px; min-height: 44px; border-radius: var(--ellie-radius-md); }
.aa-search input { border: 0; background: transparent; flex: 1; font: inherit; font-family: var(--ellie-font-ui); font-size: 14px; outline: none; color: var(--c-fg); }
.aa-search .ic { color: var(--c-fg-muted); display: inline-flex; }
.aa-search .ic i { font-size: 16px; }
.aa-search .kbd { font-family: var(--ellie-font-mono); font-size: 10px; padding: 2px 8px; border: 1px solid var(--c-border); color: var(--c-fg-muted); font-weight: 700; border-radius: var(--ellie-radius-xs); }

.aa-top-right { display: flex; gap: 16px; align-items: center; font-size: 13px; color: var(--c-fg-muted); }
.aa-context-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px;
  border: 1px solid var(--ellie-color-onyx);
  font-family: var(--ellie-font-ui); font-size: 13px; font-weight: 700;
  color: var(--c-fg);
  background: var(--c-surface);
  cursor: pointer;
  min-height: 44px;
  border-radius: var(--ellie-radius-md);
}
.aa-context-pill:hover { background: var(--ellie-color-cool-blue); }
.aa-context-pill.primary { background: var(--ellie-color-punch-red); color: white; border-color: var(--ellie-color-onyx); }
.aa-context-pill i { font-size: 14px; }
.aa-icon-btn { width: 44px; height: 44px; background: transparent; border: 1px solid transparent; display: grid; place-items: center; color: var(--c-fg-muted); cursor: pointer; position: relative; border-radius: var(--ellie-radius-md); }
.aa-icon-btn:hover { background: rgba(10,10,10,0.04); }
.aa-icon-btn i { font-size: 18px; }
.aa-icon-btn .dot { position: absolute; top: 12px; right: 12px; width: 6px; height: 6px; background: var(--ellie-color-punch-red); border-radius: var(--ellie-radius-pill); }
.aa-avatar { width: 44px; height: 44px; background: var(--ellie-color-onyx); color: white; display: grid; place-items: center; font-family: var(--ellie-font-mono); font-size: 11px; font-weight: 800; letter-spacing: 0.10em; border-radius: var(--ellie-radius-md); border: 1px solid var(--ellie-color-onyx); cursor: pointer; }

/* ─── Page header ──────────────────────────────────────────────────── */
.aa-pageheader { padding: 48px 32px 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.aa-pageheader h1 { font-family: var(--ellie-font-ui); font-weight: 700; font-size: 40px; letter-spacing: -0.015em; color: var(--c-fg); margin: 0; line-height: 1.1; }
.aa-pageheader p { margin: 12px 0 0; color: var(--c-fg-muted); font-size: 16px; max-width: 720px; line-height: 1.55; }

.aa-page { padding: 32px; }
.aa-page-tight { padding: 0 32px 32px; }

/* ─── Buttons & Inputs ────────────────────────────────────────────── */
.aa-btn {
  font-family: var(--ellie-font-ui);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 10px 18px;
  border-radius: var(--ellie-radius-md);
  border: 1px solid var(--ellie-color-onyx);
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  background: white;
  color: var(--c-fg);
  min-height: 44px;
  transition: background 150ms ease, border-color 150ms ease;
}
.aa-btn i { font-size: 16px; line-height: 1; }
.aa-btn.primary { background: var(--ellie-color-punch-red); color: white; border-color: var(--ellie-color-onyx); }
.aa-btn.primary:hover { background: #d22f3c; }
.aa-btn.danger { background: white; color: var(--ellie-color-punch-red); border-color: var(--ellie-color-punch-red); }
.aa-btn.tonal { background: var(--ellie-color-cool-blue); border-color: var(--ellie-color-onyx); }
.aa-btn.dark { background: var(--ellie-color-onyx); color: white; border-color: var(--ellie-color-onyx); }
.aa-btn.icon { padding: 10px 12px; min-width: 44px; border-radius: var(--ellie-radius-md); }
.aa-btn.small { padding: 6px 12px; font-size: 11px; min-height: 32px; border-radius: var(--ellie-radius-sm); }
.aa-btn.large { padding: 13px 22px; font-size: 14px; min-height: 52px; border-radius: var(--ellie-radius-lg); }

.aa-input, .aa-settings-input, .aa-select {
  padding: 11px 14px;
  border: 1px solid var(--ellie-color-onyx);
  border-radius: var(--ellie-radius-md);
  font: inherit;
  font-family: var(--ellie-font-ui);
  font-size: 14px;
  color: var(--c-fg);
  background: var(--c-surface);
  width: 100%;
  min-height: 44px;
  outline: none;
}
.aa-input:focus, .aa-settings-input:focus {
  border-color: var(--ellie-color-punch-red);
  box-shadow: 0 0 0 1px var(--ellie-color-punch-red);
}

.field { display: grid; gap: 8px; }
.field label { 
  font-family: var(--ellie-font-ui); 
  font-size: 11px; 
  font-weight: 800; 
  letter-spacing: 0.10em; 
  text-transform: uppercase; 
  color: var(--c-fg-muted); 
  display: flex; 
  gap: 6px; 
  align-items: center; 
}
.field .help { font-size: 12px; color: var(--c-fg-muted); margin-top: 2px; }

/* ─── Account & Settings ─────────────────────────────────────────── */
.aa-account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; margin-top: 24px; }
.aa-account-card { 
  padding: 32px; background: white; border: var(--ellie-border); 
  border-radius: var(--ellie-radius-lg); display: grid; gap: 16px; 
}
.aa-account-card span { font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-fg-muted); }
.aa-account-card strong { font-family: var(--ellie-font-display); font-size: 24px; font-weight: 800; color: var(--c-fg); }
.aa-account-card p { font-size: 14px; color: var(--c-fg-muted); margin: 0; }

.aa-setting-list { display: grid; gap: 16px; margin-top: 24px; }
.aa-setting-row { 
  display: flex; justify-content: space-between; align-items: center; gap: 24px; 
  padding: 24px 32px; background: white; border: var(--ellie-border); 
  border-radius: var(--ellie-radius-lg); 
}
.aa-setting-row strong { display: block; font-family: var(--ellie-font-display); font-size: 18px; font-weight: 700; color: var(--c-fg); }
.aa-setting-row p { font-size: 14px; color: var(--c-fg-muted); margin: 4px 0 0; }

/* ─── Identity anchor — italic editorial quote ─────────────────────── */
.aa-anchor {
  font-family: var(--ellie-font-display);
  font-style: italic;
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  color: var(--c-fg-muted);
  padding: 12px 24px;
  border-bottom: var(--ellie-border-hair);
  letter-spacing: 0.01em;
}

/* ─── Notebook layout (default Slipbox view) ───────────────────────── */
.aa-notebook { display: grid; grid-template-columns: minmax(0, 1.05fr) 1px minmax(0, 0.95fr); gap: 0; min-height: 0; flex: 1; }
.aa-notebook .split { background: var(--c-border); cursor: col-resize; }
.aa-notebook-left, .aa-notebook-right { display: flex; flex-direction: column; min-width: 0; }
.aa-notebook-left { padding: 24px 32px 32px 32px; gap: 16px; }
.aa-notebook-right { padding: 24px 32px 32px 32px; gap: 16px; overflow-y: auto; }

/* ─── Composer ─────────────────────────────────────────────────────── */
.aa-composer {
  background: var(--c-surface);
  border: var(--ellie-border);
  display: flex; flex-direction: column;
  border-radius: var(--ellie-radius-lg);
  overflow: hidden;
}
.aa-composer-toolbar { display: flex; gap: 2px; align-items: center; padding: 6px 10px; border-bottom: var(--ellie-border-hair); flex-wrap: wrap; }
.aa-composer-toolbar button { background: transparent; border: 1px solid transparent; padding: 5px 8px; min-width: 28px; height: 28px; cursor: pointer; font: inherit; font-family: var(--ellie-font-ui); font-size: 13px; font-weight: 600; color: var(--c-fg); display: inline-flex; align-items: center; justify-content: center; border-radius: var(--ellie-radius-xs); }
.aa-composer-toolbar button:hover { background: rgba(10,10,10,0.04); }
.aa-composer-toolbar button.is-active { background: var(--ellie-color-cool-blue); border-color: var(--ellie-color-onyx); }
.aa-composer-toolbar i { font-size: 14px; }
.aa-composer-toolbar .sep { width: 1px; height: 18px; background: var(--c-border-hair); margin: 0 4px; }

.aa-composer-body {
  padding: 18px 22px 14px;
  font-family: var(--ellie-font-editor);
  font-size: 17px;
  line-height: 1.6;
  color: var(--c-fg);
  min-height: 280px;
}
.aa-composer-body p { margin: 0 0 12px; }
.aa-composer-body .placeholder { color: var(--c-fg-subtle); font-style: italic; }

.aa-composer-controls {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 14px;
  border-top: var(--ellie-border-hair);
}
.aa-composer-controls .ai-bar { display: flex; gap: 6px; }
.aa-composer-controls .ai-btn {
  font: inherit; font-family: var(--ellie-font-ui);
  font-size: 12px; font-weight: 700;
  padding: 6px 12px;
  border: var(--ellie-border);
  background: var(--c-surface); color: var(--c-fg);
  cursor: pointer; display: inline-flex; gap: 5px; align-items: center;
  border-radius: var(--ellie-radius-md);
}
.aa-composer-controls .ai-btn:hover { background: var(--ellie-color-cool-blue); }
.aa-composer-controls .ai-btn .cost { font-family: var(--ellie-font-mono); font-size: 10px; color: var(--c-fg-muted); }
.aa-composer-controls .ai-btn .cost img { width: 10px; height: 10px; vertical-align: -1px; }
.aa-composer-controls .ai-btn i { font-size: 12px; color: var(--ellie-color-punch-red); }
.aa-composer-controls .save-state { margin-left: auto; font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; color: var(--c-fg-muted); }
.aa-composer-controls .save-state.is-saved { color: var(--c-fg); }
.aa-composer-controls .submit-btn {
  background: var(--ellie-color-punch-red); color: white;
  border: var(--ellie-border);
  padding: 6px 14px;
  font: inherit; font-family: var(--ellie-font-ui); font-size: 12px; font-weight: 800;
  cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
  border-radius: var(--ellie-radius-md);
}
.aa-composer-controls .submit-btn i { font-size: 12px; }

/* ─── Deadline banner ──────────────────────────────────────────────── */
.aa-deadline {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 14px;
  border: var(--ellie-border);
  background: var(--ellie-color-cool-blue);
  font-family: var(--ellie-font-ui); font-size: 12px; font-weight: 700;
  color: var(--c-fg);
  cursor: pointer;
  border-radius: var(--ellie-radius-md);
}
.aa-deadline i { font-size: 14px; }
.aa-deadline strong { font-weight: 800; }
.aa-deadline .d { font-family: var(--ellie-font-mono); margin-left: auto; }

/* ─── Discovery panel — search + tag cloud + filters ──────────────── */
.aa-discovery { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; border-bottom: var(--ellie-border-hair); }
.aa-discovery-search { width: 100%; background: transparent; border: 0; border-bottom: var(--ellie-border); font: inherit; font-family: var(--ellie-font-editor); font-size: 17px; padding: 4px 0 6px; color: var(--c-fg); outline: none; }
.aa-discovery-search::placeholder { color: var(--c-fg-subtle); font-style: italic; }
.aa-discovery-search:focus { border-bottom-width: 2px; padding-bottom: 5px; }

.aa-tag-cloud { display: flex; flex-wrap: wrap; gap: 5px; }
.aa-tag-pill {
  display: inline-flex; align-items: center;
  background: var(--c-surface);
  border: var(--ellie-border);
  padding: 2px 10px;
  font: inherit; font-family: var(--ellie-font-ui); font-size: 12px; font-weight: 700;
  color: var(--c-fg);
  cursor: pointer;
  border-radius: var(--ellie-radius-md);
}
.aa-tag-pill:hover { background: var(--ellie-color-cool-blue); }
.aa-tag-pill.is-active { background: var(--ellie-color-onyx); color: white; }
.aa-tag-pill.is-excluded { background: var(--ellie-status-error-bg); color: var(--ellie-color-punch-red); text-decoration: line-through; }

.aa-tag-group { display: inline-flex; }
.aa-tag-group .aa-tag-pill { border-right-width: 0; }
.aa-tag-group .aa-tag-pill:last-child { border-right-width: 1px; }
.aa-tag-group .exclude { padding: 2px 8px; font-family: var(--ellie-font-mono); font-size: 12px; }

.aa-filter-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 4px; }
.aa-filter-mode {
  background: var(--ellie-color-onyx); color: white;
  border: var(--ellie-border);
  padding: 3px 9px;
  font: inherit; font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  cursor: pointer;
}
.aa-filter-clear { background: transparent; border: 0; color: var(--c-fg-muted); font: inherit; font-family: var(--ellie-font-ui); font-size: 11px; font-weight: 700; cursor: pointer; padding: 3px 6px; text-decoration: underline; }

/* ─── Entry feed — note tray ──────────────────────────────────────── */
.aa-feed { display: flex; flex-direction: column; gap: 0; flex: 1; min-height: 0; }
.aa-entry {
  padding: 18px 0;
  border-bottom: var(--ellie-border-hair);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px;
  cursor: pointer;
  background: transparent;
  border-radius: var(--ellie-radius-md);
  transition: background var(--ellie-dur-fast) var(--ellie-ease);
}
.aa-entry:first-child { padding-top: 0; }
.aa-entry:hover { background: rgba(10,10,10,0.02); }

.aa-entry .meta { display: flex; gap: 10px; align-items: baseline; }
.aa-entry time {
  font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--c-fg-muted);
}
.aa-entry .pin { color: var(--ellie-color-punch-red); font-size: 12px; }

.aa-entry .snippet {
  margin-top: 6px;
  font-family: var(--ellie-font-editor); font-size: 15px; line-height: 1.55;
  color: var(--c-fg);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.aa-entry .tags { margin-top: 8px; display: flex; gap: 8px; }
.aa-entry .aa-tag-pill { 
  font-family: var(--ellie-font-ui); font-size: 10px; font-weight: 700; 
  color: var(--c-fg-muted); letter-spacing: 0.02em; 
  background: transparent; border: 0; padding: 0; cursor: pointer;
}
.aa-entry .aa-tag-pill:hover { text-decoration: underline; color: var(--c-fg); }

.aa-entry .acts { display: flex; flex-direction: column; gap: 8px; opacity: 0; transition: opacity 150ms ease; }
.aa-entry:hover .acts, .aa-entry.is-expanded .acts { opacity: 1; }
.aa-entry .acts button { 
  width: 28px; height: 28px; 
  border: var(--ellie-border-hair); 
  background: var(--c-surface); 
  cursor: pointer; 
  display: grid; place-items: center; 
  border-radius: var(--ellie-radius-xs);
}
.aa-entry .acts button i { font-size: 14px; color: var(--c-fg); }
.aa-entry .acts button:hover { background: var(--ellie-color-cool-blue); border-color: var(--ellie-color-onyx); }

.aa-entry.is-expanded { 
  background: var(--ellie-color-bright-snow); 
  padding: 24px; 
  border: 1px solid var(--ellie-color-onyx); 
  margin: 12px -16px; 
  z-index: 5; 
  box-shadow: var(--ellie-shadow-soft); 
  border-radius: var(--ellie-radius-lg);
}
.aa-entry.is-expanded .snippet { -webkit-line-clamp: unset; font-size: 16px; }
.aa-entry.is-expanded .acts { flex-direction: row; }
.aa-entry.is-expanded:hover { background: var(--ellie-color-bright-snow); }

/* ─── BUJO & TipTap Marks (Fidelity Wave) ────────────────────────── */
.tiptap ul[data-type="taskList"] { list-style: none; padding: 0; }
.tiptap li[data-type="taskItem"] { display: flex; gap: 16px; align-items: flex-start; margin: 10px 0; }
.tiptap li[data-type="taskItem"] > label { 
  width: 18px; height: 18px; 
  border: 1px solid var(--ellie-color-onyx); 
  background: var(--c-surface); 
  flex-shrink: 0; display: grid; place-items: center; 
  margin-top: 4px; cursor: pointer; 
  border-radius: var(--ellie-radius-xs);
  position: relative;
}
.tiptap li[data-type="taskItem"] > label input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.tiptap li[data-type="taskItem"] > label::after { content: ""; display: none; width: 4px; height: 8px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-bottom: 2px; }
.tiptap li[data-type="taskItem"][data-checked="true"] > label { background: var(--ellie-color-onyx); }
.tiptap li[data-type="taskItem"][data-checked="true"] > label::after { display: block; }
.tiptap li[data-type="taskItem"][data-checked="true"] > div { text-decoration: line-through; color: var(--c-fg-muted); opacity: 0.6; }

.tiptap .tt-tag { 
  color: var(--ellie-color-punch-red); 
  font-weight: 700; cursor: pointer; 
  font-family: var(--ellie-font-ui); 
  font-size: 0.92em; 
}
.tiptap .tt-tag:hover { text-decoration: underline; }

.tiptap .tt-wikilink { 
  color: var(--c-fg); 
  background: var(--ellie-color-cool-blue); 
  padding: 0 8px; 
  border: 1px solid var(--ellie-color-onyx); 
  cursor: pointer; 
  font-family: var(--ellie-font-ui); 
  font-size: 0.88em; 
  font-weight: 600; 
  border-radius: var(--ellie-radius-xs);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tiptap .tt-wikilink::before { content: "📖"; font-size: 10px; }

/* Group labels for toolbar */
.aa-composer-toolbar .grp { 
  font-family: var(--ellie-font-mono); 
  font-size: 9px; font-weight: 800; 
  letter-spacing: 0.14em; text-transform: uppercase; 
  color: var(--c-fg-subtle); padding: 0 8px; 
}


/* ─── BUJO parsed entries — rendered inline ───────────────────────── */
.aa-bujo { display: flex; flex-direction: column; gap: 2px; font-family: var(--ellie-font-editor); font-size: 15px; line-height: 1.55; color: var(--c-fg); }
.aa-bujo-bullet, .aa-bujo-task, .aa-bujo-done, .aa-bujo-migrated, .aa-bujo-plain { display: flex; gap: 8px; }
.aa-bujo .sym {
  width: 18px; flex-shrink: 0; text-align: center;
  font-family: var(--ellie-font-mono); font-weight: 700; font-size: 13px;
  color: var(--c-fg-muted);
  user-select: none;
}
.aa-bujo-done { opacity: 0.5; text-decoration: line-through; color: var(--c-fg-muted); }
.aa-bujo-migrated { color: var(--c-fg-muted); font-style: italic; text-decoration: line-through; }
.aa-bujo-insight {
  display: flex; gap: 8px; align-items: flex-start;
  border-left: 3px solid var(--ellie-color-punch-red);
  background: var(--ellie-status-error-bg);
  padding: 8px 12px;
  font-weight: 600;
  margin: 6px 0;
}
.aa-bujo-insight .sym { color: var(--ellie-color-punch-red); font-size: 14px; }
.aa-bujo .tag { color: var(--ellie-color-punch-red); font-weight: 700; cursor: pointer; }
.aa-bujo .wikilink { color: var(--c-fg); text-decoration: underline dotted; cursor: pointer; }

/* ─── MIT banner ──────────────────────────────────────────────────── */
.aa-mit { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: var(--ellie-color-cool-blue); border: var(--ellie-border); }
.aa-mit .lbl { font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-fg); }
.aa-mit ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.aa-mit li { font-family: var(--ellie-font-editor); font-size: 14px; }

/* ─── 3-pane Swiss Write surface ──────────────────────────────────── */
.aa-write {
  display: grid;
  grid-template-columns: 260px 1px minmax(0, 1fr) 1px 300px;
  gap: 0;
  flex: 1;
  min-height: 0;
}
.aa-write .vrule { background: var(--c-border); }
.aa-write-pane { display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }
.aa-write-pane-head { display: flex; gap: 8px; align-items: center; padding: 16px 24px 8px; border-bottom: var(--ellie-border-hair); }
.aa-write-pane-head h3 { font-family: var(--ellie-font-ui); font-weight: 700; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--c-fg-muted); margin: 0; flex: 1; }
.aa-write-pane-head .ico-btn { width: 32px; height: 32px; border: var(--ellie-border-hair); background: transparent; cursor: pointer; display: grid; place-items: center; }
.aa-write-pane-head .ico-btn i { font-size: 12px; }

.aa-write-lit, .aa-write-tools { padding: 0 0 20px; }
.aa-write-lit { background: var(--ellie-color-soft-linen); }
.aa-write-tools { background: var(--c-surface); }

/* Literature nodes list */
.aa-lit-node {
  padding: 12px 18px;
  border-bottom: var(--ellie-border-hair);
  cursor: pointer;
}
.aa-lit-node:hover { background: rgba(10,10,10,0.03); }
.aa-lit-node.is-active { background: var(--ellie-color-cool-blue); }
.aa-lit-node .kind { font-family: var(--ellie-font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--c-fg-muted); }
.aa-lit-node .ttl { font-family: var(--ellie-font-display); font-weight: 600; font-size: 14px; color: var(--c-fg); line-height: 1.25; margin-top: 4px; }
.aa-lit-node .au { font-family: var(--ellie-font-ui); font-size: 11px; color: var(--c-fg-muted); margin-top: 2px; }
.aa-lit-node .links { display: flex; gap: 6px; align-items: center; margin-top: 6px; font-family: var(--ellie-font-mono); font-size: 10px; color: var(--c-fg-muted); }
.aa-lit-node .links i { font-size: 10px; }

/* Center editor */
.aa-write-editor { padding: 28px 56px 60px; max-width: 760px; margin: 0 auto; background: var(--c-surface); }
.aa-write-editor h1 { font-family: var(--ellie-font-display); font-weight: 700; font-size: 36px; line-height: 1.1; letter-spacing: -0.01em; color: var(--c-heading-editorial); margin: 0 0 6px; }
.aa-write-editor .meta { display: flex; gap: 14px; font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; color: var(--c-fg-muted); margin-bottom: 24px; padding-bottom: 14px; border-bottom: var(--ellie-border-hair); }
.aa-write-editor h2 { font-family: var(--ellie-font-display); font-weight: 600; font-size: 22px; color: var(--c-heading-editorial); margin: 28px 0 12px; }
.aa-write-editor h2:first-of-type { margin-top: 0; }
.aa-write-editor p { font-family: var(--ellie-font-editor); font-size: 17px; line-height: 1.7; color: var(--c-fg); margin: 0 0 16px; }
.aa-write-editor mark { background: var(--ellie-color-cool-blue); padding: 1px 3px; color: var(--c-fg); }

/* AI scalpel tools */
.aa-scalpel { padding: 14px 18px; display: flex; flex-direction: column; gap: 16px; }
.aa-scalpel-section { display: flex; flex-direction: column; gap: 6px; }
.aa-scalpel-section .h { font-family: var(--ellie-font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--c-fg-muted); }
.aa-scalpel-tool {
  padding: 10px 12px;
  border: var(--ellie-border);
  background: var(--c-surface);
  cursor: pointer;
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px;
}
.aa-scalpel-tool:hover { background: var(--ellie-color-cool-blue); }
.aa-scalpel-tool i { font-size: 16px; color: var(--c-fg); }
.aa-scalpel-tool .lbl { font-family: var(--ellie-font-ui); font-weight: 700; font-size: 13px; color: var(--c-fg); }
.aa-scalpel-tool .cost { font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 700; color: var(--c-fg-muted); display: inline-flex; gap: 3px; align-items: center; }
.aa-scalpel-tool .cost img { width: 11px; height: 11px; }

/* ─── Library browser ─────────────────────────────────────────────── */
.aa-libgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.aa-libcard { 
  background: var(--c-surface); 
  border: var(--ellie-border); 
  padding: 20px; 
  display: flex; flex-direction: column; gap: 10px; 
  position: relative; 
  min-height: 220px; 
  cursor: pointer;
  border-radius: var(--ellie-radius-lg);
  transition: background var(--ellie-dur-fast) var(--ellie-ease);
}
.aa-libcard:hover { background: rgba(10,10,10,0.02); }
.aa-libcard.is-active { background: var(--ellie-color-cool-blue); border-color: var(--ellie-color-onyx); }

.aa-libcard .ktype { display: inline-flex; gap: 6px; align-items: center; font-family: var(--ellie-font-mono); font-size: 10px; color: var(--c-fg-muted); font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; }
.aa-libcard .ktype i { font-size: 14px; color: var(--c-fg); }
.aa-libcard .ttl { font-family: var(--ellie-font-display); font-weight: 700; font-size: 18px; color: var(--c-fg); line-height: 1.25; margin: 4px 0 2px; }
.aa-libcard .au { font-family: var(--ellie-font-ui); font-size: 13px; color: var(--c-fg-muted); line-height: 1.4; }

.aa-libcard .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.aa-libcard .t { 
  font-family: var(--ellie-font-ui); font-size: 10px; font-weight: 700;
  padding: 2px 10px; border: var(--ellie-border-hair); 
  color: var(--c-fg); background: transparent;
  border-radius: var(--ellie-radius-xs);
}

.aa-libcard .foot { 
  margin-top: auto; 
  display: flex; justify-content: space-between; align-items: center; 
  font-family: var(--ellie-font-mono); font-size: 10px; 
  color: var(--c-fg-muted); letter-spacing: 0.06em; 
  text-transform: uppercase;
  padding-top: 14px;
  border-top: var(--ellie-border-hair);
}
.aa-libcard .ib { 
  width: 28px; height: 28px; 
  border: var(--ellie-border-hair); 
  background: transparent; cursor: pointer; 
  display: grid; place-items: center; 
  border-radius: var(--ellie-radius-sm);
}
.aa-libcard .ib i { font-size: 14px; color: var(--c-fg); }
.aa-libcard .ib:hover { background: var(--ellie-color-onyx); color: white; }
.aa-libcard .ib:hover i { color: white; }

.aa-libcard .pin { color: var(--ellie-color-punch-red); margin-right: 4px; }

/* ─── Page-specific scaffolding (still used by Analysis Lab + Settings + Capture)
       — these files import kit-extras.css for the longer-form view styling. */


/* Workspace UI Kit · extras — Capture, Analysis Lab, Settings.
   Same visual rules: 1 px Onyx borders, hard corners, no shadows. */

/* ─── CAPTURE ────────────────────────────────────────────────────── */
.aa-cap-tabs { display: flex; gap: 0; margin-bottom: 24px; flex-wrap: wrap; }
.aa-cap-tabs button {
  background: var(--c-surface); border: 1px solid var(--ellie-color-onyx); border-right: 0;
  padding: 12px 16px;
  font: inherit; font-family: var(--ellie-font-ui); font-size: 13px; font-weight: 700;
  color: var(--c-fg);
  cursor: pointer; display: inline-flex; gap: 8px; align-items: center;
  transition: background 150ms ease, color 150ms ease;
  min-height: 44px;
}
.aa-cap-tabs button:last-child { border-right: 1px solid var(--ellie-color-onyx); }
.aa-cap-tabs button:hover { background: rgba(10,10,10,0.04); }
.aa-cap-tabs button:focus-visible { outline: 2px solid var(--ellie-color-onyx); outline-offset: -2px; }
.aa-cap-tabs button.active { background: var(--ellie-color-onyx); color: white; }
.aa-cap-tabs i { font-size: 14px; }

.aa-cap-drop {
  padding: 64px 32px;
  background: var(--c-bg-secondary);
  border: 1px solid var(--ellie-color-onyx);
  text-align: center;
  display: flex; flex-direction: column; gap: 16px; align-items: center;
  position: relative;
  border-radius: var(--ellie-radius-xl);
}
.aa-cap-drop::before {
  content: "";
  position: absolute; inset: 8px;
  border: 1px dashed rgba(10,10,10,0.25);
  pointer-events: none;
  border-radius: var(--ellie-radius-lg);
}
.aa-cap-drop > * { position: relative; z-index: 1; }
.aa-cap-drop-icon { width: 64px; height: 64px; display: grid; place-items: center; border: 1px solid var(--ellie-color-onyx); background: var(--ellie-color-soft-linen); color: var(--c-fg); margin-bottom: 4px; border-radius: var(--ellie-radius-lg); }
.aa-cap-drop h3 { font-family: var(--ellie-font-ui); font-weight: 700; font-size: 22px; color: var(--c-fg); margin: 0; }
.aa-cap-drop p { font-size: 14px; color: var(--c-fg-muted); margin: 0; max-width: 480px; line-height: 1.5; }
.aa-cap-link { color: var(--ellie-color-punch-red); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; transition: color 150ms ease; border-radius: var(--ellie-radius-xs); }
.aa-cap-link:hover { color: #d22f3c; }
.aa-cap-link:focus-visible { outline: 2px solid var(--ellie-color-onyx); outline-offset: 2px; }
.aa-cap-cost { margin-top: 12px; display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; background: var(--ellie-color-soft-linen); border: 1px solid var(--ellie-color-onyx); font-size: 12px; color: var(--c-fg-muted); border-radius: var(--ellie-radius-md); }
.aa-cap-cost img { width: 16px; height: 16px; }

.aa-cap-sub { font-family: var(--ellie-font-ui); font-weight: 700; font-size: 14px; color: var(--c-fg); margin: 36px 0 10px; display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 0.08em; }
.aa-cap-recent { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--ellie-color-onyx); border-radius: var(--ellie-radius-lg); overflow: hidden; }
.aa-cap-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--ellie-color-onyx); background: var(--c-surface); transition: background 150ms ease; }
.aa-cap-row:last-child { border-bottom: 0; }
.aa-cap-row:hover { background: var(--c-bg-secondary); }
.aa-cap-row-icon { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--ellie-color-onyx); background: var(--ellie-color-soft-linen); color: var(--c-fg); border-radius: var(--ellie-radius-sm); }
.aa-cap-row-icon i { font-size: 18px; }
.aa-cap-row-name { font-size: 13px; font-weight: 700; color: var(--c-fg); font-family: var(--ellie-font-ui); }
.aa-cap-row-meta { font-size: 11px; color: var(--c-fg-muted); margin-top: 2px; font-family: var(--ellie-font-mono); letter-spacing: 0.04em; }
.aa-cap-row-time { display: flex; gap: 14px; align-items: center; font-family: var(--ellie-font-mono); font-size: 10px; color: var(--c-fg-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.aa-cap-pill { display: inline-flex; gap: 5px; align-items: center; padding: 2px 8px; border: 1px solid var(--ellie-color-onyx); font-family: var(--ellie-font-ui); font-size: 11px; font-weight: 700; border-radius: var(--ellie-radius-xs); }
.aa-cap-pill.complete { background: var(--ellie-color-cool-blue); color: var(--c-fg); }
.aa-cap-pill.processing { background: var(--c-surface); color: var(--ellie-status-processing); }
.aa-cap-pill.processing i { animation: spin 1.6s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ─── ANALYSIS LAB ─────────────────────────────────────────────────── */
.aa-lab-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: 16px; }

.aa-lab-graph { background: var(--c-surface); border: var(--ellie-border); padding: 16px; display: flex; flex-direction: column; gap: 14px; min-height: 380px; border-radius: var(--ellie-radius-lg); }
.aa-lab-graph-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.aa-lab-graph-chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 12px; border: var(--ellie-border); font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; color: var(--c-fg); background: var(--ellie-color-cool-blue); border-radius: var(--ellie-radius-pill); }
.aa-lab-graph-canvas { flex: 1; position: relative; border: var(--ellie-border-hair); background: var(--ellie-color-soft-linen); overflow: hidden; min-height: 340px; border-radius: var(--ellie-radius-md); }
.aa-lab-graph-canvas svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.aa-lab-graph-tag { position: absolute; padding: 3px 9px; font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border-radius: var(--ellie-radius-xs); }
.aa-lab-graph-tag.dark { background: var(--ellie-color-onyx); color: white; border: 1px solid white; }
.aa-lab-graph-tag.accent { background: var(--ellie-color-punch-red); color: white; }
.aa-lab-graph-legend { display: flex; gap: 16px; padding: 4px 8px; font-family: var(--ellie-font-mono); font-size: 10px; color: var(--c-fg-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.aa-lab-graph-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; vertical-align: middle; }

.aa-lab-side { display: flex; flex-direction: column; gap: 16px; }
.aa-lab-panel { background: var(--c-surface); border: var(--ellie-border); padding: 16px; display: flex; flex-direction: column; gap: 16px; border-radius: var(--ellie-radius-lg); }
.aa-lab-panel-head { display: flex; gap: 8px; align-items: center; font-family: var(--ellie-font-ui); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-fg); }
.aa-lab-finding { padding: 12px 14px; background: var(--ellie-color-soft-linen); border: var(--ellie-border-hair); display: flex; flex-direction: column; gap: 8px; border-radius: var(--ellie-radius-md); }
.aa-lab-finding .badge { display: inline-flex; align-self: flex-start; padding: 2px 9px; border: var(--ellie-border-hair); font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; border-radius: var(--ellie-radius-pill); }
.aa-lab-finding .badge.consensus { background: var(--ellie-color-cool-blue); color: var(--c-fg); }
.aa-lab-finding .badge.contradiction { background: var(--ellie-status-error-bg); color: var(--ellie-color-punch-red); }
.aa-lab-finding p { font-family: var(--ellie-font-editor); font-size: 14px; color: var(--c-fg); line-height: 1.5; margin: 0; }
.aa-lab-finding .src { font-family: var(--ellie-font-mono); font-size: 10px; color: var(--c-fg-muted); display: inline-flex; gap: 6px; align-items: center; letter-spacing: 0.06em; }

.aa-lab-bottom { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; margin-top: 16px; }
.aa-lab-card { background: var(--c-surface); border: var(--ellie-border); padding: 16px; display: flex; flex-direction: column; gap: 16px; border-radius: var(--ellie-radius-lg); }
.aa-lab-card h3 { display: flex; gap: 8px; align-items: center; font-family: var(--ellie-font-ui); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--c-fg); margin: 0; }

/* Forest plot */
.aa-forest { display: flex; flex-direction: column; padding: 8px 0 0; }
.aa-forest-axis { position: relative; height: 18px; border-top: var(--ellie-border-hair); display: flex; justify-content: space-between; font-family: var(--ellie-font-mono); font-size: 10px; color: var(--c-fg-muted); padding: 2px 8px 0 130px; }
.aa-forest-row { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 10px; padding: 7px 0; border-top: var(--ellie-border-hair); }
.aa-forest-row:first-of-type { border-top: 0; }
.aa-forest-row .label { font-family: var(--ellie-font-ui); font-size: 13px; color: var(--c-fg); font-weight: 600; }
.aa-forest-row .label.pooled { color: var(--ellie-color-punch-red); font-weight: 800; }
.aa-forest-row .track { position: relative; height: 18px; }
.aa-forest-row .track::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--c-border-hair); }
.aa-forest-row .track .ci { position: absolute; top: 50%; transform: translateY(-50%); height: 2px; background: var(--ellie-color-onyx); }
.aa-forest-row .track .point { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 10px; height: 10px; background: var(--ellie-color-onyx); }
.aa-forest-row .track .point.pooled { width: 14px; height: 14px; background: var(--ellie-color-punch-red); transform: translate(-50%, -50%) rotate(45deg); }
.aa-forest-row .track .zero { position: absolute; top: -2px; bottom: -2px; left: 33%; width: 1px; background: var(--ellie-color-onyx); opacity: 0.4; }

/* Matrix table */
.aa-matrix { display: flex; flex-direction: column; }
.aa-matrix .head { display: grid; grid-template-columns: 1.3fr 1.6fr 1.8fr 70px; padding: 6px 0; font-family: var(--ellie-font-mono); font-size: 10px; letter-spacing: 0.10em; text-transform: uppercase; color: var(--c-fg-muted); border-bottom: var(--ellie-border); font-weight: 700; }
.aa-matrix .row { display: grid; grid-template-columns: 1.3fr 1.6fr 1.8fr 70px; padding: 12px 0; border-bottom: var(--ellie-border-hair); font-family: var(--ellie-font-ui); font-size: 13px; color: var(--c-fg); line-height: 1.4; gap: 8px; align-items: flex-start; }
.aa-matrix .row:last-child { border-bottom: 0; }
.aa-matrix .row strong { display: block; font-weight: 700; color: var(--c-fg); font-family: var(--ellie-font-display); }
.aa-matrix .row .sub { font-size: 11px; color: var(--c-fg-muted); margin-top: 2px; font-family: var(--ellie-font-ui); }
.aa-matrix .conf { display: inline-flex; align-items: center; gap: 4px; font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 700; padding: 2px 8px; border: var(--ellie-border-hair); background: var(--ellie-color-cool-blue); color: var(--c-fg); letter-spacing: 0.06em; text-transform: uppercase; }
.aa-matrix .conf.warn { background: var(--ellie-status-warning-bg); color: var(--ellie-status-warning); }

/* ─── SETTINGS ────────────────────────────────────────────────────── */
.aa-settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; padding-bottom: 60px; }
.aa-settings-rail { display: flex; flex-direction: column; gap: 0; border: var(--ellie-border); background: var(--c-surface); }
.aa-settings-rail button {
  background: transparent; border: 0; border-bottom: var(--ellie-border-hair);
  padding: 11px 14px; text-align: left;
  font: inherit; font-family: var(--ellie-font-ui); font-size: 13px; font-weight: 600;
  color: var(--c-fg); cursor: pointer;
  display: flex; align-items: center; gap: 10px;
}
.aa-settings-rail button:last-child { border-bottom: 0; }
.aa-settings-rail button:hover { background: rgba(10,10,10,0.04); }
.aa-settings-rail button.active { background: var(--ellie-color-cool-blue); font-weight: 700; }
.aa-settings-rail i { font-size: 16px; }

.aa-settings-body { display: flex; flex-direction: column; gap: 24px; max-width: 800px; }
.aa-settings-section { 
  background: var(--c-surface); border: var(--ellie-border); padding: 32px; 
  display: flex; flex-direction: column; gap: 24px;
  border-radius: var(--ellie-radius-lg);
}
.aa-settings-section h2 { font-family: var(--ellie-font-ui); font-weight: 700; font-size: 20px; color: var(--c-fg); margin: 0; letter-spacing: -0.01em; }
.aa-settings-section h2 + p { font-size: 14px; color: var(--c-fg-muted); margin: 0 0 8px; line-height: 1.5; }
.aa-settings-row { display: grid; grid-template-columns: 240px 1fr auto; gap: 24px; padding: 24px 0; border-top: var(--ellie-border-hair); align-items: center; }
.aa-settings-row:first-of-type { border-top: 0; padding-top: 4px; }
.aa-settings-row .label { font-size: 13px; font-weight: 700; color: var(--c-fg); }
.aa-settings-row .help { font-size: 12px; color: var(--c-fg-muted); line-height: 1.45; }
.aa-settings-input {
  padding: 9px 12px;
  border: var(--ellie-border);
  font: inherit; font-family: var(--ellie-font-ui); font-size: 13px;
  color: var(--c-fg); background: var(--c-surface);
  width: 100%;
}
.aa-settings-input:focus { outline: 2px solid var(--ellie-color-punch-red); outline-offset: 1px; }
.aa-toggle { width: 40px; height: 22px; background: white; border: var(--ellie-border); position: relative; cursor: pointer; padding: 0; flex-shrink: 0; }
.aa-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--c-fg); transition: left var(--ellie-dur-fast) var(--ellie-ease); }
.aa-toggle.on { background: var(--ellie-color-onyx); }
.aa-toggle.on::after { left: 20px; background: var(--ellie-color-cool-blue); }

.aa-plan-card { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 16px 18px; border: var(--ellie-border); background: var(--ellie-color-cool-blue); }
.aa-plan-card .nm { font-family: var(--ellie-font-ui); font-weight: 700; font-size: 16px; color: var(--c-fg); display: flex; gap: 8px; align-items: center; }
.aa-plan-card .nm img { width: 18px; height: 18px; }
.aa-plan-card .desc { font-size: 12px; color: var(--c-fg-muted); margin-top: 4px; font-family: var(--ellie-font-mono); letter-spacing: 0.04em; }
.aa-plan-card .actions { display: flex; gap: 8px; }

.aa-danger { border-color: var(--ellie-color-punch-red); }
.aa-danger h2 { color: var(--ellie-color-punch-red); }
.aa-danger .btn-danger {
  background: transparent;
  border: 1px solid var(--ellie-color-punch-red);
  color: var(--ellie-color-punch-red);
  padding: 8px 14px;
  font: inherit; font-family: var(--ellie-font-ui); font-size: 13px; font-weight: 800;
  cursor: pointer;
}
.aa-danger .btn-danger:hover { background: var(--ellie-color-punch-red); color: white; }

/* ─── Modals & Artifacts ───────────────────────────────────────────── */
.aa-modal-backdrop {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10, 10, 10, 0.45);
  backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 24px;
}

.aa-artifact-modal {
  background: var(--c-surface);
  border: var(--ellie-border);
  padding: 32px;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex; flex-direction: column; gap: 24px;
  border-radius: var(--ellie-radius-xl);
  box-shadow: var(--ellie-shadow-soft);
}

.aa-modal-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.aa-modal-heading h2 { font-family: var(--ellie-font-display); font-weight: 800; font-size: 28px; margin: 8px 0 0; }

@keyframes aa-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.aa-spin {
  display: inline-block;
  animation: aa-spin 1s linear infinite;
}

.aa-artifact-preview {
  background: var(--ellie-color-bright-snow);
  border: var(--ellie-border-hair);
  padding: 0;
  overflow-y: auto;
  min-height: 400px;
  border-radius: var(--ellie-radius-lg);
}

.aa-meta-prompt {
  margin: 18px 0 0; padding: 22px 24px;
  background: var(--ellie-color-soft-linen);
  border: 1px solid var(--ellie-color-onyx);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border-radius: var(--ellie-radius-lg);
}
/*
 * Legacy 2103 journal tokens.
 *
 * These values used to live on html/:root in JournalApp.css. Keep them scoped to
 * the restored journal shell so the lockscreen, marketing page, and future app
 * shells are not resized by importing JournalApp.
 */
.notebook-container {
  --fs-xs: clamp(8.4px, 0.5vw + 5.6px, 10.08px);
  --fs-sm: clamp(10.08px, 0.6vw + 6.3px, 11.9px);
  --fs-base: clamp(11.9px, 0.7vw + 7px, 14px);
  --fs-md: clamp(13.3px, 0.8vw + 7px, 16.1px);
  --fs-lg: clamp(15.4px, 1vw + 7px, 19.6px);
  --fs-xl: clamp(18.2px, 1.2vw + 7px, 23.8px);
  --fs-2xl: clamp(21px, 1.5vw + 7px, 30.8px);
  --sp-xs: clamp(2px, 0.3vw, 4px);
  --sp-sm: clamp(4px, 0.5vw, 8px);
  --sp-md: clamp(8px, 1vw, 16px);
  --sp-lg: clamp(12px, 1.5vw, 24px);

  --bg-primary: #fdfdfd;
  --bg-secondary: #faf8f5;
  --bg-tertiary: #f5f1ec;
  --bg-hover: #ebe6df;
  --bg-input: #fff;
  --bg-card: #fff;
  --bg-overlay: rgba(250, 248, 245, 0.95);

  --text-primary: #1a1a1a;
  --text-secondary: #2c1810;
  --text-muted: #555;
  --text-faint: #888;
  --text-placeholder: #c0b8a8;

  --border-primary: #e8e3db;
  --border-secondary: #d1cdc5;
  --border-accent: #8b7355;

  --accent-primary: #8b7355;
  --accent-warm: #c9a96e;
  --accent-success: #22c55e;
  --accent-error: #ef4444;
  --accent-warning: #f59e0b;
  --accent-info: #3b82f6;
  --accent-purple: #8b5cf6;

  --citation-bg: #f0ecff;
  --citation-bg-end: #e8e0ff;
  --citation-text: #6d28d9;
  --citation-border: rgba(139, 92, 246, 0.2);
  --citation-bg-hover: #e8e0ff;
  --citation-bg-hover-end: #ddd4ff;
  --citation-border-hover: rgba(139, 92, 246, 0.35);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.10), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Safe fallback styles for legacy modals/dashboards */
  --border: var(--border-primary);
  --border-color: var(--border-primary);
  --card-bg: var(--bg-secondary);
  --text-tertiary: var(--text-muted);
}

.export-overlay,
.lit-modal-overlay,
.focus-log-modal,
.meta-analysis-workspace-overlay,
.reviewer-card-overlay,
.action-drawer-overlay,
.lit-graph-overlay,
.manuscript-overlay,
.manuscript-ai-overlay,
.wm-canvas-overlay,
.wm-madlibs-overlay,
.cta-overlay,
.nexus-panel {
  --fs-xs: clamp(8.4px, 0.5vw + 5.6px, 10.08px);
  --fs-sm: clamp(10.08px, 0.6vw + 6.3px, 11.9px);
  --fs-base: clamp(11.9px, 0.7vw + 7px, 14px);
  --fs-md: clamp(13.3px, 0.8vw + 7px, 16.1px);
  --fs-lg: clamp(15.4px, 1vw + 7px, 19.6px);
  --fs-xl: clamp(18.2px, 1.2vw + 7px, 23.8px);
  --fs-2xl: clamp(21px, 1.5vw + 7px, 30.8px);
  --sp-xs: clamp(2px, 0.3vw, 4px);
  --sp-sm: clamp(4px, 0.5vw, 8px);
  --sp-md: clamp(8px, 1vw, 16px);
  --sp-lg: clamp(12px, 1.5vw, 24px);

  --bg-primary: #fdfdfd;
  --bg-secondary: #faf8f5;
  --bg-tertiary: #f5f1ec;
  --bg-hover: #ebe6df;
  --bg-input: #fff;
  --bg-card: #fff;
  --bg-overlay: rgba(250, 248, 245, 0.95);

  --text-primary: #1a1a1a;
  --text-secondary: #2c1810;
  --text-muted: #555;
  --text-faint: #888;
  --text-placeholder: #c0b8a8;

  --border-primary: #e8e3db;
  --border-secondary: #d1cdc5;
  --border-accent: #8b7355;

  --accent-primary: #8b7355;
  --accent-warm: #c9a96e;
  --accent-success: #22c55e;
  --accent-error: #ef4444;
  --accent-warning: #f59e0b;
  --accent-info: #3b82f6;
  --accent-purple: #8b5cf6;

  --citation-bg: #f0ecff;
  --citation-bg-end: #e8e0ff;
  --citation-text: #6d28d9;
  --citation-border: rgba(139, 92, 246, 0.2);
  --citation-bg-hover: #e8e0ff;
  --citation-bg-hover-end: #ddd4ff;
  --citation-border-hover: rgba(139, 92, 246, 0.35);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.10), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Safe fallback styles for legacy modals/dashboards */
  --border: var(--border-primary);
  --border-color: var(--border-primary);
  --card-bg: var(--bg-secondary);
  --text-tertiary: var(--text-muted);
}
/*
 * Transitional CSS aggregator for the restored legacy journal shell.
 *
 * Keep imports here while JournalApp.js is being split into feature slices so
 * the component entrypoint only owns one legacy stylesheet import.
 */
/* =========================================
   CLEAN NOTEBOOK – Private Journal (2103)
   Ivory Tower Desktop · Clean Mobile
   ========================================= */
.notebook-container {
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  height: 100dvh;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: var(--sp-md) 20px 0;
  padding-top: calc(var(--sp-md) + env(safe-area-inset-top, 0px));
  font-family: 'Georgia', 'Times New Roman', serif;
  text-align: left;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
/* ── Mobile container: full bleed, no dark gaps ── */
.notebook-container.mobile-layout {
  max-width: 100%;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  padding: 6px 12px 0;
  padding-top: calc(6px + env(safe-area-inset-top, 0px));
}
/* ── Header ── */
.notebook-header {
  border-bottom: 1px solid var(--border-primary);
  margin-bottom: var(--sp-sm);
  padding-bottom: var(--sp-xs);
  flex-shrink: 0;
}
.notebook-header h1 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: var(--fs-xl);
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}
.notebook-header p {
  margin: 4px 0 0;
  font-size: var(--fs-xs);
  color: var(--text-faint);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
}
/* ── Composer ── */
.notebook-composer {
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--sp-md);
  margin-bottom: var(--sp-sm);
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}
.notebook-composer:focus-within {
  box-shadow: var(--shadow-md);
}
.notebook-composer textarea {
  width: 100%;
  border: none;
  font-family: 'Times New Roman', Times, serif;
  font-size: 12pt;
  resize: none;
  min-height: 200px;
  outline: none;
  line-height: 1.15;
  color: var(--text-primary);
  box-sizing: border-box;
  overflow-y: hidden; /* auto-grow handles scrolling */
  flex: 1;
  min-height: 0;
  /* paragraph spacing: 0 before, 6pt after — simulated via padding */
  padding-bottom: 6pt;
}
.notebook-composer textarea::placeholder {
  color: var(--text-placeholder);
}
.notebook-controls {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  margin-top: 6px;
  border-top: 1px solid var(--border-primary);
  padding-top: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  min-height: 0;
}
.copyright-watermark {
  white-space: nowrap;
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0.5;
  margin-left: auto;
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.2px;
}
.attach-btn {
  cursor: pointer;
  font-size: calc(var(--fs-sm) * 1.15);
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: color 0.2s;
  padding: 4px 0;
  flex-shrink: 0;
}
.attach-btn:hover {
  color: var(--text-primary);
}
/* ── PDF Extract Button ── */
.pdf-extract-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
.pdf-extract-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.pdf-extract-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
/* ── Feed ── */
.notebook-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 24px;
}
/* Mobile scrollable area below composer */
.mobile-scroll-area {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.mobile-scroll-area .notebook-feed {
  overflow-y: visible;
  flex: none;
}
/* Desktop scrollable area below composer */
.desktop-scroll-area {
  flex: 1;
  overflow-y: auto !important;
  min-height: 0 !important; /* Magic rule to ensure flexbox scrolling works */
  padding-bottom: 80px;
}
.desktop-scroll-area .notebook-feed {
  overflow-y: visible;
  flex: none;
}
.notebook-empty {
  text-align: center;
  color: var(--text-placeholder);
  font-size: var(--fs-md);
  margin-top: 40px;
  font-style: italic;
}
.notebook-empty strong,
.notebook-empty span {
  display: block;
}
.notebook-empty strong {
  color: var(--text-secondary);
  font-style: normal;
  margin-bottom: 4px;
}
/* ── Entry ── */
.notebook-entry {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-primary);
}
.notebook-entry:first-child {
  padding-top: 0;
}
.notebook-entry time {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-faint);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.entry-content p {
  font-size: var(--fs-md);
  line-height: 1.85;
  color: var(--text-primary);
  margin: 0;
  white-space: pre-wrap;
}
.notebook-entry img {
  max-width: 100%;
  border-radius: 4px;
  margin-top: 18px;
}
/* ── Mobile adjustments ── */
@media (max-width: 768px) {
  .notebook-container {
    padding: 12px 16px 0;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }
  .notebook-header h1 {
    font-size: var(--fs-xl);
  }
  .notebook-composer textarea {
    font-size: 16px; /* >= 16px prevents iOS auto-zoom on focus */
    min-height: 120px;
  }
  .entry-content p {
    font-size: var(--fs-base);
    line-height: 1.75;
  }
}
/* ── Header row (date + save indicator) ── */
.notebook-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.save-indicator {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.5px;
  white-space: nowrap;
  transition: opacity 0.3s;
}
/* ── Daily Composer tweaks ── */
.notebook-composer--daily textarea {
  min-height: 260px; /* base; desktop override in DESKTOP COMPOSER-FIRST section */
}
.composer-hint {
  font-size: var(--fs-xs);
  color: var(--text-placeholder);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.5px;
}
/* ═════════════════════════════════════════
   BUJO PARSER (NoteParser.js)
   ═════════════════════════════════════════ */
.bujo-parsed {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bujo-bullet,
.bujo-task,
.bujo-task-done,
.bujo-task-migrated,
.bujo-insight,
.bujo-plain {
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--text-primary);
  margin: 0;
}
.bujo-symbol {
  display: inline-block;
  width: 22px;
  font-size: var(--fs-sm);
  text-align: center;
  margin-right: 6px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.bujo-bullet {
  display: flex;
  align-items: baseline;
  padding-left: 8px;
}
.bujo-task {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-primary);
  padding-left: 8px;
  margin-bottom: 4px;
}
.bujo-task-done {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-decoration: line-through;
  opacity: 0.55;
  color: var(--text-faint);
  padding-left: 8px;
  margin-bottom: 4px;
}
.bujo-task-migrated {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-faint);
  font-style: italic;
  text-decoration: line-through;
  padding-left: 8px;
  margin-bottom: 4px;
}
.bujo-insight {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-left: 3px solid #ffd700;
  padding: 8px 12px;
  font-weight: 600;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 0 4px 4px 0;
  margin: 10px 0;
  color: var(--text-secondary);
}
.bujo-exclaim {
  flex-shrink: 0;
  font-size: var(--fs-sm);
}
/* Interactive checkboxes */
.bujo-box.clickable {
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}
.bujo-box.clickable:hover {
  color: var(--text-secondary);
}
.bujo-task.completed {
  color: var(--text-faint);
}
.bujo-image {
  max-width: 100%;
  border-radius: 4px;
  margin: 12px 0;
}
.bujo-file-link {
  display: inline-block;
  color: #0056b3;
  text-decoration: none;
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-tertiary);
  padding: 6px 14px;
  border-radius: 6px;
  margin: 6px 0;
  transition: background 0.15s;
}
.bujo-file-link:hover {
  background: var(--bg-hover);
  text-decoration: underline;
}
.bujo-spacer {
  height: 8px;
}
.bujo-tag {
  color: #0056b3;
  font-weight: 600;
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s;
}
.bujo-tag:hover {
  background: rgba(0, 86, 179, 0.08);
}
.bujo-wikilink {
  color: var(--text-secondary);
  text-decoration: underline;
  text-decoration-style: dotted;
  cursor: pointer;
}
.clickable-wikilink {
  color: var(--text-secondary);
  text-decoration: underline dotted;
  cursor: pointer;
  transition: background-color 0.2s;
  border-radius: 3px;
  padding: 0 2px;
}
.clickable-wikilink:hover {
  background-color: rgba(74, 44, 42, 0.1);
}
.clickable-wikilink:focus-visible {
  outline: 2px solid #4a2c2a;
  outline-offset: 1px;
}
/* Sprint 43: Invalid citation in plain-text renderer */
.citation-invalid {
  color: #991b1b;
  background: #fee2e2;
  border-radius: 3px;
  padding: 0 4px;
  font-style: italic;
  cursor: help;
  text-decoration: none;
}
/* ═════════════════════════════════════════
   DISCOVERY ENGINE (Search + Tag Cloud)
   ═════════════════════════════════════════ */
.journal-discovery {
  margin-bottom: 0;
  border-top: none;
  padding-top: 0;
  flex-shrink: 0;
}
.journal-search {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-secondary);
  font-family: 'Georgia', serif;
  font-size: var(--fs-md);
  padding: 4px 0;
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.journal-search:focus {
  border-bottom-color: var(--text-faint);
}
.journal-search::placeholder {
  color: var(--text-placeholder);
  font-style: italic;
}
/* ── Search Row: flex container for search + synthesize button ── */
.search-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
}
.search-row .journal-search {
  flex: 1;
  margin-bottom: 0;
}
.search-scope-toggle {
  display: flex;
  background: var(--bg-tertiary);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-primary);
  margin-left: 4px;
}
.scope-btn {
  padding: 5px 12px;
  border-radius: calc(var(--radius-md) - 2px);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.scope-btn:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(0,0,0,0.03);
}
.scope-btn.active {
  background: var(--bg-card);
  color: var(--accent-purple);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.scope-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.import-btn {
  margin-left: auto;
  font-size: 0.82em;
  padding: 4px 10px !important;
  border: 1px solid var(--accent-purple) !important;
  border-radius: 6px;
  color: var(--accent-purple) !important;
  background: transparent !important;
}
.import-btn:hover {
  background: rgba(139, 92, 246, 0.08) !important;
}
/* ── Weekly Insight Tracker ── */
.weekly-insight-tracker {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 4px 0;
}
.weekly-insight-tracker.tracker-ready {
  color: #4a7c59;
}
.tracker-bar {
  height: 3px;
  background: var(--border-primary);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.tracker-fill {
  height: 100%;
  background: #8b5cf6;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.tracker-ready .tracker-fill {
  background: #4a7c59;
}
/* ── Omnibar Autocomplete ── */
.autocomplete-wrapper {
  position: relative;
  flex: 1;
  display: flex;
}
.autocomplete-wrapper .journal-search {
  flex: 1;
  margin-bottom: 0;
}
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  z-index: 1000;
  list-style: none;
  margin: 0;
  padding: 4px 0;
}
.autocomplete-item {
  padding: 6px 14px;
  font-size: var(--fs-sm);
  color: var(--text);
  cursor: pointer;
  transition: background .12s;
}
.autocomplete-item:hover,
.autocomplete-item:focus {
  background: var(--accent-light, #f5ebe0);
}
.synthesize-btn {
  padding: 2px 8px;
  font-size: var(--fs-sm);
  white-space: nowrap;
  line-height: 1.2;
}
.journal-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tag-pill {
  display: inline-block;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: none;
  border-radius: 14px;
  padding: 3px 10px;
  font-size: var(--fs-xs);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.tag-pill:hover {
  background: var(--bg-hover);
}
.tag-pill--active {
  background: var(--accent-primary);
  color: #fff;
}
.tag-pill--active:hover {
  background: var(--accent-primary);
}
.tag-pill--excluded {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
}
.tag-pill-group {
  display: inline-flex;
  align-items: center;
  border-radius: 16px;
  overflow: hidden;
}
.tag-pill-group .tag-pill {
  border-radius: 14px 0 0 14px;
}
.tag-pill-exclude {
  border: none;
  border-left: 1px solid rgba(15, 23, 42, 0.08);
  background: var(--bg-tertiary);
  color: var(--text-muted);
  cursor: pointer;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 0 14px 14px 0;
}
.tag-pill-exclude:hover {
  background: #fff1f2;
  color: #9f1239;
}
.search-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.search-filter-mode,
.search-filter-chip,
.search-filter-clear {
  border: 1px solid var(--border-secondary);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  padding: 3px 9px;
  cursor: pointer;
}
.search-filter-mode {
  font-weight: 700;
  color: var(--text-primary);
}
.search-filter-chip {
  background: rgba(108, 99, 255, 0.1);
  border-color: rgba(108, 99, 255, 0.25);
}
.search-filter-chip-excluded {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
.search-filter-clear {
  background: transparent;
  color: var(--text-muted);
}
.project-panel-tools {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}
.project-panel-active-scope {
  margin-left: auto;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: 600;
}
.project-panel-search {
  flex: 1 1 150px;
  min-width: 130px;
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  padding: 5px 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: var(--fs-xs);
}
.project-panel-tool-btn {
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  padding: 5px 8px;
  cursor: pointer;
}
.project-panel-tool-btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}
.project-panel-tool-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.project-panel-scope-note {
  margin: 2px 0 6px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.35;
}
.project-panel-merge {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(108, 99, 255, 0.2);
  background: rgba(108, 99, 255, 0.07);
  border-radius: 8px;
  padding: 8px;
  margin-top: 6px;
  font-size: var(--fs-xs);
}
.project-panel-merge select {
  border: 1px solid var(--border-secondary);
  border-radius: 7px;
  padding: 5px 8px;
  background: var(--bg-card);
  color: var(--text-primary);
}
.project-panel-merge-actions {
  display: flex;
  gap: 6px;
}
.project-panel-merge p,
.project-panel-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.project-tagger {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  position: relative;
}
.project-tagger-label {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  margin-right: 2px;
}
.project-tagger-empty {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-style: italic;
  opacity: 0.75;
}
.project-tagger-add {
  border: 1px dashed var(--border-secondary);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--fs-xs);
  font-weight: 700;
  padding: 2px 8px;
}
.project-tagger-compact {
  margin-top: 8px;
}
.lit-project-assign {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.lit-project-assign select {
  border: 1px solid var(--border-secondary);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: var(--fs-xs);
  padding: 4px 8px;
  max-width: 220px;
}
/* ── History separator ── */
.journal-history {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
/* ═════════════════════════════════════════
   DAILY SPARK (Zettelkasten resurface)
   ═════════════════════════════════════════ */
.daily-spark {
  margin-top: 60px;
  padding: 24px;
  border-top: 1px solid var(--border-primary);
  text-align: center;
}
.daily-spark .spark-label {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-placeholder);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}
.daily-spark p {
  font-family: 'Georgia', serif;
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--text-faint);
  font-style: italic;
  margin: 0;
}
.daily-spark .spark-date {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-placeholder);
  margin-top: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
/* ── Mobile adjustments for new journal features ── */
@media (max-width: 768px) {
  .notebook-composer--daily textarea {
    min-height: 160px;
  }
  .journal-tag-cloud {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .journal-search {
    font-size: var(--fs-sm);
  }
  .bujo-bullet,
  .bujo-task,
  .bujo-task-done,
  .bujo-task-migrated,
  .bujo-insight,
  .bujo-plain {
    font-size: var(--fs-sm);
    line-height: 1.65;
  }
  .daily-spark {
    margin-top: 40px;
    padding: 20px 12px;
  }
}
/* ═════════════════════════════════════════
   IDENTITY ANCHOR & HELP MODAL (Cheat Sheet)
   ═════════════════════════════════════════ */
.identity-anchor {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  text-align: center;
  margin-top: 0;
  margin-bottom: var(--sp-sm);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  border-bottom: 1px solid var(--border-primary);
  padding-bottom: var(--sp-xs);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}
.help-toggle-btn {
  color: var(--text-faint);
  font-family: 'Georgia', serif;
  font-style: italic;
}
.principles-toggle-btn {
  color: #8b5cf6;
  font-family: 'Georgia', serif;
  font-weight: 700;
}
.principles-toggle-btn:hover {
  background: var(--accent-purple);
  color: #fff;
  border-color: var(--accent-purple);
  transform: scale(1.1);
}
.help-toggle-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--text-secondary);
  transform: scale(1.1);
}
.help-modal {
  position: fixed;
  bottom: 116px;
  right: max(16px, 2vw);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-primary);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 20px 24px;
  width: min(580px, 90vw);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  z-index: 1000;
  animation: helpFadeIn 0.2s ease-out;
}
@keyframes helpFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.help-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: var(--fs-xl);
  line-height: 1;
  cursor: pointer;
  color: var(--text-faint);
  transition: color 0.2s;
}
.help-close-btn:hover { color: var(--text-primary); }
.help-header {
  margin: 0 0 14px 0;
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-secondary);
}
.help-manual-modal {
  width: min(760px, 92vw);
  padding: 22px 24px 18px;
}
.help-manual-head {
  padding-right: 28px;
}
.help-kicker {
  margin: 0 0 4px;
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
}
.help-manual-head .help-header {
  margin-bottom: 6px;
  font-size: var(--fs-lg);
  color: var(--text-primary);
}
.help-subtitle {
  margin: 0 0 14px;
  color: var(--text-muted);
  line-height: 1.5;
  font-size: var(--fs-sm);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.help-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-primary);
  padding-bottom: 10px;
}
.help-mode-tabs button {
  border: 1px solid var(--border-primary);
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: var(--fs-xs);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  cursor: pointer;
}
.help-mode-tabs button.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}
.help-manual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.help-manual-section {
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  padding: 14px;
  background: rgba(250, 249, 247, 0.72);
  margin-bottom: 0;
}
.help-section-summary {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  line-height: 1.45;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.help-limit-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.help-limit-card {
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  background: rgba(250, 249, 247, 0.72);
  padding: 13px 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.help-limit-card h4 {
  margin: 0 0 6px;
  color: var(--text-primary);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.help-limit-card p {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.55;
}
.help-limit-card p:last-child {
  margin-bottom: 0;
}
.help-manual-footer {
  margin-top: 14px;
  border-top: 1px solid var(--border-primary);
  padding-top: 12px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.help-user-guide-panel .help-manual-grid {
  margin-bottom: 14px;
}
.help-user-guide-limits {
  margin-top: 2px;
}
.help-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.help-column {}
.help-section { margin-bottom: 14px; }
.help-section h4 {
  margin: 0 0 6px 0;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-faint);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.help-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.help-list li {
  font-size: var(--fs-xs);
  line-height: 1.7;
  color: var(--text-muted);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.help-list code {
  background: var(--bg-tertiary);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  font-weight: 600;
}
/* ── Mobile: stack help grid ── */
@media (max-width: 768px) {
  .help-modal {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 64px;
    max-height: 70vh;
  }
  .help-grid-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .help-manual-grid {
    grid-template-columns: 1fr;
  }
  .help-mode-tabs {
    flex-wrap: wrap;
  }
}
/* ═════════════════════════════════════════
   SLIP-BOX VIEW TOGGLE
   ═════════════════════════════════════════ */
.journal-view-toggle {
  display: flex;
  gap: 12px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-primary);
  padding-bottom: 0;
  align-items: center;
}
.journal-view-toggle button {
  background: none;
  border: none;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px 2px 6px;
  transition: color 0.2s;
}
.journal-view-toggle button.active {
  color: var(--text-primary);
  font-weight: bold;
  border-bottom: 2px solid var(--accent-primary);
}
/* Analytics & Export buttons inline with view-toggle */
.view-toggle-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
  align-items: center;
}
.view-toggle-action-btn {
  background: none;
  border: none;
  font-size: calc(var(--fs-sm) * 1.2);
  cursor: pointer;
  padding: 2px 4px;
  color: var(--text-faint);
  transition: color 0.15s;
  line-height: 1;
}
.view-toggle-action-btn:hover {
  color: #4a2080;
}
/* ═════════════════════════════════════════
   GHOST GRAPH (Unlinked Mentions)
   ═════════════════════════════════════════ */
.ghost-mention {
  border-bottom: 1px dashed var(--border-secondary);
  cursor: help;
  transition: border-color 0.2s;
}
.ghost-mention:hover {
  border-bottom-color: var(--text-faint);
}
/* ═════════════════════════════════════════
   SPOTLIGHT HIGHLIGHTING (Search)
   ═════════════════════════════════════════ */
.search-highlight {
  background-color: rgba(255, 215, 0, 0.4);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}
/* ═════════════════════════════════════════
   WIKILINK AUTO-COMPLETE DROPDOWN
   ═════════════════════════════════════════ */
.suggestion-dropdown {
  position: fixed;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
  min-width: 200px;
}
.suggestion-item {
  padding: 8px 14px;
  cursor: pointer;
  font-size: var(--fs-sm);
  font-family: 'Georgia', serif;
  color: var(--text-secondary);
  transition: background 0.15s;
}
.suggestion-item:hover {
  background: rgba(74, 44, 42, 0.08);
}
.suggestion-item:first-child {
  border-radius: 8px 8px 0 0;
}
.suggestion-item:last-child {
  border-radius: 0 0 8px 8px;
}
/* ═════════════════════════════════════════
   DEADLINE COUNTDOWN BANNER
   ═════════════════════════════════════════ */
.deadline-banner {
  text-align: center;
  padding: 8px 16px;
  background: rgba(44, 24, 16, 0.05);
  border: 1px solid rgba(44, 24, 16, 0.12);
  border-radius: 8px;
  font-size: var(--fs-base);
  color: var(--text-secondary);
  font-family: 'Georgia', serif;
  margin-bottom: 10px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.deadline-banner:hover {
  background: rgba(44, 24, 16, 0.09);
}
.deadline-edit-icon {
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: var(--fs-xs);
}
.deadline-banner:hover .deadline-edit-icon {
  opacity: 1;
}
.deadline-banner.deadline-editing {
  cursor: default;
  padding: 12px 16px;
}
.deadline-banner.deadline-add {
  opacity: 0.5;
  font-style: italic;
  border-style: dashed;
}
.deadline-banner.deadline-add:hover {
  opacity: 0.8;
}
/* Compact deadline in left panel */
.deadline-banner.deadline-compact {
  font-size: calc(var(--fs-xs) * 1.2);
  padding: 2px 8px;
  margin-bottom: 4px;
  border-radius: 6px;
  background: rgba(44, 24, 16, 0.03);
  border-color: rgba(44, 24, 16, 0.08);
  color: #4a2080;
}
.deadline-edit-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.deadline-input-name {
  flex: 1;
  min-width: 140px;
  padding: 6px 10px;
  border: 1px solid rgba(44, 24, 16, 0.2);
  border-radius: 6px;
  background: var(--bg-card);
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.deadline-input-date {
  padding: 6px 10px;
  border: 1px solid rgba(44, 24, 16, 0.2);
  border-radius: 6px;
  background: var(--bg-card);
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.deadline-edit-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.deadline-btn {
  padding: 4px 14px;
  border: none;
  border-radius: 6px;
  font-size: var(--fs-xs);
  font-family: 'Georgia', serif;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.deadline-btn:active { transform: scale(0.96); }
.deadline-btn.save {
  background: #4a7c59;
  color: #fff;
}
.deadline-btn.save:hover { background: #3a6a49; }
.deadline-btn.cancel {
  background: rgba(44, 24, 16, 0.1);
  color: var(--text-secondary);
}
.deadline-btn.cancel:hover { background: rgba(44, 24, 16, 0.18); }
.deadline-btn.remove {
  background: rgba(180, 40, 40, 0.1);
  color: #b42828;
}
.deadline-btn.remove:hover { background: rgba(180, 40, 40, 0.2); }
/* ═════════════════════════════════════════
   BACKLINKS PANEL
   ═════════════════════════════════════════ */
.backlinks-panel {
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent-primary);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 0 8px 8px 0;
}
.backlinks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.backlinks-header h4 {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-family: 'Georgia', serif;
}
.backlinks-close {
  background: none;
  border: none;
  font-size: var(--fs-lg);
  cursor: pointer;
  color: var(--text-faint);
  transition: color 0.2s;
}
.backlinks-close:hover {
  color: var(--text-primary);
}
.backlinks-empty {
  font-size: var(--fs-sm);
  color: var(--text-faint);
  font-style: italic;
}
.backlink-snippet {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border-primary);
}
.backlink-snippet:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.backlink-snippet time {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-faint);
  margin-bottom: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.backlink-snippet p {
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
}
/* ═════════════════════════════════════════
   BUJO HEADING (### lines rendered)
   ═════════════════════════════════════════ */
.bujo-heading {
  font-size: var(--fs-sm);
  font-family: 'Georgia', serif;
  margin: 12px 0 6px 0;
  color: var(--text-secondary);
}
/* ═════════════════════════════════════════
   EXPORT BUTTON (header)
   ═════════════════════════════════════════ */
.export-btn {
  background: none;
  border: none;
  font-size: var(--fs-lg);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.2s;
  margin-left: 8px;
}
.export-btn:hover { background: rgba(44, 24, 16, 0.08); }
/* ═════════════════════════════════════════
   EXPORT MODAL
   ═════════════════════════════════════════ */
.export-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.export-modal {
  background: var(--bg-card);
  padding: 28px;
  border-radius: 14px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  font-family: 'Georgia', serif;
  color: var(--text-secondary);
  max-height: 90vh;
  overflow-y: auto;
}
.export-modal h3 {
  margin: 0 0 20px 0;
  font-size: var(--fs-md);
  border-bottom: 2px solid var(--border-primary);
  padding-bottom: 12px;
}
.export-group {
  margin-bottom: 18px;
}
.export-label {
  display: block;
  font-weight: bold;
  font-size: var(--fs-sm);
  margin-bottom: 8px;
  color: var(--text-secondary);
}
.export-dates {
  display: flex;
  align-items: center;
  gap: 10px;
}
.export-dates input[type="date"] {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.export-dates span {
  color: var(--text-faint);
  font-size: var(--fs-sm);
}
.export-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.export-cat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}
.export-cat-label:hover { background: rgba(0,0,0,0.03); }
.export-cat-label input[type="checkbox"] {
  accent-color: var(--text-secondary);
  width: 16px;
  height: 16px;
}
.export-cat-self { color: #2e7d32; }
.export-cat-success { color: #1565c0; }
.export-cat-social { color: #e65100; }
.export-cat-service { color: #6a1b9a; }
.export-query {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  box-sizing: border-box;
}
.export-query::placeholder { color: var(--text-placeholder); }
.export-format-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.export-format-btn {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  background: var(--bg-card);
  font-family: 'Georgia', serif;
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
  text-align: center;
  min-width: 0;
}
.export-format-btn.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--text-secondary);
}
.export-format-btn:hover:not(.active) {
  background: rgba(44, 24, 16, 0.06);
}
.export-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 22px;
}
.export-go {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.export-go:hover { background: var(--accent-primary); }
.export-go:active { transform: scale(0.97); }
.export-cancel {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.export-cancel:hover { background: var(--bg-hover); }
.export-preview-count {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  margin-right: auto;
  align-self: center;
  font-style: italic;
}
/* ── Sprint 26B: New Project Gateway Modal ── */
.new-project-modal {
  background: var(--bg-card);
  padding: 32px;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  font-family: 'Georgia', serif;
  color: var(--text-secondary);
}
.new-project-title {
  margin: 0 0 6px 0;
  font-size: var(--fs-lg);
  color: var(--text-primary);
}
.new-project-subtitle {
  margin: 0 0 24px 0;
  font-size: var(--fs-sm);
  color: var(--text-faint);
}
.new-project-options {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.new-project-card {
  background: var(--bg-secondary, #faf8f5);
  border: 2px solid var(--border-primary, #e8e3db);
  border-radius: 12px;
  padding: 20px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
}
.new-project-card:hover {
  border-color: var(--accent-primary, #8b7355);
  box-shadow: 0 4px 16px rgba(44, 24, 16, 0.08);
  transform: translateY(-2px);
}
.new-project-card-accent {
  border-color: #d4b8ff;
  background: #faf8ff;
}
.new-project-card-accent:hover {
  border-color: #8b5cf6;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
}
.new-project-icon {
  font-size: 28px;
  display: block;
  margin-bottom: 10px;
}
.new-project-card h4 {
  margin: 0 0 8px 0;
  font-size: var(--fs-base);
  color: var(--text-primary);
}
.new-project-card p {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  line-height: 1.5;
}
.new-project-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: white;
  font-size: 9.1px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
@media (max-width: 640px) {
  .new-project-options { grid-template-columns: 1fr; }
  .new-project-modal { padding: 20px; }
}
@media (max-width: 480px) {
  .export-modal { padding: 20px; }
  .export-checkboxes { grid-template-columns: 1fr; }
  .export-format-btns { flex-direction: column; }
}
/* ═════════════════════════════════════════
   INLINE SAVE BUTTON (iMessage-style)
   ═════════════════════════════════════════ */
.notebook-composer {
  position: relative;
}
.inline-save-btn {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  font-size: calc(var(--fs-xs) * 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(44, 24, 16, 0.25);
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  margin-left: auto;
}
.inline-save-btn:hover {
  background: var(--accent-primary);
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(44, 24, 16, 0.4);
}
.inline-save-btn:active {
  transform: scale(0.9);
  background: var(--accent-primary);
}
/* ═════════════════════════════════════════
   ACTION DRAWER TOGGLE + MODE BUTTONS
   (formerly zen mode — kept for drawer/manuscript UI)
   ═════════════════════════════════════════ */
.zen-toggle-btn {
  background: none;
  border: none;
  font-size: var(--fs-md);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.2s;
  margin-left: 4px;
}
.zen-toggle-btn:hover {
  background: rgba(44, 24, 16, 0.08);
}
.mode-btn {
  background: none;
  border: 1px solid transparent;
  font-size: var(--fs-xs);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 6px;
  color: var(--text-faint);
  transition: all 0.2s;
  white-space: nowrap;
}
.mode-btn:hover {
  background: rgba(44, 24, 16, 0.06);
  color: var(--text-muted);
}
/* ═════════════════════════════════════════
   RESEARCH MODE (Desktop split-screen)
   Container-query aware panes
   ═════════════════════════════════════════ */
.notebook-container.research-mode-on {
  display: grid !important;
  max-width: 100% !important;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: 0 !important;
  transition: all 0.3s ease;
}
.research-split {
  grid-template-columns: 60fr 8px 40fr;
  gap: 0;
}
/* ── Left Pane: Writing ── */
.research-left {
  container-type: inline-size;
  container-name: left-pane;
  padding: 4px var(--sp-md) var(--sp-sm) var(--sp-md) !important;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}
.research-left.research-left-manuscript {
  padding: 0 !important;
}
.research-left .mode-toggle-row {
  margin-bottom: var(--sp-sm);
  flex-shrink: 0;
}
.research-left .notebook-composer {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: none;
  background: transparent;
  padding: 2px 0 0;
  box-shadow: none;
  margin-bottom: 0;
  min-height: 0;
  overflow: visible;
  width: 100% !important;
  max-width: 100% !important;
}
.research-left .notebook-composer textarea {
  flex: 1;
  font-family: 'Times New Roman', Times, serif !important;
  font-size: 12pt;
  line-height: 1.15;
  min-height: 0;
  color: var(--text-secondary);
  overflow-y: auto !important;
  resize: none;
  width: 100% !important;
  max-width: 100%;
}
/* Ensure controls never vanish */
.research-left .notebook-controls {
  flex-shrink: 0 !important;
  min-height: 28px;
  overflow: visible !important;
}
.research-left .notebook-composer:focus-within {
  box-shadow: none;
}
/* Container-query shrink rules for left pane */
@container left-pane (max-width: 450px) {
  .notebook-composer textarea { font-size: 10pt !important; line-height: 1.15 !important; }
  .format-toolbar button { font-size: 9.8px !important; padding: 2px 5px !important; }
  .composer-top-bar { gap: 4px !important; padding: 4px 6px !important; }
  .composer-hint { display: none !important; }
  .word-count { font-size: 9.1px !important; }
}
/* ── Right Pane: Reference ── */
.research-right {
  container-type: inline-size;
  container-name: right-pane;
  padding: 4px var(--sp-md) 0 var(--sp-md);
  overflow-y: auto;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border-primary);
}
.research-right .notebook-header {
  margin-bottom: 0;
  padding-bottom: 4px;
  border-bottom: none;
  flex-shrink: 0;
}
/* Inline header: everything on one row */
.notebook-header-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  padding: 14px 10px;
  margin: 0;
  min-height: 52px;
}
.notebook-header-inline h1 {
  margin-right: 4px;
  white-space: nowrap;
  font-size: var(--fs-lg);
  color: #4a2080;
}
.notebook-header-inline p {
  margin: 0;
  margin-right: auto;
  white-space: nowrap;
  font-size: var(--fs-base);
  color: #f5b731;
  font-weight: 700;
}
/* Deadline counter centered in the header row */
.deadline-header-center {
  flex: 1;
  text-align: center;
  font-size: var(--fs-md);
  padding: 6px 12px;
  margin: 0;
  border-radius: 6px;
  background: rgba(44, 24, 16, 0.03);
  border: 1px solid rgba(44, 24, 16, 0.08);
  cursor: pointer;
  white-space: nowrap;
}
.deadline-header-center:hover { background: rgba(44, 24, 16, 0.06); }
.deadline-header-inline {
  flex: 1;
}
/* Action drawer button matching deadline height */
.action-drawer-header {
  font-size: calc(var(--fs-sm) * 1.2) !important;
  padding: 3px 8px !important;
  flex-shrink: 0;
  align-self: center;
}
.notebook-header-inline .icon-btn,
.notebook-header-inline .zen-toggle-btn,
.notebook-header-inline .export-btn {
  font-size: var(--fs-md);
  color: #4a2080;
}
.research-right .notebook-header h1 {
  font-size: var(--fs-lg);
  color: #4a2080;
}
.research-right .notebook-entry {
  padding: var(--sp-md) 0;
}
.research-right .entry-content p {
  font-size: var(--fs-base);
  line-height: 1.7;
}
.research-right .notebook-feed {
  flex: none;
  overflow-y: visible;
  min-height: 0;
}
/* Container-query shrink rules for right pane */
@container right-pane (max-width: 400px) {
  .notebook-header h1 { font-size: 14px !important; }
  .notebook-header p { font-size: 9.1px !important; }
  .journal-search { font-size: 11.9px !important; }
  .tag-pill { font-size: 9.8px !important; padding: 3px 8px !important; }
  .notebook-entry { padding: 10px 0 !important; }
  .entry-content p { font-size: 11.9px !important; line-height: 1.6 !important; }
  .notebook-entry time { font-size: 8.4px !important; }
}
/* ═════════════════════════════════════════
   PRIORITY TASK (NoteParser)
   ═════════════════════════════════════════ */
.bujo-task-priority {
  border-left: 3px solid #e53935;
  padding-left: 12px;
  background: rgba(229, 57, 53, 0.04);
  border-radius: 0 4px 4px 0;
}
/* ═════════════════════════════════════════
   TASK PROGRESS BAR (NoteParser)
   ═════════════════════════════════════════ */
.task-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-primary);
}
.task-progress-bar {
  flex: 1;
  height: 5px;
  background: var(--bg-tertiary);
  border-radius: 3px;
  overflow: hidden;
}
.task-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4a7c59, #2e7d32);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.task-progress-label {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  white-space: nowrap;
}
/* ═════════════════════════════════════════
   DRAG-AND-DROP HIGHLIGHT
   ═════════════════════════════════════════ */
.notebook-composer.drag-over {
  border-color: var(--accent-success);
  background: rgba(74, 124, 89, 0.03);
}
/* ═════════════════════════════════════════
   MOBILE-SPECIFIC OVERRIDES
   ═════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Tighter padding on mobile */
  .notebook-composer {
    padding: 16px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    position: relative;
    flex-shrink: 0;
    max-height: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .notebook-composer textarea {
    min-height: 120px;
    overflow-y: auto; /* mobile: allow scroll instead of auto-grow */
    flex: 1;
  }

  /* Float the inline save button over the textarea bottom-right on mobile */
  .mobile-layout .inline-save-btn {
    position: absolute;
    bottom: 56px; /* above the controls row */
    right: 16px;
    z-index: 10;
    width: 40px;
    height: 40px;
    box-shadow: 0 3px 12px rgba(44, 24, 16, 0.35);
  }

  /* Simplified controls row on mobile */
  .notebook-controls {
    flex-wrap: wrap;
    gap: 8px;
  }
  .composer-hint {
    display: none;
  }

  /* Stack header row elements */
  .notebook-header-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Full-width view toggle on mobile */
  .journal-view-toggle {
    justify-content: space-around;
  }
  .journal-view-toggle button {
    font-size: var(--fs-sm);
  }

  /* Deadline banner compact */
  .deadline-banner {
    font-size: var(--fs-xs);
    padding: 6px 12px;
  }
  .deadline-edit-row {
    flex-direction: column;
    gap: 6px;
  }

  /* Hide action drawer toggle + mode buttons on mobile */
  .zen-toggle-btn {
    display: none;
  }
}
/* ═════════════════════════════════════════
   FOLDABLE SECTIONS (NoteParser heading collapse)
   ═════════════════════════════════════════ */
.foldable-section {
  margin: 0;
}
.foldable-header {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}
.foldable-header:hover {
  opacity: 0.7;
}
.fold-arrow {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  transition: transform 0.2s;
  flex-shrink: 0;
  line-height: 1;
}
.fold-arrow.collapsed {
  transform: rotate(-90deg);
}
.foldable-body {
  animation: foldOpen 0.15s ease-out;
}
@keyframes foldOpen {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 2000px; }
}
.foldable-header .bujo-heading {
  margin: 0;
}
/* ═════════════════════════════════════════
   SUB-TASK INDENTATION
   ═════════════════════════════════════════ */
.bujo-indent {
  border-left: 1px solid var(--border-primary);
  padding-left: 4px;
}
/* ═════════════════════════════════════════
   PIN BUTTON & PINNED ENTRIES
   ═════════════════════════════════════════ */
.entry-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.entry-header-row time {
  margin-bottom: 0;
}
.pin-btn {
  background: none;
  border: none;
  font-size: var(--fs-sm);
  cursor: pointer;
  opacity: 0.25;
  transition: opacity 0.2s, transform 0.15s;
  padding: 2px 4px;
}
.pin-btn:hover {
  opacity: 0.6;
  transform: scale(1.15);
}
.pin-btn.pinned {
  opacity: 1;
  color: #b7791f;
}
.entry-pinned {
  background: rgba(255, 215, 0, 0.04);
  border-left: 3px solid rgba(255, 215, 0, 0.5);
  padding-left: 16px;
  border-radius: 0 4px 4px 0;
}
/* ═════════════════════════════════════════
   WORD COUNT / READING TIME
   ═════════════════════════════════════════ */
.word-count {
  font-size: calc(var(--fs-xs) * 1.15);
  color: var(--text-placeholder);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
/* ═════════════════════════════════════════
   ENTRY ACTIONS (Edit / Delete / Copy)
   ═════════════════════════════════════════ */
.entry-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.entry-action-btn {
  background: none;
  border: none;
  font-size: var(--fs-xs);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  opacity: 0.35;
  transition: opacity 0.2s, background 0.15s, transform 0.1s;
  pointer-events: auto;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.entry-action-btn:hover {
  opacity: 1;
  background: rgba(44, 24, 16, 0.06);
}
.entry-action-btn:active {
  opacity: 1;
  transform: scale(0.92);
}
.entry-delete-btn:hover {
  background: rgba(220, 40, 40, 0.08);
}
/* ── Inline Delete Confirmation Bar ── */
.delete-confirm-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 4px 0 8px;
  background: rgba(220, 40, 40, 0.06);
  border: 1px solid rgba(220, 40, 40, 0.15);
  border-radius: 10px;
  animation: slideDown 0.2s ease-out;
}
.delete-confirm-msg {
  flex: 1;
  font-size: var(--fs-xs);
  color: #8b4040;
  font-weight: 500;
}
.delete-confirm-yes {
  background: #c62828;
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.delete-confirm-yes:hover {
  background: #b71c1c;
}
.delete-confirm-yes:active {
  transform: scale(0.95);
}
.delete-confirm-no {
  background: transparent;
  color: #8b7355;
  border: 1px solid rgba(139, 115, 85, 0.25);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.delete-confirm-no:hover {
  background: var(--bg-tertiary);
}
/* ═══════════════════════════════════════════════════════════════
   FLOATING HIGHLIGHT TOOLBAR — appears on text selection (BubbleMenu)
   ═══════════════════════════════════════════════════════════════ */
.floating-highlight-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--accent-primary);
  border-radius: 8px;
  padding: 4px 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  animation: highlightFadeIn 0.15s ease;
}
@keyframes highlightFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.floating-highlight-toolbar button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: var(--fs-xs);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  transition: background 0.15s;
}
.floating-highlight-toolbar button.is-active {
  background: rgba(255, 255, 255, 0.25);
}
.floating-highlight-toolbar button:hover {
  background: rgba(255, 255, 255, 0.15);
}
.floating-highlight-toolbar .toolbar-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.3);
  margin: 0 2px;
}
/* ═══════════════════════════════════════════════════════════════
   COMMAND MENU DROPDOWN — Notion-style / command palette
   ═══════════════════════════════════════════════════════════════ */
.command-menu-dropdown {
  position: absolute;
  z-index: 100;
  bottom: 100%;
  left: 12px;
  right: 12px;
  max-height: 280px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-primary);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 6px 0;
  animation: cmdMenuIn 0.12s ease;
}
@keyframes cmdMenuIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.command-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.1s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.command-item:hover {
  background: #f5f0eb;
}
.command-icon {
  font-size: var(--fs-sm);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.command-label {
  font-size: var(--fs-sm);
  color: var(--text-primary);
}
.command-menu-empty {
  text-align: center;
  padding: 16px;
  color: var(--text-faint);
  font-size: var(--fs-xs);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
/* ═══════════════════════════════════════════════════════════════
   DESKTOP COMPOSER-FIRST LAYOUT — prioritise the writing surface
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  /* Compact the chrome above the composer */
  .desktop-layout .identity-anchor {
    margin-bottom: 10px;
    padding-bottom: 8px;
    font-size: var(--fs-xs);
  }
  .desktop-layout .notebook-header {
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom-width: 1px;
  }
  .desktop-layout .notebook-header h1 {
    font-size: var(--fs-xl);
  }
  .desktop-layout .deadline-banner {
    margin-bottom: 10px;
    padding: 6px 14px;
    font-size: var(--fs-xs);
  }
  .desktop-layout .sticky-mit-banner {
    margin-bottom: 6px;
  }

  /* HERO COMPOSER — the main writing surface */
  .desktop-layout .notebook-composer {
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 8px;
    border-color: var(--border-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s, border-color 0.3s;
    flex-shrink: 0;
    max-height: 40vh !important; /* STRICT LIMIT: Never consume the whole screen */
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .desktop-layout .notebook-composer:focus-within {
    border-color: var(--border-secondary);
    box-shadow: 0 2px 12px rgba(44, 24, 16, 0.08);
  }
  .desktop-layout .notebook-composer textarea {
    font-family: 'Times New Roman', Times, serif;
    font-size: 12pt;
    line-height: 1.15;
    min-height: 150px;
    max-height: 100%;
    overflow-y: auto !important; /* Force internal scrolling */
    resize: none;
    flex: 1;
  }
  .desktop-layout .notebook-composer--daily textarea {
    min-height: 280px;
  }

  /* Compact the discovery/search block */
  .desktop-layout .journal-discovery {
    margin-bottom: 0;
    padding-top: 0;
    flex-shrink: 0;
  }
  .desktop-layout .journal-view-toggle {
    margin-bottom: 2px;
    padding-bottom: 2px;
  }
  .desktop-layout .journal-search {
    font-size: var(--fs-sm);
  }
  .desktop-layout .journal-tag-cloud {
    margin-top: 2px;
  }

  /* Tighten entry spacing */
  .desktop-layout .notebook-entry {
    padding: 24px 0;
  }

  /* Daily spark tighter */
  .desktop-layout .daily-spark {
    margin-top: 40px;
    padding: 20px;
  }
}
/* ═══════════════════════════════════════════════════════════════
   DESKTOP FULL-SCREEN FIX — viewport-locked, no browser scroll
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
  .notebook-container.desktop-layout {
    max-width: 100% !important;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding: 16px 28px 0;
    display: flex;
    flex-direction: column;
  }
  .desktop-layout .desktop-main {
    max-width: 1200px !important; /* Expanded from 960px to breathe */
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: visible;
  }
  .desktop-layout.ivory-right-only {
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(auto, 860px) minmax(320px, 1fr);
    flex-direction: unset;
    gap: 0;
  }
  .desktop-layout.ivory-right-only .desktop-main {
    overflow-y: auto;
  }
  .ivory-sidebar-right {
    width: 100%;
    max-width: 100%;
    overflow-y: auto;
    height: 100vh;
    height: 100dvh;
    box-sizing: border-box;
  }
}
/* ════════════════════════════════════════════
   GTD Action Drawer + ZTD Sticky MITs
   ════════════════════════════════════════════ */
/* Action Drawer Button Badge */
.action-drawer-btn {
  position: relative;
}
.action-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0 3px;
}
/* ── Sticky MIT Banner ── */
.sticky-mit-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #fdf6e3 0%, #fef9ef 100%);
  border: 1px solid #f0d87030;
  border-radius: 8px;
  padding: 8px 14px;
  margin: 0 0 8px 0;
  font-size: 13px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.mit-banner-label {
  font-weight: 700;
  color: #b8860b;
  white-space: nowrap;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.mit-banner-items {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.mit-banner-item {
  background: var(--bg-card);
  border: 1px solid #f0d87050;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 12.5px;
  color: #4a3c1a;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.mit-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #c0a050;
  padding: 0;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.mit-remove-btn:hover {
  opacity: 1;
  color: #e74c3c;
}
/* ── Action Drawer Overlay ── */
.action-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  z-index: 2000;
  display: flex;
  justify-content: flex-end;
  animation: fadeInOverlay 0.2s ease-out;
}
@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* ── Action Drawer (sliding panel) ── */
.zen-action-drawer {
  width: 380px;
  max-width: 90vw;
  height: 100%;
  background: #fafaf8;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  animation: slideInDrawer 0.25s ease-out;
  overflow: hidden;
}
@keyframes slideInDrawer {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.drawer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border-primary);
  background: var(--bg-card);
}
.drawer-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.drawer-count {
  font-size: 12px;
  color: var(--text-faint);
  margin-left: auto;
  margin-right: 8px;
}
.drawer-empty {
  text-align: center;
  color: var(--text-faint);
  padding: 40px 20px;
  font-size: 14px;
}
/* ── Drawer Task List ── */
.drawer-task-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
}
.drawer-task-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-primary);
  transition: background 0.12s;
}
.drawer-task-item:hover {
  background: #f5f5f0;
}
.drawer-task-urgent {
  border-left: 3px solid #e74c3c;
  padding-left: 17px;
}
.drawer-task-text {
  flex: 1;
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.4;
}
.drawer-task-date {
  font-size: 11px;
  color: var(--text-placeholder);
  white-space: nowrap;
}
.drawer-task-check {
  background: none;
  border: 1.5px solid #ccc;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}
.drawer-task-check:hover {
  background: #27ae60;
  color: #fff;
  border-color: #27ae60;
}
/* ── MIT Star Button ── */
.mit-star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.15s, transform 0.15s;
}
.mit-star:hover {
  opacity: 1;
  transform: scale(1.15);
}
.mit-star-active {
  opacity: 1;
}
.mit-star:disabled {
  opacity: 0.15;
  cursor: default;
}
/* ── Drawer MIT Summary Section ── */
.drawer-mit-section {
  border-top: 1px solid var(--border-primary);
  padding: 14px 20px;
  background: #fdf6e3;
}
.drawer-mit-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #b8860b;
}
.drawer-mit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  font-size: 13px;
  color: #4a3c1a;
}
/* ══════════════════════════════════════════════
   ZOOM RESILIENCE — prevent layout breakage at browser zoom
   ══════════════════════════════════════════════ */
.notebook-container,
.notebook-container.desktop-layout,
.notebook-container.research-mode-on {
  box-sizing: border-box;
}
/* Prevent fixed elements from going off-screen at high zoom */
.help-toggle-btn,
.principles-toggle-btn,
.quick-dump-fab {
  position: fixed;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  font-size: var(--fs-md);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  z-index: 1000;
  transition: all 0.2s;
}
.help-toggle-btn {
  bottom: 20px;
}
.principles-toggle-btn {
  bottom: 68px;
}
/* Sprint 44: Token balance pill — positioned above principles button */
.token-balance-pill {
  position: fixed;
  right: 14px;
  bottom: 118px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-primary);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 1000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  white-space: nowrap;
  line-height: 1;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
/* Sprint 52.1: Wallet pulse — flash green on reward claim */
.token-balance-pill.wallet-pulse {
  animation: walletPulse 0.7s ease;
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}
@keyframes walletPulse {
  0% { transform: scale(1); }
  25% { transform: scale(1.12); border-color: #10b981; box-shadow: 0 0 16px rgba(16, 185, 129, 0.5); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.quick-dump-fab {
  bottom: 152px;
}
.quick-dump-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
/* Ensure modals scale and stay visible at any zoom level */
.export-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}
.export-modal,
.analytics-modal,
.principles-modal,
.audit-modal {
  max-height: 90vh;
  max-width: 95vw;
  overflow-y: auto;
}
/* ══════════════════════════════════════════════
   PHASE 1 – Master Principles Modal
   ══════════════════════════════════════════════ */
.principles-modal {
  max-width: 640px;
  width: 90vw;
}
.principles-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e8e4dc;
}
.principles-modal-header h3 {
  margin: 0;
  font-size: var(--fs-md);
  color: #2d2a24;
}
.principles-textarea {
  width: 100%;
  min-height: 360px;
  padding: 16px 20px;
  border: none;
  outline: none;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  line-height: 1.7;
  resize: vertical;
  color: #2d2a24;
  background: #fdfcfa;
  box-sizing: border-box;
}
.principles-textarea::placeholder {
  color: #b0a898;
}
.principles-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e8e4dc;
  display: flex;
  justify-content: flex-end;
}
.principles-modal-footer .export-go.saving {
  background: #10b981;
  pointer-events: none;
}
/* ══════════════════════════════════════════════
   PHASE 4 – Analytics Dashboard Modal
   ══════════════════════════════════════════════ */
.analytics-modal {
  max-width: 1400px !important; /* Much wider for charts */
  width: 90vw !important;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
}
.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e8e4dc;
  flex-wrap: wrap;
  gap: 8px;
}
.analytics-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.analytics-title-group h3 {
  margin: 0;
  font-size: var(--fs-md);
  color: #2d2a24;
}
.analytics-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.timeframe-select {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-secondary);
  font-size: 13px;
  background: white;
  color: #2d2a24;
  cursor: pointer;
}
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); /* Auto-wrapping grid */
  gap: 30px;
  padding: 20px 0;
}
.analytics-widget {
  background: #fdfcfa;
  border: 1px solid #e8e4dc;
  border-radius: 12px;
  padding: 16px;
}
.analytics-widget.full-width {
  grid-column: 1 / -1;
}
.analytics-widget h4 {
  margin: 0 0 12px 0;
  font-size: var(--fs-sm);
  color: #6b6455;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.chart-container {
  height: 350px !important; /* Taller charts */
  width: 100%;
}
.pie-container {
  display: flex;
  align-items: center;
  gap: 20px;
}
.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
}
.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
  flex-shrink: 0;
}
/* Analytics responsive — single column on small screens */
@media (max-width: 800px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .analytics-modal {
    max-height: 90vh;
    width: 95vw;
  }
}
/* ══════════════════════════════════════════════
   REALITY ENGINE – Tab Bar & New Visualizations
   ══════════════════════════════════════════════ */
.re-tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e8e4dc;
  padding: 0 16px;
  background: #fdfcfa;
}
.re-tab {
  padding: 10px 18px;
  border: none;
  background: none;
  font-size: var(--fs-md);
  font-weight: 600;
  color: #9b9488;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.re-tab:hover { color: #6b6455; }
.re-tab.active {
  color: #8b5cf6;
  border-bottom-color: #8b5cf6;
}
.weekly-insight-tracker {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  padding: 4px 0;
  font-family: 'Georgia', serif;
}
.weekly-insight-tracker.tracker-ready {
  color: #4a7c59;
}
/* ── Momentum Heatmap ── */
.re-heatmap-container {
  padding: 8px 0;
}
.re-heatmap-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.re-heatmap-cell {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: default;
  transition: transform 0.1s;
}
.re-heatmap-cell:hover {
  transform: scale(1.2);
  z-index: 2;
}
.re-heatmap-label {
  font-size: 9px;
  color: rgba(255,255,255,0.85);
  font-weight: 600;
}
.re-heatmap-legend {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.re-heatmap-legend .legend-item {
  font-size: 12px;
}
/* ── Constellation SVG ── */
.re-constellation-container {
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.re-constellation-svg {
  width: 100%;
  height: 400px;
  max-height: 50vh;
}
/* ── Top Tags & Commands bars ── */
.re-tag-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}
.re-tag-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 3px 0;
  overflow: hidden;
}
.re-tag-item:hover .re-tag-name { color: #8b5cf6; }
.re-tag-name {
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  min-width: 80px;
  transition: color 0.15s;
}
.re-tag-bar {
  height: 6px;
  background: linear-gradient(90deg, #8b5cf6, #c4b5fd);
  border-radius: 3px;
  flex-shrink: 1;
  max-width: calc(100% - 120px);
  transition: width 0.3s ease;
}
.re-cmd-bar {
  background: linear-gradient(90deg, #10b981, #6ee7b7);
}
.re-tag-count {
  font-size: 12px;
  color: #9b9488;
  min-width: 24px;
  text-align: right;
}
/* ── Smart Brief Tab ── */
.re-brief-container {
  padding: 20px;
}
.re-brief-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.re-lens-picker {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.re-lens-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-secondary);
  border-radius: 8px;
  background: white;
  font-size: 12px;
  font-weight: 500;
  color: #6b6455;
  cursor: pointer;
  transition: all 0.15s;
}
.re-lens-btn:hover { border-color: var(--accent-purple); color: #8b5cf6; }
.re-lens-btn.active {
  background: var(--accent-purple);
  color: white;
  border-color: var(--accent-purple);
}
.re-brief-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #9b9488;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 6px;
}
.re-lens-desc {
  font-style: italic;
  color: #b0a896;
}
.re-brief-output {
  background: #fdfcfa;
  border: 1px solid #e8e4dc;
  border-radius: 12px;
  padding: 20px;
  min-height: 200px;
  max-height: 50vh;
  overflow-y: auto;
}
.re-brief-text {
  line-height: 1.7;
  font-size: var(--fs-sm);
  color: #3b3a36;
}
.re-brief-text h2 {
  font-size: var(--fs-md);
  color: #2d2a24;
  margin: 18px 0 8px 0;
  border-bottom: 1px solid #e8e4dc;
  padding-bottom: 4px;
}
.re-brief-text h3 {
  font-size: var(--fs-base);
  color: #4b5563;
  margin: 14px 0 6px 0;
}
.re-brief-text h4 {
  font-size: var(--fs-sm);
  color: #6b6455;
  margin: 10px 0 4px 0;
}
.re-brief-text p {
  margin: 4px 0;
}
.re-brief-text li {
  margin-left: 20px;
  margin-bottom: 3px;
}
.re-brief-placeholder {
  color: #9b9488;
  text-align: center;
  padding: 30px 20px;
}
.re-brief-placeholder ul {
  text-align: left;
  max-width: 420px;
  margin: 16px auto 0;
  list-style: none;
  padding: 0;
}
.re-brief-placeholder li {
  padding: 6px 0;
  border-bottom: 1px solid #f0ece4;
  font-size: 13px;
}
.re-brief-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}
/* ══════════════════════════════════════════════
   PHASE 5 – Reviewer Card (full overlay modal matching lit modal)
   ══════════════════════════════════════════════ */
.reviewer-card-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reviewer-card {
  position: relative;
  max-width: 850px;
  width: 90vw;
  max-height: 85vh;
  background: white;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: "Times New Roman", Times, serif;
  font-size: 16.1px;
  text-align: justify;
  padding: 30px;
  animation: litModalIn 0.25s ease;
}
.reviewer-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid #e8e4dc;
}
.reviewer-card-header h4 {
  margin: 0;
  font-size: 18.2px;
  color: #2d2a24;
  font-family: "Times New Roman", Times, serif;
}
/* Sprint 42: Critique mode badge — academic labels only */
.rc-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 10.08px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  letter-spacing: 0.03em;
  vertical-align: middle;
  white-space: nowrap;
}
.rc-badge--red      { background: #fee2e2; color: #991b1b; }
.rc-badge--blue     { background: #dbeafe; color: #1e40af; }
.rc-badge--green    { background: #dcfce7; color: #166534; }
.rc-badge--amber    { background: #fef3c7; color: #92400e; }
.rc-badge--purple   { background: #ede9fe; color: #5b21b6; }
.reviewer-card-body {
  padding: 20px 0;
  overflow-y: auto;
  flex: 1;
  font-size: 16.1px;
  line-height: 1.75;
  color: #3b3a36;
  font-family: "Times New Roman", Times, serif;
}
.reviewer-card-body p {
  margin: 0 0 8px 0;
}
.reviewer-card-footer {
  padding-top: 14px;
  border-top: 1px solid #e8e4dc;
  font-size: 11.9px;
  color: #9b9488;
  text-align: center;
}
/* ── Streaming Typing Cursor ── */
.typing-cursor {
  display: inline-block;
  color: #3b82f6;
  font-weight: bold;
  animation: blink 0.7s step-end infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
/* ══════════════════════════════════════════════
   PHASE 6 – Nexus Side Panel
   ══════════════════════════════════════════════ */
.nexus-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  background: white;
  box-shadow: -6px 0 24px rgba(0,0,0,0.12);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.nexus-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e8e4dc;
  background: #f8f7f4;
}
.nexus-header h3 {
  margin: 0;
  font-size: var(--fs-md);
  color: #2d2a24;
}
.nexus-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.nexus-spinner {
  text-align: center;
  padding: 40px 0;
  color: #8b5cf6;
  font-style: italic;
}
.nexus-section {
  margin-bottom: 24px;
}
.nexus-section h4 {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b6455;
  margin: 0 0 8px 0;
}
.nexus-section p {
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: #3b3a36;
  margin: 0;
}
.link-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.suggested-link {
  display: inline-block;
  background: #ede9fe;
  color: #7c3aed;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.suggested-link:hover {
  background: #ddd6fe;
}
/* ══════════════════════════════════════════════
   PHASE 6 – Audit Modal
   ══════════════════════════════════════════════ */
.audit-modal {
  max-width: 640px;
  width: 90vw;
}
.audit-results {
  padding: 20px;
  min-height: 120px;
  max-height: 50vh;
  overflow-y: auto;
  color: #3b3a36;
}
.audit-results-content {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: var(--fs-base);
}
/* ══════════════════════════════════════════════
   PHASE 5 – AI Scalpel Toolbar
   ══════════════════════════════════════════════ */
.ai-scalpel-toolbar button {
  font-size: 14px;
}
.ai-scalpel-toolbar button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ai-spinner {
  font-size: 13px;
  color: #8b5cf6;
  font-style: italic;
  padding: 4px 0;
}
/* ══════════════════════════════════════════════
   PHASE 3/6 – Drawer Upgrades (Slice, Audit, Sections)
   ══════════════════════════════════════════════ */
.audit-btn {
  background: none;
  border: 1px solid var(--border-secondary);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  color: #6b6455;
  transition: all 0.15s;
}
.audit-btn:hover {
  background: #ece9e1;
}
.slice-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.slice-btn:hover {
  opacity: 1;
}
.nexus-trigger-btn {
  background: none;
  border: 1px solid #ddd6fe;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  cursor: pointer;
  color: #7c3aed;
  transition: all 0.15s;
  margin-left: auto;
}
.nexus-trigger-btn:hover {
  background: #ede9fe;
}
.drawer-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e8e4dc;
}
.drawer-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9b9488;
  margin: 0 0 6px 0;
  font-weight: 600;
}
.drawer-task-deferred {
  opacity: 0.5;
  font-style: italic;
}
.error-text {
  color: #ef4444;
  font-size: var(--fs-sm);
}
/* ══════════════════════════════════════════════
   Responsive – Analytics & Nexus
   ══════════════════════════════════════════════ */
@media (max-width: 700px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .analytics-modal {
    width: 98vw;
    max-height: 90vh;
  }
  .nexus-panel {
    width: 100vw;
  }
  .reviewer-card {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: 16px;
  }
  .pie-container {
    flex-direction: column;
  }
}
/* ══════════════════════════════════════════════
   MARKDOWN FORMATTING TOOLBAR & COMPOSER TOP BAR
   ══════════════════════════════════════════════ */
.composer-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f7f4;
  border-bottom: 1px solid #e8e4dc;
  padding: 4px 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.format-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
}
/* Sprint 52: Utility controls (Sort, Font size) — right-aligned cluster */
.utility-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.utility-controls button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: 'Georgia', serif;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.utility-controls button:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.format-toolbar button {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: 'Georgia', serif;
  font-size: 14px;
  transition: background 0.15s, color 0.15s;
}
.format-toolbar button:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}
.format-toolbar button.is-active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}
.toolbar-divider {
  width: 1px;
  height: 16px;
  background: #d1cdc5;
  margin: 0 4px;
}
/* ── Font Size Controls ── */
.font-size-btn {
  font-family: 'Georgia', serif !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: -0.5px;
}
.font-size-label {
  font-size: 11px;
  color: var(--text-faint);
  min-width: 20px;
  text-align: center;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
  user-select: none;
}
/* ── Sort Select (Discovery) ── */
.sort-select {
  background: transparent;
  border: 1px solid var(--border-secondary);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 10.5px;
  padding: 3px 6px;
  cursor: pointer;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.sort-select:hover,
.sort-select:focus {
  border-color: #8b7355;
  color: var(--text-secondary);
}
/* ═════════════════════════════════════════
   LITERATURE BROWSER
   ═════════════════════════════════════════ */
.lit-browser {
  padding: 0;
  animation: fadeIn 0.2s ease;
}
/* ── Literature Sort Bar ── */
.lit-sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  margin-top: 0;
}
.lit-sort-label {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.lit-sort-pills {
  display: flex;
  background: #f5f4f1;
  border-radius: 6px;
  padding: 3px;
}
.lit-sort-btn {
  background: transparent;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: var(--fs-xs);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
}
.lit-sort-btn.active {
  background: var(--bg-card);
  color: #111;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
/* ── Search row ── */
.lit-search-row {
  position: relative;
  margin-bottom: 16px;
}
.lit-panel-search-row {
  position: relative;
  margin-bottom: 10px;
}
.lit-search {
  width: 100%;
  box-sizing: border-box;
}
.lit-clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: var(--fs-lg);
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.lit-clear-search:hover {
  color: var(--text-primary);
}
/* ── Card list ── */
.lit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lit-card {
  background: var(--bg-card);
  border: 1px solid #e8e4dc;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.lit-card:hover {
  border-color: #c4b5a0;
  box-shadow: 0 2px 12px rgba(44, 24, 16, 0.06);
  transform: translateY(-1px);
}
.lit-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2px;
}
.lit-card-ref {
  font-family: 'Georgia', serif;
  font-size: var(--fs-xs);
  color: #8b5cf6;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.lit-card-title {
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  margin: 0 0 2px 0;
  line-height: 1.3;
  font-weight: 600;
}
.lit-card-keywords {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  margin: 0;
  font-style: italic;
}
.lit-card-snippet {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}
/* ── Sprint 26A: Literature Review Synthesizer ── */
.lit-card-selected {
  border-color: #8b5cf6;
  background: #faf8ff;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.15);
}
.lit-card-checkbox {
  accent-color: #8b5cf6;
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.lit-synth-panel {
  background: #faf8ff;
  border: 1px solid #e0d4f5;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lit-synth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: #6d28d9;
  font-weight: 600;
}
.lit-synth-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.lit-synth-thesis {
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  border: 1px solid #e0d4f5;
  border-radius: 6px;
  padding: 8px 12px;
  resize: vertical;
  background: var(--bg-card);
  color: var(--text-primary);
  line-height: 1.5;
}
.lit-synth-thesis::placeholder {
  color: var(--text-faint);
  font-style: italic;
}
.lit-synth-result {
  background: var(--bg-card);
  border: 1px solid #e0d4f5;
  border-radius: 8px;
  overflow: hidden;
}
.lit-synth-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f5f0ff;
  border-bottom: 1px solid #e0d4f5;
  font-size: var(--fs-sm);
  color: #6d28d9;
}
.lit-synth-result-body {
  padding: 14px 16px;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  line-height: 1.7;
  max-height: 400px;
  overflow-y: auto;
}
.lit-synth-result-body .bujo-parsed,
.lit-synth-modal-body .bujo-parsed {
  background: #fffdf8;
  border: 1px solid #ebe2d6;
  border-radius: 8px;
  color: #29231c;
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.78;
  padding: 18px 20px;
}
.lit-synth-result-body .bujo-parsed {
  max-height: 320px;
  overflow: hidden;
}
.lit-synth-result-body .bujo-heading,
.lit-synth-modal-body .bujo-heading {
  color: #22170f;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0.85em 0 0.35em;
}
.lit-synth-result-body .bujo-heading:first-child,
.lit-synth-modal-body .bujo-heading:first-child {
  margin-top: 0;
}
.lit-synth-result-body .bujo-heading-1,
.lit-synth-modal-body .bujo-heading-1 {
  font-size: 18.9px;
}
.lit-synth-result-body .bujo-heading-2,
.lit-synth-modal-body .bujo-heading-2 {
  font-size: 15.68px;
}
.lit-synth-result-body .bujo-plain,
.lit-synth-modal-body .bujo-plain {
  margin: 0 0 0.7em;
}
.lit-synth-result-body .bujo-wikilink,
.lit-synth-modal-body .bujo-wikilink {
  white-space: nowrap;
}
.lit-synth-modal {
  max-width: min(920px, 92vw);
  width: 920px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.lit-synth-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e4dc;
}
.lit-synth-modal-header h3 {
  margin: 0;
}
.lit-synth-modal-header p {
  margin: 4px 0 0;
  color: var(--text-faint);
  font-size: var(--fs-sm);
}
.lit-synth-modal-body {
  flex: 1;
  overflow-y: auto;
  line-height: 1.72;
  padding: 16px 4px;
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
}
.lit-synth-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #e8e4dc;
}
/* ── Detail view ── */
.lit-detail {
  animation: fadeIn 0.2s ease;
}
.lit-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e4dc;
}
.lit-back-btn {
  background: none;
  border: none;
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: #8b5cf6;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s;
}
.lit-back-btn:hover {
  color: #6d28d9;
}
.lit-detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.lit-detail-title {
  font-family: 'Georgia', serif;
  font-size: var(--fs-lg);
  color: #8b5cf6;
  margin: 0 0 20px 0;
  font-weight: 700;
}
.lit-detail-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lit-field-label {
  font-family: 'Georgia', serif;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lit-field-value {
  font-size: var(--fs-sm);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: 6px;
  border: 1px solid transparent;
  white-space: pre-wrap;
}
.lit-field-empty {
  color: var(--text-placeholder);
  font-style: italic;
}
.lit-field-edit {
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  line-height: 1.6;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid #c4b5a0;
  border-radius: 6px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.lit-field-edit:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.1);
}
/* ── Lit Note Quick-Edit Popup (right panel) ── */
.lit-popup-panel {
  background: var(--bg-secondary);
  border: 1px solid #e0dbd5;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  max-height: 60vh;
  overflow-y: auto;
}
.lit-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px solid #e8e4dc;
  padding-bottom: 8px;
}
.lit-popup-header h4 {
  margin: 0;
  font-size: var(--fs-base);
  color: var(--text-secondary);
  font-family: 'Georgia', serif;
}
.lit-popup-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.lit-popup-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lit-popup-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.lit-popup-field .lit-field-label {
  font-size: var(--fs-xs);
}
.lit-popup-field .lit-field-value {
  font-size: var(--fs-sm);
  padding: 2px 0;
}
.lit-popup-field .lit-field-edit {
  font-size: var(--fs-sm);
  padding: 4px 8px;
  min-height: unset;
}
/* ── Citing entries section ── */
.lit-citing-entries {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e8e4dc;
}
.lit-citing-entries h4 {
  font-family: 'Georgia', serif;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0 0 12px 0;
}
.lit-citing-entries .backlink-snippet {
  cursor: pointer;
  transition: background 0.2s;
  padding: 8px 12px;
  border-radius: 6px;
}
.lit-citing-entries .backlink-snippet:hover {
  background: #f5f0ea;
}
/* ── Mobile responsiveness for lit browser ── */
@media (max-width: 768px) {
  .lit-card {
    padding: 12px 14px;
  }

  .lit-detail-title {
    font-size: var(--fs-md);
  }

  .lit-field-edit {
    font-size: var(--fs-sm);
  }

  .lit-detail-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
/* ══════════════════════════════════════════
   MOBILE TAB SWITCHER (Write / Browse)
   ══════════════════════════════════════════ */
.mobile-tab-switcher {
  display: none;
}
/* ══════════════════════════════════════════
   MOBILE AI BAR (runs on full note)
   ══════════════════════════════════════════ */
.mobile-ai-bar {
  display: none;
}
/* ══════════════════════════════════════════
   MOBILE SUBMIT ROW (center bottom)
   ══════════════════════════════════════════ */
.mobile-submit-row {
  display: none;
}
@media (max-width: 768px) {
  .mobile-tab-switcher {
    display: flex;
    gap: 0;
    margin: 4px 0 8px;
    border: 1px solid #d6cfc5;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f0eb;
  }
  .mobile-tab-btn {
    flex: 1;
    padding: 8px 0;
    font-size: 11.9px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: #8b8478;
    cursor: pointer;
    transition: all 0.2s;
  }
  .mobile-tab-btn.mobile-tab-active {
    background: var(--bg-card);
    color: #2c2825;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  }

  /* ── Mobile AI Action Bar ── */
  .mobile-ai-bar {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    background: #f9f7f5;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    margin: 4px 0;
    justify-content: center;
    flex-wrap: wrap;
  }
  .mobile-ai-bar button {
    background: var(--bg-card);
    border: 1px solid #d6cfc5;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11.2px;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-secondary);
  }
  .mobile-ai-bar button:hover {
    background: #f0ebe5;
  }
  .mobile-ai-bar button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  /* ── Mobile Submit Row ── */
  .mobile-submit-row {
    display: flex;
    justify-content: center;
    padding: 8px 0 16px;
  }
  .mobile-submit-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 24px;
    font-size: 12.6px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(44, 24, 16, 0.3);
    transition: all 0.15s;
  }
  .mobile-submit-btn:hover {
    background: var(--accent-primary);
    transform: scale(1.02);
  }
  .mobile-submit-btn:active {
    transform: scale(0.96);
  }

  /* ── Mobile Lit Popup Bottom Sheet ── */
  .lit-popup-bottom-sheet {
    max-height: 80vh;
    overflow-y: auto;
  }
  .lit-popup-bottom-sheet .lit-popup-header {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-primary);
  }
  .lit-popup-bottom-sheet .lit-popup-body {
    padding-top: 8px;
  }
}
/* ══════════════════════════════════════════
   MOBILE COMPACT HEADER (1-line)
   ══════════════════════════════════════════ */
@media (max-width: 768px) {
  .mobile-anchor {
    font-size: 8.4px !important;
    letter-spacing: 1.5px !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    border: none !important;
    opacity: 0.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary) !important;
  }
  .mobile-header-compact {
    padding: 4px 0 !important;
    margin: 0 !important;
  }
  .mobile-header-compact h1 {
    font-size: 14px !important;
    margin: 0 !important;
    color: var(--text-primary) !important;
  }
  .mobile-header-line {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .mobile-header-line p {
    font-size: 10.5px !important;
    margin: 0 !important;
    color: #9b9488;
  }
  .mobile-header-line .save-indicator {
    font-size: 9.8px !important;
  }
  .mobile-header-line .icon-btn,
  .mobile-header-line .action-drawer-btn {
    font-size: 11.9px !important;
    padding: 2px !important;
  }

  /* ── Hide export button on mobile ── */
  .mobile-layout .export-btn {
    display: none !important;
  }

  /* ── Hide deadline on mobile ── */
  .mobile-layout .deadline-banner {
    display: none !important;
  }

  /* ── Composer compaction ── */
  .mobile-layout .composer-top-bar {
    flex-wrap: nowrap !important;
    gap: 4px !important;
    padding: 4px 8px !important;
  }
  .mobile-layout .format-toolbar button {
    font-size: 10.5px !important;
    padding: 3px 6px !important;
    min-width: unset !important;
  }

  /* ── Textarea: TNR 12pt, 16 lines × 40 chars ── */
  .mobile-layout .notebook-composer textarea {
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 12pt !important;
    line-height: 1.15 !important;
    min-height: calc(16 * 12pt * 1.15) !important;
    max-height: none !important;
    flex: 1 !important;
    overflow-y: auto !important;
  }

  /* ── Controls row: shrink attach, hide word count, reposition submit ── */
  .mobile-layout .attach-btn {
    font-size: 10.5px !important;
    padding: 3px 8px !important;
  }
  .mobile-layout .word-count {
    display: none !important;
  }
  .mobile-layout .composer-hint {
    display: none !important;
  }
  .mobile-layout .notebook-controls {
    flex-wrap: nowrap !important;
    gap: 4px !important;
  }
  .mobile-layout .inline-save-btn {
    display: none !important;
  }
}
/* ══════════════════════════════════════════
   DRAGGABLE SPLIT DIVIDER (Desktop Research)
   ══════════════════════════════════════════ */
.split-divider {
  width: 8px;
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  margin: 0 -4px;
}
.split-divider:hover .split-divider-line,
.split-divider:active .split-divider-line {
  background: var(--accent-purple);
  width: 3px;
}
.split-divider-line {
  width: 2px;
  height: 60px;
  background: #d6cfc5;
  border-radius: 2px;
  transition: all 0.15s;
}
/* ══════════════════════════════════════════
   RESEARCH LEFT HEADER (Desktop)
   ══════════════════════════════════════════ */
.research-left-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 2px;
  gap: 2px;
  padding: 2px 0;
}
.research-left-header .identity-anchor {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  font-size: clamp(9.1px, 2cqi, 11.9px);
  color: #4a2080;
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  text-align: center;
  line-height: 1.4;
  font-weight: 700;
}
/* Row 2: toolbars left, mode icons right */
.research-left-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.research-left-toolbars {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.format-toolbar--header {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}
.format-toolbar--header button {
  background: none;
  border: none;
  font-size: calc(var(--fs-xs) * 1.2);
  cursor: pointer;
  color: var(--text-faint);
  padding: 3px 6px;
  border-radius: 3px;
  transition: background 0.15s;
}
.format-toolbar--header button:hover { background: rgba(44,24,16,0.06); }
.research-left-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.mode-btn-icon {
  font-size: calc(var(--fs-sm) * 1.2) !important;
  padding: 3px 7px !important;
  line-height: 1;
}
.mode-btn-icon:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.research-left-controls .save-indicator {
  font-size: calc(var(--fs-xs) * 0.9);
  color: #4a2080;
  white-space: nowrap;
}
/* ── Research split: use CSS grid with dynamic columns (inline style overrides) ── */
.research-split {
  display: grid !important;
  gap: 0 !important;
  align-items: start;
}
/* =========================================
   COMPACT NOTE CARDS (Timeline Trays)
   ========================================= */
.note-tray-collapsed {
  cursor: pointer;
  padding: 12px 16px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-color, #e8e4dc);
  border-radius: 8px;
  margin-bottom: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.note-tray-collapsed:hover {
  border-color: var(--accent-primary, #8b5cf6);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.05));
  transform: translateY(-1px);
}
.note-tray-snippet {
  font-size: 14.7px;
  color: var(--text-secondary, #555);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
  margin-bottom: 8px;
}
.note-tray-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.note-tray-tags .tag-pill {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 12px;
  background: var(--bg-tag, #f3f0eb);
  color: var(--text-secondary, #6b6455);
  cursor: pointer;
  transition: background 0.15s ease;
}
.note-tray-tags .tag-pill:hover {
  background: var(--accent-primary, #8b5cf6);
  color: #fff;
}
/* When expanded, mark with accent border */
.notebook-entry.is-expanded {
  border-left: 3px solid var(--accent-primary, #8b5cf6);
  padding-left: 13px;
}
/* ══════════════════════════════════════════════
   TRUE MODAL: Literature Detail / Edit Popup
   Times New Roman, 1.2x scale, justify
   ══════════════════════════════════════════════ */
.lit-modal-overlay {
  z-index: 9999 !important;
}
.lit-modal {
  max-width: 850px !important;
  width: 90vw !important;
  max-height: 85vh !important;
  display: flex !important;
  flex-direction: column !important;
  font-family: "Times New Roman", Times, serif !important;
  font-size: 16.1px !important;
  text-align: justify !important;
  padding: 30px !important;
  border-radius: 12px !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3) !important;
  animation: litModalIn 0.25s ease;
}
@keyframes litModalIn {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.lit-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid var(--border-primary, #e8e4dc);
  padding-bottom: 15px;
  margin-bottom: 20px;
}
.lit-modal-title {
  margin: 0;
  font-size: 19.6px;
  color: var(--accent-primary, #8b5cf6);
  text-align: left;
  font-family: "Times New Roman", Times, serif;
}
.lit-modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}
.lit-modal-save-btn {
  background: var(--color-success, #10b981);
  color: #fff;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: background 0.15s;
}
.lit-modal-save-btn:hover { background: #059669; }
.lit-modal-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.lit-modal-cancel-btn,
.lit-modal-edit-btn {
  background: var(--bg-hover, #f0eee8);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary, #2d2a24);
  transition: background 0.15s;
}
.lit-modal-cancel-btn:hover,
.lit-modal-edit-btn:hover {
  background: var(--border-primary, #e8e4dc);
}
.lit-modal-close-btn {
  background: none;
  border: none;
  font-size: 21px;
  cursor: pointer;
  color: var(--text-muted, #9b9488);
  margin-left: 10px;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.lit-modal-close-btn:hover { color: var(--text-primary); }
.lit-modal-body {
  overflow-y: auto;
  padding-right: 15px;
  flex: 1;
}
.lit-modal-field {
  margin-bottom: 20px;
}
.lit-modal-field-label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--text-secondary, #6b6860);
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  text-align: left;
}
.lit-modal-field-edit {
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--accent-primary, #8b5cf6);
  background: var(--bg-main, #faf9f6);
  color: var(--text-primary, #2d2a24);
  resize: vertical;
  font-family: "Times New Roman", Times, serif;
  font-size: 16.1px;
  line-height: 1.6;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.lit-modal-field-edit:focus {
  outline: none;
  border-color: var(--accent-secondary, #7c3aed);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.lit-modal-field-value {
  line-height: 1.6;
  color: var(--text-primary, #2d2a24);
  font-family: "Times New Roman", Times, serif;
  font-size: 16.1px;
}
/* ── AI Thinking Indicator (Normal Mode) ── */
.ai-thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border-radius: 12px;
  font-size: 11.2px;
  font-weight: 600;
  animation: aiThinkPulse 1.5s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes aiThinkPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
/* ── Mobile responsive for lit modal ── */
@media (max-width: 768px) {
  .lit-modal {
    max-width: 100vw !important;
    width: 96vw !important;
    max-height: 92vh !important;
    padding: 18px !important;
    font-size: 14px !important;
    border-radius: 10px !important;
  }
  .lit-modal-title {
    font-size: 16.8px;
  }
  .lit-modal-field-edit {
    font-size: 14px;
    padding: 10px;
  }
  .lit-modal-field-value {
    font-size: 14px;
  }
}
/* ══════════════════════════════════════════
   TIME SLICER (Pomodoro/Deep Work)
   ══════════════════════════════════════════ */
/* ── Sticky Focus Banner ── */
.focus-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-bottom: 2px solid #e94560;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  animation: focusBannerSlide 0.3s ease-out;
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.3);
}
.focus-banner-timer {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 28px;
  font-weight: 700;
  color: #e94560;
  letter-spacing: 2px;
  min-width: 100px;
  text-align: center;
}
.focus-banner-task {
  color: rgba(255, 255, 255, 0.85);
  font-size: 13.3px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.focus-banner-actions {
  display: flex;
  gap: 8px;
}
.focus-btn {
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  font-size: 11.9px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.focus-btn-pause {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}
.focus-btn-pause:hover {
  background: rgba(255, 255, 255, 0.25);
}
.focus-btn-finish {
  background: #e94560;
  color: #fff;
}
.focus-btn-finish:hover {
  background: #d63851;
}
@keyframes focusBannerSlide {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
/* ── Focus Log Modal ── */
.focus-log-modal {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.focus-log-modal > div {
  background: #1e1e2e;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.focus-log-title {
  font-size: 15.4px;
  font-weight: 600;
  color: #e94560;
  margin-bottom: 4px;
}
.focus-log-task {
  font-size: 11.9px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 14px;
}
.focus-log-textarea {
  width: 100%;
  min-height: 120px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  font-size: 13.3px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 14px;
}
.focus-log-textarea:focus {
  outline: none;
  border-color: #e94560;
}
.focus-log-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.focus-log-cancel {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 11.9px;
}
.focus-log-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
}
.focus-log-save {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  background: #e94560;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: 11.9px;
}
.focus-log-save:hover {
  background: #d63851;
}
/* ── Mobile responsive for focus banner ── */
@media (max-width: 768px) {
  .focus-banner {
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px;
  }
  .focus-banner-timer {
    font-size: 22.4px;
  }
  .focus-banner-task {
    max-width: 90vw;
    font-size: 11.9px;
  }
}
/* ══════════════════════════════════════════
   MANUSCRIPT EDITOR — Isolated 3-Pane Layout
   Phase 4: Manuscript Mode
   Sprint 25: Harmonised with JournalApp.css token system
   ══════════════════════════════════════════ */

/* ── Full-screen overlay ── */
.manuscript-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-secondary, #faf8f5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: msSlideIn 0.3s ease;
}

@keyframes msSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Top Bar ── */
.manuscript-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  background: var(--bg-secondary, #faf8f5);
  gap: 14px;
  flex-shrink: 0;
  min-height: 48px;
}

.manuscript-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.manuscript-close-btn {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: var(--radius-md, 8px);
  padding: 6px 14px;
  color: var(--text-secondary, #4a3f35);
  cursor: pointer;
  font-size: 0.82rem;
  white-space: nowrap;
  transition: all 0.2s;
  font-weight: 500;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.manuscript-close-btn:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
  border-color: var(--accent-primary, #8b7355);
  box-shadow: var(--shadow-md, 0 2px 8px rgba(0,0,0,0.10));
}

.manuscript-title-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 1.15rem;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: 600;
  color: var(--text-primary, #2c1810);
  padding: 4px 0;
  flex: 1;
  min-width: 0;
  outline: none;
  transition: border-color 0.2s;
}

.manuscript-title-input:focus {
  border-bottom-color: #8b7355;
}

.manuscript-topbar-center {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.manuscript-wordcount {
  font-size: 0.82rem;
  color: var(--text-faint, #888);
  font-family: 'SF Mono', 'Cascadia Code', monospace;
}

.manuscript-save-status {
  font-size: 0.72rem;
  font-weight: 500;
}

.manuscript-save-status.saved { color: #22c55e; }
.manuscript-save-status.saving { color: #f59e0b; }
.manuscript-save-status.error { color: #ef4444; }
.manuscript-save-status.editing { color: var(--text-faint, #888); }

.manuscript-topbar-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.ms-toolbar-btn {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid transparent;
  color: var(--text-secondary, #4a3f35);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: 'Georgia', serif;
  font-size: 13px;
  transition: all 0.15s;
}

.ms-toolbar-btn:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
  border-color: var(--border-secondary, #d1cdc5);
}

.ms-toolbar-btn.active {
  background: var(--bg-hover, #ebe6df);
  border-color: var(--border-accent, #8b7355);
  color: var(--text-primary, #2c1810);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.ms-toolbar-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ms-font-label {
  font-size: 11px;
  color: var(--text-faint, #888);
  min-width: 20px;
  text-align: center;
  font-family: 'SF Mono', 'Cascadia Code', monospace;
}

.ms-toolbar-divider {
  width: 1px;
  height: 18px;
  background: #d1cdc5;
  margin: 0 4px;
}

/* ── 3-Pane Body ── */
.manuscript-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ── Left Pane: ToC ── */
.manuscript-toc {
  width: 220px;
  min-width: 180px;
  border-right: 1px solid var(--border-primary, #e8e3db);
  padding: 16px 14px;
  overflow-y: auto;
  flex-shrink: 0;
  background: var(--bg-tertiary, #f7f3ee);
}

.toc-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary, #4a3f35);
  margin: 0 0 14px 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.toc-empty {
  font-size: 0.82rem;
  color: var(--text-faint, #999);
  font-style: italic;
  line-height: 1.6;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  line-height: 1.4;
  transition: all 0.15s;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toc-item:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
}

.toc-level-1 { font-weight: 600; padding-left: 10px; }
.toc-level-2 { padding-left: 22px; }
.toc-level-3 { padding-left: 34px; font-size: 0.82rem; }
.toc-level-4 { padding-left: 46px; font-size: 0.72rem; color: var(--text-faint, #888); }

.toc-stats {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--border-primary, #e8e3db);
}

.toc-stat {
  font-size: 0.72rem;
  color: var(--text-faint, #999);
  margin-bottom: 4px;
}

/* ── Center Pane: Editor ── */
.manuscript-editor-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
}

.manuscript-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 32px 48px;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-primary, #2c1810);
  background: var(--bg-secondary, #faf8f5);
  overflow-y: auto;
  tab-size: 4;
}

.manuscript-textarea::placeholder {
  color: var(--text-placeholder, #c0b8a8);
  font-style: italic;
}

.manuscript-textarea:focus {
  background: #fffdf9;
}

.manuscript-graveyard-float {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: #f5f1ec;
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  color: var(--text-faint, #888);
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.6;
}

.manuscript-graveyard-float:hover {
  opacity: 1;
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
  border-color: var(--border-accent, #8b7355);
}

/* ── Right Pane: Graveyard + AI ── */
.manuscript-right-pane {
  width: 300px;
  min-width: 240px;
  border-left: 1px solid var(--border-primary, #e8e3db);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-tertiary, #f7f3ee);
}

/* ── AI Result Card ── */
.manuscript-ai-result {
  padding: 12px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  max-height: 40%;
  overflow-y: auto;
}

.ai-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ai-result-header h4 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-primary, #2c1810);
}

.ai-result-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-faint, #888);
  padding: 2px 6px;
}

.ai-result-close:hover { color: #ef4444; }

.ai-result-body p {
  font-size: 0.82rem;
  color: var(--text-muted, #555);
  line-height: 1.5;
  margin: 4px 0;
}

.ai-result-insert {
  margin-top: 8px;
  background: #2c1810;
  color: #faf8f5;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s;
}

.ai-result-insert:hover {
  background: #8b7355;
}

/* ── Graveyard ── */
.manuscript-graveyard {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.graveyard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  background: var(--bg-tertiary, #f3efe9);
}

.graveyard-header h4 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary, #4a3f35);
  font-weight: 700;
}

.graveyard-count {
  font-size: 0.72rem;
  color: var(--text-faint, #999);
  font-weight: 400;
  margin-left: 6px;
}

.graveyard-restore-btn {
  background: transparent;
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--text-muted, #555);
  cursor: pointer;
  transition: all 0.15s;
}

.graveyard-restore-btn:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
}

.graveyard-textarea {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 12px;
  font-family: 'Georgia', serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-faint, #888);
  background: transparent;
  overflow-y: auto;
}

.graveyard-textarea::placeholder {
  color: var(--text-placeholder, #c0b8a8);
  font-style: italic;
}

/* ── AI Processing Overlay ── */
.manuscript-ai-overlay {
  position: absolute;
  inset: 0;
  background: rgba(250, 248, 245, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.manuscript-ai-spinner {
  background: var(--bg-card, #fff);
  padding: 16px 32px;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  font-size: 1rem;
  color: var(--text-primary, #2c1810);
  animation: msPulse 1.5s infinite;
}

@keyframes msPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── Focus Mode ── */
.manuscript-overlay.focus-mode .manuscript-topbar {
  opacity: 0.3;
  transition: opacity 0.3s;
}

.manuscript-overlay.focus-mode .manuscript-topbar:hover {
  opacity: 1;
}

.manuscript-overlay.focus-mode .manuscript-textarea {
  padding: 48px 20%;
  max-width: 100%;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .manuscript-toc { display: none; }
  .manuscript-right-pane { 
    position: fixed;
    right: 0;
    top: 48px;
    bottom: 0;
    width: 85vw;
    max-width: 320px;
    z-index: 10;
    box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  }
  .manuscript-textarea {
    padding: 16px;
  }
  .manuscript-topbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 10px;
  }
  .manuscript-topbar-right {
    flex-wrap: wrap;
  }
}

/* ── Manuscript Dashboard Grid (in JournalApp) ── */
.manuscripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 8px 0;
}

.manuscript-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: var(--radius-lg, 12px);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.manuscript-card:hover {
  border-color: var(--accent-primary, #8b7355);
  box-shadow: var(--shadow-md, 0 2px 8px rgba(0,0,0,0.10));
  transform: translateY(-1px);
}

.manuscript-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary, #2c1810);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manuscript-card-meta {
  font-size: 0.72rem;
  color: var(--text-faint, #999);
  display: flex;
  gap: 12px;
}

.manuscript-card-preview {
  font-size: 0.82rem;
  color: #777;
  line-height: 1.4;
  max-height: 3.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.manuscript-new-card {
  background: transparent;
  border: 2px dashed #d1cdc5;
  border-radius: 10px;
  padding: 24px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint, #999);
  font-size: 0.88rem;
  transition: all 0.2s;
}

.manuscript-new-card:hover {
  border-color: var(--border-accent, #8b7355);
  color: var(--text-primary, #2c1810);
  background: #f5f1ec;
}

.manuscript-delete-btn {
  background: transparent;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 0.82rem;
  padding: 2px 6px;
  border-radius: 4px;
  align-self: flex-end;
  transition: color 0.15s;
}

.manuscript-delete-btn:hover {
  color: #ef4444;
}

/* ══════════════════════════════════════════════════════════
   NATIVE MANUSCRIPT EDITOR  (integrated into left pane)
   ══════════════════════════════════════════════════════════ */

.manuscript-native-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Top Bar ── */
.ms-native-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary, #faf8f5);
  border-bottom: 1px solid #e8e2d9;
  flex-shrink: 0;
  flex-wrap: wrap;
  min-height: 44px;
}

/* ── Manuscript Format Toolbar ── */
.ms-format-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 10px;
  background: #f5f2ed;
  border-bottom: 1px solid #e8e2d9;
  flex-shrink: 0;
  overflow-x: auto;
  flex-wrap: wrap;
  gap: 6px;
}
.ms-format-toolbar .format-toolbar {
  display: flex;
  align-items: center;
  gap: 1px;
  flex-wrap: wrap;
  min-width: 0;
}
.ms-format-toolbar .format-toolbar button {
  background: transparent;
  border: 1px solid transparent;
  color: #4a3a2e;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-weight: 500;
}
.ms-format-toolbar .format-toolbar button:hover {
  background: rgba(139, 115, 85, 0.08);
  border-color: #d4cdc4;
}
.ms-format-toolbar .format-toolbar button.is-active {
  background: #4a3a2e;
  border-color: #4a3a2e;
  color: #fffdf8;
}
.ms-format-toolbar .toolbar-divider {
  width: 1px;
  height: 14px;
  background: #d4cdc4;
  margin: 0 3px;
}
.ms-format-toolbar .font-size-label {
  font-size: 10px;
  color: #8a7a6a;
  min-width: 18px;
  text-align: center;
}
/* Sprint 52: Utility controls (Sort, Font size) — right-aligned in manuscript toolbar */
.ms-format-toolbar .utility-controls {
  display: flex;
  align-items: center;
  gap: 1px;
}
.ms-format-toolbar .utility-controls button {
  background: transparent;
  border: 1px solid transparent;
  color: #4a3a2e;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-weight: 500;
}
.ms-format-toolbar .utility-controls button:hover {
  background: rgba(139, 115, 85, 0.08);
  border-color: #d4cdc4;
}

/* ── Permanent AI Scalpel Buttons (own row) ── */
.ms-scalpel-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 12px 4px;
  border-bottom: 1px solid #e8e0d6;
  background: rgba(176, 137, 104, 0.04);
  flex-wrap: wrap;
}
.ms-scalpel-divider {
  border-left: 2px solid #b08968 !important;
  background: #b08968 !important;
  width: 2px !important;
  margin: 0 8px !important;
}
.ms-scalpel-btn {
  color: #8b6914 !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  padding: 3px 6px !important;
  white-space: nowrap !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
  border-radius: 5px !important;
  background: rgba(176, 137, 104, 0.06) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.ms-scalpel-btn:hover {
  background: rgba(176, 137, 104, 0.15) !important;
  border-color: #b08968 !important;
}
.ms-scalpel-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
}
.ms-scalpel-row > button,
.ms-tool-select {
  border: 1px solid #ded4c8;
  border-radius: 6px;
  background: #fffdf8;
  color: #5f4a35;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 7px;
}
.ms-tool-select {
  max-width: 112px;
}
.ms-save-indicator.ai {
  color: #b08968;
  font-weight: 600;
}

.ms-native-topbar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.ms-native-topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.ms-back-btn {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.ms-back-btn:hover {
  background: var(--bg-hover, #ebe6df);
  border-color: var(--border-accent, #8b7355);
  color: var(--text-primary, #2c1810);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.ms-toc-toggle {
  background: transparent;
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  color: #6b5b47;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.ms-toc-toggle:hover {
  background: #f0ebe4;
  border-color: var(--border-accent, #8b7355);
}

.ms-native-title {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary, #2c1810);
  font-family: 'EB Garamond', 'Crimson Text', Georgia, serif;
  padding: 4px 8px;
  border-radius: 4px;
  outline: none;
  transition: background 0.15s;
}

.ms-native-title:focus {
  background: var(--bg-card, #fff);
  box-shadow: 0 0 0 2px rgba(139, 115, 85, 0.2);
}

.ms-native-title::placeholder {
  color: #b8ad9e;
  font-weight: 400;
}

.ms-wordcount {
  font-size: 0.72rem;
  color: var(--text-faint, #a09080);
  white-space: nowrap;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.ms-nexus-btn {
  background: linear-gradient(135deg, #f0ebe4, #e8e2d9);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  color: #6b5b47;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.ms-nexus-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #e8e2d9, #d1cdc5);
  border-color: var(--border-accent, #8b7355);
  color: var(--text-primary, #2c1810);
}

.ms-nexus-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ms-tool-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.ms-tool-btn:hover {
  background: #f0ebe4;
  border-color: var(--border-secondary, #d1cdc5);
}

.ms-tool-btn.active {
  background: #e8e2d9;
  border-color: var(--border-accent, #8b7355);
}

.ms-tool-btn.ms-delete-btn:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

.ms-save-indicator {
  font-size: 0.72rem;
  color: var(--text-faint, #a09080);
  transition: color 0.3s;
  white-space: nowrap;
  flex-shrink: 0;
}

.ms-save-indicator.saving { color: #d97706; }
.ms-save-indicator.saved  { color: #16a34a; }
.ms-save-indicator.error  { color: #ef4444; }

/* ── Nexus Result Banner ── */
.ms-nexus-result {
  background: linear-gradient(135deg, #fefce8, #fef9c3);
  border: 1px solid #fde68a;
  border-radius: 8px;
  margin: 8px 12px;
  padding: 0;
  overflow: hidden;
  animation: ms-nexus-fade-in 0.3s ease;
}

@keyframes ms-nexus-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ms-nexus-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 4px;
  font-size: 0.82rem;
  color: #92400e;
}

.ms-nexus-close {
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-faint, #a09080);
  padding: 0 4px;
  line-height: 1;
}

.ms-nexus-close:hover { color: #2c1810; }

.ms-nexus-result-body {
  padding: 4px 12px 10px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #44403c;
  white-space: pre-wrap;
}

/* ── Body: ToC + Canvas + Manuscript Research Panel ── */
.ms-native-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.ms-native-body.ms-has-toc {
  grid-template-columns: 180px minmax(0, 1fr);
}
.ms-native-body.ms-has-right-panel {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
}
.ms-native-body.ms-has-toc.ms-has-right-panel {
  grid-template-columns: 180px minmax(0, 1fr) minmax(320px, 380px);
}

/* ── Table of Contents Sidebar ── */
.ms-native-toc {
  width: 180px;
  min-width: 140px;
  max-width: 220px;
  background: var(--bg-secondary, #faf8f5);
  border-right: 1px solid #e8e2d9;
  padding: 12px 10px;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ms-toc-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-primary, #8b7355);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

.ms-toc-empty {
  font-size: 0.72rem;
  color: #b8ad9e;
  font-style: italic;
  margin: 0;
}

.ms-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ms-toc-item {
  font-size: 0.8rem;
  line-height: 1.4;
  color: #6b5b47;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-toc-item:hover {
  background: #f0ebe4;
  color: var(--text-primary, #2c1810);
}

.ms-toc-item.ms-toc-level-1 { padding-left: 6px; font-weight: 600; }
.ms-toc-item.ms-toc-level-2 { padding-left: 16px; }
.ms-toc-item.ms-toc-level-3 { padding-left: 26px; font-size: 0.78rem; }
.ms-toc-item.ms-toc-level-4 { padding-left: 36px; font-size: 0.75rem; color: var(--text-faint, #a09080); }

.ms-toc-stats {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #e8e2d9;
  font-size: 0.75rem;
  color: var(--text-faint, #a09080);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Canvas (textarea + scalpels) ── */
.ms-native-canvas {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.ms-native-textarea {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  background: #fffdf8;
  color: var(--text-primary, #2c1810);
  font-family: 'EB Garamond', 'Crimson Text', Georgia, serif;
  font-size: 15px;
  line-height: 1.8;
  padding: 16px 20px;
  resize: none;
  overflow-y: auto;
  tab-size: 4;
}

.ms-native-textarea::placeholder {
  color: #c8bfb0;
  font-style: italic;
}

.ms-native-textarea:focus {
  background: #fffef9;
}

.ms-confidence-score {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 12px;
  border-top: 1px solid #e8e2d9;
  background: #fffaf2;
  color: #4a3a2e;
  font-size: 0.78rem;
  line-height: 1.3;
}

.ms-confidence-label {
  white-space: nowrap;
  color: #6b5b47;
}

.ms-confidence-value,
.ms-confidence-label strong {
  color: #2c1810;
  font-weight: 800;
}

.ms-confidence-bar {
  width: 72px;
  height: 5px;
  border-radius: 999px;
  background: #eadfd2;
  overflow: hidden;
  flex-shrink: 0;
}

.ms-confidence-fill {
  height: 100%;
  border-radius: inherit;
  background: #8b7355;
}

.ms-confidence-gold .ms-confidence-fill {
  background: #b7791f;
}

.ms-confidence-solid .ms-confidence-fill {
  background: #3f7d58;
}

.ms-confidence-muted .ms-confidence-fill {
  background: #8b7355;
}

.ms-confidence-hint {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7a6a5a;
}

@media (max-width: 900px) {
  .ms-confidence-hint {
    display: none;
  }
}

/* ── Graveyard Pane ── */
.ms-graveyard-pane {
  border-top: 1px solid #e8e2d9;
  background: var(--bg-secondary, #faf8f5);
  display: flex;
  flex-direction: column;
  max-height: 200px;
  min-height: 100px;
  flex-shrink: 0;
}

.ms-graveyard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid #e8e2d9;
}

.ms-graveyard-header h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-primary, #8b7355);
  margin: 0;
}

.ms-graveyard-count {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-faint, #a09080);
  margin-left: 6px;
}

.ms-graveyard-action {
  background: transparent;
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: #6b5b47;
  cursor: pointer;
  margin-left: 4px;
  transition: all 0.15s;
}

.ms-graveyard-action:hover {
  background: #f0ebe4;
  border-color: var(--border-accent, #8b7355);
}

.ms-graveyard-textarea {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  background: #faf6f0;
  color: #78716c;
  font-family: 'EB Garamond', 'Crimson Text', Georgia, serif;
  font-size: 13px;
  line-height: 1.7;
  padding: 10px 14px;
  resize: none;
  overflow-y: auto;
  font-style: italic;
}

.ms-graveyard-textarea::placeholder {
  color: #c8bfb0;
}

/* ── Trash Banner (soft-delete view) ── */
.ms-trash-banner {
  grid-column: 1 / -1;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.82rem;
  color: #b91c1c;
  text-align: center;
}

.ms-card-deleted {
  opacity: 0.7;
  border-style: dashed !important;
}

/* ══════════════════════════════════════════
   WRITE MODE — Phase 9: Tri-Panel Assembly Engine
   Deterministic Academic Compiler UI
   ══════════════════════════════════════════ */

/* ── Container ── */
.wm-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--bg-secondary, #faf8f5);
}

/* ── Top Bar ── */
.wm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  background: var(--bg-secondary, #faf8f5);
  gap: 12px;
  flex-shrink: 0;
  min-height: 48px;
}

.wm-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.wm-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.wm-title-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 1.15rem;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: 600;
  color: var(--text-primary, #2c1810);
  padding: 4px 0;
  flex: 1;
  min-width: 0;
  outline: none;
  transition: border-color 0.2s;
}

.wm-title-input:focus {
  border-bottom-color: #8b7355;
}

.wm-action-btn {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.wm-action-btn:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
  border-color: var(--border-accent, #8b7355);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.wm-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.wm-export-btn {
  background: #e8f5e8;
  border-color: #a3d9a3;
  color: #2d6a2d;
}

.wm-export-btn:hover {
  background: #d4edd4;
  border-color: #6bbb6b;
}

/* ── Tri-Panel Body ── */
.wm-body {
  display: grid;
  grid-template-columns: 220px 1fr 340px;
  gap: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Left Panel: Outline ── */
.wm-panel-left {
  border-right: 1px solid var(--border-primary, #e8e3db);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-tertiary, #f7f3ee);
  padding-bottom: 8px;
}

.wm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
}

.wm-panel-header h4 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary, #4a3f35);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.wm-small-btn {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--text-muted, #6b5c4d);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.wm-small-btn:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-primary, #2c1810);
}

.wm-block-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.wm-block-item {
  padding: 10px 12px;
  border-radius: var(--radius-md, 8px);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
  position: relative;
  background: rgba(255,255,255,0.6);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.wm-block-item:hover {
  background: var(--bg-hover, #f0ebe4);
  border-color: var(--border-primary, #e8e3db);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.wm-block-active {
  background: #B2FFFF;
  border-color: #4fb7c7;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

.wm-block-new {
  background: rgba(252, 138, 45, 0.18);
  border-color: #FC8A2D;
  box-shadow: 0 1px 8px rgba(252, 138, 45, 0.22);
}

.wm-block-dragging {
  opacity: 0.55;
}

.wm-block-locked {
  opacity: 0.8;
}

.wm-block-item-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  margin-bottom: 4px;
}

.wm-block-status {
  font-size: 0.72rem;
}

.wm-block-type {
  color: var(--accent-primary, #8b7355);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.8px;
}

.wm-block-idx {
  color: var(--text-faint, #b0a090);
  font-size: 0.68rem;
  margin-left: auto;
}

.wm-block-goal {
  font-size: 0.82rem;
  color: var(--text-secondary, #3a3228);
  line-height: 1.35;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.wm-block-name {
  color: var(--text-primary, #2c1810);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm-block-goal em {
  color: var(--text-faint, #b0a090);
}

.wm-block-meta {
  display: flex;
  gap: 8px;
  font-size: 0.68rem;
  color: var(--text-faint, #a09080);
  margin-top: 3px;
  flex-wrap: wrap;
}

.wm-readiness-pill {
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.08);
  background: #f8fafc;
  color: #475569;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wm-readiness-pill.wm-readiness-ready {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.wm-readiness-pill.wm-readiness-may-lack-evidence {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

.wm-readiness-pill.wm-readiness-too-much-noise {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.wm-readiness-pill.wm-readiness-needs-papers,
.wm-readiness-pill.wm-readiness-needs-data,
.wm-readiness-pill.wm-readiness-needs-policy,
.wm-readiness-pill.wm-readiness-finish-linked-blocks,
.wm-readiness-pill.wm-readiness-needs-user-specification {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.wm-block-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.wm-block-actions button {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: var(--radius-sm, 4px);
  padding: 4px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-muted, #6b5c4d);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.wm-block-actions button:hover {
  background: var(--bg-hover, #e0d8cf);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
}

.wm-block-actions button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.wm-job-badge {
  font-size: 0.72rem;
  animation: wmPulse 1.5s infinite;
}

@keyframes wmPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Center Panel: Workbench ── */
.wm-panel-center {
  display: flex;
  flex-direction: column;
  padding: 18px 24px;
  overflow-y: auto;
  min-height: 0;
}

.wm-workbench-header {
  flex-shrink: 0;
  margin-bottom: 12px;
}

.wm-workbench-type-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.wm-type-select {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  cursor: pointer;
}

.wm-status-badge {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.wm-status-empty { background: var(--bg-tertiary, #f3f0ec); color: var(--text-faint, #a09080); }
.wm-status-armed { background: #fef3c7; color: #92400e; }
.wm-status-drafted { background: #d1fae5; color: #065f46; }
.wm-status-locked { background: #e0e7ff; color: #3730a3; }

.wm-goal-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  padding: 8px 0;
  font-size: 0.95rem;
  color: var(--text-primary, #2c1810);
  outline: none;
  font-family: 'Georgia', serif;
  transition: border-color 0.2s;
}

.wm-goal-input:focus {
  border-bottom-color: #8b7355;
}

.wm-goal-input::placeholder {
  color: var(--text-placeholder, #c0b8a8);
  font-style: italic;
}

/* ── Attached Note Chips ── */
.wm-attached-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.wm-note-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: var(--text-muted, #6b5c4d);
}

.wm-note-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-faint, #b0a090);
  font-size: 0.88rem;
  padding: 0 2px;
  line-height: 1;
}

.wm-note-chip button:hover {
  color: #ef4444;
}

/* ── S06 Block Readiness ── */
.wm-readiness-card {
  border: 1px solid #e5ded2;
  border-radius: 12px;
  background: #fffdf8;
  padding: 10px 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(70, 52, 33, 0.06);
}

.wm-readiness-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #5f5143;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.wm-readiness-card-head strong {
  color: #2f281f;
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
  text-align: right;
}

.wm-readiness-card p {
  margin: 8px 0 0;
  color: #51483c;
  font-size: 0.84rem;
  line-height: 1.45;
}

.wm-readiness-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.wm-readiness-card-meta span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #f6f1eb;
  color: #66594d;
  font-size: 0.68rem;
  font-weight: 700;
}

.wm-readiness-ready,
.wm-compile-ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.wm-readiness-may-lack-evidence,
.wm-compile-may-lack-evidence {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.wm-readiness-too-much-noise,
.wm-compile-too-much-noise {
  border-color: #fed7aa;
  background: #fff7ed;
}

.wm-readiness-needs-papers,
.wm-readiness-needs-data,
.wm-readiness-needs-policy,
.wm-readiness-finish-linked-blocks,
.wm-readiness-needs-user-specification {
  border-color: #fecaca;
  background: #fff7f7;
}

/* ── Compile Row ── */
.wm-compile-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.wm-compile-btn,
.wm-revise-btn {
  background: linear-gradient(135deg, #8b7355, #6b5c4d);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.wm-compile-btn:hover,
.wm-revise-btn:hover {
  background: linear-gradient(135deg, #6b5c4d, #4a3f35);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.wm-compile-btn:disabled,
.wm-revise-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.wm-compile-btn.wm-compile-ready {
  background: linear-gradient(135deg, #166534, #15803d);
}

.wm-compile-btn.wm-compile-may-lack-evidence {
  background: linear-gradient(135deg, #315f9e, #1d4ed8);
}

.wm-compile-btn.wm-compile-too-much-noise {
  background: linear-gradient(135deg, #9a5b18, #c2410c);
}

.wm-compile-btn.wm-compile-needs-papers,
.wm-compile-btn.wm-compile-needs-data,
.wm-compile-btn.wm-compile-needs-policy,
.wm-compile-btn.wm-compile-finish-linked-blocks,
.wm-compile-btn.wm-compile-needs-user-specification {
  background: linear-gradient(135deg, #7f1d1d, #991b1b);
}

.wm-lock-btn, .wm-unlock-btn {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted, #6b5c4d);
}

.wm-lock-btn:hover {
  background: #e0e7ff;
  border-color: #818cf8;
  color: #3730a3;
}

.wm-unlock-btn:hover {
  background: #fef3c7;
  border-color: #fbbf24;
  color: #92400e;
}

.wm-version-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--accent-primary, #8b7355);
  margin-left: auto;
}

.wm-version-nav button {
  background: var(--bg-tertiary, #f5f0ea);
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 3px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--text-muted, #6b5c4d);
}

.wm-version-nav button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.wm-stream-card {
  border: 1px solid var(--border-secondary, #d1cdc5);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: var(--bg-tertiary, #f5f0ea);
}

.wm-stream-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.wm-stream-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary, #4a3f35);
  letter-spacing: 0.2px;
}

.wm-stream-status {
  font-size: 0.72rem;
  color: var(--accent-primary, #8b7355);
  font-weight: 600;
}

.wm-stream-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-faint, #9f907f);
  margin-bottom: 8px;
}

.wm-stream-preview {
  max-height: 140px;
  overflow: auto;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-primary, #2c1810);
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.wm-stream-hint {
  margin: 0 0 8px 0;
  font-size: 0.78rem;
  color: var(--text-faint, #9f907f);
}

.wm-stream-error {
  margin: 0 0 8px 0;
  font-size: 0.78rem;
  color: #b91c1c;
}

.wm-stream-actions {
  display: flex;
  gap: 6px;
}

.wm-stream-btn {
  border: 1px solid var(--border-secondary, #d1cdc5);
  background: var(--bg-card, #fff);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.74rem;
  cursor: pointer;
  color: var(--text-secondary, #4a3f35);
}

.wm-stream-btn-stop {
  border-color: #fca5a5;
  color: #991b1b;
}

.wm-stream-btn-resume {
  border-color: #86efac;
  color: #065f46;
}

.wm-stream-btn-dismiss {
  border-color: #cbd5e1;
  color: #334155;
}

/* ── Draft Textarea ── */
.wm-draft-textarea {
  flex: 1;
  min-height: 250px;
  width: 100%;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 10px;
  padding: 16px 18px;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary, #2c1810);
  resize: none;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.wm-draft-textarea:focus {
  border-color: var(--border-accent, #8b7355);
  box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.1);
}

.wm-draft-textarea:disabled {
  background: var(--bg-tertiary, #f7f3ee);
  color: var(--accent-primary, #8b7355);
  cursor: not-allowed;
}

.wm-draft-textarea::placeholder {
  color: var(--text-placeholder, #c0b8a8);
  font-style: italic;
}

.wm-empty-workbench {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-faint, #b0a090);
  font-style: italic;
}

/* ── Right Panel: Intelligence Hub ── */
.wm-panel-right {
  border-left: 1px solid var(--border-primary, #e8e3db);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-tertiary, #f7f3ee);
  min-width: 0;
}

.ms-workspace-panel {
  min-height: 0;
}

.ms-workspace-panel:not(.wm-drawer-open) {
  display: none;
}

.wm-hub-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  flex-shrink: 0;
  background: var(--bg-tertiary, #f3efe9);
}

.wm-hub-tabs button {
  flex: 1;
  padding: 9px 6px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 0.72rem;
  color: var(--accent-primary, #8b7355);
  transition: all 0.2s;
  white-space: nowrap;
  font-weight: 500;
}

.wm-hub-tabs button:hover {
  background: var(--bg-hover, #ebe6df);
  color: var(--text-secondary, #4a3f35);
}

.wm-hub-tabs button.active {
  color: var(--text-primary, #2c1810);
  border-bottom-color: #8b7355;
  font-weight: 700;
  background: var(--bg-tertiary, #f7f3ee);
}

.wm-hub-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}

.wm-hub-section-title {
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  margin: 0 0 10px 0;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.wm-hub-empty {
  color: var(--text-faint, #b0a090);
  font-size: 0.82rem;
  font-style: italic;
  text-align: center;
  padding: 32px 12px;
  line-height: 1.6;
}
.wm-data-coming-soon {
  background: #f8fafc;
  border: 1px solid #dbe4ee;
  border-radius: 10px;
  padding: 18px;
  color: #334155;
  line-height: 1.6;
}
.wm-data-coming-soon h4 {
  margin: 0 0 10px;
  color: #0f172a;
  font-size: 1rem;
}
.wm-data-coming-soon p {
  margin: 0 0 10px;
  font-size: 0.86rem;
}
.wm-data-coming-soon span {
  display: inline-flex;
  margin-top: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #075985;
  font-size: 0.72rem;
  font-weight: 700;
}

.wm-zettel-hub {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wm-zettel-header h4 {
  margin: 0 0 4px;
  color: #1f2937;
}
.wm-zettel-helper {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
}
.wm-zettel-list {
  display: grid;
  gap: 8px;
}
.wm-zettel-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px;
  border: 1px solid #eee4d7;
  border-radius: 8px;
  background: #fffdf8;
}
.wm-zettel-item.is-starred {
  border-color: #d69b2d;
  background: #fff8e7;
}
.wm-zettel-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: flex-start;
}
.wm-zettel-card-body {
  min-width: 0;
}
.wm-zettel-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  color: #7c6f62;
  font-size: 0.76rem;
}
.wm-zettel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.wm-zettel-tags span {
  border-radius: 999px;
  background: #f3eee7;
  color: #5f4f3e;
  font-size: 0.72rem;
  padding: 2px 7px;
}
.wm-zettel-item label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.wm-zettel-star {
  background: transparent;
  border: 0;
  color: #8b7355;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
}
.wm-zettel-text {
  color: #374151;
  font-size: 0.82rem;
  line-height: 1.45;
  flex: 1;
  min-width: 0;
}
.wm-zettel-source {
  color: #64748b;
  flex: 0 0 100%;
  font-size: 0.78rem;
  line-height: 1.3;
  margin-left: 26px;
}
.wm-zettel-empty {
  margin: 12px 0;
  padding: 22px 16px;
  border: 1px dashed #d9c8b5;
  border-radius: 12px;
  background: #fffdf8;
  color: #6b5b47;
  font-size: 0.86rem;
  line-height: 1.55;
  text-align: center;
}
.wm-zettel-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 0 4px;
  text-align: center;
}
.wm-zettel-btn {
  border: 1px solid #d7c8f6;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.wm-zettel-btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  min-width: min(100%, 240px);
}
.wm-zettel-btn-link {
  background: transparent;
  color: #6d28d9;
}
.wm-zettel-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.wm-insight-chip {
  background: #fef3c7;
  border-color: #facc15;
  color: #78350f;
}

/* Suggest tab items */
.wm-suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  border-bottom: 1px solid #f0ebe4;
  transition: background 0.15s;
}

.wm-suggest-item:hover {
  background: rgba(139,115,85,0.04);
}

.wm-suggest-item:last-child {
  border-bottom: none;
}
.wm-rag-results {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.wm-rag-suggest-card {
  align-items: flex-start;
  background: #fffdf8;
  border: 1px solid #efe7dc;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(44, 24, 16, 0.04);
}
.wm-rag-suggest-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.wm-rag-suggest-main strong {
  color: #1f2937;
  font-size: 0.88rem;
}
.wm-rag-suggest-title {
  color: #475569;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wm-rag-suggest-main p,
.wm-rag-cost-note {
  margin: 0;
  color: #64748b;
  font-size: 0.76rem;
  line-height: 1.45;
}
.wm-missing-label {
  color: #9ca3af;
  font-size: 0.72rem;
  white-space: nowrap;
}
.wm-rag-cost-note {
  margin-top: 8px;
  text-align: left;
}

.wm-attach-btn {
  background: #d1fae5;
  border: 1px solid #86efac;
  border-radius: 5px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: #065f46;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-weight: 500;
}

.wm-attach-btn:hover {
  background: #a7f3d0;
}

.wm-detach-btn {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.68rem;
  color: #b91c1c;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.wm-detach-btn:hover {
  background: #fecaca;
}

.wm-attached-label {
  font-size: 0.68rem;
  color: #065f46;
  font-weight: 600;
}

/* Notes tab */
.wm-note-search {
  width: 100%;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
  color: var(--text-primary, #2c1810);
  outline: none;
  margin-bottom: 8px;
  transition: border-color 0.2s;
}

.wm-note-search:focus {
  border-color: var(--border-accent, #8b7355);
}

.wm-note-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wm-note-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 4px;
  gap: 6px;
  transition: background 0.15s;
}

.wm-note-item:hover {
  background: #f0ebe4;
}

.wm-note-attached {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.wm-note-item-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.wm-note-item-info strong {
  font-size: 0.78rem;
  color: var(--text-muted, #6b5c4d);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wm-note-title {
  display: -webkit-box;
  font-size: 0.76rem;
  line-height: 1.32;
  color: var(--text-faint, #a09080);
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Audit tab */
.wm-audit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wm-audit-item {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 6px;
  padding: 8px 10px;
}

.wm-audit-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.wm-audit-block {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #6b5c4d);
}

.wm-audit-time {
  font-size: 0.68rem;
  color: var(--text-faint, #b0a090);
}

.wm-audit-body {
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  line-height: 1.5;
  white-space: pre-wrap;
}

/* ── Manuscript Card badge for Write Mode ── */
.wm-new-card {
  background: linear-gradient(135deg, #f5f0ea, #ebe6df) !important;
  border-color: #8b7355 !important;
  color: #6b5c4d !important;
}

.wm-card-write {
  border-left: 3px solid #8b7355 !important;
}

.wm-card-badge {
  margin-right: 4px;
}

/* ══════════════════════════════════════════
   SPRINT 4-5: Polish Engine v2, Memory Loop,
   Auto-Injector, Export Engine
   ══════════════════════════════════════════ */

/* ── Polish Mode: Back to Write Mode button ── */
.wm-polish-return-btn {
  background: linear-gradient(135deg, #7c3aed22, #6366f122);
  border: 1px solid #7c3aed44;
  color: #7c3aed;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.wm-polish-return-btn:hover {
  background: linear-gradient(135deg, #7c3aed33, #6366f133);
  border-color: #7c3aed66;
}

/* ── Audit Checklist Panel (Polish Mode) ── */
.ms-audit-checklist-pane {
  border-top: 1px solid var(--border-primary, #e8e3db);
  padding: 12px 16px;
  background: var(--bg-secondary, #faf8f5);
  max-height: 280px;
  overflow-y: auto;
}
.ms-audit-checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ms-audit-checklist-header h4 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted, #555);
}
.ms-audit-count {
  font-size: 0.72rem;
  color: var(--text-faint, #888);
  margin-left: 6px;
}
.ms-audit-checklist-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ms-audit-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.82rem;
  color: #444;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
}
.ms-audit-check-item:hover {
  background: #f0eee9;
}
.ms-audit-check-item.ms-audit-resolved {
  opacity: 0.5;
  text-decoration: line-through;
  order: 999;
}
.ms-audit-checkbox {
  flex-shrink: 0;
  font-size: 0.88rem;
}
.ms-audit-check-text {
  flex: 1;
  line-height: 1.4;
}
.ms-audit-dismiss-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  opacity: 0.5;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity 0.15s;
}
.ms-audit-dismiss-btn:hover {
  opacity: 1;
  background: #fee2e2;
}

/* ── Auto-Injector: PDF upload row ── */
.wm-auto-inject-row {
  padding: 6px 0 8px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  margin-bottom: 8px;
}
.wm-inject-btn {
  width: 100%;
  padding: 8px 12px;
  border: 1px dashed #7c3aed44;
  border-radius: 8px;
  background: linear-gradient(135deg, #7c3aed08, #6366f108);
  color: #7c3aed;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.wm-inject-btn:hover {
  background: linear-gradient(135deg, #7c3aed18, #6366f118);
  border-color: #7c3aed66;
}
.wm-inject-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════
   Sprint 46: Co-Pilot UI — Banners & Action Items
   ══════════════════════════════════════════ */

/* Inline Co-Pilot Banner — appears below compiled draft text */
.wm-copilot-banner {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0f9ff 100%);
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: copilotSlideIn 0.3s ease-out;
}
.wm-copilot-banner-outline {
  margin-bottom: 8px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 50%, #faf5ff 100%);
  border-color: #93c5fd;
}
.wm-copilot-banner-text {
  font-size: 0.85rem;
  color: #166534;
  font-weight: 500;
  line-height: 1.4;
}
.wm-copilot-banner-outline .wm-copilot-banner-text {
  color: #1e40af;
}
.wm-copilot-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.wm-copilot-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.wm-copilot-btn-primary {
  background: #16a34a;
  color: #fff;
}
.wm-copilot-btn-primary:hover {
  background: #15803d;
}
.wm-copilot-btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}
.wm-copilot-btn-secondary {
  background: transparent;
  color: #6b7280;
  border: 1px solid #d1d5db;
}
.wm-copilot-btn-secondary:hover {
  background: #f3f4f6;
  color: #374151;
}

/* Action Items Tab Cards */
.wm-action-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wm-action-card {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-primary, #e8e3db);
  border-left: 3px solid #16a34a;
  border-radius: 6px;
  padding: 10px 12px;
}
.wm-action-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.wm-action-card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary, #4a3f35);
  font-weight: 500;
  line-height: 1.4;
}
.wm-action-card-cost {
  font-size: 0.75rem;
  font-weight: 700;
  color: #d97706;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.wm-action-card-actions {
  display: flex;
  gap: 6px;
}

@keyframes copilotSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dark mode overrides */
@media (prefers-color-scheme: dark) {
  .wm-copilot-banner {
    background: linear-gradient(135deg, #052e16 0%, #064e3b 50%, #0c2937 100%);
    border-color: #166534;
  }
  .wm-copilot-banner-text { color: #86efac; }
  .wm-copilot-banner-outline {
    background: linear-gradient(135deg, #172554 0%, #0c2937 50%, #1e1b4b 100%);
    border-color: #1e40af;
  }
  .wm-copilot-banner-outline .wm-copilot-banner-text { color: #93c5fd; }
  .wm-copilot-btn-primary { background: #15803d; }
  .wm-copilot-btn-secondary { color: #9ca3af; border-color: #4b5563; }
  .wm-copilot-btn-secondary:hover { background: #1f2937; color: #d1d5db; }
}

/* ── Audit item dismiss button ── */
.wm-audit-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.72rem;
  opacity: 0.4;
  padding: 2px;
  margin-left: 4px;
  border-radius: 3px;
  transition: all 0.15s;
}
.wm-audit-dismiss:hover {
  opacity: 1;
  background: #fee2e2;
}

/* ── Export Tab ── */
.wm-export-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wm-export-action-btn {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 8px;
  background: var(--bg-card, #fff);
  color: #444;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.wm-export-action-btn:hover {
  background: #f0eee9;
  border-color: var(--border-secondary, #d1cdc5);
}
.wm-export-action-btn select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 6px;
  background: #fff;
  padding: 6px 8px;
}

/* ── Memory Loop stats ── */
.wm-memory-loop-info {
  font-size: 0.82rem;
  color: var(--text-faint, #888);
  margin: 4px 0 8px;
  line-height: 1.4;
}
.wm-dismissed-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wm-dismissed-item {
  font-size: 0.72rem;
  color: #666;
  padding: 4px 8px;
  background: #fef2f2;
  border-radius: 6px;
  border: 1px solid #fee2e2;
}
.wm-dismissed-text {
  display: block;
}
.wm-dismissed-reason {
  display: block;
  font-style: italic;
  color: var(--text-faint, #999);
  font-size: 0.72rem;
  margin-top: 2px;
}

/* ══════════════════════════════════════════
   Sprint 16 – Vector 3: iPad / Tablet Responsive Drawers
   Breakpoint: 901px–1024px → drawer-based tri-panel
   ══════════════════════════════════════════ */

/* Drawer toggle buttons – hidden on desktop */
.wm-drawer-toggle {
  display: none;
}

/* Drawer backdrop – hidden by default */
.wm-drawer-backdrop {
  display: none;
}

@media (min-width: 901px) and (max-width: 1024px) {
  /* ── Grid: single column, panels become drawers ── */
  .wm-body {
    grid-template-columns: 1fr;
    position: relative;
    overflow: hidden;
  }

  /* ── Center panel takes full width ── */
  .wm-panel-center {
    grid-column: 1 / -1;
  }

  /* ── Drawer toggle buttons – visible on tablet ── */
  .wm-drawer-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 64px;
    border: 1px solid var(--border-primary, #e8e3db);
    background: var(--bg-tertiary, #f7f3ee);
    color: var(--text-muted, #6b5c4d);
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 110;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  .wm-drawer-toggle:hover {
    background: #f0ebe4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  }
  .wm-drawer-toggle:active {
    transform: translateY(-50%) scale(0.96);
  }

  .wm-drawer-toggle-left {
    left: 0;
    border-radius: 0 10px 10px 0;
    border-left: none;
  }
  .wm-drawer-toggle-right {
    right: 0;
    border-radius: 10px 0 0 10px;
    border-right: none;
  }

  /* ── Left panel as sliding drawer ── */
  .wm-panel-left {
    position: fixed;
    top: 0;
    left: -280px;
    width: 260px;
    height: 100vh;
    z-index: 120;
    background: var(--bg-tertiary, #f7f3ee);
    border-right: 1px solid var(--border-primary, #e8e3db);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
  }
  .wm-panel-left.wm-drawer-open {
    left: 0;
  }

  /* ── Right panel as sliding drawer ── */
  .wm-panel-right {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    z-index: 120;
    background: var(--bg-tertiary, #f7f3ee);
    border-left: 1px solid var(--border-primary, #e8e3db);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
  }
  .wm-panel-right.wm-drawer-open {
    right: 0;
  }

  /* ── Semi-transparent backdrop ── */
  .wm-drawer-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 115;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: drawerBackdropIn 0.2s ease-out;
  }

  @keyframes drawerBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
}

/* ── Responsive: Collapse panels on phone (≤900px) ── */
@media (max-width: 900px) {
  .wm-body {
    grid-template-columns: 1fr;
  }
  .wm-panel-left {
    display: none;
  }
  .wm-panel-right {
    border-left: none;
    border-top: 1px solid var(--border-primary, #e8e3db);
    max-height: 250px;
  }
  .wm-drawer-toggle {
    display: none;
  }
  .wm-drawer-backdrop {
    display: none;
  }
}

/* ══════════════════════════════════════════
   Sprint 6: Ghost Job, Context Weight, Retry UI
   ══════════════════════════════════════════ */

/* ── Ghost Job Retry Button ── */
.wm-retry-btn {
  padding: 6px 14px;
  border: 1px solid #f97316;
  border-radius: 8px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.wm-retry-btn:hover {
  background: #fed7aa;
  border-color: #ea580c;
}

/* ── Context Weight Indicator ── */
.wm-context-weight {
  font-size: 0.72rem;
  color: #78716c;
  font-weight: 600;
  padding: 2px 8px;
  background: #f5f0eb;
  border-radius: 10px;
  white-space: nowrap;
}
.wm-context-full {
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fca5a5;
}

/* ── Timeout badge in compile button ── */
.wm-compile-btn[disabled],
.wm-revise-btn[disabled] {
  opacity: 0.6;
}

/* ── Keyboard shortcut hint ── */
.wm-shortcut-hint {
  font-size: 0.68rem;
  color: #a8a29e;
  margin-left: 8px;
}

/* ══════════════════════════════════════════
   Sprint 7: Parachute Export Button
   ══════════════════════════════════════════ */
.wm-parachute-btn {
  width: 100%;
  padding: 12px 14px;
  border: 2px dashed #e8e3db;
  border-radius: 10px;
  background: linear-gradient(135deg, #fefce8, #fef9c3);
  color: #854d0e;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  margin-top: 12px;
}
.wm-parachute-btn:hover {
  background: linear-gradient(135deg, #fef9c3, #fde68a);
  border-color: #f59e0b;
}
.wm-parachute-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════
   Sprint 8: Spatial Canvas Overlay
   ══════════════════════════════════════════ */
.wm-canvas-overlay {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: #faf9f7;
  border-radius: 12px;
  overflow: hidden;
}

.spatial-canvas-shell {
  width: 100%;
  height: 100%;
  position: relative;
  background:
    radial-gradient(circle at top left, rgba(215, 198, 173, 0.38), transparent 34%),
    linear-gradient(135deg, #fffaf2 0%, #f3ede4 100%);
  color: #2f281f;
}

.spatial-canvas-toolbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e2d6c6;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.94);
  box-shadow: 0 12px 32px rgba(47, 40, 31, 0.12);
  backdrop-filter: blur(10px);
}

.spatial-canvas-mode-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid #e4d8c9;
  border-radius: 12px;
  background: #f6efe5;
}

.spatial-canvas-mode-tab,
.spatial-canvas-button {
  min-height: 34px;
  border: 1px solid #d8c9b8;
  border-radius: 10px;
  background: #fffaf2;
  color: #4a3a2e;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.spatial-canvas-mode-tab {
  padding: 6px 10px;
  border-color: transparent;
  background: transparent;
}

.spatial-canvas-mode-tab:hover,
.spatial-canvas-button:hover {
  transform: translateY(-1px);
  border-color: #b89f7d;
}

.spatial-canvas-mode-tab.is-active,
.spatial-canvas-button.is-active {
  background: #4a3a2e;
  border-color: #4a3a2e;
  color: #fffaf2;
  box-shadow: 0 6px 16px rgba(74, 58, 46, 0.18);
}

.spatial-canvas-control {
  display: grid;
  gap: 3px;
}

.spatial-canvas-control label {
  color: #7a6a5a;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.spatial-canvas-control select {
  min-height: 34px;
  border: 1px solid #d8c9b8;
  border-radius: 10px;
  background: #fffaf2;
  color: #2f281f;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0 9px;
}

.spatial-canvas-button {
  padding: 7px 12px;
}

.spatial-canvas-close {
  margin-left: auto;
}

.spatial-canvas-status,
.spatial-canvas-cap-message {
  position: absolute;
  left: 18px;
  z-index: 95;
  max-width: min(760px, calc(100% - 36px));
  border: 1px solid #e2d6c6;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.94);
  color: #5d4d3e;
  font-size: 0.78rem;
  line-height: 1.35;
  padding: 8px 12px;
  box-shadow: 0 8px 20px rgba(47, 40, 31, 0.09);
}

.spatial-canvas-status {
  top: 82px;
}

.spatial-canvas-status[data-state="error"] {
  border-color: #f3c2a2;
  background: #fff7ed;
  color: #8a3b12;
}

.spatial-canvas-status button {
  margin-left: 8px;
  border: 1px solid #d8a27d;
  border-radius: 999px;
  background: #fffaf2;
  color: #8a3b12;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.spatial-canvas-cap-message {
  top: 122px;
  border-color: #d9c49d;
  background: #fffbeb;
  color: #725523;
}

.spatial-block-node {
  width: 100%;
  box-sizing: border-box;
  border: 2px solid #dacdbc;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.96);
  box-shadow: 0 12px 28px rgba(47, 40, 31, 0.13);
  padding: 11px 13px;
  transition: opacity 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.spatial-block-node-container {
  min-height: 118px;
  border-color: #bca887;
  background: linear-gradient(135deg, rgba(255, 252, 247, 0.98), rgba(245, 236, 223, 0.96));
}

.spatial-block-node-dimmed {
  opacity: 0.34;
  filter: grayscale(0.45);
  box-shadow: none;
}

.spatial-node-kicker,
.spatial-node-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.spatial-node-kicker {
  margin-bottom: 6px;
  color: #7a6a5a;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.spatial-node-status,
.spatial-node-meta span {
  border-radius: 999px;
  padding: 2px 7px;
  color: #3f3328;
  letter-spacing: 0;
  text-transform: none;
}

.spatial-node-title {
  color: #1f1a15;
  font-size: 0.86rem;
  font-weight: 820;
  line-height: 1.32;
}

.spatial-node-subtitle {
  margin-top: 6px;
  color: #66594d;
  font-size: 0.72rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spatial-node-meta {
  margin-top: 8px;
  color: #7a6a5a;
  font-size: 0.68rem;
  font-weight: 700;
}

.spatial-node-meta span {
  background: #f3ede4;
}

.spatial-note-node {
  max-width: 170px;
  border: 1px solid #e0bd68;
  border-radius: 10px;
  background: #fff8dc;
  color: #4d3b16;
  box-shadow: 0 8px 18px rgba(47, 40, 31, 0.1);
  padding: 8px 10px;
}

.spatial-note-title {
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.25;
}

.spatial-note-text {
  margin-top: 4px;
  color: #746036;
  font-size: 0.68rem;
  line-height: 1.3;
}

.spatial-node-handle {
  background: #7a6a5a;
}

@media (max-width: 860px) {
  .spatial-canvas-toolbar {
    max-height: 150px;
    overflow-y: auto;
  }

  .spatial-canvas-status {
    top: 172px;
  }

  .spatial-canvas-cap-message {
    top: 214px;
  }
}

/* ══════════════════════════════════════════
   Sprint 9: Writing Style Selector
   ══════════════════════════════════════════ */
.wm-style-select {
  padding: 5px 10px;
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 8px;
  background: #faf9f7;
  color: #44403c;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.15s;
}
.wm-style-select:hover {
  border-color: var(--border-secondary, #d1cdc5);
  background: #f0eee9;
}
.wm-style-select:focus {
  border-color: var(--accent-primary, #6366f1);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.wm-paper-spec-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  color: #6b5c4d;
  font-size: 0.72rem;
}
.wm-paper-spec-summary span {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 7px;
  border: 1px solid #e5ded2;
  border-radius: 999px;
  background: #fffdf8;
}

/* ══════════════════════════════════════════
   Sprint 9: Mad Libs Architect Panel
   ══════════════════════════════════════════ */
.wm-madlibs-panel {
  padding: 12px 14px;
  background: linear-gradient(135deg, #f0f9ff, #eff6ff);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  margin: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wm-madlibs-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(15, 23, 42, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.wm-madlibs-modal {
  width: min(860px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  background: #fffdf8;
  border: 1px solid #e5ded2;
  border-radius: 10px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  padding: 22px;
}
.wm-madlibs-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #ebe2d6;
  margin-bottom: 16px;
}
.wm-madlibs-modal-header h3 {
  margin: 0;
  color: #1e293b;
  font-size: 1.35rem;
}
.wm-madlibs-modal-header p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
}
.wm-madlibs-modal-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px 16px;
  align-items: start;
}
.wm-madlibs-modal-grid .wm-madlibs-label {
  padding-top: 9px;
}
.wm-madlibs-textarea {
  min-height: 76px;
  resize: vertical;
  line-height: 1.55;
}
.wm-madlibs-modal-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #ebe2d6;
}
@media (max-width: 720px) {
  .wm-madlibs-modal-grid {
    grid-template-columns: 1fr;
  }
  .wm-madlibs-modal-grid .wm-madlibs-label {
    padding-top: 0;
  }
}
.wm-madlibs-intro {
  font-size: 0.82rem;
  color: #64748b;
  margin: 0 0 4px;
  line-height: 1.4;
}
.wm-madlibs-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  margin-top: 2px;
}
.wm-madlibs-optional {
  font-weight: 400;
  color: #94a3b8;
  font-style: italic;
}
.wm-madlibs-select {
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: var(--bg-card, #fff);
  font-size: 0.82rem;
  color: #1e293b;
}
.wm-madlibs-input {
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: var(--bg-card, #fff);
  font-size: 0.82rem;
  color: #1e293b;
  width: 100%;
  box-sizing: border-box;
}
.wm-madlibs-input::placeholder {
  color: #94a3b8;
  font-style: italic;
}
.wm-madlibs-input:focus,
.wm-madlibs-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}
.wm-madlibs-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.wm-madlibs-hint {
  grid-column: 1 / -1;
  border: 1px solid #d7c6ad;
  border-radius: 8px;
  background: #fff8ea;
  color: #6b4f2a;
  padding: 10px 12px;
  font-size: 0.84rem;
  line-height: 1.45;
}
@media (max-width: 720px) {
  .wm-madlibs-two-col {
    grid-template-columns: 1fr;
  }
}
.wm-madlibs-generate {
  margin-top: 6px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.wm-madlibs-generate:hover {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.wm-madlibs-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ══════════════════════════════════════════
   Sprint 9: Playground / Empty State
   ══════════════════════════════════════════ */
.wm-playground-prompt {
  text-align: center;
  padding: 40px 24px;
  max-width: 480px;
  margin: 0 auto;
}
.wm-playground-prompt h3 {
  font-size: 1.3rem;
  color: #1c1917;
  margin: 0 0 8px;
  font-weight: 700;
}
.wm-playground-prompt > p {
  font-size: 0.88rem;
  color: #78716c;
  margin: 0 0 24px;
  line-height: 1.5;
}
.wm-playground-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wm-playground-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 24px;
  border: 2px solid #e8e3db;
  border-radius: 14px;
  background: var(--bg-card, #fff);
  color: #1c1917;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.wm-playground-btn:hover {
  border-color: #6366f1;
  background: #f0f0ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}
.wm-playground-example {
  border-style: dashed;
  background: linear-gradient(135deg, #fefce8, #fff);
}
.wm-playground-example:hover {
  border-color: #f59e0b;
  background: #fffbeb;
}
.wm-playground-subtitle {
  font-size: 0.72rem;
  font-weight: 400;
  color: #78716c;
  line-height: 1.3;
}

/* ══════════════════════════════════════════
   Sprint 21: Workspace Toggle — Dual-Lens Paradigm
   ══════════════════════════════════════════ */
.workspace-toggle {
  display: flex;
  align-items: center;
  background: #f0ece6;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
  border: 1px solid #e0dbd3;
}

.workspace-toggle-btn {
  background: transparent;
  border: none;
  padding: 6px 16px;
  font-size: 0.82rem;
  font-family: 'Georgia', 'Times New Roman', serif;
  font-weight: 500;
  color: #78716c;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.25s ease;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.workspace-toggle-btn:hover:not(.workspace-toggle-active) {
  background: rgba(255, 255, 255, 0.6);
  color: #44403c;
}

.workspace-toggle-active {
  background: var(--bg-card, #fff);
  color: var(--text-primary, #2c1810);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.04);
  cursor: default;
}

/* Responsive: stack toggle vertically on narrow screens */
@media (max-width: 768px) {
  .workspace-toggle {
    order: -1;
    width: 100%;
    justify-content: center;
  }
  .workspace-toggle-btn {
    flex: 1;
    text-align: center;
    padding: 8px 12px;
    font-size: 0.82rem;
  }
  .wm-topbar {
    flex-wrap: wrap;
  }
}

/* ══════════════════════════════════════════════════════════════════
   Sprint 42: Nexus Action Drawer — unified validation results panel
   ══════════════════════════════════════════════════════════════════ */

.nexus-drawer {
  background: var(--bg-primary, #fffdf8);
  border: 1px solid #e8e2d9;
  border-radius: 8px;
  margin: 8px 12px;
  overflow: hidden;
  animation: ms-nexus-fade-in 0.3s ease;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
}

.nexus-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px;
  border-bottom: 1px solid #f0ebe3;
}
.nexus-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-primary, #2c1810);
}
.nexus-confidence {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}
.nexus-confidence.high { background: #dcfce7; color: #166534; }
.nexus-confidence.mid  { background: #fef3c7; color: #92400e; }
.nexus-confidence.low  { background: #fee2e2; color: #991b1b; }

.nexus-verdict {
  padding: 6px 14px;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-secondary, #78716c);
  border-bottom: 1px solid #f0ebe3;
}

.nexus-summary-strip {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  flex-wrap: wrap;
}
.nexus-chip {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.chip-ok    { background: #dcfce7; color: #166534; }
.chip-warn  { background: #fef3c7; color: #92400e; }
.chip-struct { background: #f3e8ff; color: #6b21a8; }
.chip-logic { background: #dbeafe; color: #1e40af; }
.chip-blind { background: #e0f2fe; color: #0c4a6e; }

.nexus-tabs {
  display: flex;
  border-bottom: 1px solid #e8e2d9;
  padding: 0 8px;
}
.nexus-tab {
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text-secondary, #78716c);
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}
.nexus-tab:hover { color: var(--text-primary, #2c1810); }
.nexus-tab.active {
  color: var(--accent-primary, #b45309);
  border-bottom-color: var(--accent-primary, #b45309);
  font-weight: 600;
}

.nexus-drawer-body {
  overflow-y: auto;
  padding: 10px 12px;
  flex: 1;
  min-height: 0;
}

.nexus-card {
  border-left: 3px solid #ccc;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
  transition: box-shadow 0.15s ease;
}
.nexus-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.nexus-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.nexus-card-emoji { font-size: 0.9rem; }
.nexus-card-severity {
  margin-left: auto;
  font-weight: 700;
  font-size: 0.68rem;
}

.nexus-card-claim {
  color: var(--text-primary, #2c1810);
  margin-bottom: 4px;
}
.nexus-card-evidence {
  font-size: 0.75rem;
  color: var(--text-secondary, #78716c);
  font-style: italic;
  margin-bottom: 4px;
}
.nexus-card-fix {
  font-size: 0.75rem;
  color: #b45309;
  font-weight: 500;
}

.nexus-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary, #78716c);
  padding: 10px 0 4px;
  letter-spacing: 0.05em;
}

.nexus-empty {
  text-align: center;
  color: var(--text-secondary, #78716c);
  padding: 20px;
  font-size: 0.82rem;
  font-style: italic;
}

/* ═══════════════════════════════════════════════
   Sprint 48: Dashboard & Admin Panel Styles
   ═══════════════════════════════════════════════ */

/* ── Shared dashboard modal overrides ── */
.dashboard-modal,
.admin-modal {
  max-width: 680px;
  width: 95%;
}

.dashboard-header,
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.dashboard-header h3,
.admin-header h3 {
  margin: 0;
  font-size: 1.15rem;
}

/* ── Card grid ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.dash-card {
  background: var(--card-bg, #f9fafb);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.dash-card-wallet {
  border-left: 3px solid #8b5cf6;
}
.dash-card-admin {
  border-left: 3px solid #f59e0b;
}
.dash-card-cost {
  border-left: 3px solid #ef4444;
}

.dash-card-icon {
  font-size: 1.5rem;
  margin-bottom: 4px;
}
.dash-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.dash-card-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
}
.dash-card-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary, #6b7280);
  margin-top: 2px;
}
.dash-card-sub {
  font-size: 0.7rem;
  color: var(--text-tertiary, #9ca3af);
  margin-top: 4px;
}

/* ── Velocity snapshot ── */
.dash-velocity {
  margin-top: 12px;
}
.dash-velocity h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 8px;
}
.dash-vel-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border, #f3f4f6);
}
.dash-vel-row:last-child {
  border-bottom: none;
}

/* ── Admin: Tool usage breakdown ── */
.admin-tool-usage {
  margin-top: 18px;
}
.admin-tool-usage h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 8px;
}
.admin-tool-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-tool-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}
.admin-tool-row span:first-child {
  min-width: 120px;
  text-align: right;
  color: var(--text-secondary, #6b7280);
}
.admin-tool-bar-wrap {
  flex: 1;
  height: 14px;
  background: var(--border, #e5e7eb);
  border-radius: 7px;
  overflow: hidden;
}
.admin-tool-bar {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  border-radius: 7px;
  transition: width 0.3s ease;
}
.admin-tool-row span:last-child {
  min-width: 32px;
  font-weight: 600;
}

/* ── Admin days selector ── */
.admin-days-select {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border, #d1d5db);
  font-size: 0.8rem;
  background: var(--card-bg, #fff);
}

/* ── Admin daily breakdown ── */
.admin-daily {
  margin-top: 18px;
}
.admin-daily h4 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 8px;
}
.admin-daily-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-daily-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 4px 0;
  border-bottom: 1px solid var(--border, #f3f4f6);
}

/* ── Loading / empty states ── */
.admin-loading,
.admin-empty {
  text-align: center;
  padding: 32px;
  font-size: 0.9rem;
  color: var(--text-secondary, #9ca3af);
}

/* ── Dark mode overrides ── */
@media (prefers-color-scheme: dark) {
  .dash-card {
    background: #1e1e2e;
    border-color: #313244;
  }
  .dash-card-value {
    color: #cdd6f4;
  }
  .admin-tool-bar-wrap {
    background: #313244;
  }
  .admin-days-select {
    background: #1e1e2e;
    border-color: #313244;
    color: #cdd6f4;
  }
}

/* ═══════════════════════════════════════════════
   Sprint 49: Zero-State Tutors
   ═══════════════════════════════════════════════ */

.zero-state-tutor {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px dashed var(--border, #d1d5db);
  border-radius: 14px;
  padding: 36px 24px;
  margin: 20px auto;
  max-width: 420px;
  background: var(--card-bg, #fafbfc);
}
.zero-state-tutor-lg {
  max-width: 520px;
  padding: 48px 32px;
}
.zero-state-icon {
  font-size: 2.6rem;
  opacity: 0.45;
  margin-bottom: 12px;
}
.zero-state-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  margin: 0 0 8px;
}
.zero-state-helper {
  font-size: 0.84rem;
  color: var(--text-secondary, #6b7280);
  line-height: 1.55;
  margin: 0 0 18px;
  max-width: 380px;
}
.zero-state-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.zero-state-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid var(--border, #d1d5db);
  background: var(--card-bg, #fff);
  color: var(--text-primary, #374151);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.zero-state-cta:hover:not(:disabled) {
  border-color: #8b5cf6;
  color: #8b5cf6;
  background: #f5f3ff;
}
.zero-state-cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.zero-state-cta-primary {
  background: #8b5cf6;
  color: #fff;
  border-color: #8b5cf6;
  animation: zero-state-pulse 2s infinite;
}
.zero-state-cta-primary:hover:not(:disabled) {
  background: #7c3aed;
  color: #fff;
}
.zero-state-cta-secondary {
  background: transparent;
}

@keyframes zero-state-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(139, 92, 246, 0); }
}

/* ═══════════════════════════════════════════════
   Sprint 49: Welcome Wizard Modal
   ═══════════════════════════════════════════════ */

.welcome-modal {
  max-width: 480px;
  width: 90%;
  text-align: center;
  padding: 40px 32px;
}
.welcome-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}
.welcome-modal h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text-primary, #1f2937);
}
.welcome-body {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary, #4b5563);
  margin: 0 0 24px;
}
.welcome-token-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
  border: 1px solid #c4b5fd;
  border-radius: 20px;
  padding: 6px 14px;
  font-weight: 600;
  font-size: 1rem;
  color: #7c3aed;
  margin: 0 0 8px;
}
.welcome-subtext {
  font-size: 0.78rem;
  color: var(--text-secondary, #6b7280);
  margin: 0 0 20px;
  opacity: 0.85;
}
.welcome-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 32px;
  border-radius: 10px;
  border: none;
  background: #8b5cf6;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.welcome-cta:hover {
  background: #7c3aed;
  transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
  .zero-state-tutor {
    background: #1e1e2e;
    border-color: #45475a;
  }
  .zero-state-cta {
    background: #1e1e2e;
    border-color: #45475a;
    color: #cdd6f4;
  }
  .zero-state-cta:hover:not(:disabled) {
    background: #2a2a3d;
  }
  .zero-state-cta-primary {
    background: #8b5cf6;
    color: #fff;
    border-color: #8b5cf6;
  }
  .welcome-token-badge {
    background: rgba(139, 92, 246, 0.15);
    border-color: #7c3aed;
  }
}

/* ═══════════════════════════════════════════════
   TUTORIAL COACH (Sprint 51)
   ═══════════════════════════════════════════════ */
.tutorial-coach {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  max-width: 380px;
  width: calc(100% - 48px);
  animation: tutorialSlideIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.tutorial-coach.left {
  right: auto;
  left: 24px;
}
.tutorial-coach.bottom-right {
  right: 60px;
  bottom: 60px;
}

@keyframes tutorialSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.tutorial-coach.tutorial-just-advanced .tutorial-coach-card {
  animation: tutorialPulse 0.5s ease;
}
@keyframes tutorialPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.tutorial-coach-card {
  background: var(--bg-primary, #1a1a2e);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(139, 92, 246, 0.15);
  overflow: hidden;
}

/* Progress bar */
.tutorial-progress-bar {
  height: 3px;
  background: rgba(139, 92, 246, 0.12);
  width: 100%;
}
.tutorial-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #10b981);
  border-radius: 0 2px 2px 0;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Header */
.tutorial-coach-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 0;
}
.tutorial-step-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(139, 92, 246, 0.8);
}
.tutorial-reward-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}
.tutorial-coach-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tutorial-skip-btn {
  background: none;
  border: none;
  color: var(--text-secondary, #888);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.tutorial-skip-btn:hover {
  color: var(--text-primary, #e0e0e0);
  background: rgba(255, 255, 255, 0.06);
}
.tutorial-dismiss-btn {
  background: none;
  border: none;
  color: var(--text-secondary, #666);
  font-size: 1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color 0.15s;
}
.tutorial-dismiss-btn:hover {
  color: var(--text-primary, #e0e0e0);
}

/* Content */
.tutorial-coach-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px 8px;
}
.tutorial-coach-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}
.tutorial-coach-text {
  flex: 1;
  min-width: 0;
}
.tutorial-coach-text h4 {
  margin: 0 0 4px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary, #e0e0e0);
}
.tutorial-coach-text p {
  margin: 0 0 4px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-secondary, #aaa);
}
.tutorial-hint {
  font-size: 0.73rem !important;
  font-style: italic;
  opacity: 0.6;
  margin-top: 2px !important;
}

/* Phase label */
.tutorial-phase-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 7px;
  border-radius: 8px;
}

/* Grind progress counter */
.tutorial-grind-counter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.tutorial-grind-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.tutorial-grind-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #f59e0b);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.tutorial-grind-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #f59e0b;
  min-width: 28px;
  text-align: right;
}

/* Future phase dot — dimmer for quests in later phases */
.tutorial-dot-future-phase {
  opacity: 0.3;
}

/* Step dots */
.tutorial-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px 4px;
}

/* Next step teaser — open loop psychology */
.tutorial-next-teaser {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-secondary, #9ca3af);
  padding: 0 14px 10px;
  opacity: 0.7;
  font-style: italic;
  letter-spacing: 0.2px;
}
.tutorial-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.15);
  transition: background 0.3s, transform 0.3s;
}
.tutorial-dot-done {
  background: #10b981;
}
.tutorial-dot-active {
  background: #8b5cf6;
  transform: scale(1.3);
  box-shadow: 0 0 6px rgba(139, 92, 246, 0.4);
}

/* Celebration flash — contextual message */
.tutorial-celebrate-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(16, 185, 129, 0.95);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 10px 20px;
  border-radius: 20px;
  animation: celebrateFlash 1.2s ease forwards;
  pointer-events: none;
  z-index: 10;
  text-align: center;
  max-width: 280px;
  line-height: 1.4;
}
@keyframes celebrateFlash {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  60% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(0.95); }
}

/* Celebrating state — dim card behind flash */
.tutorial-celebrating .tutorial-coach-card {
  opacity: 0.5;
  transition: opacity 0.3s;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .tutorial-coach {
    bottom: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
    width: auto;
  }
  .tutorial-coach.left {
    left: 12px;
    right: 12px;
  }
  .tutorial-coach.bottom-right {
    right: 12px;
    bottom: 12px;
  }
}

/* ── Sprint 51.2: Spotlight effect for tutorial targets ── */
@keyframes tutorialSpotlightPulse {
  0%   { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.5); }
  50%  { box-shadow: 0 0 16px 6px rgba(76, 175, 80, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.5); }
}
.tutorial-spotlight {
  animation: tutorialSpotlightPulse 1.6s ease-in-out infinite;
  border-radius: 8px;
  position: relative;
  z-index: 2;
}
/* Tab buttons inside the view toggle get a subtler variant */
.journal-view-toggle .tutorial-spotlight {
  border-radius: 6px;
}
/* The small icon buttons (principles, etc.) */
button.tutorial-spotlight {
  border-radius: 50%;
}
/* NexusCard.css — Stage 6 step 41 shared card styles. */

:root {
  /* Neutral palette for the "suggestion" severity (new in Stage 6). */
  --nexus-neutral-bg: #f3f4f6;
  --nexus-neutral-border: #6b7280;
}

.nexus-card {
  --nexus-card-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--nexus-card-bg, #f9fafb);
  border: 1px solid var(--nexus-card-border, rgba(0, 0, 0, 0.08));
  border-left-width: 4px;
  border-radius: var(--nexus-card-radius);
  transition: transform 80ms ease, box-shadow 80ms ease, opacity 120ms ease;
}

.nexus-card[role="button"]:hover,
.nexus-card[role="button"]:focus-visible {
  outline: 2px solid var(--nexus-card-border, #4b6cb7);
  outline-offset: 1px;
}

.nexus-card--muted .nexus-card__title--muted {
  text-decoration: line-through;
  color: var(--text-muted, #6b7280);
}

.nexus-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.nexus-card__select {
  margin-top: 4px;
}

.nexus-card__title-block {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nexus-card__title {
  font-weight: 600;
  font-size: 0.95em;
  line-height: 1.3;
  color: var(--text-primary, #111827);
  word-break: break-word;
}

.nexus-card__subtitle {
  font-size: 0.8em;
  color: var(--text-secondary, #4b5563);
  word-break: break-word;
}

.nexus-card__chip-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nexus-card__chip {
  font-size: 0.7em;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary, #374151);
  white-space: nowrap;
}

.nexus-card__chip--source { background: #4b6cb7; color: #fff; }
.nexus-card__chip--ai { background: #4b6cb7; color: #fff; }
.nexus-card__chip--severity-blocking { background: var(--nexus-contradicted-border, #dc2626); color: #fff; }
.nexus-card__chip--severity-strong { background: var(--nexus-supported-border, #16a34a); color: #fff; }
.nexus-card__chip--severity-moderate { background: var(--nexus-unsupported-border, #d97706); color: #fff; }
.nexus-card__chip--severity-suggestion { background: var(--nexus-neutral-border, #6b7280); color: #fff; }

.nexus-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.nexus-card__body {
  font-size: 0.85em;
  color: var(--text-secondary, #4b5563);
  line-height: 1.45;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
  padding-top: 6px;
}

/* `bare` mode skips the divider + padding so the card surface can host
   pre-existing card-body markup (e.g. ResearchReviewPanel's
   .nexus-card-claim / .nexus-card-evidence rows) without visible drift. */
.nexus-card__body--bare {
  border-top: 0;
  padding-top: 0;
  font-size: inherit;
  color: inherit;
  line-height: inherit;
}

/* Tone-specific accent shadows (kept subtle so the existing nexus palette
   stays the dominant signal). */
.nexus-card--tone-contradicted { box-shadow: 0 1px 0 rgba(220, 38, 38, 0.12); }
.nexus-card--tone-supported    { box-shadow: 0 1px 0 rgba(22, 163, 74, 0.12); }
.nexus-card--tone-unsupported  { box-shadow: 0 1px 0 rgba(217, 119, 6, 0.12); }
.nexus-card--tone-sabotage     { box-shadow: 0 1px 0 rgba(219, 39, 119, 0.12); }
.nexus-card--tone-supports     { box-shadow: 0 1px 0 rgba(37, 99, 235, 0.12); }
.nexus-card--tone-neutral      { box-shadow: 0 1px 0 rgba(107, 114, 128, 0.10); }
.meta-analysis-panel {
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  background: var(--ellie-surface-subtle, #f8fafc);
  color: var(--ellie-ink, #0f172a);
}

.meta-analysis-panel--compact {
  padding: 0;
  background: transparent;
  overflow-x: hidden;
}

.meta-analysis-header,
.meta-analysis-compact-header,
.meta-analysis-saved-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.meta-analysis-header h2,
.meta-analysis-compact-header h3 {
  margin: 0;
  color: var(--ellie-ink, #0f172a);
}

.meta-analysis-header h2 {
  font-size: clamp(1.45rem, 2vw, 1.75rem);
}

.meta-analysis-compact-header h3 {
  font-size: 1.05rem;
}

.meta-analysis-header p,
.meta-analysis-compact-header p,
.meta-analysis-muted {
  margin: 4px 0 0;
  color: var(--ellie-muted, #64748b);
  font-size: 0.82rem;
  line-height: 1.45;
}

.meta-analysis-actions,
.meta-analysis-compact-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meta-analysis-header--actions-only {
  justify-content: flex-start;
}

.meta-analysis-actions--left {
  justify-content: flex-start;
}

.meta-analysis-workspace-chip {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.35;
  padding: 7px 10px;
}

.meta-analysis-workspace-select {
  display: grid;
  gap: 4px;
  min-width: min(260px, 100%);
  color: #334155;
  font-size: 0.76rem;
  font-weight: 800;
}

.meta-analysis-workspace-select select,
.meta-analysis-workspace-create input,
.meta-analysis-workspace-manager input,
.meta-analysis-workspace-manager select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  color: #0f172a;
  font: inherit;
  padding: 8px 10px;
}

.meta-analysis-workspace-manager {
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #f8fbff;
  padding: 12px;
  margin-bottom: 14px;
  display: grid;
  gap: 10px;
}

.meta-analysis-workspace-manager-row {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-analysis-workspace-create {
  display: flex;
  gap: 8px;
  flex: 1 1 380px;
}

.meta-analysis-workspace-source-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.meta-analysis-source-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}

.meta-analysis-source-card div {
  min-width: 0;
}

.meta-analysis-source-card strong,
.meta-analysis-source-card span,
.meta-analysis-source-card em {
  display: block;
}

.meta-analysis-source-card strong {
  color: #0f172a;
  font-size: 0.82rem;
}

.meta-analysis-source-card span {
  color: #334155;
  font-size: 0.8rem;
  line-height: 1.35;
  margin-top: 3px;
}

.meta-analysis-source-card em {
  color: #64748b;
  font-size: 0.74rem;
  font-style: normal;
  margin-top: 4px;
}

.meta-analysis-text-btn {
  border: 0;
  background: transparent;
  color: #0f766e;
  cursor: pointer;
  font-weight: 800;
  padding: 2px 0;
}

.meta-analysis-card,
.meta-analysis-empty-card {
  background: var(--ellie-card, #ffffff);
  border: 1px solid var(--ellie-border, #e2e8f0);
  border-radius: 10px;
  padding: 14px;
  box-sizing: border-box;
}

.meta-analysis-empty-card {
  text-align: center;
  padding: 32px 24px;
}

.meta-analysis-empty-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ellie-ink, #0f172a);
  margin-bottom: 8px;
}

.meta-analysis-metric-grid,
.meta-analysis-triple-grid,
.meta-analysis-double-grid,
.meta-analysis-compact-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.meta-analysis-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.meta-analysis-double-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-analysis-double-grid--weighted {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
}

.meta-analysis-compact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-analysis-metric-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--ellie-muted, #64748b);
  font-weight: 800;
}

.meta-analysis-metric-value {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  color: var(--ellie-ink, #0f172a);
  font-weight: 850;
  line-height: 1.2;
  margin-top: 6px;
}

.meta-analysis-metric-detail {
  color: var(--ellie-muted, #64748b);
  font-size: 0.75rem;
  margin-top: 4px;
  line-height: 1.35;
}

.meta-analysis-card-title,
.meta-analysis-section-title {
  font-weight: 850;
  color: var(--ellie-ink, #0f172a);
  margin-bottom: 8px;
}

.meta-analysis-section-gap {
  margin-bottom: 12px;
}

.meta-analysis-risk-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
  margin-bottom: 12px;
}

.meta-analysis-risk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.meta-analysis-risk-row {
  font-size: 0.76rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-analysis-risk-row span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.meta-analysis-stat-list {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 0.82rem;
}

.meta-analysis-warning-card {
  border-color: #fde68a;
  background: #fffbeb;
}

.meta-analysis-warning-list {
  margin: 0;
  padding-left: 18px;
  color: #78350f;
  font-size: 0.82rem;
  display: grid;
  gap: 6px;
}

.meta-analysis-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
  font-size: 0.82rem;
}

.meta-analysis-plot-card {
  min-height: 340px;
}

.meta-analysis-primary-btn,
.meta-analysis-secondary-btn,
.meta-analysis-dark-btn,
.meta-analysis-teal-btn {
  border-radius: 8px;
  padding: 8px 11px;
  font-weight: 750;
  font-size: 0.82rem;
  cursor: pointer;
}

.meta-analysis-primary-btn {
  border: 0;
  background: #0f766e;
  color: #ffffff;
}

.meta-analysis-secondary-btn {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
}

.meta-analysis-dark-btn {
  border: 0;
  background: #334155;
  color: #ffffff;
}

.meta-analysis-teal-btn {
  border: 0;
  background: #0f766e;
  color: #ffffff;
}

.meta-analysis-primary-btn:disabled,
.meta-analysis-secondary-btn:disabled,
.meta-analysis-dark-btn:disabled,
.meta-analysis-teal-btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.meta-analysis-status,
.meta-analysis-error {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #64748b;
}

.meta-analysis-status[data-tone="warning"],
.meta-analysis-saved-header span[data-tone="warning"],
.meta-analysis-error {
  color: #b45309;
}

.meta-analysis-saved-header span {
  font-size: 0.75rem;
  color: #64748b;
}

.meta-analysis-run-list,
.meta-analysis-correction-list,
.meta-analysis-link-list {
  display: grid;
  gap: 8px;
  max-height: 270px;
  overflow-y: auto;
}

.meta-analysis-run-row,
.meta-analysis-correction-row,
.meta-analysis-link-row {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  font-size: 0.8rem;
}

.meta-analysis-run-row div,
.meta-analysis-correction-row strong,
.meta-analysis-link-row strong {
  font-weight: 850;
  color: #0f172a;
}

.meta-analysis-run-row span,
.meta-analysis-correction-row span,
.meta-analysis-link-row span {
  display: block;
  color: #64748b;
  margin-top: 4px;
}

.meta-analysis-table-card {
  padding: 0;
  overflow: hidden;
}

.meta-analysis-wide-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.meta-analysis-table-shell {
  min-width: 760px;
}

.meta-analysis-table-header,
.meta-analysis-table-row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) 88px 88px 88px 112px;
  gap: 8px;
  align-items: center;
}

.meta-analysis-table-header {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.75rem;
  font-weight: 850;
  color: #475569;
}

.meta-analysis-table-viewport {
  overflow-y: auto;
  position: relative;
}

.meta-analysis-table-row {
  position: absolute;
  left: 0;
  right: 0;
  padding: 0 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.75rem;
  color: #334155;
  background: #ffffff;
}

.meta-analysis-table-row:nth-child(odd) {
  background: #fbfdff;
}

.meta-analysis-table-row span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-analysis-skeleton {
  min-height: 140px;
  overflow: hidden;
}

.meta-analysis-skeleton-label {
  font-size: 0.76rem;
  font-weight: 800;
  color: #475569;
  margin-bottom: 14px;
}

.analysis-skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e2e8f0, #f8fafc, #e2e8f0);
  animation: ellie-analysis-pulse 1.35s ease-in-out infinite;
  margin-bottom: 10px;
}

.analysis-skeleton-block {
  width: 100%;
  height: 72px;
  margin-bottom: 12px;
}

@keyframes ellie-analysis-pulse {
  0% { opacity: .55; transform: translateX(-4px); }
  50% { opacity: 1; transform: translateX(4px); }
  100% { opacity: .55; transform: translateX(-4px); }
}

.meta-analysis-workspace-overlay {
  position: fixed;
  inset: 18px;
  z-index: 2400;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.meta-analysis-workspace-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.meta-analysis-workspace-bar h2 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.meta-analysis-workspace-bar p {
  margin: 3px 0 0;
  color: #64748b;
  font-size: .82rem;
}

.meta-analysis-workspace-body {
  min-height: 0;
  overflow: hidden;
}

@media (max-width: 980px) {
  .meta-analysis-metric-grid,
  .meta-analysis-triple-grid,
  .meta-analysis-double-grid,
  .meta-analysis-double-grid--weighted {
    grid-template-columns: 1fr;
  }

  .meta-analysis-panel {
    padding: 16px;
  }

  .meta-analysis-workspace-overlay {
    inset: 8px;
    border-radius: 12px;
  }
}

@media (max-width: 460px) {
  .meta-analysis-compact-grid {
    grid-template-columns: 1fr;
  }

  .meta-analysis-compact-header,
  .meta-analysis-header,
  .meta-analysis-workspace-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .meta-analysis-actions,
  .meta-analysis-compact-actions {
    justify-content: stretch;
  }

  .meta-analysis-workspace-manager-row,
  .meta-analysis-workspace-create,
  .meta-analysis-source-card {
    align-items: stretch;
    flex-direction: column;
  }

  .meta-analysis-actions button,
  .meta-analysis-compact-actions button,
  .meta-analysis-primary-btn,
  .meta-analysis-secondary-btn {
    width: 100%;
  }
}

/* S2 & S4: Project Membership and Paper Type UI */
.meta-analysis-workspace-projects {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.meta-analysis-project-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-analysis-project-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s;
}

.meta-analysis-project-chip:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.meta-analysis-project-chip.active {
  border-color: #0f766e;
  background: #f0fdfa;
  color: #0f766e;
}

.project-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.paper-type-options-list button {
  text-align: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
}

.resizable-panel-shell {
  --rps-left-width: 240px;
  --rps-left-resizer: 8px;
  --rps-right-width: 360px;
  --rps-right-resizer: 8px;
  --rps-center-min: 520px;
  display: grid;
  grid-template-columns:
    var(--rps-left-width)
    var(--rps-left-resizer)
    minmax(min(var(--rps-center-min), 100%), 1fr)
    var(--rps-right-resizer)
    var(--rps-right-width);
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.resizable-panel-shell.wm-body,
.resizable-panel-shell.ms-native-body {
  display: grid;
  grid-template-columns:
    var(--rps-left-width)
    var(--rps-left-resizer)
    minmax(min(var(--rps-center-min), 100%), 1fr)
    var(--rps-right-resizer)
    var(--rps-right-width);
}

.resizable-panel-shell .rps-panel {
  min-height: 0;
  min-width: 0;
}

.resizable-panel-shell .rps-panel-left {
  grid-column: 1;
}

.resizable-panel-shell .rps-resizer-left {
  grid-column: 2;
}

.resizable-panel-shell .rps-panel-center {
  grid-column: 3;
}

.resizable-panel-shell .rps-resizer-right {
  grid-column: 4;
}

.resizable-panel-shell .rps-panel-right {
  grid-column: 5;
}

.resizable-panel-shell .rps-panel-left,
.resizable-panel-shell .rps-panel-right {
  width: auto;
  max-width: none;
}

.resizable-panel-shell .rps-panel-center {
  display: flex;
  flex-direction: column;
  min-width: min(var(--rps-center-min), 100%);
  min-height: 0;
  overflow: hidden;
}

.resizable-panel-shell .rps-panel-center > .wm-panel-center,
.resizable-panel-shell .rps-panel-center > .ms-native-canvas {
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.rps-resizer {
  appearance: none;
  border: 0;
  border-left: 1px solid rgba(139, 115, 85, 0.18);
  border-right: 1px solid rgba(139, 115, 85, 0.18);
  background:
    linear-gradient(90deg, transparent 0, rgba(139, 115, 85, 0.12) 45%, rgba(139, 115, 85, 0.26) 50%, rgba(139, 115, 85, 0.12) 55%, transparent 100%);
  cursor: col-resize;
  min-width: 8px;
  padding: 0;
  position: relative;
  z-index: 4;
}

.rps-resizer:hover,
.rps-resizer:focus-visible {
  background:
    linear-gradient(90deg, transparent 0, rgba(75, 108, 183, 0.18) 42%, rgba(75, 108, 183, 0.55) 50%, rgba(75, 108, 183, 0.18) 58%, transparent 100%);
  outline: none;
}

.rps-is-resizing,
.rps-is-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.rps-drawer-toggle,
.rps-drawer-backdrop {
  display: none;
}

.resizable-panel-shell.rps-desktop-mode.rps-left-closed .rps-drawer-toggle-left,
.resizable-panel-shell.rps-desktop-mode.rps-right-closed .rps-drawer-toggle-right {
  align-items: center;
  background: rgba(247, 243, 238, 0.96);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 999px;
  color: var(--text-muted, #6b5c4d);
  cursor: pointer;
  display: flex;
  font-size: 0.72rem;
  font-weight: 700;
  height: 28px;
  justify-content: center;
  padding: 0 10px;
  position: absolute;
  top: 10px;
  z-index: 20;
}

.resizable-panel-shell.rps-desktop-mode.rps-left-closed .rps-drawer-toggle-left {
  left: 10px;
}

.resizable-panel-shell.rps-desktop-mode.rps-right-closed .rps-drawer-toggle-right {
  right: 10px;
}

.resizable-panel-shell.rps-drawer-mode {
  display: block;
}

.resizable-panel-shell.rps-drawer-mode .rps-panel-center {
  height: 100%;
  min-width: 0;
}

.resizable-panel-shell.rps-drawer-mode .rps-drawer-toggle {
  align-items: center;
  background: var(--bg-tertiary, #f7f3ee);
  border: 1px solid var(--border-primary, #e8e3db);
  color: var(--text-muted, #6b5c4d);
  cursor: pointer;
  display: flex;
  font-size: 0.78rem;
  font-weight: 700;
  height: 64px;
  justify-content: center;
  letter-spacing: 0.02em;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  z-index: 130;
  writing-mode: vertical-rl;
}

.resizable-panel-shell.rps-drawer-mode .rps-drawer-toggle-left {
  border-left: 0;
  border-radius: 0 10px 10px 0;
  left: 0;
}

.resizable-panel-shell.rps-drawer-mode .rps-drawer-toggle-right {
  border-radius: 10px 0 0 10px;
  border-right: 0;
  right: 0;
}

.resizable-panel-shell.rps-drawer-mode .rps-drawer-backdrop {
  appearance: none;
  background: rgba(20, 16, 12, 0.26);
  border: 0;
  display: block;
  inset: 0;
  padding: 0;
  position: fixed;
  z-index: 120;
}

.resizable-panel-shell.rps-drawer-mode .rps-panel-left,
.resizable-panel-shell.rps-drawer-mode .rps-panel-right {
  bottom: 0;
  display: flex;
  max-height: none;
  position: fixed;
  top: 0;
  transition: transform 0.22s ease;
  width: min(84vw, 360px);
  z-index: 135;
}

.resizable-panel-shell.rps-drawer-mode .rps-panel-left {
  left: 0;
  transform: translateX(0);
}

.resizable-panel-shell.rps-drawer-mode .rps-panel-right {
  right: 0;
  transform: translateX(0);
}

@media (max-width: 700px) {
  .resizable-panel-shell .rps-panel-center {
    min-width: 0;
  }

  .resizable-panel-shell.rps-drawer-mode .rps-panel-left,
  .resizable-panel-shell.rps-drawer-mode .rps-panel-right {
    width: min(92vw, 360px);
  }
}
/**
 * ReviewerCard.css — Sprint 25C: Peer Review Card Styles
 * "No Red Ink" palette — academic colours only.
 */

/* ── Card Base ── */
.rc-card {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  border-left: 4px solid transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.35s ease-in-out;
  position: relative;
}

.rc-card--resolving {
  opacity: 0;
  transform: translateX(16px);
  background-color: #dcfce7 !important;
  border-left-color: #16a34a !important;
}

.rc-card--resolved {
  opacity: 0.6;
}

/* ── Card Header ── */
.rc-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.rc-card-type {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

.rc-card-block {
  font-size: 0.7rem;
  opacity: 0.5;
  font-style: italic;
}

/* ── Card Body ── */
.rc-card-body {
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 10px;
}

/* ── Card Actions ── */
.rc-card-actions {
  display: flex;
  gap: 8px;
}

.rc-resolve-btn {
  flex: 1;
  padding: 6px 10px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: background-color 0.2s;
}

.rc-resolve-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.95);
}

.rc-resolve-btn:disabled {
  cursor: default;
  color: #16a34a !important;
  font-weight: 700;
}

.rc-dismiss-btn {
  padding: 6px 10px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  opacity: 0.4;
  cursor: pointer;
  font-size: 0.75rem;
  transition: opacity 0.2s;
}

.rc-dismiss-btn:hover {
  opacity: 0.8;
}

/* ── Reviewer Drawer (slide-out panel in ManuscriptMode) ── */
.reviewer-drawer {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary, #f9faf8);
  border-left: 1px solid var(--border-primary, #e8e3db);
  width: 320px;
  min-width: 280px;
  max-width: 380px;
  overflow-y: auto;
  transition: width 0.3s ease;
}

.reviewer-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  position: sticky;
  top: 0;
  background: inherit;
  z-index: 1;
}

.reviewer-drawer-header h4 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}

.reviewer-drawer-count {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-left: 6px;
}

.reviewer-drawer-body {
  padding: 12px;
  flex: 1;
}

/* ── Empty State (Celebration) ── */
.reviewer-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-faint, #b0a090);
}

.reviewer-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.reviewer-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #2c2416);
  margin-bottom: 6px;
}

.reviewer-empty-text {
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 240px;
}
.block-schema-editor {
  background: #fdfdfd;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.schema-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: #f0f4f8;
  cursor: pointer;
  user-select: none;
}

.schema-header h4 {
  margin: 0;
  font-size: 14px;
  color: #333;
}

.toggle-btn {
  background: none;
  border: none;
  font-size: 12px;
  color: #666;
  cursor: pointer;
}

.schema-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schema-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.schema-field label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
}

.schema-field input,
.schema-field select,
.schema-field textarea {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
}

.schema-field textarea {
  resize: vertical;
  min-height: 60px;
}

.logic-bridge-helper {
  background: #f9f9f9;
  border: 1px dashed #ddd;
  padding: 10px;
  border-radius: 4px;
}

.helper-text {
  margin: 0 0 8px 0;
  font-size: 12px;
  color: #666;
}

.linked-blocks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.linked-block-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
}
/* TasksTab.css — Stage 6 step 43 styles for the severity-grouped Tasks tab. */

.tasks-tab {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tasks-tab__compose {
  display: flex;
  gap: 8px;
}

.tasks-tab__filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tasks-tab__filter-chip {
  font-size: 0.78em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-popover, #f3f4f6);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--text-secondary, #4b5563);
  cursor: pointer;
  transition: background 80ms ease, color 80ms ease, border-color 80ms ease;
}

.tasks-tab__filter-chip.is-on {
  background: #1f2937;
  color: #fff;
  border-color: #1f2937;
}

.tasks-tab__bulk-resolve {
  margin-left: auto;
}

.tasks-tab__groups {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tasks-tab__group {
  list-style: none;
}

.tasks-tab__group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.tasks-tab__group-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  font-weight: 600;
  font-size: 0.92em;
  color: var(--text-primary, #1f2937);
  cursor: pointer;
}

.tasks-tab__group-trigger[data-state="closed"] .tasks-tab__group-count {
  opacity: 0.6;
}

.tasks-tab__group-count {
  font-weight: 400;
  font-size: 0.85em;
  color: var(--text-secondary, #6b7280);
}

.tasks-tab__rows {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tasks-tab__row {
  list-style: none;
}

.tasks-tab__row--focused .nexus-card {
  box-shadow: 0 0 0 2px var(--nexus-card-border, #4b6cb7);
}

.tasks-tab__preview-trigger {
  background: transparent;
  border: 0;
  color: var(--text-link, #2563eb);
  font-size: 0.8em;
  padding: 0;
  cursor: pointer;
}

.tasks-tab__preview-body {
  margin-top: 6px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--text-secondary, #4b5563);
}
/**
 * LiteratureGraph.css — Sprint 31: Live Literature Graph Styling
 */

/* ── Overlay container ── */
.lit-graph-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg-primary, #faf8f4);
  display: flex;
  flex-direction: column;
  color: var(--text-primary, #2c2416);
}

/* ── Top bar ── */
.lit-graph-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-primary, #e8e3db);
  background: var(--bg-card, #fff);
  z-index: 1;
}
.lit-graph-topbar h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #2c2416);
}
.lit-graph-topbar p {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--text-secondary, #78716c);
}
.lit-graph-close-btn {
  background: none;
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-secondary, #78716c);
  transition: background 0.15s;
}
.lit-graph-close-btn:hover {
  background: var(--bg-tertiary, #f7f3ee);
}
.lit-graph-search {
  flex: 1;
  max-width: 360px;
  padding: 6px 12px;
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--bg-primary, #faf8f4);
  color: var(--text-primary, #2c2416);
}
.lit-graph-search::placeholder {
  color: var(--text-placeholder, #c0b8a8);
}
.lit-graph-stats {
  font-size: 0.75rem;
  color: var(--text-secondary, #78716c);
  margin-left: auto;
  white-space: nowrap;
}

.lit-graph-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(520px, 1fr) minmax(280px, 340px);
  background:
    radial-gradient(circle at 12% 16%, rgba(139, 115, 85, 0.08), transparent 28%),
    linear-gradient(135deg, #faf8f4 0%, #f5f0e8 100%);
}

.lit-graph-left-panel,
.lit-graph-right-panel {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  border-right: 1px solid var(--border-primary, #e8e3db);
}

.lit-graph-right-panel {
  border-right: 0;
  border-left: 1px solid var(--border-primary, #e8e3db);
}

.lit-graph-canvas-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ── Graph canvas ── */
.lit-graph-canvas {
  flex: 1;
  min-height: 0;
  background: rgba(255, 253, 248, 0.72);
}

.lit-graph-panel-card,
.lit-graph-detail-card {
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(44, 36, 22, 0.06);
  margin-bottom: 12px;
}

.lit-graph-section-title {
  font-size: 0.72rem;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--text-secondary, #6b5b47);
  margin-bottom: 10px;
}

.lit-graph-section-title.small {
  margin-top: 12px;
  margin-bottom: 8px;
}

.lit-graph-view-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.lit-graph-view-btn,
.lit-graph-primary-btn,
.lit-graph-secondary-btn,
.lit-graph-chip {
  font-family: inherit;
  cursor: pointer;
}

.lit-graph-view-btn {
  text-align: left;
  border: 1px solid var(--border-primary, #e8e3db);
  background: var(--bg-card, #fff);
  color: var(--text-primary, #2c2416);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.lit-graph-view-btn.active {
  background: #2c2416;
  color: #fffdf8;
  border-color: #2c2416;
}

.lit-graph-control-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.lit-graph-control-row.wrap {
  flex-wrap: wrap;
}

.lit-graph-board-name,
.lit-graph-select {
  width: 100%;
  border: 1px solid var(--border-primary, #e8e3db);
  background: #fffdf8;
  color: var(--text-primary, #2c2416);
  border-radius: 8px;
  padding: 7px 9px;
  font-family: inherit;
  font-size: 0.82rem;
}

.lit-graph-select.full {
  width: 100%;
}

.lit-graph-primary-btn,
.lit-graph-secondary-btn {
  border: 1px solid var(--border-primary, #e8e3db);
  border-radius: 8px;
  padding: 7px 10px;
  font-weight: 800;
  font-size: 0.8rem;
}

.lit-graph-primary-btn {
  color: #fffdf8;
  background: #4a3a2e;
  border-color: #4a3a2e;
}

.lit-graph-primary-btn.full {
  width: 100%;
  margin-top: 10px;
}

.lit-graph-secondary-btn {
  color: var(--text-primary, #2c2416);
  background: #f5f2ed;
}

.lit-graph-secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.lit-graph-field-label {
  display: block;
  margin: 10px 0 5px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-secondary, #6b5b47);
}

.lit-graph-save-status {
  margin-top: 8px;
  color: #2f7d52;
  font-size: 0.76rem;
}

.lit-graph-filter-group {
  margin-top: 12px;
}

.lit-graph-filter-group > span {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-secondary, #6b5b47);
  margin-bottom: 6px;
}

.lit-graph-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.lit-graph-chip {
  border: 1px solid #e8e2d9;
  background: #f5f2ed;
  color: #4a3a2e;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.72rem;
  line-height: 1.2;
}

.lit-graph-chip.active {
  background: #2f281f;
  color: #fffdf8;
  border-color: #2f281f;
}

.lit-graph-chip.readonly {
  cursor: default;
  background: #f1e9dd;
}

.lit-graph-notice {
  margin: 10px 12px 0;
  padding: 8px 12px;
  border-radius: 999px;
  color: #6b5b47;
  background: #fbf3df;
  border: 1px solid #ead7ad;
  font-size: 0.78rem;
  line-height: 1.25;
}

.lit-graph-notice.empty {
  border-radius: 12px;
  background: #fffdf8;
}

.lit-graph-summary-grid,
.lit-graph-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  font-size: 0.78rem;
}

.lit-graph-summary-grid span,
.lit-graph-detail-grid span {
  color: var(--text-secondary, #78716c);
}

.lit-graph-details-empty {
  background: rgba(255, 253, 248, 0.86);
  border: 1px dashed #d8cfc0;
  border-radius: 14px;
  padding: 16px;
  color: var(--text-secondary, #6b5b47);
  font-size: 0.9rem;
  line-height: 1.4;
}

.lit-graph-detail-kicker {
  font-size: 0.68rem;
  font-weight: 900;
  color: var(--text-muted, #8a7a6a);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lit-graph-detail-card h4 {
  margin: 4px 0 4px;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--text-primary, #2c2416);
}

.lit-graph-detail-card p {
  color: var(--text-secondary, #4a3a2e);
  font-size: 0.82rem;
  line-height: 1.42;
}

.lit-graph-detail-meta,
.lit-graph-detail-note {
  color: var(--text-muted, #8a7a6a) !important;
}

.lit-graph-detail-section {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  font-size: 0.8rem;
}

.lit-graph-detail-section strong {
  color: var(--text-primary, #2c2416);
}

.lit-graph-detail-section > span {
  color: var(--text-secondary, #4a3a2e);
}

.lit-graph-fallback {
  max-width: 560px;
  margin: 12vh auto;
  background: #fffdf8;
  border: 1px solid #e8e2d9;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(44, 36, 22, 0.12);
  text-align: center;
}

.lit-graph-fallback h3 {
  margin-top: 0;
  color: #2c2416;
}

.lit-graph-fallback p {
  color: #4a3a2e;
  line-height: 1.5;
}

/* ── Custom lit node ── */
.lit-graph-node {
  background: #fff;
  border: 2px solid var(--border-primary, #e8e3db);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 200px;
  max-width: 260px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.lit-graph-node:hover {
  border-color: var(--accent-primary, #8b7355);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.lit-graph-node.highlighted {
  border-color: #6d28d9;
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}
.lit-graph-node.dimmed {
  opacity: 0.3;
}

.lit-node-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary, #2c2416);
  line-height: 1.3;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.lit-node-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.lit-node-author {
  font-size: 0.7rem;
  color: var(--text-secondary, #78716c);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.lit-node-year {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--accent-primary, #8b7355);
  color: #fff;
  white-space: nowrap;
}
.lit-node-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.lit-node-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 5px;
}
.lit-node-badge {
  font-size: 0.58rem;
  line-height: 1.1;
  padding: 2px 5px;
  border-radius: 999px;
  background: #f1e9dd;
  color: #6b5b47;
  text-transform: capitalize;
}
.lit-node-badge.pinned {
  background: #dcfce7;
  color: #166534;
}
.lit-node-keyword {
  font-size: 0.6rem;
  padding: 1px 5px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f0ecff, #e8e0ff);
  color: #6d28d9;
  white-space: nowrap;
}

/* ── React Flow overrides ── */
.lit-graph-canvas .react-flow__minimap {
  border-radius: 8px;
  border: 1px solid var(--border-primary, #e8e3db);
}
.lit-graph-canvas .react-flow__controls {
  border-radius: 8px;
  border: 1px solid var(--border-primary, #e8e3db);
}

@media (max-width: 1100px) {
  .lit-graph-body {
    grid-template-columns: minmax(220px, 280px) minmax(420px, 1fr);
  }
  .lit-graph-right-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  .lit-graph-topbar {
    flex-wrap: wrap;
  }
  .lit-graph-search {
    max-width: none;
    flex-basis: 100%;
  }
  .lit-graph-body {
    grid-template-columns: 1fr;
  }
  .lit-graph-left-panel {
    max-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--border-primary, #e8e3db);
  }
}
/* Editorial marketing kit — Newsreader display, hard-cornered, 1 px Onyx
   borders, no shadows except the canonical 8/8 editorial shadow. */

.ml-page { background: var(--ellie-color-soft-linen); color: var(--c-fg); font-family: var(--ellie-font-ui); min-height: 100vh; }

.ml-progress { position: fixed; top: 0; left: 0; width: 100%; height: 4px; background: var(--ellie-color-punch-red); transform-origin: 0% 50%; z-index: 1000; }

.ml-header {
  position: sticky; top: 0; z-index: 900;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 24px;
  padding: 16px clamp(24px, 5vw, 64px);
  border-bottom: var(--ellie-border);
  background: rgba(245, 241, 230, 0.8);
  backdrop-filter: blur(12px);
}
.ml-brand { color: var(--c-fg); font-family: var(--ellie-font-brand); font-weight: 800; font-size: 24px; letter-spacing: 0.08em; text-decoration: none; display: flex; gap: 12px; align-items: center; }
.ml-brand img { width: 32px; }
.ml-nav { display: flex; gap: 32px; justify-content: center; }
.ml-nav a { color: var(--c-fg); text-decoration: none; font-family: var(--ellie-font-ui); font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; padding-bottom: 4px; cursor: pointer; border-bottom: 2px solid transparent; transition: color 150ms ease; min-height: 44px; display: inline-flex; align-items: center; }
.ml-nav a:hover { color: var(--ellie-color-onyx); }
.ml-nav a.active { border-bottom: 2px solid var(--c-fg); }
.ml-actions { display: flex; justify-content: flex-end; gap: 16px; align-items: center; }

.ml-btn { font: inherit; font-family: var(--ellie-font-ui); font-size: 13px; font-weight: 800; padding: 10px 18px; border: var(--ellie-border); background: var(--c-surface); color: var(--c-fg); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; border-radius: var(--ellie-radius-md); transition: background 150ms ease, border-color 150ms ease; }
.ml-btn.primary { background: var(--ellie-color-punch-red); color: white; }
.ml-btn.primary:hover { background: #d22f3c; }
.ml-btn.secondary:hover { background: var(--ellie-color-cool-blue); }
.ml-btn:focus-visible { outline: 2px solid var(--ellie-color-onyx); outline-offset: 2px; }

.ml-link { font: inherit; font-family: var(--ellie-font-ui); font-size: 13px; font-weight: 800; background: transparent; border: 0; color: var(--c-fg); cursor: pointer; transition: color 150ms ease; border-radius: var(--ellie-radius-sm); }
.ml-link:hover { text-decoration: underline; }

/* Hero */
.ml-hero { display: grid; grid-template-columns: 0.92fr 1.08fr; gap: 64px; align-items: center; padding: 64px clamp(24px, 6vw, 80px) 64px; min-height: calc(100vh - 160px); }
.ml-hero h1 { font-family: var(--ellie-font-display); font-weight: 700; font-size: 104px; line-height: 0.98; letter-spacing: -0.025em; color: var(--c-heading-editorial); margin: 0; }
.ml-hero h1 em { font-family: var(--ellie-font-brand); font-style: normal; font-weight: 800; letter-spacing: 0.04em; color: var(--c-fg); display: block; font-size: 0.92em; line-height: 0.95; }
.ml-hero p { font-family: var(--ellie-font-display); font-size: 22px; line-height: 1.45; color: var(--c-fg); max-width: 540px; margin: 0; }
.ml-hero figure { margin: 0; }
.ml-hero figure img, .ml-proof-card img { width: 100%; display: block; border: var(--ellie-border); background: var(--c-surface); box-shadow: var(--ellie-shadow-editorial); border-radius: var(--ellie-radius-xl); }
.ml-hero figcaption { font-family: var(--ellie-font-mono); color: var(--c-fg-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.10em; text-transform: uppercase; margin-top: 16px; }
.ml-hero .ml-actions { justify-content: flex-start; gap: 16px; margin-top: 8px; }

.ml-kicker { display: inline-flex; align-items: center; gap: 8px; width: fit-content; border: var(--ellie-border); padding: 8px 16px; color: var(--c-fg); font-family: var(--ellie-font-ui); font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; border-radius: var(--ellie-radius-pill); }
.ml-kicker .dot { width: 8px; height: 8px; background: var(--ellie-color-punch-red); border-radius: var(--ellie-radius-pill); }

.ml-section { padding: 128px clamp(24px, 6vw, 80px); border-top: var(--ellie-border); }
.ml-section h2 { font-family: var(--ellie-font-display); font-weight: 700; font-size: 76px; line-height: 0.98; color: var(--c-heading-editorial); margin: 0; max-width: 960px; letter-spacing: -0.015em; }
.ml-section-head { display: grid; gap: 24px; margin-bottom: 48px; max-width: 980px; }

.ml-proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.ml-proof-card { display: grid; gap: 24px; }
.ml-proof-card h3 { font-family: var(--ellie-font-display); font-weight: 700; font-size: 22px; color: var(--c-heading-editorial); margin: 0; }
.ml-proof-card p { font-family: var(--ellie-font-display); font-size: 16px; line-height: 1.55; color: var(--c-fg); margin: 8px 0 0; }

.ml-workflow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 0; margin: 0; list-style: none; }
.ml-workflow li { min-height: 180px; padding: 24px; background: var(--c-surface); border: var(--ellie-border); display: grid; align-content: space-between; box-shadow: var(--ellie-shadow-editorial); border-radius: var(--ellie-radius-lg); }
.ml-workflow span { color: var(--ellie-color-punch-red); font-family: var(--ellie-font-mono); font-size: 13px; font-weight: 900; }
.ml-workflow strong { font-family: var(--ellie-font-display); font-weight: 600; font-size: 22px; line-height: 1.15; color: var(--c-heading-editorial); }

.ml-access { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; background: var(--ellie-color-shadow-fjord); color: white; }
.ml-access h2, .ml-access .ml-kicker { color: white; }
.ml-access .ml-kicker { border-color: rgba(255,255,255,0.7); }
.ml-access .ml-btn.secondary { border-color: white; color: white; background: transparent; }
.ml-access .ml-btn.secondary:hover { background: rgba(255,255,255,0.1); }

.ml-footer { display: flex; justify-content: space-between; gap: 16px; padding: 24px clamp(18px, 5vw, 72px); border-top: var(--ellie-border); color: var(--c-fg-muted); font-family: var(--ellie-font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.ml-footer strong { font-family: var(--ellie-font-brand); font-weight: 800; letter-spacing: 0.08em; color: var(--c-fg); text-transform: none; }

@media (max-width: 900px) {
  .ml-header { grid-template-columns: 1fr; gap: 10px; }
  .ml-nav, .ml-actions { justify-content: flex-start; flex-wrap: wrap; }
  .ml-hero, .ml-proof-grid, .ml-workflow { grid-template-columns: 1fr; }
  .ml-hero h1 { font-size: 56px; }
  .ml-section h2 { font-size: 42px; }
  .ml-hero p { font-size: 16px; }
  .ml-access, .ml-footer { flex-direction: column; align-items: flex-start; }
}


* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

.ma-page { background: var(--ellie-color-soft-linen); color: var(--c-fg); font-family: var(--ellie-font-ui); min-height: 100vh; }

.ma-hero { text-align: center; max-width: 900px; margin: 0 auto; padding: 96px clamp(18px, 5vw, 72px) 56px; }
.ma-hero h1 { font-family: var(--ellie-font-display); font-weight: 700; font-size: 84px; line-height: 0.98; letter-spacing: -0.02em; color: var(--c-heading-editorial); margin: 24px 0 18px; }
.ma-hero p { font-family: var(--ellie-font-display); font-size: 20px; line-height: 1.5; color: var(--c-fg); margin: 0 auto; max-width: 640px; }

.ma-bento { max-width: 1280px; margin: 0 auto; padding: 0 clamp(18px, 5vw, 72px) 96px; display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }

.ma-card { background: var(--c-surface); border: var(--ellie-border); padding: 28px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.ma-card.feature { box-shadow: var(--ellie-shadow-editorial); }
.ma-card .kicker { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border: var(--ellie-border-hair); background: var(--ellie-color-cool-blue); color: var(--c-fg); font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 800; letter-spacing: 0.10em; text-transform: uppercase; align-self: flex-start; }
.ma-card .kicker i { font-size: 14px; }
.ma-card h2 { font-family: var(--ellie-font-display); font-weight: 700; font-size: 30px; line-height: 1.15; color: var(--c-heading-editorial); margin: 0 0 4px; letter-spacing: -0.01em; }
.ma-card h3 { font-family: var(--ellie-font-display); font-weight: 700; font-size: 22px; line-height: 1.15; color: var(--c-heading-editorial); margin: 0; letter-spacing: -0.005em; }
.ma-card p { font-family: var(--ellie-font-display); font-size: 15px; line-height: 1.55; color: var(--c-fg); margin: 0; max-width: 520px; }

.ma-feat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.ma-feat { display: flex; gap: 12px; align-items: center; padding: 14px; border: var(--ellie-border-hair); background: var(--ellie-color-soft-linen); }
.ma-feat .ic { width: 36px; height: 36px; border: var(--ellie-border); background: var(--c-surface); display: grid; place-items: center; }
.ma-feat .ic i { font-size: 18px; color: var(--c-fg); }
.ma-feat h4 { font-family: var(--ellie-font-ui); font-size: 13px; font-weight: 700; color: var(--c-fg); margin: 0; letter-spacing: -0.005em; }
.ma-feat .sub { font-family: var(--ellie-font-mono); font-size: 10px; color: var(--c-fg-muted); margin-top: 2px; letter-spacing: 0.06em; }

.ma-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ma-list li { display: flex; gap: 10px; align-items: center; font-family: var(--ellie-font-ui); font-size: 14px; color: var(--c-fg); }
.ma-list li .dot { width: 6px; height: 6px; background: var(--ellie-color-punch-red); flex-shrink: 0; }
.ma-list li i { font-size: 16px; color: var(--c-fg); }

.ma-step { padding: 14px; border: var(--ellie-border-hair); background: var(--ellie-color-soft-linen); display: flex; flex-direction: column; gap: 6px; }
.ma-step .hd { display: flex; gap: 10px; align-items: center; font-family: var(--ellie-font-ui); font-weight: 700; font-size: 14px; color: var(--c-fg); }
.ma-step .hd i { font-size: 18px; color: var(--c-fg); }
.ma-step p { font-family: var(--ellie-font-ui); font-size: 12px; color: var(--c-fg-muted); margin: 0; line-height: 1.5; max-width: none; }

.ma-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ma-tag { padding: 3px 10px; border: var(--ellie-border-hair); background: var(--c-surface); font-family: var(--ellie-font-mono); font-size: 11px; font-weight: 700; color: var(--c-fg); letter-spacing: 0.04em; }

/* Card spans */
.ma-span-8 { grid-column: span 8; }
.ma-span-4 { grid-column: span 4; }
.ma-span-6 { grid-column: span 6; }

@media (max-width: 980px) {
  .ma-bento { grid-template-columns: 1fr; }
  .ma-span-8, .ma-span-4, .ma-span-6 { grid-column: 1; }
  .ma-feat-grid { grid-template-columns: 1fr; }
  .ma-hero h1 { font-size: 52px; }
}


* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--ellie-color-soft-linen); color: var(--c-fg); font-family: var(--ellie-font-ui); }

.pr-page { min-height: 100vh; }

/* Header — synchronised with editorial marketing */
.pr-header {
  position: sticky; top: 0; z-index: 50;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 18px;
  padding: 14px clamp(18px, 4vw, 54px);
  background: var(--ellie-color-soft-linen);
  border-bottom: var(--ellie-border);
}
.pr-brand { display: flex; gap: 12px; align-items: center; font-family: var(--ellie-font-brand); font-size: 24px; font-weight: 800; letter-spacing: 0.08em; color: var(--c-fg); text-decoration: none; }
.pr-brand img { width: 28px; }
.pr-nav { display: flex; gap: 28px; justify-content: center; }
.pr-nav a { color: var(--c-fg); text-decoration: none; padding-bottom: 4px; font-family: var(--ellie-font-ui); font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; cursor: pointer; }
.pr-nav a.is-active { border-bottom: 2px solid var(--c-fg); }
.pr-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.pr-link { background: transparent; border: 0; color: var(--c-fg); font: inherit; font-family: var(--ellie-font-ui); font-size: 13px; font-weight: 800; cursor: pointer; }
.pr-cta { background: var(--ellie-color-punch-red); color: white; padding: 10px 22px; border: var(--ellie-border); font: inherit; font-family: var(--ellie-font-ui); font-size: 13px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.pr-cta:hover { background: #d22f3c; }

/* Hero */
.pr-hero { text-align: center; padding: 80px 24px 48px; max-width: 900px; margin: 0 auto; }
.pr-hero .kicker { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: var(--ellie-border); color: var(--c-fg); font-family: var(--ellie-font-ui); font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; }
.pr-hero .kicker img { width: 14px; height: 14px; }
.pr-hero h1 { font-family: var(--ellie-font-display); font-weight: 700; font-size: 96px; line-height: 0.98; letter-spacing: -0.025em; color: var(--c-heading-editorial); margin: 24px 0 18px; }
.pr-hero p { font-family: var(--ellie-font-display); font-size: 19px; line-height: 1.55; color: var(--c-fg); margin: 0; max-width: 640px; margin: 0 auto; }
.pr-hero p + p { margin-top: 8px; font-size: 15px; color: var(--c-fg-muted); }

/* Grid */
.pr-grid { max-width: 1280px; margin: 0 auto; padding: 0 24px 96px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: stretch; }

.pr-card { background: var(--c-surface); border: var(--ellie-border); padding: 28px; display: flex; flex-direction: column; gap: 16px; position: relative; border-radius: var(--ellie-radius-xl); }
.pr-card.featured { box-shadow: var(--ellie-shadow-editorial); transform: translateY(-12px); }
.pr-card .ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 4px 12px; background: var(--ellie-color-onyx); color: white; font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; border: var(--ellie-border); }
.pr-card .ribbon img { width: 12px; height: 12px; }
.pr-card .audience { display: inline-flex; align-items: center; padding: 4px 10px; background: var(--ellie-color-cool-blue); color: var(--c-fg); font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 800; letter-spacing: 0.10em; text-transform: uppercase; align-self: flex-start; border: var(--ellie-border-hair); }
.pr-card.featured .audience { background: var(--ellie-color-punch-red); color: white; border: 0; }
.pr-card h2 { font-family: var(--ellie-font-display); font-weight: 700; font-size: 32px; line-height: 1; color: var(--c-heading-editorial); margin: 0; }
.pr-card .price { font-family: var(--ellie-font-display); font-weight: 700; font-size: 56px; line-height: 0.95; color: var(--c-fg); display: flex; align-items: baseline; gap: 4px; margin: 4px 0 0; }
.pr-card .price small { font-family: var(--ellie-font-ui); font-weight: 500; font-size: 14px; color: var(--c-fg-muted); }
.pr-card .blurb { font-family: var(--ellie-font-display); font-size: 14px; line-height: 1.55; color: var(--c-fg); margin: 0; min-height: 80px; }
.pr-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.pr-card li { display: flex; gap: 10px; align-items: flex-start; font-family: var(--ellie-font-ui); font-size: 14px; line-height: 1.45; color: var(--c-fg); }
.pr-card li i { color: var(--c-fg); flex-shrink: 0; margin-top: 2px; font-size: 16px; }
.pr-card .coin { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin: 0 2px; }
.pr-card .planbtn { padding: 12px 18px; border: var(--ellie-border); background: var(--c-surface); color: var(--c-fg); font: inherit; font-family: var(--ellie-font-ui); font-weight: 800; font-size: 13px; cursor: pointer; }
.pr-card.featured .planbtn { background: var(--ellie-color-punch-red); color: white; }
.pr-card .planbtn:hover { background: var(--ellie-color-cool-blue); }
.pr-card.featured .planbtn:hover { background: #d22f3c; }

/* Token economy block */
.pr-economy { max-width: 1100px; margin: 0 auto 96px; padding: 56px 28px; background: var(--c-surface); border: var(--ellie-border); box-shadow: var(--ellie-shadow-editorial); display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.pr-economy h2 { font-family: var(--ellie-font-display); font-weight: 700; font-size: 44px; line-height: 1.02; color: var(--c-heading-editorial); margin: 0 0 14px; letter-spacing: -0.01em; }
.pr-economy p { font-family: var(--ellie-font-display); font-size: 15px; line-height: 1.6; color: var(--c-fg); margin: 0; max-width: 460px; }
.pr-economy ul { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.pr-economy li { display: flex; gap: 10px; align-items: center; font-family: var(--ellie-font-ui); font-size: 14px; color: var(--c-fg); }
.pr-economy li img { width: 18px; height: 18px; }
.pr-economy .visual { display: flex; align-items: center; justify-content: center; padding: 36px; background: var(--ellie-color-soft-linen); border: var(--ellie-border); }
.pr-economy .visual img { width: 180px; height: 180px; }

/* Footer */
.pr-footer { padding: 24px clamp(18px, 5vw, 72px); border-top: var(--ellie-border); color: var(--c-fg-muted); font-family: var(--ellie-font-mono); font-size: 11px; display: flex; justify-content: space-between; align-items: center; letter-spacing: 0.06em; text-transform: uppercase; }
.pr-footer strong { color: var(--c-fg); font-family: var(--ellie-font-brand); font-weight: 800; letter-spacing: 0.08em; text-transform: none; }
.pr-footer-links { display: flex; gap: 22px; }
.pr-footer-links a { color: var(--c-fg-muted); text-decoration: none; cursor: pointer; }

@media (max-width: 1100px) {
  .pr-grid { grid-template-columns: repeat(2, 1fr); }
  .pr-card.featured { transform: none; }
}
@media (max-width: 700px) {
  .pr-header { grid-template-columns: 1fr; gap: 8px; }
  .pr-grid, .pr-economy { grid-template-columns: 1fr; }
  .pr-hero h1 { font-size: 56px; }
  .pr-economy h2 { font-size: 32px; }
}

/* ─── Pay-As-You-Go ───────────────────────────────────────────────── */
.pr-payg { max-width: 1280px; margin: 0 auto; padding: 24px 24px 96px; }
.pr-payg-head { text-align: center; max-width: 720px; margin: 0 auto 36px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.pr-payg-head h2 { font-family: var(--ellie-font-display); font-weight: 700; font-size: 44px; line-height: 1.02; color: var(--c-heading-editorial); margin: 0; letter-spacing: -0.01em; }
.pr-payg-head p { font-family: var(--ellie-font-display); font-size: 16px; line-height: 1.55; color: var(--c-fg); margin: 0; }

.pr-payg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: stretch; }

.pr-payg-card { background: var(--c-surface); border: var(--ellie-border); padding: 22px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.pr-payg-card.featured { box-shadow: var(--ellie-shadow-editorial); }
.pr-payg-ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 4px 12px; background: var(--ellie-color-punch-red); color: white; font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; border: var(--ellie-border); white-space: nowrap; }
.pr-payg-tag { display: inline-flex; align-self: flex-start; padding: 3px 10px; background: var(--ellie-color-cool-blue); border: var(--ellie-border-hair); font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 800; letter-spacing: 0.10em; text-transform: uppercase; color: var(--c-fg); }
.pr-payg-coins { display: flex; gap: 10px; align-items: center; font-family: var(--ellie-font-display); font-weight: 700; font-size: 36px; line-height: 1; color: var(--c-heading-editorial); margin-top: 4px; }
.pr-payg-coins img { width: 28px; height: 28px; }
.pr-payg-price { font-family: var(--ellie-font-display); font-weight: 700; font-size: 28px; color: var(--c-fg); line-height: 1; display: flex; align-items: baseline; gap: 6px; }
.pr-payg-price small { font-family: var(--ellie-font-ui); font-size: 12px; font-weight: 500; color: var(--c-fg-muted); }
.pr-payg-per { font-family: var(--ellie-font-mono); font-size: 11px; font-weight: 700; color: var(--c-fg); letter-spacing: 0.04em; }
.pr-payg-per span { color: var(--c-fg-muted); font-weight: 500; }
.pr-payg-btn { margin-top: auto; padding: 10px 14px; border: var(--ellie-border); background: var(--c-surface); color: var(--c-fg); font: inherit; font-family: var(--ellie-font-ui); font-size: 13px; font-weight: 800; cursor: pointer; }
.pr-payg-btn:hover { background: var(--ellie-color-cool-blue); }
.pr-payg-card.featured .pr-payg-btn { background: var(--ellie-color-punch-red); color: white; }
.pr-payg-card.featured .pr-payg-btn:hover { background: #d22f3c; }

.pr-payg-meter { background: var(--ellie-color-soft-linen); border: var(--ellie-border); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.pr-payg-meter .lbl { font-family: var(--ellie-font-mono); font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--c-fg); }
.pr-payg-meter p { font-family: var(--ellie-font-display); font-size: 14px; line-height: 1.5; color: var(--c-fg); margin: 0; }
.pr-payg-meter-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-top: 6px; }
.pr-payg-meter-row label { font-family: var(--ellie-font-ui); font-size: 12px; font-weight: 700; color: var(--c-fg); }
.pr-payg-meter-row input { padding: 8px 10px; border: var(--ellie-border); font: inherit; font-family: var(--ellie-font-mono); font-size: 13px; font-weight: 700; }
.pr-payg-btn.ghost { background: transparent; }
.pr-payg-meter-note { font-family: var(--ellie-font-mono); font-size: 10px; color: var(--c-fg-muted); letter-spacing: 0.04em; margin-top: 4px; }

@media (max-width: 1100px) {
  .pr-payg-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .pr-payg-grid { grid-template-columns: 1fr; }
  .pr-payg-head h2 { font-size: 32px; }
}


/* ─── Pay-As-You-Go — one short note under the grid ───────────────── */
.pr-payg-note { max-width: 880px; margin: 32px auto 64px; padding: 20px 28px; background: var(--c-surface); border: var(--ellie-border); text-align: center; }
.pr-payg-note p { font-family: var(--ellie-font-display); font-size: 17px; line-height: 1.55; color: var(--c-fg); margin: 0; }
.pr-payg-note strong { color: var(--ellie-color-punch-red); }

/* Current tabbed public landing */
.ml-header .ml-brand {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.ml-nav .ml-link {
  color: var(--c-fg);
  text-decoration: none;
  font-family: var(--ellie-font-ui);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: none;
  padding: 12px 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.ml-nav .ml-link.active {
  border-bottom-color: var(--c-fg);
}

.ml-tab-panel {
  display: block;
}

.ml-hero-copy {
  display: grid;
  gap: 24px;
  align-content: center;
}

.ml-section-copy {
  font-family: var(--ellie-font-display);
  font-size: 18px;
  line-height: 1.55;
  color: var(--c-fg);
  margin: 0;
  max-width: 780px;
}

.ml-card-body {
  padding: 28px;
}

.ml-card-grid,
.ml-impact-grid,
.ml-split {
  display: grid;
  gap: 24px;
}

.ml-card-grid,
.ml-impact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.ml-text-card {
  background: var(--c-surface);
  border: var(--ellie-border);
  border-radius: var(--ellie-radius-lg);
  padding: 28px;
  display: grid;
  gap: 14px;
  min-height: 220px;
  box-shadow: var(--ellie-shadow-editorial);
}

.ml-text-card > i {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: var(--ellie-border);
  border-radius: var(--ellie-radius-md);
  background: var(--ellie-color-cool-blue);
  color: var(--c-fg);
  font-size: 22px;
}

.ml-text-card h3 {
  font-family: var(--ellie-font-display);
  font-size: 24px;
  line-height: 1.15;
  color: var(--c-heading-editorial);
  margin: 0;
}

.ml-text-card p,
.ml-workflow li p {
  font-family: var(--ellie-font-display);
  font-size: 15px;
  line-height: 1.55;
  color: var(--c-fg);
  margin: 0;
}

.ml-workflow li {
  gap: 18px;
}

.ml-final-cta {
  margin: 0 clamp(24px, 6vw, 80px) clamp(56px, 8vw, 96px);
  background: var(--ellie-color-shadow-fjord);
  color: white;
  border: var(--ellie-border);
  border-radius: var(--ellie-radius-xl);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px;
  align-items: end;
}

.ml-final-cta h2,
.ml-final-cta .ml-section-copy,
.ml-final-cta .ml-kicker {
  color: white;
}

.ml-final-cta .ml-kicker {
  border-color: rgba(255,255,255,0.65);
}

.ml-final-cta .ml-btn.secondary {
  background: transparent;
  color: white;
  border-color: white;
}

.ml-final-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 14px;
  width: min(460px, 100%);
}

.ml-final-actions-grid .ml-btn {
  justify-content: center;
  width: 100%;
  min-height: 48px;
}

.ml-footer-links {
  display: flex;
  gap: 24px;
}

.ml-footer > div:first-child {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.ma-hero .ml-actions {
  justify-content: center;
  margin-top: 28px;
}

.ma-bento .ma-card {
  min-height: 220px;
}

.pr-card .ml-btn {
  justify-content: center;
  width: 100%;
  margin-top: auto;
}

@media (max-width: 980px) {
  .ml-card-grid,
  .ml-impact-grid,
  .ml-split,
  .ml-final-cta {
    grid-template-columns: 1fr;
  }

  .ml-final-actions-grid {
    width: 100%;
  }
}
