:root {
  --pink-50: #fff5f8;
  --pink-100: #ffe5ef;
  --pink-200: #ffcadd;
  --pink-400: #ff91b9;
  --pink-500: #f7659d;
  --pink-600: #dc477f;
  --pink-700: #b8336b;
  --navy-700: #343760;
  --navy-900: #202347;
  --violet-400: #a895e7;
  --green-500: #55c98a;
  --text: #24264d;
  --text-soft: #625e73;
  --text-muted: #827d8d;
  --glass: rgba(255, 250, 252, 0.71);
  --glass-strong: rgba(255, 252, 253, 0.86);
  --glass-soft: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.72);
  --glass-highlight: rgba(255, 255, 255, 0.9);
  --input-bg: rgba(255, 255, 255, 0.82);
  --hover-bg: rgba(255, 255, 255, 0.83);
  --shadow: 0 22px 54px rgba(117, 72, 101, 0.16), 0 4px 14px rgba(112, 75, 95, 0.08);
  --shadow-small: 0 9px 24px rgba(120, 79, 101, 0.13);
  --shadow-soft: 0 12px 30px rgba(120, 79, 101, 0.14);
  --focus-ring: rgba(236, 77, 140, 0.34);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --ease-soft: cubic-bezier(0.22, 0.8, 0.24, 1);
  --character-scene-scale: 0.84;
  --character-scene-x: -15px;
  --character-scene-y: -118px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --pink-50: #2c2037;
  --pink-100: #3d2844;
  --pink-200: #63415e;
  --pink-400: #f09bbf;
  --pink-500: #ec76a8;
  --pink-600: #f19abf;
  --pink-700: #ffc5dc;
  --navy-700: #c7c9e6;
  --navy-900: #f2efff;
  --text: #f4f0ff;
  --text-soft: #d4cee2;
  --text-muted: #aaa6bb;
  --glass: rgba(15, 19, 46, 0.72);
  --glass-strong: rgba(17, 21, 50, 0.84);
  --glass-soft: rgba(27, 31, 66, 0.55);
  --glass-border: rgba(193, 198, 239, 0.16);
  --glass-highlight: rgba(255, 255, 255, 0.12);
  --input-bg: rgba(8, 12, 33, 0.6);
  --hover-bg: rgba(60, 61, 101, 0.66);
  --shadow: 0 24px 64px rgba(2, 5, 24, 0.42), 0 5px 18px rgba(2, 4, 20, 0.3);
  --shadow-small: 0 10px 30px rgba(1, 3, 18, 0.32);
  --shadow-soft: 0 12px 32px rgba(1, 3, 18, 0.34);
  --focus-ring: rgba(240, 155, 191, 0.3);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  height: 100%;
  min-width: 320px;
  background: #f7dce6;
  scroll-behavior: smooth;
  overflow: hidden;
}

html[data-theme="dark"] {
  background: #090e29;
}

body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-width: 320px;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  background: transparent;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  transition: color 420ms ease, background-color 420ms ease;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

button:active {
  transform: translateY(1px) scale(0.985);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layered student council room ---------- */

.room-stage,
.table-stage {
  --scene-crossfade: 760ms cubic-bezier(0.22, 0.61, 0.36, 1);
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.room-stage {
  z-index: 0;
  background: #f4dfe8;
  isolation: isolate;
}

.room-backgrounds,
.table-backgrounds,
.room-image,
.table-image {
  position: absolute;
  inset: 0;
}

.room-backgrounds,
.table-backgrounds {
  overflow: hidden;
}

.room-image,
.table-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: opacity var(--scene-crossfade);
  will-change: opacity;
}

.room-image--day,
.table-image--day { opacity: 1; }

.room-image--night,
.table-image--night { opacity: 0; }

html[data-theme="dark"] .room-image--day,
html[data-theme="dark"] .table-image--day { opacity: 0; }

html[data-theme="dark"] .room-image--night,
html[data-theme="dark"] .table-image--night { opacity: 1; }

.table-stage {
  z-index: 3;
  isolation: isolate;
}

.room-ambient,
.room-vignette,
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.room-ambient {
  transition: opacity 780ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: opacity;
}

.room-ambient--day {
  opacity: 0.26;
  background:
    radial-gradient(ellipse at 43% 13%, rgba(255, 255, 255, 0.42), transparent 48%),
    linear-gradient(90deg, rgba(255, 249, 251, 0.18), transparent 52%);
  mix-blend-mode: screen;
}

.room-ambient--night {
  opacity: 0;
  background:
    radial-gradient(ellipse at 31% 10%, rgba(141, 174, 242, 0.18), transparent 35%),
    linear-gradient(180deg, rgba(25, 42, 95, 0.05), rgba(4, 8, 31, 0.17));
}

html[data-theme="dark"] .room-ambient--day { opacity: 0; }
html[data-theme="dark"] .room-ambient--night { opacity: 1; }

.room-vignette {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(255, 247, 250, 0.35) 0%, rgba(255, 247, 250, 0.13) 36%, transparent 67%),
    radial-gradient(ellipse at center, transparent 63%, rgba(78, 38, 62, 0.08) 100%);
  transition: background 620ms ease;
}

html[data-theme="dark"] .room-vignette {
  background:
    linear-gradient(90deg, rgba(5, 10, 35, 0.34) 0%, rgba(7, 12, 40, 0.12) 42%, transparent 70%),
    radial-gradient(ellipse at center, transparent 59%, rgba(2, 4, 20, 0.2) 100%);
}

/* ---------- Ambient effects ---------- */

.sakura-background,
.ambient-layer {
  --expression-speed: 1;
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.sakura-background { z-index: 1; }
.ambient-layer { z-index: 6; }

.ambient-glow {
  z-index: 3;
  top: 8%;
  right: 8%;
  bottom: auto;
  left: auto;
  width: min(44vw, 620px);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0.2;
  background: radial-gradient(circle, rgba(255, 171, 205, 0.42), transparent 66%);
  filter: blur(24px);
  transform: translate3d(0, 0, 0) scale(1);
  transition: opacity 420ms ease, transform 520ms var(--ease-soft), filter 420ms ease;
}

body[data-expression="happy"] .ambient-glow,
body[data-expression="excited"] .ambient-glow {
  opacity: 0.32;
  transform: scale(1.05);
}

body[data-expression="surprised"] .ambient-glow {
  opacity: 0.39;
  transform: scale(0.92);
  filter: blur(18px);
}

body[data-expression="playful"] .ambient-glow,
body[data-expression="smug"] .ambient-glow,
body[data-expression="sulky"] .ambient-glow,
body[data-expression="suspicious"] .ambient-glow,
body[data-expression="embarrassed"] .ambient-glow {
  opacity: 0.34;
  transform: translate3d(12px, -7px, 0) scale(1.02);
}

body[data-expression="gentle"] .ambient-glow,
body[data-expression="sad"] .ambient-glow,
body[data-expression="crying"] .ambient-glow,
body[data-expression="shy"] .ambient-glow {
  opacity: 0.23;
  transform: scale(1.12);
  filter: blur(32px);
}

body[data-expression="happy"] .ambient-layer,
body[data-expression="happy"] .sakura-background,
body[data-expression="excited"] .ambient-layer,
body[data-expression="excited"] .sakura-background { --expression-speed: 0.92; }
body[data-expression="surprised"] .ambient-layer,
body[data-expression="surprised"] .sakura-background { --expression-speed: 0.88; }
body[data-expression="playful"] .ambient-layer,
body[data-expression="playful"] .sakura-background,
body[data-expression="smug"] .ambient-layer,
body[data-expression="smug"] .sakura-background,
body[data-expression="sulky"] .ambient-layer,
body[data-expression="sulky"] .sakura-background,
body[data-expression="suspicious"] .ambient-layer,
body[data-expression="suspicious"] .sakura-background,
body[data-expression="embarrassed"] .ambient-layer,
body[data-expression="embarrassed"] .sakura-background { --expression-speed: 0.76; }
body[data-expression="gentle"] .ambient-layer,
body[data-expression="gentle"] .sakura-background,
body[data-expression="sad"] .ambient-layer,
body[data-expression="sad"] .sakura-background,
body[data-expression="crying"] .ambient-layer,
body[data-expression="crying"] .sakura-background,
body[data-expression="shy"] .ambient-layer,
body[data-expression="shy"] .sakura-background { --expression-speed: 1.22; }

html[data-theme="dark"] .ambient-glow {
  opacity: 0.17;
  background: radial-gradient(circle, rgba(218, 120, 178, 0.32), rgba(90, 105, 183, 0.12) 42%, transparent 69%);
}

.sakura-layer {
  position: absolute;
  inset: 0;
}

.sakura-background .petal {
  opacity: calc(var(--opacity) * 0.48);
  filter: blur(0.35px);
}

.petal {
  position: absolute;
  top: -9vh;
  left: var(--left);
  width: var(--size);
  height: calc(var(--size) * 0.72);
  border-radius: 75% 12% 70% 38%;
  opacity: var(--opacity);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(255, 150, 187, 0.92) 60%, rgba(238, 98, 150, 0.72));
  box-shadow: 0 2px 7px rgba(211, 82, 134, 0.16);
  transform-origin: 70% 70%;
  animation: petal-fall calc(var(--duration) * var(--expression-speed)) linear var(--delay) infinite;
  will-change: transform, opacity;
}

.petal::after {
  content: "";
  position: absolute;
  right: 8%;
  bottom: 7%;
  width: 34%;
  height: 34%;
  border-right: 1px solid rgba(181, 75, 116, 0.2);
  border-radius: 50%;
}

html[data-theme="dark"] .petal {
  opacity: calc(var(--opacity) * 0.64);
  background: linear-gradient(145deg, rgba(255, 223, 237, 0.88), rgba(225, 123, 173, 0.72) 60%, rgba(157, 103, 178, 0.56));
  box-shadow: 0 0 8px rgba(244, 156, 199, 0.22);
}

@keyframes petal-fall {
  0% {
    opacity: 0;
    transform: translate3d(0, -7vh, 0) rotate(var(--rotation-start));
  }
  9% { opacity: var(--opacity); }
  46% {
    transform: translate3d(var(--drift), 48vh, 0) rotate(calc(var(--rotation-end) * 0.48));
  }
  78% { opacity: calc(var(--opacity) * 0.76); }
  100% {
    opacity: 0;
    transform: translate3d(calc(var(--drift) * -0.42), 114vh, 0) rotate(var(--rotation-end));
  }
}

.expression-spark {
  position: fixed;
  left: var(--spark-x);
  top: var(--spark-y);
  width: var(--spark-size);
  height: var(--spark-size);
  opacity: 0;
  border-radius: 50%;
  background: rgba(255, 213, 233, 0.95);
  box-shadow: 0 0 16px rgba(247, 101, 157, 0.52);
  animation: sparkle-burst 760ms var(--ease-soft) forwards;
}

@keyframes sparkle-burst {
  0% { opacity: 0; transform: scale(0.2) rotate(0); }
  34% { opacity: 0.92; }
  100% { opacity: 0; transform: translate3d(var(--spark-dx), var(--spark-dy), 0) scale(1.4) rotate(120deg); }
}

/* ---------- Character stage ---------- */

.character-stage {
  position: fixed;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.character-stage::before {
  content: "";
  position: absolute;
  right: clamp(3vw, 6vw, 110px);
  bottom: 8vh;
  width: min(42vw, 650px);
  height: 16vh;
  border-radius: 50%;
  opacity: 0.12;
  background: radial-gradient(ellipse, rgba(67, 38, 61, 0.42), transparent 68%);
  filter: blur(18px);
  transform: translate3d(0, 0, 0);
  transition: opacity 620ms ease, background-color 620ms ease;
}

.character-image {
  --character-scale: 1;
  --character-x: 0px;
  --character-y: 0px;
  position: absolute;
  right: clamp(3vw, 6vw, 110px);
  bottom: -21vh;
  width: auto;
  height: 112.5vh;
  max-width: none;
  opacity: 0;
  object-fit: contain;
  object-position: center center;
  filter: drop-shadow(0 18px 22px rgba(82, 42, 67, 0.18));
  transform:
    translate3d(
      calc(var(--character-x) + var(--character-scene-x)),
      calc(var(--character-y) + var(--character-scene-y)),
      0
    )
    scale(var(--character-scale))
    scale(var(--character-scene-scale));
  transform-origin: 55% 66%;
  transition: opacity 320ms var(--ease-soft), filter 620ms ease;
  will-change: opacity, transform;
}

.character-image[data-character="surprised"] {
  --character-scale: 1.005;
  --character-x: 7px;
  --character-y: -2px;
}

.character-image[data-character="playful"] {
  --character-scale: 0.99;
  --character-x: -8px;
  --character-y: 2px;
}

.character-image[data-character="gentle"] {
  --character-scale: 1.015;
  --character-x: 8px;
  --character-y: -3px;
}

.character-image[data-character="smug"],
.character-image[data-character="suspicious"] {
  --character-scale: 1.005;
  --character-x: 4px;
  --character-y: -1px;
}

.character-image[data-character="sulky"],
.character-image[data-character="crying"] {
  --character-scale: 1.01;
  --character-x: 5px;
  --character-y: -2px;
}

.character-image[data-character="shy"],
.character-image[data-character="embarrassed"] {
  --character-scale: 1.008;
  --character-x: 3px;
  --character-y: -2px;
}

.character-image[data-character="excited"] {
  --character-scale: 0.995;
  --character-x: -2px;
  --character-y: 1px;
}

.character-image.is-current {
  opacity: 1;
}

.character-image.is-leaving,
.character-image.is-next { opacity: 0; }

html[data-theme="dark"] .character-image {
  filter:
    brightness(0.94)
    saturate(0.94)
    drop-shadow(-8px 7px 4px rgba(130, 163, 229, 0.15))
    drop-shadow(0 22px 28px rgba(0, 4, 28, 0.38));
}

html[data-theme="dark"] .character-stage::before {
  opacity: 0.18;
  background: radial-gradient(ellipse, rgba(1, 5, 27, 0.58), transparent 70%);
}

/* ---------- Layout and shared glass ---------- */

.page-shell {
  --shell-x: clamp(22px, 3.2vw, 58px);
  --shell-top: clamp(14px, 1.8vh, 22px);
  position: relative;
  z-index: 4;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition: opacity 220ms ease, transform 240ms var(--ease-soft), visibility 0s linear 0s;
}

html.is-immersive .page-shell,
html.is-immersive dialog,
html.is-immersive .toast {
  opacity: 0 !important;
  visibility: hidden;
  pointer-events: none;
}

html.is-immersive .page-shell {
  transform: translate3d(0, -8px, 0);
  transition: opacity 220ms ease, transform 240ms var(--ease-soft), visibility 0s linear 240ms;
}

html.is-immersive,
html.is-immersive body {
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

html.is-immersive body {
  -webkit-touch-callout: none;
}

html.is-immersive .room-image,
html.is-immersive .table-image,
html.is-immersive .character-image {
  -webkit-user-drag: none;
}

.glass-panel {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px) saturate(1.08);
  backdrop-filter: blur(22px) saturate(1.08);
  transition: background-color 430ms ease, border-color 430ms ease, box-shadow 430ms ease, color 430ms ease;
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.topbar {
  position: absolute;
  top: var(--shell-top);
  right: var(--shell-x);
  left: var(--shell-x);
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 1.4vw, 20px);
  height: 68px;
  min-height: 0;
  padding: 0 clamp(12px, 1vw, 16px);
  border-radius: 999px;
}

.brand {
  display: inline-flex;
  height: 44px;
  align-items: center;
  justify-self: start;
  gap: 10px;
  width: max-content;
  min-width: 0;
  font-family: ui-rounded, "Arial Rounded MT Bold", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1;
  white-space: nowrap;
}

.brand strong { color: var(--pink-600); }

.brand-name {
  display: inline-flex;
  align-items: center;
  gap: 0.42em;
  line-height: 1;
}

.brand-mark {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--pink-400), var(--pink-600));
  box-shadow: 0 7px 16px rgba(220, 71, 127, 0.25);
  font-size: 16px;
  line-height: 1;
}

.tabs {
  display: flex;
  height: 50px;
  align-items: center;
  justify-self: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: var(--glass-soft);
}

.tab {
  display: inline-flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: var(--text-soft);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  transition: color 220ms ease, background-color 220ms ease, box-shadow 220ms ease, transform 180ms ease;
}

.tab:hover { color: var(--pink-600); background: var(--glass-soft); }

.tab.is-active {
  color: var(--pink-600);
  background: var(--pink-100);
  box-shadow: 0 5px 15px rgba(220, 71, 127, 0.12);
}

.tab-mark {
  display: inline-grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
}

.tab-mark svg {
  display: block;
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-actions {
  position: relative;
  display: inline-flex;
  height: 44px;
  align-items: center;
  justify-self: end;
  justify-content: flex-end;
  gap: 9px;
}

.local-status {
  display: inline-flex;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 92px;
  padding: 0 14px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--glass-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.neuron-meter {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
}

.neuron-meter__trigger {
  cursor: pointer;
  transition:
    color 210ms ease,
    background-color 210ms ease,
    border-color 210ms ease,
    box-shadow 210ms ease,
    transform 180ms ease;
}

.neuron-meter__trigger:hover,
.neuron-meter__trigger:focus-visible {
  box-shadow: var(--shadow-small);
}

.neuron-meter__value {
  display: inline-block;
  min-width: 50px;
  text-align: center;
}

.neuron-meter.is-updating .neuron-meter__value {
  animation: neuron-value-settle 180ms ease both;
}

@keyframes neuron-value-settle {
  from { opacity: 0.42; transform: translate3d(0, 2px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.status-dot {
  display: block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green-500);
  box-shadow: 0 0 0 4px rgba(85, 201, 138, 0.13);
  transition: background-color 210ms ease, box-shadow 210ms ease, opacity 180ms ease;
}

.neuron-meter[data-status="green"] .neuron-meter__trigger {
  color: #287851;
  border-color: rgba(70, 175, 119, 0.26);
  background: rgba(221, 250, 235, 0.66);
}

.neuron-meter[data-status="orange"] .neuron-meter__trigger {
  color: #a65e16;
  border-color: rgba(221, 139, 45, 0.3);
  background: rgba(255, 238, 211, 0.72);
}

.neuron-meter[data-status="orange"] .status-dot {
  background: #e29438;
  box-shadow: 0 0 0 4px rgba(226, 148, 56, 0.14);
}

.neuron-meter[data-status="red"] .neuron-meter__trigger {
  color: #b93450;
  border-color: rgba(211, 72, 99, 0.3);
  background: rgba(255, 221, 227, 0.74);
}

.neuron-meter[data-status="red"] .status-dot {
  background: #d34863;
  box-shadow: 0 0 0 4px rgba(211, 72, 99, 0.14);
}

.neuron-meter[data-status="unknown"] .status-dot {
  background: #9a98a6;
  box-shadow: 0 0 0 4px rgba(130, 125, 141, 0.12);
}

.neuron-meter.is-loading .status-dot { opacity: 0.56; }

html[data-theme="dark"] .neuron-meter[data-status="green"] .neuron-meter__trigger {
  color: #a8e8c6;
  border-color: rgba(119, 214, 164, 0.24);
  background: rgba(33, 94, 66, 0.44);
}

html[data-theme="dark"] .neuron-meter[data-status="orange"] .neuron-meter__trigger {
  color: #f4c481;
  border-color: rgba(232, 163, 75, 0.26);
  background: rgba(112, 70, 24, 0.42);
}

html[data-theme="dark"] .neuron-meter[data-status="red"] .neuron-meter__trigger {
  color: #ffb2c0;
  border-color: rgba(238, 113, 136, 0.25);
  background: rgba(104, 38, 54, 0.48);
}

.neuron-popover {
  position: absolute;
  z-index: 32;
  top: calc(100% + 9px);
  left: 50%;
  width: min(236px, calc(100vw - 20px));
  padding: 13px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 17px;
  color: var(--text-soft);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(20px) saturate(1.08);
  backdrop-filter: blur(20px) saturate(1.08);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(calc(-50% + var(--popover-shift-x, 0px)), -5px, 0);
  transform-origin: top center;
  font-size: 11.5px;
  line-height: 1.5;
  transition: opacity 190ms ease, transform 190ms var(--ease-soft), visibility 0s linear 190ms;
}

.neuron-meter.is-open .neuron-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(calc(-50% + var(--popover-shift-x, 0px)), 0, 0);
  transition: opacity 190ms ease, transform 190ms var(--ease-soft), visibility 0s linear 0s;
}

.neuron-popover p { margin: 2px 0; }

.neuron-popover__state {
  margin-bottom: 7px !important;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.neuron-popover__stale {
  margin-top: 7px !important;
  color: var(--text-muted);
  font-size: 10.5px;
}

.immersive-toggle {
  display: inline-flex;
  height: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--glass-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: color 210ms ease, background-color 210ms ease, box-shadow 210ms ease, transform 180ms ease;
}

.immersive-toggle:hover {
  color: var(--pink-600);
  background: var(--hover-bg);
  box-shadow: var(--shadow-small);
}

.theme-toggle {
  display: inline-flex;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px 0 7px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text);
  background: var(--glass-strong);
  box-shadow: var(--shadow-small);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  transition: color 240ms ease, background-color 320ms ease, border-color 320ms ease, transform 180ms ease, box-shadow 240ms ease;
}

.theme-toggle:hover { box-shadow: 0 12px 27px rgba(111, 74, 96, 0.16); }

.theme-toggle__current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle__icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--violet-400), var(--pink-500));
  font-size: 15px;
  line-height: 1;
  transition: background-color 220ms ease;
}

.theme-icon {
  display: none;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon--sun,
html[data-theme="dark"] .theme-icon--moon,
.theme-label--day,
html[data-theme="dark"] .theme-label--night { display: block; }

.theme-icon--moon,
html[data-theme="dark"] .theme-icon--sun,
.theme-label--night,
html[data-theme="dark"] .theme-label--day { display: none; }

html[data-theme="dark"] .theme-toggle__icon {
  background: linear-gradient(145deg, #8da8e4, #b38fda);
}

.theme-switch { display: none; }

@media (min-width: 621px) {
  .theme-toggle {
    width: 142px;
    padding: 3px;
  }

  .theme-toggle__current { display: none; }

  .theme-switch {
    position: relative;
    display: grid;
    width: 100%;
    height: 36px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    isolation: isolate;
  }

  .theme-switch__thumb {
    position: absolute;
    z-index: 0;
    top: 0;
    bottom: 0;
    left: 0;
    width: 50%;
    border-radius: 999px;
    background: linear-gradient(145deg, var(--pink-400), var(--pink-500));
    box-shadow: 0 4px 12px rgba(215, 76, 130, 0.18);
    transform: translate3d(0, 0, 0);
    transition: transform 220ms var(--ease-soft);
    will-change: transform;
  }

  html[data-theme="dark"] .theme-switch__thumb {
    background: linear-gradient(145deg, #718ccf, #9b7ac2);
    transform: translate3d(100%, 0, 0);
  }

  .theme-switch__option {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--text-soft);
    opacity: 0.62;
    transition: color 200ms ease, opacity 200ms ease;
  }

  .theme-switch__option svg {
    display: block;
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  html:not([data-theme="dark"]) .theme-switch__option--day,
  html[data-theme="dark"] .theme-switch__option--night {
    color: #fff;
    opacity: 1;
  }
}

.main-content {
  position: absolute;
  z-index: 2;
  top: calc(var(--shell-top) + 80px);
  right: var(--shell-x);
  bottom: clamp(14px, 2vh, 24px);
  left: var(--shell-x);
  min-height: 0;
  overflow: hidden;
}

.view-panel {
  position: absolute;
  inset: 0;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.view-panel[hidden] { display: none; }

.view-panel.is-entering { animation: panel-enter 360ms var(--ease-soft) both; }
.view-panel.is-leaving { animation: panel-leave 180ms ease both; }

@keyframes panel-enter {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes panel-leave {
  from { opacity: 1; transform: translate3d(0, 0, 0); }
  to { opacity: 0; transform: translate3d(0, -7px, 0); }
}

.page-enter { animation: page-rise 620ms var(--ease-soft) both; }
.page-enter--delay { animation-delay: 90ms; }

@keyframes page-rise {
  from { opacity: 0; transform: translate3d(0, 18px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.content-column {
  width: min(49vw, 680px);
  height: 100%;
}

.chat-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: clamp(13px, 1.8vh, 22px);
}

.eyebrow,
.card-kicker {
  margin: 0;
  color: var(--pink-600);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  font-size: 13px;
}

.hero-copy h1,
.section-heading h1 {
  max-width: 690px;
  margin: 0;
  color: var(--text);
  font-family: ui-rounded, "Arial Rounded MT Bold", "Segoe UI", sans-serif;
  font-size: clamp(38px, min(4.25vw, 6vh), 61px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.04;
  text-wrap: balance;
}

.hero-copy h1 span,
.section-heading h1 span {
  color: var(--pink-600);
  background: linear-gradient(100deg, var(--pink-600), var(--pink-400));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-heading > p:last-child {
  max-width: 590px;
  margin: clamp(11px, 1.7vh, 19px) 0 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.72;
  text-wrap: pretty;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 19px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  transition: color 220ms ease, background-color 220ms ease, border-color 220ms ease, transform 180ms ease, box-shadow 220ms ease;
}

.button:hover { transform: translateY(-2px); }

.button--primary {
  color: #fff;
  background: linear-gradient(105deg, var(--pink-600), var(--pink-500));
  box-shadow: 0 12px 28px rgba(220, 71, 127, 0.29);
}

.button--primary:hover { box-shadow: 0 15px 34px rgba(220, 71, 127, 0.37); }

.button--glass {
  color: var(--text);
  background: var(--glass-strong);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-small);
  -webkit-backdrop-filter: blur(15px);
  backdrop-filter: blur(15px);
}

.button--glass:hover { background: var(--hover-bg); }

.button--ghost {
  color: var(--text-soft);
  background: transparent;
  border-color: var(--glass-border);
}

.button--ghost:hover { color: var(--text); background: var(--glass-soft); }

.button--danger {
  color: #fff;
  background: linear-gradient(105deg, #ca5274, #df6681);
  box-shadow: 0 10px 25px rgba(167, 56, 87, 0.24);
}

.button--small { min-height: 40px; padding: 9px 16px; font-size: 13px; }

/* ---------- Chat ---------- */

.chat-card {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin-top: 0;
  padding: clamp(16px, 2vh, 24px);
  flex-direction: column;
  border-radius: var(--radius-xl);
}

.card-heading,
.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.card-heading h2,
.dialog-heading h2,
.confirm-dialog h2 {
  margin: 3px 0 0;
  color: var(--text);
  font-family: ui-rounded, "Arial Rounded MT Bold", "Segoe UI", sans-serif;
  font-size: 21px;
  line-height: 1.2;
}

.memory-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--glass-soft);
  font-size: 11px;
  font-weight: 750;
}

.chat-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.personality-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.personality-switch {
  position: relative;
  display: grid;
  width: 74px;
  min-width: 74px;
  height: 36px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  padding: 3px;
  isolation: isolate;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--glass-soft);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  cursor: pointer;
  font: 800 10px/1 inherit;
  letter-spacing: 0.035em;
  transition: border-color 190ms ease, background-color 190ms ease, box-shadow 190ms ease, opacity 190ms ease, transform 180ms ease;
}

.personality-switch:hover:not(:disabled) {
  border-color: rgba(224, 102, 151, 0.34);
  background: var(--hover-bg);
  box-shadow: 0 7px 16px rgba(220, 71, 127, 0.1);
  transform: translateY(-1px);
}

.personality-switch:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.personality-switch__thumb {
  position: absolute;
  z-index: 0;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc(50% - 3px);
  border-radius: 999px;
  background: linear-gradient(145deg, var(--pink-400), var(--pink-500));
  box-shadow: 0 4px 12px rgba(215, 76, 130, 0.18);
  transform: translate3d(0, 0, 0);
  transition: transform 220ms var(--ease-soft), background-color 220ms ease;
  will-change: transform;
}

.personality-switch[data-mode="off"] .personality-switch__thumb {
  background: linear-gradient(145deg, #9291a6, #77778f);
  transform: translate3d(100%, 0, 0);
}

.personality-switch__option {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.58;
  transition: color 200ms ease, opacity 200ms ease;
}

.personality-switch:not([data-mode="off"]) .personality-switch__option--on,
.personality-switch[data-mode="off"] .personality-switch__option--off {
  color: #fff;
  opacity: 1;
}

.chat-new-button {
  display: inline-grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--pink-600);
  background: var(--glass-soft);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  cursor: pointer;
  font: 600 23px/1 ui-rounded, "Arial Rounded MT Bold", "Segoe UI", sans-serif;
  transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.chat-new-button:hover {
  color: var(--pink-600);
  border-color: rgba(224, 102, 151, 0.36);
  background: var(--pink-100);
  box-shadow: 0 8px 18px rgba(220, 71, 127, 0.14);
  transform: translateY(-1px);
}

.chat-new-button:active { transform: translateY(0) scale(0.96); }

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-height: 0;
  flex: 1;
  max-height: none;
  margin: clamp(12px, 1.6vh, 19px) -4px clamp(11px, 1.4vh, 16px) 0;
  padding: 2px 6px 2px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--pink-200) transparent;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  animation: message-enter 270ms var(--ease-soft) both;
}

.message--user { justify-content: flex-end; }

.message--assistant .message__mark {
  color: var(--pink-700);
  background: var(--pink-100);
}

.message--assistant .message__mark--chatbot {
  color: var(--text-soft);
  background: var(--glass-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.message__mark {
  display: grid;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  color: var(--pink-600);
  background: var(--pink-100);
  font-size: 13px;
}

.message__bubble {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 82%;
  padding: 12px 15px;
  border: 1px solid var(--glass-border);
  border-radius: 17px 17px 17px 6px;
  color: var(--text-soft);
  background: var(--glass-strong);
  font-size: 13.5px;
  line-height: 1.55;
}

.message__bubble strong { color: var(--text); font-size: 13.5px; }

.message__text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message--user .message__bubble {
  border-color: rgba(225, 118, 159, 0.2);
  border-radius: 17px 17px 6px 17px;
  color: var(--text);
  background: var(--pink-100);
}

.message--error .message__bubble {
  color: var(--text-soft);
  border-color: rgba(196, 78, 111, 0.25);
  background: rgba(255, 227, 233, 0.68);
}

html[data-theme="dark"] .message--error .message__bubble {
  color: var(--text);
  border-color: rgba(245, 140, 176, 0.24);
  background: rgba(80, 29, 58, 0.48);
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 34px;
  min-height: 14px;
}

.typing-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pink-500);
  animation: typing-dot 1.05s ease-in-out infinite;
}

.typing-dots i:nth-child(2) { animation-delay: 120ms; }
.typing-dots i:nth-child(3) { animation-delay: 240ms; }

@keyframes typing-dot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(1px); }
  30% { opacity: 1; transform: translateY(-2px); }
}

@keyframes message-enter {
  from { opacity: 0; transform: translate3d(0, 7px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 6px 6px 6px 17px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: var(--input-bg);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.chat-composer:focus-within { border-color: var(--pink-400); box-shadow: 0 0 0 4px var(--focus-ring); }

.chat-composer textarea {
  min-width: 0;
  min-height: 24px;
  max-height: 92px;
  flex: 1;
  padding: 7px 0;
  border: 0;
  outline: 0;
  resize: none;
  color: var(--text);
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  scrollbar-width: thin;
}

.chat-composer textarea::placeholder { color: var(--text-muted); }

.send-button,
.stop-button {
  display: grid;
  flex: 0 0 auto;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--pink-400), var(--pink-600));
  box-shadow: 0 8px 18px rgba(220, 71, 127, 0.27);
  cursor: pointer;
  font-size: 17px;
  transition: transform 180ms ease, box-shadow 220ms ease;
}

.stop-button {
  color: var(--pink-700);
  border: 1px solid rgba(225, 118, 159, 0.28);
  background: var(--pink-100);
  box-shadow: none;
  font-size: 11px;
}

.send-button:hover:not(:disabled),
.stop-button:hover { transform: translateY(-1px) scale(1.04); box-shadow: 0 10px 22px rgba(220, 71, 127, 0.34); }

.send-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
}

.chat-jump-button {
  position: absolute;
  left: 50%;
  bottom: 78px;
  z-index: 2;
  min-height: 31px;
  padding: 6px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text);
  background: var(--glass-strong);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  font-weight: 750;
  transform: translateX(-50%);
}

.chat-jump-button:hover { color: var(--pink-700); }

.stop-button[hidden],
.chat-jump-button[hidden] { display: none !important; }

.privacy-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 3px 0;
  color: var(--text-muted);
  font-size: 11.5px;
}

.chat-presence {
  margin-left: auto;
  color: var(--text-soft);
  font-weight: 680;
}

/* ---------- Expressions ---------- */

.section-heading { max-width: 780px; }
.section-heading--compact { max-width: 670px; }

#panel-expression .section-heading {
  width: min(50vw, 720px);
}

#panel-expression .section-heading h1 {
  font-size: clamp(35px, min(3.45vw, 5.2vh), 50px);
}

#panel-expression .section-heading > p:last-child {
  margin-top: clamp(9px, 1.3vh, 14px);
  font-size: 14px;
  line-height: 1.58;
}

.expression-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  width: min(50vw, 720px);
  max-width: none;
  margin-top: clamp(14px, 2vh, 22px);
}

.expression-card { border-radius: var(--radius-xl); }

.expression-card { padding: clamp(17px, 1.7vw, 23px); }

.expression-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.expression-option {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 9px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text);
  background: var(--glass-soft);
  cursor: pointer;
  text-align: left;
  transition: transform 180ms ease, background-color 240ms ease, border-color 240ms ease, box-shadow 240ms ease;
}

.expression-option:hover { transform: translateY(-2px); background: var(--hover-bg); }

.expression-option.is-active {
  border-color: var(--pink-400);
  background: var(--pink-100);
  box-shadow: 0 10px 23px rgba(220, 71, 127, 0.13);
}

.expression-option__symbol {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 13px;
  color: var(--pink-600);
  background: var(--glass-strong);
  font-size: 16px;
  transition: transform 330ms var(--ease-soft), color 230ms ease;
}

.expression-option.is-active .expression-option__symbol { transform: rotate(-5deg) scale(1.06); }

.expression-option__copy { display: flex; min-width: 0; flex-direction: column; }
.expression-option__copy strong { font-size: 12.5px; }
.expression-option__copy small { margin-top: 1px; color: var(--text-muted); font-size: 10px; line-height: 1.3; }

.expression-option__check {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 50%;
  color: transparent;
  background: var(--glass-soft);
  font-size: 11px;
  transition: color 220ms ease, background-color 220ms ease, transform 240ms var(--ease-soft);
}

.expression-option.is-active .expression-option__check {
  color: #fff;
  background: var(--pink-500);
  transform: scale(1.04);
}

/* ---------- Memories ---------- */

.history-heading,
.memory-heading {
  display: flex;
  width: min(62vw, 1040px);
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  max-width: none;
}

#panel-history,
#panel-memories {
  display: flex;
  width: min(62vw, 1040px);
  flex-direction: column;
}

#panel-history[hidden],
#panel-memories[hidden] { display: none; }

#panel-history .section-heading h1,
#panel-memories .section-heading h1 {
  font-size: clamp(35px, min(3.4vw, 5vh), 49px);
}

#panel-history .section-heading > p:last-child,
#panel-memories .section-heading > p:last-child {
  margin-top: clamp(9px, 1.3vh, 14px);
  font-size: 14px;
  line-height: 1.55;
}

.history-surface,
.memories-surface {
  display: flex;
  width: 100%;
  min-height: 0;
  margin-top: clamp(13px, 2vh, 22px);
  padding: clamp(16px, 1.8vw, 24px);
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.history-heading-row,
.memories-heading-row { align-items: center; }

.empty-state {
  display: flex;
  max-width: 480px;
  min-height: 0;
  margin: 18px auto 0;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-state[hidden] { display: none; }

.empty-state__mark {
  display: grid;
  width: 57px;
  height: 57px;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 19px;
  color: var(--pink-600);
  background: var(--pink-100);
  box-shadow: var(--shadow-small);
  font-size: 25px;
  transform: rotate(-4deg);
}

.empty-state h3 { margin: 15px 0 6px; color: var(--text); font-size: 18px; }
.empty-state p { margin: 0 0 18px; color: var(--text-soft); font-size: 13.5px; line-height: 1.6; }

.history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 0;
  flex: 1;
  align-content: start;
  gap: 13px;
  margin-top: 22px;
  padding-right: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--pink-200) transparent;
}

.history-grid:empty { display: none; }

.history-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 154px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-soft);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  animation: memory-enter 330ms var(--ease-soft) both;
  transition: transform 190ms ease, background-color 240ms ease, border-color 240ms ease, opacity 180ms ease;
}

.history-card:hover {
  border-color: rgba(224, 102, 151, 0.26);
  background: var(--hover-bg);
  transform: translateY(-2px);
}

.history-card.is-active {
  border-color: rgba(224, 102, 151, 0.42);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 8px 24px rgba(220, 71, 127, 0.1);
}

.history-card.is-removing { opacity: 0; transform: translateY(7px) scale(0.98); }

.history-card__open {
  display: block;
  min-width: 0;
  flex: 1;
  padding: 17px 17px 11px;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

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

.history-card__badges {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.history-card__date,
.history-card__active,
.history-card__mode {
  margin: 0;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 720;
}

.history-card__active {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--pink-600);
  background: var(--pink-100);
}

.history-card__mode {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(68, 157, 118, 0.2);
  border-radius: 999px;
  color: #277956;
  background: rgba(224, 248, 235, 0.54);
}

.history-card__mode--off {
  color: var(--text-muted);
  border-color: var(--glass-border);
  background: var(--glass-soft);
}

.history-card h3 {
  margin: 10px 0 5px;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-card__preview {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.history-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px 11px 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.history-card__open-label {
  color: var(--pink-600);
  font-size: 11.5px;
  font-weight: 750;
}

.history-card__delete {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-size: 17px;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.history-card__delete:hover {
  color: #c84e70;
  background: rgba(206, 76, 111, 0.11);
  transform: translateY(-1px);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-top: 22px;
  padding-right: 5px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--pink-200) transparent;
}

.memory-grid:empty { display: none; }

.memory-card {
  display: flex;
  min-height: 205px;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-soft);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  animation: memory-enter 360ms var(--ease-soft) both;
  transition: transform 190ms ease, background-color 240ms ease, border-color 240ms ease, opacity 180ms ease;
}

.memory-card:hover { transform: translateY(-3px); background: var(--hover-bg); }
.memory-card.is-removing { opacity: 0; transform: translateY(7px) scale(0.97); }

@keyframes memory-enter {
  from { opacity: 0; transform: translate3d(0, 12px, 0) scale(0.985); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

.memory-card__date {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--pink-600);
  font-size: 11px;
  font-weight: 750;
}

.memory-card h3 {
  margin: 11px 0 7px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.memory-card__preview {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.55;
}

.memory-card__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-top: auto;
  padding-top: 18px;
}

.memory-action {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text-soft);
  background: var(--glass-soft);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.memory-action:hover { color: var(--pink-600); background: var(--pink-100); transform: translateY(-1px); }

.memory-action--delete {
  display: grid;
  width: 34px;
  padding: 0;
  place-items: center;
  color: var(--text-muted);
  background: transparent;
  font-size: 17px;
}

.memory-action--delete:hover { color: #c84e70; background: rgba(206, 76, 111, 0.1); }

/* ---------- Dialogs and toast ---------- */

dialog {
  color: var(--text);
}

.memory-dialog,
.confirm-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border-radius: var(--radius-xl);
}

.memory-dialog[open],
.confirm-dialog[open] {
  animation: dialog-open 310ms var(--ease-soft) both;
}

.memory-dialog.is-closing,
.confirm-dialog.is-closing {
  animation: dialog-close 180ms ease both;
}

.memory-dialog::backdrop,
.confirm-dialog::backdrop {
  background: rgba(17, 15, 36, 0.42);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: backdrop-open 260ms ease both;
}

html[data-theme="dark"] .memory-dialog::backdrop,
html[data-theme="dark"] .confirm-dialog::backdrop {
  background: rgba(2, 4, 18, 0.66);
}

@keyframes dialog-open {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.975); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes dialog-close {
  from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.98); }
}

@keyframes backdrop-open {
  from { opacity: 0; }
  to { opacity: 1; }
}

.memory-dialog form { padding: clamp(22px, 4vw, 32px); }

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text-soft);
  background: var(--glass-soft);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.icon-button:hover { color: var(--pink-600); background: var(--pink-100); transform: rotate(4deg); }

.field-group { margin-top: 21px; }

.field-group label {
  display: block;
  margin: 0 0 7px 3px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.field-group input,
.field-group textarea {
  width: 100%;
  border: 1px solid var(--glass-border);
  border-radius: 15px;
  outline: 0;
  color: var(--text);
  background: var(--input-bg);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 280ms ease;
}

.field-group input { height: 48px; padding: 0 15px; }
.field-group textarea { min-height: 160px; padding: 13px 15px; resize: vertical; line-height: 1.55; }

.field-group input:focus,
.field-group textarea:focus { border-color: var(--pink-400); box-shadow: 0 0 0 4px var(--focus-ring); }

.field-group input::placeholder,
.field-group textarea::placeholder { color: var(--text-muted); }

.field-group .is-invalid { border-color: #ce5275; }

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-height: 20px;
  margin: 5px 3px 0;
  color: var(--text-muted);
  font-size: 11px;
}

.field-error { color: #c94d71; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}

.confirm-dialog {
  width: min(430px, calc(100vw - 32px));
  padding: 29px;
  text-align: center;
}

.confirm-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 13px;
  place-items: center;
  border-radius: 17px;
  color: #ca5274;
  background: rgba(206, 76, 111, 0.11);
  font-size: 22px;
}

.confirm-dialog p { margin: 10px auto 0; color: var(--text-soft); font-size: 13.5px; line-height: 1.55; }
.confirm-dialog .dialog-actions { justify-content: center; }

.toast {
  position: fixed;
  z-index: 60;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--text);
  background: var(--glass-strong);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transform: translate3d(0, 10px, 0);
  font-size: 12.5px;
  font-weight: 700;
  transition: opacity 230ms ease, transform 230ms var(--ease-soft), background-color 400ms ease;
}

.toast.is-visible { opacity: 1; transform: translate3d(0, 0, 0); }

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .page-shell { --shell-x: clamp(18px, 2.5vw, 32px); }
  .brand-name { font-size: 13px; }
  .brand-name > span { display: none; }
  .header-actions { gap: 6px; }
  .theme-toggle { width: auto; min-height: 40px; padding: 4px; }
  .theme-toggle__current { display: inline-flex; }
  .theme-switch { display: none; }
  .theme-toggle__icon { width: 30px; height: 30px; }
  .theme-toggle__label { display: none; }
  .content-column { width: min(52vw, 630px); }
  #panel-expression .section-heading,
  .expression-layout { width: min(53vw, 680px); }
  #panel-history,
  .history-heading,
  #panel-memories,
  .memory-heading { width: min(66vw, 900px); }
  .character-image { right: 0; }
  .character-stage::before { right: 0; }
  .memory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .page-shell {
    --shell-x: 16px;
    --shell-top: 12px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    gap: 8px 14px;
    height: 116px;
    padding: 9px 12px 10px;
    border-radius: 24px;
  }

  .tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .tab { flex: 1; min-width: 0; }
  .header-actions { grid-column: 2; grid-row: 1; }

  .neuron-popover {
    position: fixed;
    top: 136px;
    right: 16px;
    left: auto;
    transform: translate3d(0, -5px, 0);
  }

  .neuron-meter.is-open .neuron-popover { transform: translate3d(0, 0, 0); }

  .main-content { top: 140px; bottom: 14px; }
  .view-panel { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  .hero-copy h1,
  .section-heading h1 { font-size: clamp(35px, 6.8vw, 48px); }
  .content-column { width: min(58vw, 450px); }

  .chat-view {
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
  }

  #panel-chat { overflow: hidden; }
  .chat-card { height: 100%; min-height: 0; }

  #panel-expression .section-heading,
  .expression-layout { width: min(58vw, 450px); }
  .expression-options { grid-template-columns: 1fr; }
  .expression-option { min-height: 62px; }

  #panel-history,
  .history-heading,
  #panel-memories,
  .memory-heading { width: min(64vw, 500px); }
  .history-grid { grid-template-columns: 1fr; }
  .memory-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .memory-heading .button { align-self: flex-start; }

  .room-vignette {
    background:
      linear-gradient(90deg, rgba(255, 247, 250, 0.4), rgba(255, 247, 250, 0.08) 75%),
      radial-gradient(ellipse at center, transparent 58%, rgba(78, 38, 62, 0.08) 100%);
  }

  html[data-theme="dark"] .room-vignette {
    background:
      linear-gradient(90deg, rgba(5, 10, 35, 0.32), rgba(7, 12, 40, 0.05) 75%),
      radial-gradient(ellipse at center, transparent 58%, rgba(2, 4, 20, 0.18) 100%);
  }

  .character-image {
    right: -18vw;
    bottom: -14.5vh;
    height: 90vh;
  }

  .character-stage::before {
    right: -14vw;
    bottom: 4vh;
    width: 52vw;
  }

}

@media (max-width: 620px) {
  :root {
    --glass: rgba(255, 250, 252, 0.6);
    --glass-strong: rgba(255, 252, 253, 0.72);
    --glass-soft: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.65);
    --input-bg: rgba(255, 255, 255, 0.68);
    --hover-bg: rgba(255, 255, 255, 0.74);
  }

  html[data-theme="dark"] {
    --glass: rgba(15, 19, 46, 0.6);
    --glass-strong: rgba(17, 21, 50, 0.72);
    --glass-soft: rgba(27, 31, 66, 0.44);
    --glass-border: rgba(193, 198, 239, 0.15);
    --input-bg: rgba(8, 12, 33, 0.5);
    --hover-bg: rgba(60, 61, 101, 0.56);
  }

  .page-shell {
    --shell-x: 10px;
    --shell-top: 7px;
  }

  .topbar {
    height: auto;
    gap: 4px 10px;
    padding: 6px 10px 13px;
    border-radius: 22px;
  }

  .tabs { height: auto; min-height: 40px; padding: 2px; }
  .main-content { top: calc(var(--shell-top) + 128px); right: 10px; bottom: 8px; left: 10px; }

  .brand { gap: 7px; font-size: 12px; letter-spacing: 0.055em; }
  .brand-mark { width: 30px; height: 30px; font-size: 14px; }

  .header-actions { gap: 5px; }
  .neuron-popover { top: 132px; right: 10px; }
  .local-status {
    height: 38px;
    min-width: 86px;
    min-height: 38px;
    padding: 0 9px;
  }
  .neuron-meter__value { min-width: 47px; }
  .immersive-toggle { height: 38px; min-height: 38px; padding: 0 10px; }

  .theme-toggle { min-height: 38px; padding: 4px; }
  .theme-toggle__icon { width: 28px; height: 28px; }
  .theme-toggle__label { display: none; }

  .tab { min-height: 36px; padding: 7px 5px; font-size: 12px; }
  .tab-mark { display: none; }

  .hero-copy h1,
  .section-heading h1 { font-size: clamp(27px, 7.8vw, 34px); line-height: 1.02; }
  .eyebrow { gap: 5px; margin-bottom: 6px; font-size: 11px; }
  .section-heading > p:last-child { margin-top: 7px; font-size: 12.5px; line-height: 1.45; }

  .button { min-height: 44px; padding: 10px 16px; }

  .content-column,
  #panel-expression .section-heading,
  .expression-layout,
  #panel-history,
  .history-heading,
  #panel-memories,
  .memory-heading { width: 100%; }

  .chat-view {
    display: grid;
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 9px;
  }

  .chat-card {
    height: auto;
    min-height: 0;
    padding: 14px;
    border-radius: 23px;
    overflow: hidden;
  }

  .chat-card .card-heading h2 { font-size: 19px; }
  .chat-card .card-kicker { font-size: 10.5px; }
  .personality-control { gap: 6px; font-size: 10px; }
  .personality-switch { width: 70px; min-width: 70px; height: 34px; }
  .chat-new-button { width: 34px; height: 34px; }
  .chat-log { gap: 10px; margin-block: 9px; }
  .chat-composer { padding: 5px 5px 5px 14px; }
  .privacy-note { margin-top: 7px; }
  .chat-presence { display: none; }
  .message__bubble { max-width: 90%; padding: 10px 13px; font-size: 13px; }

  #panel-expression .section-heading h1,
  #panel-history .section-heading h1,
  #panel-memories .section-heading h1 { font-size: clamp(27px, 7.8vw, 34px); }

  #panel-expression:not([hidden]) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #panel-expression .section-heading {
    flex: 0 0 auto;
    order: 1;
  }

  #panel-expression .section-heading > p:last-child { display: none; }

  #panel-expression::after {
    content: "";
    display: block;
    min-height: clamp(270px, 41dvh, 350px);
    flex: 1 1 auto;
    order: 2;
    pointer-events: none;
  }

  #panel-expression .expression-layout {
    display: block;
    flex: 0 0 auto;
    order: 3;
    margin-top: 4px;
  }

  #panel-expression .expression-card {
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  #panel-expression .expression-card::before,
  #panel-expression .expression-card > .card-heading { display: none; }

  #panel-expression .expression-options {
    display: flex;
    gap: 9px;
    width: 100%;
    margin: 0;
    padding: 3px 2px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-padding-inline: 2px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  #panel-expression .expression-options::-webkit-scrollbar { display: none; }

  #panel-expression .expression-option {
    grid-template-columns: 31px minmax(0, 1fr) 18px;
    gap: 8px;
    min-height: 74px;
    padding: 9px;
    flex: 0 0 clamp(146px, 42vw, 176px);
    scroll-snap-align: start;
  }

  #panel-expression .expression-option__symbol {
    width: 31px;
    height: 31px;
    border-radius: 11px;
  }

  #panel-expression .expression-option__copy strong { font-size: 12px; }
  #panel-expression .expression-option__copy small { font-size: 9.5px; }

  #panel-expression,
  #panel-history,
  #panel-memories { padding-bottom: 4px; }

  .memory-heading { flex-direction: row; align-items: flex-end; }
  .memory-heading .button { flex: 0 0 auto; }
  .memory-heading .button span { display: none; }
  .history-surface,
  .memories-surface { min-height: 360px; flex: 1 0 360px; }

  .memory-grid { grid-template-columns: 1fr; }
  .memory-card { min-height: 190px; }

  .memory-dialog,
  .confirm-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    border-radius: 23px;
  }

  .dialog-actions .button { flex: 1; }
  .toast { right: 10px; bottom: 10px; }

  .ambient-glow { top: 18%; right: -20%; width: 82vw; }

  .character-image {
    right: -7vw;
    bottom: -9.5vh;
    height: 70vh;
    opacity: 0;
    mix-blend-mode: normal;
  }

  .character-stage::before {
    right: -7vw;
    bottom: 2vh;
    width: 76vw;
    height: 13vh;
    opacity: 0.08;
  }

  .room-vignette {
    background: linear-gradient(180deg, rgba(255, 248, 251, 0.22), rgba(255, 245, 249, 0.14));
  }

  html[data-theme="dark"] .room-vignette {
    background: linear-gradient(180deg, rgba(5, 9, 31, 0.14), rgba(3, 7, 25, 0.2));
  }
}

@media (max-width: 860px) and (orientation: landscape) and (max-height: 560px) {
  .page-shell {
    --shell-x: 10px;
    --shell-top: 7px;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: 1fr;
    gap: 9px;
    height: 58px;
    padding: 5px 9px;
    border-radius: 999px;
  }

  .brand { grid-column: 1; grid-row: 1; height: 40px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-name { font-size: 11.5px; }
  .tabs {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    min-height: 42px;
    padding: 2px;
  }
  .tab { min-height: 36px; padding: 6px 5px; font-size: 11.5px; }
  .tab-mark { display: none; }
  .header-actions { grid-column: 3; grid-row: 1; }
  .neuron-popover { top: 69px; right: 10px; }
  .local-status { height: 38px; min-height: 38px; padding-inline: 10px; }
  .immersive-toggle { height: 38px; min-height: 38px; padding-inline: 10px; }
  .theme-toggle { width: auto; min-height: 38px; padding: 4px; }
  .theme-toggle__current { display: inline-flex; }
  .theme-switch { display: none; }
  .theme-toggle__icon { width: 28px; height: 28px; }
  .theme-toggle__label { display: none; }

  .main-content { top: 74px; right: 10px; bottom: 7px; left: 10px; }
  .chat-view { grid-template-rows: minmax(0, 1fr); gap: 0; }
  .chat-view .hero-copy { display: none; }
  .chat-card { padding: 12px; }
  .chat-log { margin-block: 7px; }

  #panel-expression .section-heading > p:last-child { display: none; }
  #panel-expression .section-heading h1 { font-size: 25px; }
  #panel-expression .expression-layout { margin-top: 8px; }
  #panel-expression .expression-card { padding: 11px; }
  #panel-expression .expression-card > .card-heading { display: none; }
  #panel-expression .expression-options {
    display: flex;
    gap: 8px;
    margin-top: 0;
    padding: 2px 2px 7px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  #panel-expression .expression-options::-webkit-scrollbar { display: none; }
  #panel-expression .expression-option {
    flex: 0 0 150px;
    min-height: 62px;
    scroll-snap-align: start;
  }
}

@media (max-width: 390px) {
  .immersive-toggle > span:first-child { display: none; }
  .chat-composer { padding-left: 13px; }
  .personality-control { gap: 5px; font-size: 9.5px; }
  .personality-switch { width: 66px; min-width: 66px; }
  .chat-heading-actions { gap: 6px; }
  .memory-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }
  .memory-heading .button { width: 100%; }
  .card-heading { gap: 10px; }
}

@media (max-width: 360px) and (max-height: 620px) {
  #panel-expression::after { min-height: 245px; }
  #panel-expression .section-heading h1 { font-size: 25px; }
  .character-image { bottom: -21vh; }
}

@media (max-height: 820px) and (min-width: 861px) {
  .page-shell { --shell-top: 12px; }
  .topbar { height: 64px; }
  .main-content { top: 84px; bottom: 12px; }
  .hero-copy h1,
  .section-heading h1 { font-size: 41px; }
  .eyebrow { margin-bottom: 7px; }
  .button { min-height: 42px; padding-block: 9px; }
  .chat-card { height: 100%; min-height: 0; }
  .chat-log { margin-block: 10px; }
  .privacy-note { margin-top: 7px; }
  .character-image { height: 111.5vh; bottom: -21vh; }

  #panel-expression .section-heading h1,
  #panel-history .section-heading h1,
  #panel-memories .section-heading h1 { font-size: 38px; }
  #panel-expression .section-heading > p:last-child,
  #panel-history .section-heading > p:last-child,
  #panel-memories .section-heading > p:last-child { font-size: 12.5px; line-height: 1.45; }
  .expression-layout { margin-top: 12px; }
  .expression-card { padding: 15px; }
  .expression-options { margin-top: 11px; }
  .expression-option { min-height: 55px; }
  .history-surface,
  .memories-surface { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .sakura-layer,
  .sakura-background,
  .expression-spark { display: none; }

  .room-image,
  .table-image,
  .room-ambient { transition-duration: 160ms !important; }
}
