@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@400;500;600;700;800&display=swap');

:root {
  --black: #050406;
  --white: #fffafb;
  --purple: #7d38ff;
  --red: #ef314d;
  --grey: #d8d2d7;
  --panel: rgba(18, 14, 22, 0.72);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
  font-family: "Bricolage Grotesque", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--white);
  background: #020103;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.gradient-field,
.heart-field,
.theme-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.theme-field {
  z-index: -4;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  opacity: 0;
  transition: opacity 260ms ease;
}

.theme-field::before,
.theme-field::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0;
}

.gradient-field {
  z-index: -3;
  background:
    radial-gradient(circle at 50% 52%, rgba(125, 56, 255, 0.12), transparent 16%),
    radial-gradient(circle at 66% 62%, rgba(84, 3, 27, 0.42), transparent 34%),
    radial-gradient(circle at 31% 38%, rgba(42, 10, 75, 0.36), transparent 28%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04), transparent 10%),
    linear-gradient(135deg, #000 0%, #020103 24%, #09030e 50%, #21030d 74%, #000 100%);
  background-size: 180% 180%;
  animation: gradientShift 34s ease-in-out infinite alternate;
}

.gradient-field::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0.04) 0%, rgba(2, 1, 4, 0.42) 42%, rgba(0, 0, 0, 0.94) 100%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.025), transparent 31%, rgba(0, 0, 0, 0.68));
  mix-blend-mode: normal;
  animation: sheen 28s ease-in-out infinite alternate;
}

.heart-field {
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 53%, rgba(255, 255, 255, 0.05), transparent 3%),
    radial-gradient(circle at 50% 53%, rgba(125, 56, 255, 0.08), transparent 18%),
    radial-gradient(circle at 50% 66%, rgba(80, 3, 26, 0.18), transparent 32%),
    radial-gradient(ellipse at center, transparent 20%, rgba(0, 0, 0, 0.58) 86%);
}

body[data-background-theme="goth"] .theme-field,
body[data-background-theme="starry"] .theme-field,
body[data-background-theme="office"] .theme-field,
body[data-background-theme="dream"] .theme-field {
  opacity: 1;
}

body[data-background-theme="goth"] .heart-field,
body[data-background-theme="starry"] .heart-field,
body[data-background-theme="office"] .heart-field,
body[data-background-theme="dream"] .heart-field {
  background: transparent;
}

body[data-background-theme="goth"] .heart,
body[data-background-theme="starry"] .heart,
body[data-background-theme="office"] .heart,
body[data-background-theme="dream"] .heart {
  display: none;
}

body[data-background-theme="goth"] .gradient-field,
body[data-background-theme="starry"] .gradient-field,
body[data-background-theme="office"] .gradient-field,
body[data-background-theme="dream"] .gradient-field {
  background:
    radial-gradient(circle at 50% 50%, rgba(125, 56, 255, 0.08), transparent 34%),
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.54) 72%, rgba(0, 0, 0, 0.9) 100%);
}

body[data-background-theme="goth"] .theme-field {
  --gothic-flow-x: 7%;
  --gothic-flow-y: 11%;
  --gothic-flow-mid-x: 21%;
  --gothic-flow-mid-y: 12%;
  --gothic-flow-tail-x: 39%;
  --gothic-flow-tail-y: 8%;
  background-image: url("/backgrounds/goth.jpg");
  background-position: center;
  filter: contrast(1.12) brightness(1.08);
}

body[data-background-theme="goth"] .theme-field::before {
  opacity: 0.98;
  background-image: url("/backgrounds/goth.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter:
    grayscale(1)
    contrast(3.9)
    brightness(5.4)
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.92))
    drop-shadow(0 0 22px rgba(239, 49, 77, 0.34));
  -webkit-mask-image:
    radial-gradient(ellipse 18% 24% at var(--gothic-flow-x) var(--gothic-flow-y), #000 0 26%, rgba(0, 0, 0, 0.82) 44%, transparent 76%),
    radial-gradient(ellipse 13% 18% at var(--gothic-flow-mid-x) var(--gothic-flow-mid-y), rgba(0, 0, 0, 0.76) 0 28%, transparent 78%),
    radial-gradient(ellipse 10% 15% at var(--gothic-flow-tail-x) var(--gothic-flow-tail-y), rgba(0, 0, 0, 0.64) 0 26%, transparent 80%);
  mask-image:
    radial-gradient(ellipse 18% 24% at var(--gothic-flow-x) var(--gothic-flow-y), #000 0 26%, rgba(0, 0, 0, 0.82) 44%, transparent 76%),
    radial-gradient(ellipse 13% 18% at var(--gothic-flow-mid-x) var(--gothic-flow-mid-y), rgba(0, 0, 0, 0.76) 0 28%, transparent 78%),
    radial-gradient(ellipse 10% 15% at var(--gothic-flow-tail-x) var(--gothic-flow-tail-y), rgba(0, 0, 0, 0.64) 0 26%, transparent 80%);
  mix-blend-mode: screen;
  animation: gothicFlowPulse 3.8s ease-in-out infinite alternate;
  will-change: opacity, mask-image;
}

body[data-background-theme="goth"] .theme-field::after {
  opacity: 0.74;
  background:
    radial-gradient(ellipse at 64% 57%, rgba(116, 18, 54, 0.22), transparent 38%),
    linear-gradient(120deg, rgba(0, 0, 0, 0.18), transparent 42%, rgba(83, 15, 71, 0.18));
  animation: gothicPulse 8s ease-in-out infinite alternate;
}

body[data-background-theme="starry"] .theme-field {
  background-image: url("/backgrounds/starry.jpg");
  background-position: center;
  filter: saturate(1.18) contrast(1.14) brightness(1.06);
}

body[data-background-theme="starry"] .theme-field::before {
  opacity: 0.86;
  background:
    radial-gradient(circle at 15% 6%, rgba(255, 241, 178, 0.98), transparent 1.7%),
    radial-gradient(circle at 40% 3%, rgba(255, 236, 156, 0.96), transparent 2.2%),
    radial-gradient(circle at 75% 3%, rgba(255, 242, 185, 1), transparent 3.2%),
    radial-gradient(circle at 23% 12%, rgba(255, 230, 129, 0.96), transparent 2.8%),
    radial-gradient(circle at 63% 13%, rgba(255, 234, 148, 0.94), transparent 2.4%),
    radial-gradient(circle at 42% 24%, rgba(255, 231, 137, 0.98), transparent 2.6%),
    radial-gradient(circle at 72% 28%, rgba(255, 237, 163, 1), transparent 3.2%),
    radial-gradient(circle at 17% 43%, rgba(255, 240, 174, 0.9), transparent 2.6%),
    radial-gradient(circle at 51% 43%, rgba(255, 236, 155, 0.98), transparent 3.4%),
    radial-gradient(circle at 80% 51%, rgba(255, 234, 143, 0.96), transparent 2.6%),
    radial-gradient(circle at 32% 62%, rgba(255, 238, 166, 0.94), transparent 2.4%),
    radial-gradient(circle at 68% 65%, rgba(255, 231, 135, 0.98), transparent 2.8%),
    radial-gradient(circle at 20% 83%, rgba(255, 242, 186, 0.94), transparent 2.4%),
    radial-gradient(circle at 56% 88%, rgba(255, 234, 145, 0.96), transparent 2.7%),
    radial-gradient(circle at 84% 89%, rgba(255, 239, 171, 1), transparent 3.1%);
  filter: blur(0.05px);
  mix-blend-mode: screen;
  animation: starCenterTwinkle 5.8s steps(6, end) infinite;
}

body[data-background-theme="office"] .theme-field {
  background-image: url("/backgrounds/office.jpg");
  background-position: center;
  filter: saturate(1.16) contrast(1.12) brightness(1.08);
}

body[data-background-theme="office"] .theme-field::before {
  opacity: 0.76;
  background:
    radial-gradient(ellipse at 7% 3%, rgba(255, 255, 235, 0.94), transparent 6%),
    radial-gradient(ellipse at 20% 8%, rgba(255, 255, 232, 0.88), transparent 5%),
    radial-gradient(ellipse at 34% 12%, rgba(255, 255, 232, 0.78), transparent 5%),
    radial-gradient(ellipse at 47% 10%, rgba(255, 255, 235, 0.82), transparent 5%),
    radial-gradient(ellipse at 63% 5%, rgba(255, 255, 235, 0.86), transparent 6%),
    radial-gradient(ellipse at 85% 3%, rgba(255, 255, 232, 0.92), transparent 7%),
    radial-gradient(ellipse at 22% 20%, rgba(255, 244, 151, 0.28), transparent 9%),
    radial-gradient(ellipse at 42% 26%, rgba(255, 244, 151, 0.22), transparent 10%),
    radial-gradient(ellipse at 62% 18%, rgba(255, 244, 151, 0.24), transparent 9%),
    radial-gradient(ellipse at 84% 16%, rgba(255, 244, 151, 0.24), transparent 10%);
  mix-blend-mode: screen;
  animation: officeLights 6.2s steps(7, end) infinite;
}

body[data-background-theme="office"] .theme-field::after {
  opacity: 0.42;
  background:
    radial-gradient(ellipse at 50% 34%, rgba(255, 232, 124, 0.11), transparent 30%),
    radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.36));
  animation: officeFlicker 4.8s linear infinite;
}

body[data-background-theme="dream"] .theme-field {
  background-image: url("/backgrounds/dream.jpg");
  background-position: center;
}

body[data-background-theme="dream"] .theme-field::before {
  opacity: 0.42;
  background-image: url("/backgrounds/dream.jpg");
  background-position: center;
  background-size: cover;
  mix-blend-mode: screen;
  transform: scale(1.08);
  animation: dreamCloudDrift 34s ease-in-out infinite alternate;
}

body[data-background-theme="dream"] .theme-field::after {
  opacity: 0.46;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 34%, rgba(255, 255, 255, 0.08)),
    radial-gradient(ellipse at 48% 30%, rgba(255, 255, 255, 0.18), transparent 32%);
  animation: dreamHaze 18s ease-in-out infinite alternate;
}

.heart {
  --heart-size: 72px;
  position: absolute;
  left: 50%;
  top: 56%;
  width: var(--heart-size);
  height: var(--heart-size);
  background: var(--heart-color);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-45deg) scale(var(--start-scale));
  transform-origin: center;
  animation: heartBloom var(--duration) cubic-bezier(0.18, 0.02, 0.2, 1) infinite;
  animation-delay: var(--delay);
  filter: blur(var(--blur));
  mix-blend-mode: screen;
}

.heart::before,
.heart::after {
  position: absolute;
  width: 100%;
  height: 100%;
  content: "";
  background: inherit;
  border-radius: 50%;
}

.heart::before {
  top: -50%;
  left: 0;
}

.heart::after {
  top: 0;
  left: 50%;
}

.heart:nth-child(3n),
.heart:nth-child(7n) {
  mix-blend-mode: normal;
}

.view {
  position: relative;
  min-height: 100vh;
}

.auth-view {
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-panel {
  width: min(420px, calc(100vw - 40px));
  padding: 28px;
  background: rgba(245, 241, 246, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.auth-panel h1 {
  margin: 0 0 26px;
  color: #000;
  font-size: clamp(58px, 13vw, 104px);
  line-height: 0.82;
  letter-spacing: 0;
  text-align: center;
  font-weight: 800;
}

.auth-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: rgba(0, 0, 0, 0.72);
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  color: #080609;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 6px;
  outline: none;
}

input:focus,
select:focus {
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(125, 56, 255, 0.16);
}

.primary-button,
.secondary-button,
.icon-button,
.tool-button,
.utensil,
.modal-close {
  border: 0;
  border-radius: 6px;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease, opacity 140ms ease;
}

.primary-button {
  min-height: 46px;
  padding: 0 18px;
  color: #fff;
  background: #050406;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  font-weight: 800;
}

.primary-button:hover,
.tool-button:hover,
.icon-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  min-height: 44px;
  padding: 0 16px;
  color: #050406;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-weight: 800;
}

.text-button {
  min-height: 34px;
  padding: 0;
  color: #050406;
  background: transparent;
  border: 0;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-note {
  margin: 0;
  color: rgba(5, 4, 6, 0.72);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.auth-form input[name="code"] {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: 800;
}

.field-error input,
.field-error select {
  border-color: #ef314d;
  box-shadow: 0 0 0 3px rgba(239, 49, 77, 0.16);
}

.verify-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: center;
}

.verify-status {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: transparent;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-size: 20px;
  font-weight: 900;
}

.verify-status.verified {
  color: #0b7a3d;
  background: rgba(218, 255, 233, 0.9);
  border-color: rgba(11, 122, 61, 0.38);
}

.verify-status.verified::before {
  content: "\2713";
}

.verify-status.invalid {
  color: #ef314d;
  background: rgba(255, 224, 229, 0.9);
  border-color: rgba(239, 49, 77, 0.42);
}

.verify-status.invalid::before {
  content: "\00d7";
}

.verify-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 8px;
  align-items: end;
}

.studio-view {
  height: 100vh;
  overflow: hidden;
}

.studio-topbar {
  position: fixed;
  z-index: 30;
  top: 18px;
  right: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: none;
  flex-wrap: wrap;
}

.studio-topbar > * {
  pointer-events: auto;
}

#exhibitPicker {
  width: min(320px, 42vw);
  min-height: 40px;
  color: #fff;
  background: rgba(5, 4, 6, 0.78);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.cursor-settings-button {
  margin-right: auto;
}

.page-bar {
  position: fixed;
  z-index: 27;
  top: 72px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

#pagePicker {
  width: min(220px, 34vw);
  min-height: 38px;
  color: #fff;
  background: rgba(5, 4, 6, 0.72);
  border-color: rgba(255, 255, 255, 0.22);
}

.role-pill {
  min-width: 76px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  color: #fff;
  background: rgba(5, 4, 6, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-weight: 800;
  font-size: 13px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(5, 4, 6, 0.72);
}

.tool-menu {
  position: fixed;
  z-index: 28;
  top: 98px;
  left: 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 158px;
  padding: 10px;
  background: rgba(16, 12, 21, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.tool-button {
  min-height: 52px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: rgba(255, 250, 252, 0.9);
  background: rgba(255, 255, 255, 0.12);
  font-weight: 800;
  text-align: left;
}

.tool-button span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tool-button.active {
  color: #fff;
  background: linear-gradient(135deg, #050406, #421062 52%, #71051e);
}

.tool-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
  transform: none;
}

.read-mode .tool-menu,
.read-mode .brush-panel,
.read-mode .role-pill,
.read-mode #shareButton,
.read-mode #logoutButton,
.read-mode .page-bar .icon-button,
.read-mode .widget-menu,
.read-mode .move-handle,
.read-mode .resize-handle {
  display: none !important;
}

.read-mode #exhibitPicker,
.read-mode #cursorSettingsButton {
  display: none;
}

.brush-panel {
  position: fixed;
  z-index: 27;
  top: 98px;
  left: 196px;
  width: 214px;
  padding: 8px;
  display: grid;
  gap: 12px;
  background: rgba(16, 12, 21, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
}

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

.utensil {
  width: 100%;
  min-width: 0;
  height: 38px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.84);
}

.utensil.active {
  color: #fff;
  background: #050406;
}

.color-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.color-swatch {
  width: 24px;
  height: 24px;
  justify-self: center;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.color-swatch.active {
  border-color: #ffc857;
  box-shadow:
    0 0 0 2px #050406,
    0 0 0 5px rgba(255, 200, 87, 0.76);
}

.brush-size {
  width: 100%;
  accent-color: #050406;
}

.board-viewport {
  position: absolute;
  inset: 0;
  overflow: auto;
  cursor: grab;
  overscroll-behavior: contain;
}

.board-viewport.panning {
  cursor: grabbing;
}

.board {
  position: relative;
  overflow: hidden;
  min-width: 5200px;
  min-height: 3600px;
  transform-origin: 0 0;
}

.board.custom-cursor-active,
.board.custom-cursor-active *,
.board-viewport.panning .board,
.board-viewport.panning .board * {
  cursor: none !important;
}

.zoom-controls {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 32;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: rgba(5, 4, 6, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  backdrop-filter: blur(16px);
}

.zoom-value {
  min-width: 54px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.drag-preview {
  position: absolute;
  z-index: 90;
  border: 1px dashed rgba(0, 0, 0, 0.78);
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.02);
}

.remote-cursor {
  position: absolute;
  z-index: 120;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 68px auto;
  align-items: start;
  gap: 5px;
  pointer-events: none;
  transform: translate3d(-999px, -999px, 0);
  transform-origin: 0 0;
  overflow: visible;
  will-change: transform;
}

.local-cursor {
  position: absolute;
  z-index: 125;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 68px auto;
  align-items: start;
  gap: 5px;
  pointer-events: none;
  transform: translate3d(-999px, -999px, 0);
  transform-origin: 0 0;
  overflow: visible;
  will-change: transform;
}

.remote-cursor strong,
.local-cursor strong {
  max-width: 140px;
  margin-top: 28px;
  padding: 3px 7px;
  overflow: hidden;
  color: #fff;
  background: var(--cursor-color, #7d38ff);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remote-cursor-arrow {
  width: 0;
  height: 0;
  display: block;
  border-top: 25px solid var(--cursor-color, #7d38ff);
  border-right: 15px solid transparent;
  filter:
    drop-shadow(1px 0 0 #050406)
    drop-shadow(0 1px 0 #050406)
    drop-shadow(0 8px 10px rgba(0, 0, 0, 0.32));
  transform: skew(-10deg);
}

.remote-cursor img,
.local-cursor img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.32));
}

.image-cursor img {
  transform: translate(-12px, -12px);
  transform-origin: center;
}

.art-widget {
  position: absolute;
  z-index: 2;
  min-width: 40px;
  min-height: 40px;
  border: var(--widget-border-width, 1px) solid var(--widget-border-color, rgba(255, 255, 255, 0.16));
  border-radius: var(--widget-radius, 8px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  container-type: size;
  cursor: grab;
  overflow: visible;
}

.art-widget:active {
  cursor: grabbing;
}

.art-widget.selected {
  outline: 2px solid rgba(125, 56, 255, 0.78);
}

.art-widget:hover,
.art-widget.controls-open,
.art-widget.selected {
  z-index: 80 !important;
}

.art-widget canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--widget-bg, rgba(255, 255, 255, 0.82));
  border-radius: inherit;
  clip-path: var(--widget-clip, none);
  touch-action: none;
}

.wordbox-content {
  width: 100%;
  height: 100%;
  padding: 18px;
  color: var(--word-color, #050406);
  background: var(--widget-bg, rgba(255, 255, 255, 0.82));
  font-family: var(--word-font, "Bricolage Grotesque", Arial, sans-serif);
  font-size: var(--word-size, 18px);
  font-style: var(--word-style, normal);
  font-weight: var(--word-weight, 500);
  line-height: 1.22;
  outline: none;
  overflow: auto;
  white-space: pre-wrap;
  border-radius: inherit;
  clip-path: var(--widget-clip, none);
}

.external-controls .wordbox-content {
  padding: 10px;
}

.question-widget {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 18px;
  color: var(--answer-color, #24103d);
  background: var(--widget-bg, rgba(255, 255, 255, 0.86));
  border-radius: inherit;
  clip-path: var(--widget-clip, none);
  overflow: hidden;
}

.external-controls .question-widget {
  padding: 10px;
}

.question-prompt {
  color: var(--question-color, #050406);
  font-family: var(--question-font, "Bricolage Grotesque", Arial, sans-serif);
  font-size: var(--question-size, 20px);
  font-style: var(--question-style, normal);
  font-weight: var(--question-weight, 800);
  line-height: 1.16;
  white-space: pre-wrap;
}

.question-comment {
  min-height: 0;
  padding: 12px;
  color: var(--answer-color, #24103d);
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(5, 4, 6, 0.08);
  border-radius: 7px;
  font-family: var(--answer-font, "Bricolage Grotesque", Arial, sans-serif);
  font-size: var(--answer-size, 17px);
  font-style: var(--answer-style, normal);
  font-weight: var(--answer-weight, 500);
  line-height: 1.28;
  outline: none;
  overflow: auto;
  white-space: pre-wrap;
}

.media-widget {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  margin: 0;
  overflow: visible;
}

.media-widget img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.32));
}

.picture-shell {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.picture-widget {
  width: 100%;
  height: 100%;
  display: grid;
  margin: 0;
  overflow: hidden;
  background: #fff;
  border-radius: var(--widget-radius, 8px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

.picture-widget img {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  pointer-events: none;
}

.picture-frame-clean {
  padding: 0;
  background: transparent;
}

.picture-frame-classic {
  padding: 10px;
  background: #fff;
  border: 1px solid rgba(5, 4, 6, 0.12);
}

.picture-frame-polaroid {
  padding: 14px 14px 42px;
  background: #fff;
  border: 1px solid rgba(5, 4, 6, 0.1);
}

.picture-frame-film {
  padding: 16px;
  background:
    repeating-linear-gradient(90deg, #0a080b 0 10px, #fff 10px 15px, #0a080b 15px 25px) top / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, #0a080b 0 10px, #fff 10px 15px, #0a080b 15px 25px) bottom / 100% 12px no-repeat,
    #0a080b;
}

.picture-frame-heart {
  padding: 14px;
  background: linear-gradient(135deg, #fff5f8, #f1bfd4);
  border: 2px solid rgba(239, 49, 77, 0.32);
}

.sticker-shell,
.gif-shell {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.music-widget {
  width: 100%;
  height: 100%;
  background: rgba(var(--player-rgb, 27, 27, 29), var(--player-alpha, 0.88));
  color: var(--player-ink, #fff);
  border-radius: inherit;
  clip-path: inherit;
  container-type: size;
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.cover-art-frame {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.74);
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-radius: 6px;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.78);
}

.music-widget.cover {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 8px;
  padding: 10px;
}

.cover-art-frame img,
.player-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  min-height: 0;
}

.music-widget.player {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 24px 28px 22px;
  background:
    radial-gradient(circle at 16% 16%, rgba(255, 255, 255, 0.2), transparent 34%),
    rgba(var(--player-rgb, 246, 232, 241), var(--player-alpha, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 30px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 22px 48px rgba(0, 0, 0, 0.22);
}

.player-top {
  display: grid;
  grid-template-columns: minmax(56px, 92px) minmax(0, 1fr) 34px;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.player-art {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  min-width: 0;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.9),
    0 10px 22px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.player-signal {
  display: grid;
  place-items: center;
  color: var(--player-muted, rgba(255, 255, 255, 0.68));
}

.player-signal svg {
  width: 28px;
  height: 28px;
  stroke-width: 3;
}

.music-meta {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: 0;
  padding: 8px 10px 10px;
  text-align: center;
}

.player-meta {
  justify-items: start;
  align-content: center;
  padding: 0;
  text-align: left;
}

.cover-meta {
  padding-bottom: 0;
}

.music-title,
.music-artist {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-title {
  color: var(--player-ink, #fff);
  font-weight: 800;
  font-size: 20px;
}

.music-artist {
  color: var(--player-muted, rgba(255, 255, 255, 0.72));
  font-size: 18px;
}

.music-audio {
  display: none;
}

.music-progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.music-progress-time {
  min-width: 38px;
  color: var(--player-muted, rgba(255, 255, 255, 0.72));
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.music-progress-time:last-child {
  text-align: right;
}

.music-progress-track {
  position: relative;
  height: 12px;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: var(--player-track, rgba(255, 255, 255, 0.2));
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.music-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--player-fill, rgba(255, 255, 255, 0.7));
  border-radius: inherit;
  transition: width 120ms linear;
}

.player-control-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(34px, 1fr));
  align-items: center;
  justify-items: center;
  min-height: 56px;
}

.player-control {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--player-ink, #fff);
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.player-control svg {
  width: 36px;
  height: 36px;
  stroke-width: 3.5;
}

.player-play {
  width: 68px;
  height: 68px;
}

.player-play svg {
  width: 56px;
  height: 56px;
}

.player-cast {
  color: var(--player-muted, rgba(255, 255, 255, 0.68));
}

.player-cast svg {
  width: 32px;
  height: 32px;
}

.music-inline-play {
  width: 38px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--player-ink, #fff);
  background: var(--player-track, rgba(0, 0, 0, 0.32));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 0;
}

@container (max-height: 170px) {
  .music-widget.player {
    gap: 4px;
    padding: 8px 12px;
    border-radius: 18px;
  }

  .player-top {
    grid-template-columns: 44px minmax(0, 1fr) 24px;
    gap: 10px;
  }

  .player-art {
    border-radius: 8px;
  }

  .music-title {
    font-size: 15px;
  }

  .music-artist {
    font-size: 13px;
  }

  .player-signal svg {
    width: 18px;
    height: 18px;
  }

  .music-progress {
    gap: 6px;
  }

  .music-progress-time {
    min-width: 30px;
    font-size: 10px;
  }

  .music-progress-track {
    height: 7px;
  }

  .player-control-row {
    min-height: 30px;
  }

  .player-control {
    width: 30px;
    height: 30px;
  }

  .player-control svg,
  .player-cast svg {
    width: 22px;
    height: 22px;
  }

  .player-play svg {
    width: 28px;
    height: 28px;
  }
}

@container (max-width: 340px) {
  .music-widget.player {
    padding: 10px 12px;
  }

  .player-top {
    grid-template-columns: 48px minmax(0, 1fr) 24px;
    gap: 10px;
  }

  .music-title {
    font-size: 15px;
  }

  .music-artist {
    font-size: 13px;
  }

  .player-control {
    width: 34px;
    height: 34px;
  }

  .player-control svg,
  .player-cast svg {
    width: 24px;
    height: 24px;
  }

  .player-play svg {
    width: 34px;
    height: 34px;
  }
}

.widget-menu {
  position: absolute;
  z-index: 8;
  top: 0;
  right: auto;
  left: calc(100% + 8px);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  width: 186px;
  background: rgba(14, 10, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  backdrop-filter: blur(12px);
}

.art-widget:hover .widget-menu,
.art-widget.controls-open .widget-menu,
.art-widget.selected .widget-menu {
  opacity: 1;
  pointer-events: auto;
}

.controls-left .widget-menu {
  right: calc(100% + 8px);
  left: auto;
}

.music-widget-menu {
  width: 232px;
}

.color-widget-menu {
  width: 232px;
}

.wordbox-widget-menu {
  width: 268px;
}

.picture-widget-menu {
  width: 220px;
}

.delete-widget-menu {
  width: auto;
  min-width: 36px;
  padding: 6px;
  flex-wrap: nowrap;
}

.widget-color-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.mini-swatch,
.mini-button,
.move-handle,
.resize-handle {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
}

.mini-swatch {
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.mini-swatch.active {
  border-color: #ffc857;
  outline: 2px solid #050406;
  box-shadow:
    0 0 0 3px rgba(255, 200, 87, 0.8),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.mini-button,
.move-handle,
.resize-handle {
  color: #fff;
  background: rgba(5, 4, 6, 0.84);
}

.music-opacity-control {
  width: 100%;
  height: 28px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 0 3px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(5, 4, 6, 0.72);
  border-radius: 5px;
}

.music-opacity-control svg {
  width: 14px;
  height: 14px;
}

.music-opacity-control input {
  width: 100%;
  min-width: 0;
  accent-color: #efd6e4;
}

.word-font-select {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 6px;
  color: #fff;
  background: rgba(5, 4, 6, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  font-size: 12px;
}

.word-format-row {
  width: 100%;
  display: grid;
  grid-template-columns: 28px 28px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.word-format-button {
  font-weight: 900;
  font-family: Georgia, serif;
}

.word-format-button.italic {
  font-style: italic;
}

.word-format-button.active {
  color: #050406;
  background: rgba(255, 255, 255, 0.88);
}

.word-size-control {
  height: 28px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(5, 4, 6, 0.72);
  border-radius: 5px;
}

.word-size-control svg {
  width: 12px;
  height: 12px;
}

.word-size-control input {
  width: 100%;
  min-width: 0;
  accent-color: #efd6e4;
}

.word-color-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 5px;
}

.word-color-swatch {
  width: 100%;
}

.border-control-row,
.shape-control-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.frame-control-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.frame-button {
  width: 100%;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 5px;
}

.frame-button::before {
  content: "";
  width: 18px;
  height: 18px;
  display: block;
  background: rgba(255, 255, 255, 0.9);
}

.frame-classic::before {
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(5, 4, 6, 0.38);
}

.frame-polaroid::before {
  height: 23px;
  border: 3px solid #fff;
  border-bottom-width: 9px;
  box-shadow: 0 0 0 1px rgba(5, 4, 6, 0.34);
}

.frame-film::before {
  background:
    repeating-linear-gradient(90deg, #050406 0 4px, #fff 4px 6px, #050406 6px 10px);
}

.frame-heart::before {
  background: #f1bfd4;
  clip-path: polygon(50% 92%, 14% 58%, 6% 36%, 12% 18%, 27% 8%, 42% 14%, 50% 28%, 58% 14%, 73% 8%, 88% 18%, 94% 36%, 86% 58%);
}

.frame-button.active {
  outline: 2px solid #ffc857;
  background: rgba(255, 255, 255, 0.34);
}

.question-type-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 32px;
  gap: 6px;
}

.question-type-button {
  min-width: 0;
  height: 30px;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}

.question-type-button svg {
  width: 14px;
  height: 14px;
}

.question-type-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.question-type-button.active {
  color: #050406;
  background: rgba(255, 255, 255, 0.9);
}

.question-style-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 28px minmax(76px, 1fr);
  gap: 6px;
  align-items: center;
}

.question-color-row {
  max-height: 70px;
  overflow-y: auto;
  padding: 1px;
}

.border-width-control {
  width: 100%;
  height: 28px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(5, 4, 6, 0.72);
  border-radius: 5px;
}

.border-width-control svg {
  width: 14px;
  height: 14px;
}

.border-width-control input {
  width: 100%;
  min-width: 0;
  accent-color: #efd6e4;
}

.transparent-swatch {
  background:
    linear-gradient(45deg, transparent 44%, #ef314d 45% 55%, transparent 56%),
    linear-gradient(45deg, rgba(255,255,255,0.74) 25%, rgba(0,0,0,0.18) 25% 50%, rgba(255,255,255,0.74) 50% 75%, rgba(0,0,0,0.18) 75%) !important;
  background-size: 100% 100%, 8px 8px !important;
}

.shape-button {
  width: 100%;
  height: 28px;
  padding: 0;
  background: rgba(255, 255, 255, 0.72);
  border: 0;
  border-radius: 5px;
  position: relative;
}

.shape-button::before {
  position: absolute;
  inset: 5px;
  content: "";
  background: #050406;
}

.shape-button.active {
  outline: 2px solid rgba(255, 255, 255, 0.88);
}

.shape-rect::before {
  border-radius: 2px;
}

.shape-round::before {
  border-radius: 7px;
}

.shape-circle::before {
  border-radius: 999px;
}

.shape-arch::before {
  border-radius: 999px 999px 3px 3px;
}

.shape-diamond::before {
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

.shape-ticket::before {
  border-radius: 9px 2px 9px 2px;
}

.shape-heart::before {
  clip-path: polygon(50% 92%, 14% 58%, 6% 36%, 12% 18%, 27% 8%, 42% 14%, 50% 28%, 58% 14%, 73% 8%, 88% 18%, 94% 36%, 86% 58%);
}

.shape-star::before {
  clip-path: polygon(50% 3%, 61% 35%, 95% 35%, 67% 54%, 78% 90%, 50% 68%, 22% 90%, 33% 54%, 5% 35%, 39% 35%);
}

.shape-hex::before {
  clip-path: polygon(25% 5%, 75% 5%, 98% 50%, 75% 95%, 25% 95%, 2% 50%);
}

.shape-gem::before {
  clip-path: polygon(50% 0, 92% 24%, 80% 100%, 20% 100%, 8% 24%);
}

.move-handle {
  position: absolute;
  z-index: 8;
  top: 50%;
  right: calc(100% + 8px);
  left: auto;
  cursor: grab;
  opacity: 0.74;
  transform: translateY(-50%);
  transition: opacity 120ms ease;
}

.controls-left .move-handle {
  right: auto;
  left: calc(100% + 8px);
}

.drag-dots {
  display: grid;
  grid-template-columns: repeat(3, 3px);
  grid-template-rows: repeat(3, 3px);
  place-content: center;
  gap: 2px;
}

.drag-dots span {
  width: 3px;
  height: 3px;
  background: currentColor;
  border-radius: 50%;
}

.art-widget:hover .move-handle,
.art-widget.selected .move-handle {
  opacity: 1;
}

.resize-handle {
  position: absolute;
  right: -13px;
  bottom: -13px;
  z-index: 8;
  cursor: nwse-resize;
  opacity: 0.35;
  transition: opacity 120ms ease, transform 120ms ease;
}

.art-widget:hover .resize-handle,
.art-widget:focus-within .resize-handle {
  opacity: 0.9;
}

.resize-handle:hover {
  transform: scale(1.08);
}

.modal {
  width: min(520px, calc(100vw - 30px));
  padding: 0;
  color: #050406;
  background: transparent;
  border: 0;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 22px;
  background: rgba(216, 210, 215, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal-panel h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.62);
}

.music-search {
  display: grid;
  grid-template-columns: 1fr 50px;
  gap: 8px;
}

.primary-button.compact {
  min-width: 50px;
  padding: 0;
}

.secondary-button.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.people-panel {
  gap: 16px;
}

.people-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.empty-people {
  margin: 0;
  color: rgba(5, 4, 6, 0.68);
  font-size: 13px;
  font-weight: 700;
}

.person-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(116px, auto) 34px;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 7px;
}

.person-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.person-meta strong,
.person-meta small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.person-meta small {
  color: rgba(5, 4, 6, 0.62);
  font-size: 12px;
  font-weight: 700;
}

.person-role {
  padding: 5px 8px;
  color: #050406;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.person-remove-button {
  width: 34px;
  height: 34px;
  background: rgba(5, 4, 6, 0.86);
}

.music-results {
  display: grid;
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

.music-result {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 66px;
  padding: 6px;
  color: #050406;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  text-align: left;
}

.music-result.active {
  outline: 2px solid #050406;
}

.music-result img {
  width: 54px;
  height: 54px;
  border-radius: 5px;
  object-fit: cover;
}

.asset-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.asset-loading {
  grid-column: 1 / -1;
  padding: 18px;
  color: #050406;
  text-align: center;
}

.asset-result {
  min-height: 140px;
  display: grid;
  grid-template-rows: minmax(86px, 1fr) auto;
  gap: 7px;
  padding: 8px;
  color: #050406;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 7px;
  text-align: left;
}

.asset-result:hover,
.asset-result:focus-visible {
  outline: 2px solid #050406;
}

.asset-result img {
  width: 100%;
  height: 92px;
  object-fit: contain;
  background:
    linear-gradient(45deg, rgba(0, 0, 0, 0.06) 25%, transparent 25% 75%, rgba(0, 0, 0, 0.06) 75%),
    linear-gradient(45deg, rgba(0, 0, 0, 0.06) 25%, transparent 25% 75%, rgba(0, 0, 0, 0.06) 75%);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
  border-radius: 5px;
}

.asset-result span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.asset-result strong,
.asset-result small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-result small {
  opacity: 0.68;
}

.music-choice {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.music-choice .secondary-button.active {
  color: #fff;
  background: #8f8991;
  border-color: rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.24);
}

.cursor-panel {
  gap: 16px;
  width: min(500px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
}

.auth-modal-panel {
  width: min(460px, calc(100vw - 30px));
}

.settings-section {
  display: grid;
  gap: 10px;
}

.settings-section h3 {
  margin: 0;
  color: #050406;
  font-size: 13px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
}

.account-summary {
  display: grid;
  grid-template-columns: minmax(86px, auto) minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  color: rgba(5, 4, 6, 0.72);
  font-size: 13px;
  font-weight: 700;
}

.account-summary strong {
  min-width: 0;
  overflow: hidden;
  color: #050406;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-form {
  display: grid;
  gap: 10px;
}

.settings-form .primary-button {
  min-height: 42px;
}

.settings-form .text-button {
  justify-self: start;
}

.cursor-preview-row {
  display: grid;
  grid-template-columns: 1fr 54px;
  gap: 10px;
  align-items: center;
}

.cursor-preview {
  min-height: 82px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(45deg, rgba(0, 0, 0, 0.07) 25%, transparent 25% 75%, rgba(0, 0, 0, 0.07) 75%),
    linear-gradient(45deg, rgba(0, 0, 0, 0.07) 25%, transparent 25% 75%, rgba(0, 0, 0, 0.07) 75%);
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 7px;
}

.cursor-preview .remote-cursor-arrow {
  border-top-width: 42px;
  border-right-width: 26px;
}

.cursor-preview img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

#cursorColorInput {
  width: 54px;
  height: 54px;
  padding: 0;
  background: transparent;
  border: 0;
}

.cursor-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cursor-preset {
  min-height: 78px;
  display: grid;
  place-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.58);
  border: 2px solid transparent;
  border-radius: 7px;
}

.cursor-preset.active {
  border-color: #050406;
}

.cursor-preset .remote-cursor-arrow {
  border-top-width: 36px;
  border-right-width: 22px;
}

.cursor-preset img {
  width: 66px;
  height: 66px;
  object-fit: contain;
}

.default-cursor-mark {
  display: grid;
  place-items: center;
  gap: 3px;
  color: #050406;
  font-size: 11px;
  font-weight: 800;
}

.screenshot-viewport {
  background: #020103;
}

.screenshot-background {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.screenshot-background .gradient-field,
.screenshot-background .heart-field,
.screenshot-background .theme-field {
  position: absolute;
  inset: 0;
  z-index: auto;
}

.screenshot-board {
  z-index: 1;
}

.cursor-upload {
  min-height: 46px;
  display: grid;
  grid-template-columns: 22px auto;
  place-content: center;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: #050406;
  border-radius: 7px;
  font-weight: 800;
}

.cursor-upload input {
  display: none;
}

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

.background-preset {
  display: grid;
  grid-template-rows: 74px auto;
  gap: 6px;
  padding: 7px;
  color: #050406;
  background: rgba(255, 255, 255, 0.58);
  border: 2px solid transparent;
  border-radius: 7px;
  text-align: left;
}

.background-preset.active {
  border-color: #050406;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
}

.background-preset-thumb {
  display: block;
  width: 100%;
  height: 74px;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  border-radius: 5px;
}

.background-preset-thumb.default-thumb {
  background:
    radial-gradient(circle at 50% 50%, rgba(125, 56, 255, 0.24), transparent 34%),
    radial-gradient(circle at 62% 58%, rgba(239, 49, 77, 0.28), transparent 38%),
    linear-gradient(135deg, #020103, #170725 55%, #390817);
}

.background-preset strong {
  overflow: hidden;
  font-size: 13px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 24px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  color: #fff;
  background: rgba(5, 4, 6, 0.88);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes gradientShift {
  0% {
    background-position: 0% 38%;
  }
  45% {
    background-position: 76% 18%;
  }
  100% {
    background-position: 42% 92%;
  }
}

@keyframes sheen {
  from {
    opacity: 0.74;
    transform: scale(1);
  }
  to {
    opacity: 1;
    transform: scale(1.02);
  }
}

@keyframes heartBloom {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-45deg) scale(var(--start-scale));
  }
  14% {
    opacity: var(--heart-opacity);
  }
  64% {
    opacity: var(--heart-opacity);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-45deg) scale(var(--end-scale));
  }
}

@keyframes gothicLights {
  0%,
  100% {
    opacity: 0.54;
    filter: brightness(0.84) blur(0.4px);
  }
  28% {
    opacity: 0.92;
    filter: brightness(1.38) blur(0.1px);
  }
  54% {
    opacity: 0.66;
    filter: brightness(0.96) blur(0.6px);
  }
  78% {
    opacity: 1;
    filter: brightness(1.58) blur(0);
  }
}

@keyframes gothicFlowPulse {
  0% {
    opacity: 0.78;
  }
  42% {
    opacity: 1;
  }
  100% {
    opacity: 0.9;
  }
}

@keyframes gothicPulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.035);
  }
}

@keyframes starTwinkle {
  0%,
  100% {
    opacity: 0.36;
    filter: brightness(0.84);
  }
  24% {
    opacity: 0.96;
    filter: brightness(1.46);
  }
  47% {
    opacity: 0.52;
    filter: brightness(0.92);
  }
  72% {
    opacity: 1;
    filter: brightness(1.72);
  }
}

@keyframes starCenterTwinkle {
  0%,
  100% {
    opacity: 0.42;
    filter: brightness(0.96) blur(0.05px);
  }
  18% {
    opacity: 0.96;
    filter: brightness(1.55) blur(0);
  }
  33% {
    opacity: 0.58;
    filter: brightness(1.04) blur(0.05px);
  }
  57% {
    opacity: 1;
    filter: brightness(1.85) blur(0);
  }
  78% {
    opacity: 0.68;
    filter: brightness(1.18) blur(0.05px);
  }
}

@keyframes officeLights {
  0%,
  12%,
  100% {
    opacity: 0.62;
    filter: brightness(0.95);
  }
  15% {
    opacity: 0.24;
    filter: brightness(0.62);
  }
  18% {
    opacity: 0.86;
    filter: brightness(1.34);
  }
  72% {
    opacity: 0.74;
    filter: brightness(1.08);
  }
  76% {
    opacity: 0.34;
    filter: brightness(0.72);
  }
  80% {
    opacity: 0.92;
    filter: brightness(1.42);
  }
}

@keyframes officeFlicker {
  0%,
  58%,
  100% {
    opacity: 0.32;
  }
  61% {
    opacity: 0.58;
  }
  64% {
    opacity: 0.24;
  }
}

@keyframes dreamCloudDrift {
  from {
    transform: scale(1.08) translate3d(-2.4%, 0, 0);
  }
  to {
    transform: scale(1.1) translate3d(2.4%, -1.6%, 0);
  }
}

@keyframes dreamHaze {
  from {
    transform: translateX(-2%);
  }
  to {
    transform: translateX(2%);
  }
}

@media (max-width: 720px) {
  .auth-view {
    padding: 20px;
  }

  .auth-panel {
    padding: 22px;
  }

  .studio-topbar {
    top: 10px;
    right: 10px;
    left: 10px;
    gap: 6px;
  }

  #exhibitPicker {
    width: min(190px, 42vw);
  }

  .icon-button {
    width: 38px;
    height: 38px;
  }

  .page-bar {
    top: 58px;
    right: 10px;
    left: 10px;
    justify-content: flex-end;
  }

  #pagePicker {
    width: min(180px, 52vw);
  }

  .role-pill {
    display: none;
  }

  .tool-menu {
    top: auto;
    right: 10px;
    bottom: 12px;
    left: 10px;
    width: auto;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    padding: 6px;
  }

  .tool-button {
    min-height: 48px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
    padding: 4px 2px;
    font-size: 11px;
    text-align: center;
  }

  .verify-code-row,
  .person-row {
    grid-template-columns: 1fr;
  }

  .person-remove-button {
    justify-self: start;
  }

  .brush-panel {
    top: auto;
    bottom: 82px;
    left: 10px;
    width: calc(100vw - 20px);
    grid-template-columns: minmax(0, 1fr) minmax(86px, 120px);
    grid-template-areas:
      "utensils size"
      "colors colors";
    align-items: center;
    gap: 8px;
    max-height: calc(100vh - 172px);
    overflow: hidden;
  }

  .zoom-controls {
    right: 10px;
    bottom: 78px;
  }

  .utensils {
    grid-area: utensils;
    grid-template-columns: repeat(4, minmax(0, 38px));
  }

  .utensil {
    width: 100%;
  }

  .color-rail {
    grid-area: colors;
    grid-template-columns: repeat(auto-fit, minmax(24px, 1fr));
    justify-content: center;
    max-height: 118px;
    overflow-y: auto;
    padding: 4px 2px;
  }

  .brush-size {
    grid-area: size;
  }

  .external-controls .widget-menu,
  .external-controls.controls-left .widget-menu {
    top: -38px;
    right: auto;
    left: 0;
    width: min(268px, calc(100vw - 20px));
  }

  .external-controls .delete-widget-menu,
  .external-controls.controls-left .delete-widget-menu {
    width: auto;
    min-width: 36px;
  }

  .external-controls .move-handle,
  .external-controls.controls-left .move-handle {
    top: -38px;
    right: 0;
    left: auto;
  }

  .music-choice {
    grid-template-columns: 1fr;
  }
}
