/* n1k0der / Forest 2026 — layered after existing styles so API/DOM contracts remain unchanged. */
:root {
  --ink: #f0f0e8;
  --muted: #aeb5a5;
  --accent: #ffe135;
  --accent-hover: #ffeb69;
  --paper: #262826;
  --surface: #30322d;
  --soft: #383b31;
  --border: #45493f;
  --danger: #ff8980;
  --forest-surface: #20241f;
  --forest-card: #2b3028;
  --forest-success: #7cd67c;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
html { background: #1c1f1b; }
body { background: #1c1f1b; }
:where(button, input, textarea) { font-family: inherit; }
:where(input, textarea)::placeholder { color: #899283; opacity: 1; }
:where(button, a, summary, input, textarea):focus-visible { outline: 2px solid #ffe135; outline-offset: 3px; }
:where(.button, .icon-button, .auth-switch button) { transition-duration: .18s; }
.button.primary, .icon-button.filled, .send-button { color: #20221d; }
.button.primary:disabled { transform: none; }
.button.primary:not(:disabled):active { transform: translateY(1px) scale(.99); }
:where(.form-notice, .ops-notice) { overflow-wrap: anywhere; }
.form-notice.success { border-color: #7cd67c57; background: #7cd67c10; color: #b7f2b2; }

/* Login / registration: one responsive illustrated scene, not a rasterized UI. */
.auth-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(420px, .94fr);
  width: min(1560px, calc(100% - 36px));
  min-height: max(700px, calc(100svh - 36px));
  max-width: 1560px;
  margin: 18px auto;
  background: #151e21 url('/assets/forest/n1k0der-bg-desktop.webp') center / cover no-repeat;
  border: 1px solid #d8d0a62e;
  border-radius: 27px;
  box-shadow: 0 32px 90px #0007, inset 0 1px #fff1;
  overflow: hidden;
  isolation: isolate;
}
.auth-layout::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, #0c17184d 0%, #101a1a16 37%, #0711125e 62%, #101a19ba 100%);
}
.auth-layout .intro {
  position: relative;
  z-index: 1;
  min-height: 700px;
  padding: clamp(28px, 4vw, 55px);
  overflow: hidden;
  background: linear-gradient(90deg, #0c131649 0%, #0d151600 100%);
}
.auth-layout .intro::before,
.auth-layout .intro::after { display: none; }
.auth-layout .intro > .brand {
  position: relative;
  z-index: 4;
  color: #ffe135;
  font-size: 26px;
  font-weight: 770;
  letter-spacing: -1.3px;
  filter: drop-shadow(0 1px 3px #0007);
}
.auth-layout .brand-mark { width: 37px; height: 37px; border-radius: 11px; }
.auth-layout .intro-copy { position: relative; z-index: 3; margin-top: clamp(55px, 8vh, 100px); margin-left: clamp(85px, 9vw, 150px); max-width: 480px; }
.auth-layout .auth-kicker { display: inline-flex; align-items: center; gap: 9px; color: #d4dfcc; font-size: 11px; font-weight: 550; letter-spacing: .075em; }
.auth-layout .auth-kicker::before { content: ""; width: 19px; height: 3px; border-radius: 5px; background: #ffe135; }
.auth-layout .intro-copy h1 {
  margin: 18px 0 20px;
  font-size: clamp(39px, 4vw, 62px);
  font-weight: 735;
  letter-spacing: -.052em;
  line-height: 1.085;
  color: #f6f5ea;
  text-shadow: 0 3px 18px #0009;
}
.auth-title-dot { color: #ffe135; }
.auth-layout .intro-copy p { margin: 0; font-size: 14px; line-height: 1.65; color: #d5dccd; text-shadow: 0 2px 8px #071110; }
.auth-leaf, .auth-fireflies { position: absolute; z-index: 2; pointer-events: none; object-fit: contain; }
.auth-leaf--upper { top: -37px; right: -25px; width: 220px; height: auto; opacity: .83; transform: rotate(8deg); }
.auth-leaf--lower { right: -38px; bottom: -170px; width: 120px; height: auto; transform: rotate(65deg); opacity: .7; }
.auth-fireflies { left: 3%; bottom: 22%; width: 240px; height: auto; opacity: .6; mix-blend-mode: screen; }

.auth-layout .mascot-stage {
  position: absolute;
  z-index: 3;
  left: clamp(14px, 9%, 130px);
  bottom: 1%;
  width: clamp(255px, 28vw, 395px);
  height: clamp(245px, 31vw, 395px);
  max-width: none;
  margin: 0;
  --scene-surface: transparent;
  pointer-events: none;
  filter: drop-shadow(0 25px 20px #0008);
}
.mascot-stage .mascot-art {
  position: absolute;
  z-index: 3;
  inset: auto auto 0 50%;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  transform: translate(calc(-50% + var(--gaze-x, 0px)), var(--gaze-y, 0px));
  transition: transform .3s ease, opacity .18s ease;
}
.mascot-stage.has-art .spirit-svg, .mascot-stage.has-art .mascot-conversation { display: none; }
.mascot-stage[data-mood="success"] .mascot-art { animation: forest-bounce .55s ease-out; }
.mascot-stage[data-mood="error"] .mascot-art { animation: forest-shiver .3s ease-in-out 2; }
.mascot-stage.is-sleepy .mascot-art { transform: translate(-50%, 4px) rotate(-3deg); }
.mascot-stage:not(.is-visible) .mascot-art { animation-play-state: paused; }

.auth-layout .auth-side {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 700px;
  padding: 34px clamp(22px, 3.7vw, 60px);
  border-left: 0;
  background: linear-gradient(90deg, #0b171817, #0b151a50 100%);
}
.auth-layout .auth-card {
  width: min(100%, 460px);
  max-width: 460px;
  padding: clamp(25px, 3vw, 38px);
  border-radius: 25px;
  border: 1px solid #ffeaa43d;
  background: linear-gradient(155deg, #252a27ed, #1d2324f0);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px #0008, 0 0 40px #ffc62e14, inset 0 1px #ffffff10;
}
.auth-layout .auth-switch {
  display: flex;
  gap: 4px;
  padding: 5px;
  margin: 0 0 25px;
  background: #151b1b9e;
  border: 1px solid #d0c5a02b;
  border-radius: 14px;
}
.auth-layout .auth-switch button { min-height: 41px; font-size: 13px; border-radius: 10px; color: #c1c5b8; }
.auth-layout .auth-switch button.active { background: #ffe135; color: #222419; box-shadow: 0 3px 14px #ffdf4427; }
.auth-layout .auth-switch button:not(.active):hover { background: #ffffff0d; color: #fff; }
.auth-layout .auth-card h2 { margin: 0 0 9px; font-size: clamp(26px, 2.4vw, 32px); font-weight: 700; letter-spacing: -.044em; line-height: 1.17; color: #f3f2e8; }
.auth-layout :is(.auth-subtitle, .auth-card .muted) { margin: 0 0 23px; color: #bcc5b7; font-size: 13px; line-height: 1.6; }
.auth-layout .auth-card form { display: grid; gap: 17px; }
.auth-layout .auth-card label { display: grid; gap: 8px; color: #e1e5d8; font-weight: 560; font-size: 12px; }
.auth-layout .auth-card input {
  min-width: 0;
  min-height: 51px;
  border: 1px solid #a0a99736;
  background: #131a19be;
  border-radius: 12px;
  padding: 12px 15px;
  color: #f3f3ea;
  font-size: 14px;
  box-shadow: inset 0 1px #ffffff03;
}
.auth-layout .auth-card input:hover { border-color: #d3dfc55a; }
.auth-layout .auth-card input:focus { border-color: #ffe135; box-shadow: 0 0 0 3px #ffe1351e; }
.auth-layout .password-field { display: block; position: relative; }
.auth-layout .password-field input { padding-right: 49px; }
.auth-layout .password-toggle { top: 7px; right: 7px; width: 37px; height: 37px; }
.auth-layout .password-toggle svg { width: 19px; height: 19px; }
.auth-layout .auth-card .field-note { color: #a6afa1; font-size: 11px; }
.auth-layout .auth-card .wide { min-height: 53px; margin-top: 5px; padding: 12px 19px; border-radius: 12px; font-size: 14px; }
.auth-layout .auth-card .wide > .button-label { font-size: 14px; font-weight: 750; }
.auth-layout .auth-card .action-arrow { width: 19px; height: 19px; }
.auth-layout .auth-card .wide:focus-visible { outline-offset: 3px; }
.auth-layout .auth-error-art { display: none !important; }
.auth-layout .form-notice { margin: 16px 0 0; background: #532720dd; border: 1px solid #ff898078; color: #ffd9d5; font-size: 12px; }
.auth-layout .form-notice.success { background: #23482bdd; border-color: #7cd67c6b; color: #e6ffdf; }
.auth-layout .auth-bottom { margin: 16px 0 0; text-align: center; color: #aeb5a5; }
.auth-developer summary { display: inline-block; cursor: pointer; color: #adb7a4; font-size: 11px; letter-spacing: 0; opacity: .75; }
.auth-developer[open] summary { opacity: 1; }
.auth-developer .diagnostics-toggle { margin: 10px auto 0; background: #171c19e0; }
.password-meter { display: grid; gap: 7px; margin-top: 0; }
.password-meter-bars { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; }
.password-meter-bars i { height: 4px; border-radius: 10px; background: #81867d59; transition: background .2s ease; }
.password-meter[data-strength="1"] i:nth-child(-n+1) { background: #ec8880; }
.password-meter[data-strength="2"] i:nth-child(-n+2) { background: #f6bc57; }
.password-meter[data-strength="3"] i:nth-child(-n+3) { background: #cddd64; }
.password-meter[data-strength="4"] i { background: #83d47b; }
.password-meter-caption { font-size: 11px; color: #aeb5a5; }

/* Chats are a workspace: use the same tokens, but keep the forest out of message content. */
.app-shell { border-color: #d5d7c01e; box-shadow: 0 22px 80px #0006; }
.sidebar { background: #1f241e; }
.sidebar-heading h2, .chat-heading h2 { color: #f0f0e8; }
.chat-row.active { background: #ffe1350e; border-color: #ffe1354b; }
.chat-row:hover { border-color: #ffffff15; }
.chat-row:focus-visible { outline-offset: -2px; }
.search-field, .composer textarea { border-color: #bec6ad25; }
.search-field:focus-within, .composer textarea:focus { border-color: #ffe13599; box-shadow: 0 0 0 3px #ffe13514; }
.chat-header, .composer { background: #282d27; }
.message-scroll { background-color: #252a25; }
.message-bubble { background: #34392f; border-color: #ffffff14; }
.mine .message-bubble { background: #ffe135; border-color: #ffe135; color: #1e221d; }
.mine .message-text { color: #1e221d; }
.mine .message-time { color: #5e5d35; }
.date-separator { border-color: #c5d0b01f; }
#open-operations { border-color: #ffe1354d; }
#open-operations:hover { background: #ffe13518; }
:where(.reaction-button, .reaction-picker, .attachment-card, .processing-results article) { transition: border-color .18s ease, background .18s ease; }
:where(.attachment-card, .processing-results article):hover { border-color: #ffe13534; }
.message-copy:focus-visible, .message-copy:hover { opacity: 1; pointer-events: auto; }
:where(dialog:not(.ops-panel):not(.image-viewer), .processing-panel) { border-color: #cdd8b02b; }

/* The monitoring screen intentionally stays technical: emphasize state, not scenery. */
.ops-panel { background: #222622; }
.ops-rail { background: #1d221d; border-color: #e5e9d912; }
.ops-content { color: #f0f0e8; }
.ops-metrics article { background: linear-gradient(145deg,#32372f,#292e29); border-color: #e0e8cf1b; }
.ops-box { background: #292e28; border-color: #e0e8cf17; }
.ops-node { background: #20251f; }
.ops-service { border-color: #e0e8cf22; }
.ops-service.served { background: #ffe1350d; border-color: #ffe13575; }
.ops-rail nav button:focus-visible, .ops-panel button:focus-visible { outline-color: #ffe135; }
.ops-panel .ops-rail nav .is-active { background: #ffe13514; border-color: #ffe13531; }

@keyframes forest-bounce {
  0%,100% { transform: translate(-50%, 0); }
  40% { transform: translate(-50%, -10px); }
  70% { transform: translate(-50%, 0); }
}
@keyframes forest-shiver {
  0%,100% { transform: translate(-50%, 0); }
  30% { transform: translate(calc(-50% - 5px), 0); }
  70% { transform: translate(calc(-50% + 5px), 0); }
}
@media (prefers-reduced-motion: no-preference) {
  .auth-layout .auth-card { animation: forest-card-enter .35s ease-out both; }
  .auth-layout .auth-leaf--upper { animation: forest-leaves 12s ease-in-out infinite alternate; transform-origin: right top; }
  .auth-layout .auth-fireflies { animation: forest-glimmer 5s ease-in-out infinite alternate; }
}
@keyframes forest-card-enter { from { opacity: .65; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes forest-leaves { from { transform: rotate(8deg); } to { transform: rotate(11deg); } }
@keyframes forest-glimmer { from { opacity: .28; } to { opacity: .62; } }

@media (max-width: 1090px) and (min-width: 721px) {
  .auth-layout { grid-template-columns: minmax(0,.95fr) minmax(375px,1.05fr); }
  .auth-layout .intro { padding: 34px; }
  .auth-layout .intro-copy { margin-left: 0; }
  .auth-layout .intro-copy h1 { font-size: clamp(34px, 4.3vw, 48px); }
  .auth-layout .auth-side { padding: 25px; }
  .auth-layout .auth-card { padding: 27px; }
  .auth-layout .mascot-stage { left: 5%; bottom: 5%; width: 270px; height: 270px; }
}
@media (max-width: 720px) {
  html, body { overflow-x: clip; }
  body { background: #162123; }
  .auth-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100svh;
    margin: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
    background: #12202a url('/assets/forest/n1k0der-bg-mobile.webp') center top / cover no-repeat;
  }
  .auth-layout::before { position: fixed; background: linear-gradient(180deg,#07141835 0%,#06151647 35%,#071618d9 75%,#071618eb 100%); }
  .auth-layout .intro { flex: 0 0 auto; min-height: 92px; padding: max(19px, env(safe-area-inset-top)) 23px 8px; background: transparent; overflow: visible; }
  .auth-layout .intro > .brand { font-size: 23px; }
  .auth-layout .brand-mark { width: 32px; height: 32px; }
  .auth-layout .intro-copy { display: none; }
  .auth-layout .auth-leaf--upper { right: -5px; top: 3px; width: 138px; opacity: .55; }
  .auth-layout .auth-leaf--lower { display: none; }
  .auth-layout .auth-fireflies { left: auto; right: 2%; top: 95px; bottom: auto; width: 150px; }
  .auth-layout .auth-side { flex: 1 0 auto; min-height: 0; padding: 0 16px max(24px,env(safe-area-inset-bottom)); border: 0; background: transparent; justify-content: flex-start; }
  .auth-layout .mascot-stage { position: relative; align-self: center; inset: auto; width: 200px; height: 166px; min-height: 166px; margin: -10px 0 -13px; filter: drop-shadow(0 14px 12px #0007); }
  .mascot-stage .mascot-art { object-position: center bottom; }
  .auth-layout .auth-card { width: min(100%, 425px); padding: 22px; border-radius: 22px; background: #1e2525f0; border-color: #ffeaa43a; box-shadow: 0 20px 55px #0009; }
  .auth-layout .auth-switch { margin-bottom: 20px; }
  .auth-layout .auth-switch button { min-height: 38px; font-size: 12px; }
  .auth-layout .auth-card h2 { font-size: 27px; }
  .auth-layout :is(.auth-subtitle, .auth-card .muted) { margin-bottom: 19px; }
  .auth-layout .auth-card form { gap: 14px; }
  .auth-layout .auth-card input { min-height: 49px; }
  .auth-layout .auth-card .wide { min-height: 51px; }
  .auth-layout .auth-bottom { margin: 12px 0 0; }
  .ops-panel, .app-shell { min-width: 0; }
}
@media (max-width: 370px) {
  .auth-layout .mascot-stage { height: 125px; min-height: 125px; width: 160px; }
  .auth-layout .auth-card { padding: 17px; }
  .auth-layout .auth-card h2 { font-size: 24px; }
  .auth-layout .intro { min-height: 77px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-layout *, .auth-layout *::before, .auth-layout *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .app-shell *, .ops-panel * { scroll-behavior: auto !important; }
}


/* Forest Motion v2: animated image layers; lightweight transform/opacity only. */
.auth-layout .forest-leaf-rain {
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
  contain: layout paint;
}
.auth-layout .forest-leaf-rain img {
  position: absolute;
  display: block;
  left: var(--leaf-x);
  top: -68px;
  width: var(--leaf-size);
  height: auto;
  opacity: 0;
  transform: translate3d(0, -20px, 0) rotate(0deg);
  transform-origin: 50% 50%;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px #0b0c0988);
  will-change: transform, opacity;
}
.auth-layout .forest-lantern-aura {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  left: -9%;
  bottom: -4%;
  width: min(38vw, 470px);
  height: min(45vw, 470px);
  background: radial-gradient(circle, #ffc44326 0%, #ffc4430d 32%, transparent 68%);
  mix-blend-mode: screen;
  opacity: .7;
  border-radius: 50%;
}
/* The mascot wrapper breathes while the child still follows the original pointer/focus logic. */
.auth-layout .mascot-stage .mascot-art {
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform-origin: center bottom;
}
@media (prefers-reduced-motion: no-preference) {
  .auth-layout .auth-leaf--upper { animation: forest-v2-sway-top 5.5s ease-in-out infinite alternate; transform-origin: 86% 6%; }
  .auth-layout .auth-leaf--lower { animation: forest-v2-sway-bottom 7.7s ease-in-out infinite alternate; transform-origin: 90% 5%; }
  .auth-layout .auth-fireflies { animation: forest-v2-fireflies 6.8s ease-in-out infinite alternate; }
  .auth-layout .mascot-stage.is-visible { animation: forest-v2-breathe 5s ease-in-out infinite; }
  .auth-layout .mascot-stage.is-visible.is-curious { animation-duration: 2.4s; }
  .auth-layout .mascot-stage.is-visible[data-mood="pending"] { animation-duration: 3.1s; }
  .auth-layout .mascot-stage.is-visible[data-mood="success"] { animation: forest-v2-cheer .7s ease-out 1; }
  .auth-layout .mascot-stage.is-visible[data-mood="error"] { animation: forest-v2-recoil .42s ease-in-out 1; }
  .auth-layout .forest-lantern-aura { animation: forest-v2-lantern 4.6s ease-in-out infinite alternate; }
  .auth-layout .forest-leaf-rain img {
    animation: forest-v2-fall var(--leaf-duration) linear var(--leaf-delay) infinite;
  }
  .auth-layout.forest-paused .forest-leaf-rain img,
  .auth-layout.forest-paused .forest-lantern-aura,
  .auth-layout.forest-paused .mascot-stage,
  .auth-layout.forest-paused .auth-leaf,
  .auth-layout.forest-paused .auth-fireflies { animation-play-state: paused !important; }
}
@keyframes forest-v2-sway-top {
  0% { transform: translate3d(-9px, -5px, 0) rotate(1deg); }
  50% { transform: translate3d(3px, 3px, 0) rotate(6deg); }
  100% { transform: translate3d(15px, -2px, 0) rotate(11deg); }
}
@keyframes forest-v2-sway-bottom {
  0% { transform: translate3d(-6px, 0, 0) rotate(58deg); }
  100% { transform: translate3d(11px, 11px, 0) rotate(70deg); }
}
@keyframes forest-v2-fireflies {
  0% { transform: translate3d(-8px, 7px, 0); opacity: .25; }
  50% { opacity: .75; }
  100% { transform: translate3d(20px, -18px, 0); opacity: .48; }
}
@keyframes forest-v2-breathe {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(-.8deg); }
  50% { transform: translate3d(0, -8px, 0) rotate(.8deg); }
}
@keyframes forest-v2-cheer {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(-17px) scale(1.045); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes forest-v2-recoil {
  0%, 100% { transform: translateX(0); }
  25%, 75% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
}
@keyframes forest-v2-lantern {
  0% { transform: scale(.91); opacity: .38; }
  100% { transform: scale(1.09); opacity: .9; }
}
@keyframes forest-v2-fall {
  0% { opacity: 0; transform: translate3d(0, -40px, 0) rotate(-30deg); }
  9% { opacity: .82; }
  45% { transform: translate3d(calc(var(--leaf-drift) * .5), 45svh, 0) rotate(145deg); }
  86% { opacity: .76; }
  100% { opacity: 0; transform: translate3d(var(--leaf-drift), 112svh, 0) rotate(340deg); }
}
@media (max-width: 720px) {
  .auth-layout .forest-lantern-aura { left: -45%; bottom: 12%; width: 320px; height: 320px; }
  .auth-layout .mascot-stage { width: 214px; height: 184px; min-height: 184px; margin: -10px 0 -15px; }
  .auth-layout .auth-leaf--upper { opacity: .72; }
  .auth-layout .forest-leaf-rain img { width: calc(var(--leaf-size) * .73); }
  .auth-layout .forest-leaf-rain img:nth-child(n+8) { display: none; }
}
@media (max-width: 370px) {
  .auth-layout .mascot-stage { width: 175px; height: 144px; min-height: 144px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-layout .forest-leaf-rain, .auth-layout .forest-lantern-aura { display: none !important; }
  .auth-layout .mascot-stage { animation: none !important; }
}
