/* Nebula-only app styling */
:root,
[data-palette="nebula"] {
  color-scheme: dark;
  --bg: #08111d;
  --bg-2: #0c1728;
  --panel: rgba(10, 19, 33, 0.82);
  --panel-strong: rgba(13, 25, 42, 0.96);
  --panel-soft: rgba(18, 31, 50, 0.7);
  --text: #ecf3ff;
  --muted: #99abc7;
  --line: rgba(146, 176, 224, 0.16);
  --line-strong: rgba(146, 176, 224, 0.28);
  --accent: #84b7ff;
  --accent-strong: #4f8fff;
  --accent-glow: rgba(102, 163, 255, 0.22);
  --accent-btn-top: #7ba8ff;
  --accent-btn-bottom: #5a88ef;
  --success: #54d4a4;
  --warning: #f7c96f;
  --danger: #ff8e99;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.36);
  --content: 1380px;
  --header-h: 72px;
  --rail-bg: #242638;
  --rail-border: rgba(255, 255, 255, 0.1);
  --rail-surface: rgba(255, 255, 255, 0.06);
  --rail-text: rgba(236, 243, 255, 0.92);
  --rail-muted: rgba(176, 188, 214, 0.78);
  --overlay-start: rgba(7, 14, 25, 0.2);
  --overlay-end: rgba(7, 14, 25, 0.68);
  --overlay-glow: rgba(96, 138, 255, 0.12);
  --fullscreen-overlay-start: rgba(7, 14, 25, 0.06);
  --fullscreen-overlay-end: rgba(7, 14, 25, 0.28);
}

[data-palette="aurora"] {
  color-scheme: dark;
  --bg: #061612;
  --bg-2: #0c221c;
  --panel: rgba(8, 24, 20, 0.84);
  --panel-strong: rgba(10, 30, 24, 0.96);
  --panel-soft: rgba(14, 36, 30, 0.72);
  --text: #e8fff7;
  --muted: #8eb8aa;
  --line: rgba(110, 196, 168, 0.16);
  --line-strong: rgba(110, 196, 168, 0.28);
  --accent: #5ee0b8;
  --accent-strong: #2bb893;
  --accent-glow: rgba(94, 224, 184, 0.22);
  --accent-btn-top: #6ce8c4;
  --accent-btn-bottom: #2bb893;
  --rail-bg: #1a2824;
  --rail-border: rgba(110, 196, 168, 0.14);
  --rail-surface: rgba(255, 255, 255, 0.06);
  --rail-text: rgba(232, 255, 247, 0.94);
  --rail-muted: rgba(142, 184, 170, 0.82);
  --overlay-glow: rgba(94, 224, 184, 0.12);
}

[data-palette="ember"] {
  color-scheme: dark;
  --bg: #140c0a;
  --bg-2: #221310;
  --panel: rgba(28, 16, 12, 0.84);
  --panel-strong: rgba(36, 20, 14, 0.96);
  --panel-soft: rgba(44, 24, 18, 0.72);
  --text: #fff1ea;
  --muted: #c9a08f;
  --line: rgba(255, 154, 107, 0.16);
  --line-strong: rgba(255, 154, 107, 0.28);
  --accent: #ff9a6b;
  --accent-strong: #e86a3a;
  --accent-glow: rgba(255, 154, 107, 0.22);
  --accent-btn-top: #ffb088;
  --accent-btn-bottom: #e86a3a;
  --rail-bg: #2a201c;
  --rail-border: rgba(255, 154, 107, 0.14);
  --rail-surface: rgba(255, 255, 255, 0.06);
  --rail-text: rgba(255, 241, 234, 0.94);
  --rail-muted: rgba(201, 160, 143, 0.82);
  --overlay-glow: rgba(255, 154, 107, 0.12);
}

[data-palette="rose"] {
  color-scheme: dark;
  --bg: #120a14;
  --bg-2: #1e1020;
  --panel: rgba(24, 12, 26, 0.84);
  --panel-strong: rgba(32, 16, 34, 0.96);
  --panel-soft: rgba(40, 20, 42, 0.72);
  --text: #fceff8;
  --muted: #c49ab8;
  --line: rgba(240, 160, 216, 0.16);
  --line-strong: rgba(240, 160, 216, 0.28);
  --accent: #f0a0d8;
  --accent-strong: #d66eb8;
  --accent-glow: rgba(240, 160, 216, 0.22);
  --accent-btn-top: #f4b0e0;
  --accent-btn-bottom: #d66eb8;
  --rail-bg: #281c28;
  --rail-border: rgba(240, 160, 216, 0.14);
  --rail-surface: rgba(255, 255, 255, 0.06);
  --rail-text: rgba(252, 239, 248, 0.94);
  --rail-muted: rgba(196, 154, 184, 0.82);
  --overlay-glow: rgba(240, 160, 216, 0.12);
}

[data-palette="slate"] {
  color-scheme: dark;
  --bg: #0e1118;
  --bg-2: #141a24;
  --panel: rgba(16, 20, 28, 0.84);
  --panel-strong: rgba(20, 26, 36, 0.96);
  --panel-soft: rgba(24, 30, 40, 0.72);
  --text: #edf2f8;
  --muted: #95a3b8;
  --line: rgba(158, 180, 208, 0.16);
  --line-strong: rgba(158, 180, 208, 0.28);
  --accent: #9eb4d0;
  --accent-strong: #7a95b8;
  --accent-glow: rgba(158, 180, 208, 0.22);
  --accent-btn-top: #b0c4dc;
  --accent-btn-bottom: #7a95b8;
  --rail-bg: #222630;
  --rail-border: rgba(158, 180, 208, 0.14);
  --rail-surface: rgba(255, 255, 255, 0.06);
  --rail-text: rgba(237, 242, 248, 0.94);
  --rail-muted: rgba(149, 163, 184, 0.82);
  --overlay-glow: rgba(158, 180, 208, 0.1);
}

[data-palette="frost"] {
  color-scheme: light;
  --bg: #eef4ff;
  --bg-2: #f6f9ff;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --panel-soft: rgba(242, 246, 255, 0.92);
  --text: #162338;
  --muted: #607391;
  --line: rgba(87, 116, 168, 0.16);
  --line-strong: rgba(87, 116, 168, 0.28);
  --accent: #2f76ff;
  --accent-strong: #145de7;
  --accent-glow: rgba(47, 118, 255, 0.16);
  --accent-btn-top: #5a94ff;
  --accent-btn-bottom: #2f76ff;
  --success: #149b68;
  --warning: #af7b00;
  --danger: #dc4d63;
  --shadow: 0 16px 40px rgba(30, 52, 93, 0.12);
  --rail-bg: #e8edf8;
  --rail-border: rgba(87, 116, 168, 0.16);
  --rail-surface: rgba(255, 255, 255, 0.72);
  --rail-text: #162338;
  --rail-muted: #607391;
  --overlay-start: rgba(255, 255, 255, 0.18);
  --overlay-end: rgba(234, 241, 255, 0.68);
  --overlay-glow: rgba(96, 138, 255, 0.1);
  --fullscreen-overlay-start: rgba(255, 255, 255, 0.08);
  --fullscreen-overlay-end: rgba(234, 241, 255, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at top left, rgba(96, 138, 255, 0.18), transparent 26%),
    radial-gradient(circle at 84% 14%, rgba(118, 111, 255, 0.15), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-color: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--user-bg-image, none);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0.34;
  transform: scale(1.02);
  pointer-events: none;
}

body.nebula-fullscreen::after {
  background:
    linear-gradient(180deg, var(--fullscreen-overlay-start), var(--fullscreen-overlay-end)),
    radial-gradient(circle at top left, var(--overlay-glow), transparent 26%);
}

body.nebula-fullscreen::before {
  opacity: 0.48;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, var(--overlay-start), var(--overlay-end)),
    radial-gradient(circle at top left, var(--overlay-glow), transparent 26%);
  pointer-events: none;
}

body.nebula-bg[data-background="aurora"] {
  background-image:
    radial-gradient(circle at 18% 12%, rgba(84, 212, 164, 0.24), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(103, 151, 255, 0.22), transparent 24%),
    linear-gradient(180deg, #07121c 0%, #122338 100%);
}

body.nebula-bg[data-background="midnight"] {
  background-image:
    radial-gradient(circle at 50% 0%, rgba(90, 129, 255, 0.14), transparent 20%),
    linear-gradient(180deg, #040911 0%, #091320 100%);
}

body.nebula-bg[data-background="dawn"] {
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255, 199, 143, 0.28), transparent 25%),
    radial-gradient(circle at 82% 15%, rgba(255, 239, 196, 0.26), transparent 25%),
    linear-gradient(180deg, #fff3e8 0%, #eaf2ff 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.95rem;
}

input,
button,
textarea,
select {
  font: inherit;
}

input[type="range"] {
  width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--panel);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  max-width: var(--content);
  min-height: var(--header-h);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.nebula-brand__orb {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #fff, var(--accent) 56%, transparent 100%);
  box-shadow: 0 0 18px var(--accent-glow);
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
}

.site-header__link,
.site-header__toggle,
.btn-primary,
.btn-secondary,
.btn-3d {
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.site-header__link,
.site-header__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.site-header__link:hover,
.site-header__toggle:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.08);
}

.site-header__toggle {
  width: 40px;
  padding: 0;
}

.site-header__toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-wrap {
  max-width: var(--content);
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
}

.card-block,
.auth-card,
.feed-card,
.chat-message,
.presence-item {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.card-block,
.auth-card {
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(18px);
}

.auth-page {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(100%, 560px);
  padding: 2rem;
}

.auth-copy,
.auth-switch {
  color: var(--muted);
  line-height: 1.65;
}

.auth-card a {
  color: var(--accent);
}

.callout {
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--panel-soft);
}

.callout--error {
  color: #ffd6dc;
  border-color: rgba(255, 142, 153, 0.28);
  background: rgba(96, 21, 34, 0.45);
}

[data-palette="frost"] .callout--error {
  color: #8f1831;
  background: rgba(255, 231, 235, 0.96);
}

.nebula-workspace {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.nebula-fullscreen {
  overflow: hidden;
}

body.nebula-fullscreen .nebula-workspace {
  max-width: none;
  margin: 0;
  padding: 0;
}

.nebula-rail {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--rail-bg);
  border-right: 1px solid var(--rail-border);
  z-index: 20;
}

.nebula-rail__brand {
  display: grid;
  place-items: center;
  padding: 0.85rem 0.5rem 0.65rem;
  flex: none;
}

.nebula-rail__mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(180deg, #6ea0ff, #4578e8);
  overflow: hidden;
}

.nebula-rail__mark .nebula-brand__orb {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #fff;
  box-shadow: none;
}

.nebula-rail__nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.2rem 0.35rem;
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.rail-group {
  display: grid;
  gap: 0.08rem;
}

.rail-group + .rail-group {
  margin-top: 0.2rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--rail-border);
}

.rail-group__items {
  display: grid;
  gap: 0.08rem;
}

.rail-group--apps .rail-section-label {
  margin-bottom: 0.1rem;
}

.nebula-rail__footer {
  display: grid;
  gap: 0.08rem;
  padding: 0.45rem 0.35rem 0.7rem;
  border-top: 1px solid var(--rail-border);
  flex: none;
}

.rail-item {
  display: grid;
  gap: 0.24rem;
  justify-items: center;
  width: 100%;
  padding: 0.5rem 0.15rem;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--rail-muted);
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

.rail-item:hover {
  color: var(--rail-text);
  background: var(--rail-surface);
}

.rail-item.is-active {
  color: var(--rail-text);
  background: var(--rail-surface);
  border-color: rgba(132, 183, 255, 0.35);
}

.rail-item__icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
}

.rail-item__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-item__label {
  font-size: 0.62rem;
  line-height: 1.1;
  text-align: center;
  max-width: 84px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.rail-item--link {
  color: var(--rail-muted);
}

.nebula-viewport {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

.nebula-widget {
  position: absolute;
  display: none;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--rail-border);
  background: var(--rail-bg);
  backdrop-filter: blur(20px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.28);
  overflow: hidden;
  min-width: 300px;
  min-height: 260px;
  color: var(--rail-text);
}

.nebula-widget.is-open {
  display: flex;
}

.nebula-widget--spaces {
  top: 28px;
  left: 28px;
  width: 380px;
  height: 560px;
}

.nebula-widget--chat {
  top: 48px;
  left: calc(50% - 250px);
  width: 500px;
  height: 640px;
}

.nebula-widget--notes {
  top: 120px;
  left: 80px;
  width: 400px;
  height: 360px;
}

.nebula-widget--focus {
  top: 36px;
  right: 36px;
  left: auto;
  width: 320px;
  height: 340px;
}

.nebula-widget--environment {
  top: 220px;
  right: 64px;
  left: auto;
  width: 360px;
  height: 520px;
}

.nebula-widget--admin {
  top: 72px;
  left: 420px;
  width: 400px;
  height: 560px;
}

.nebula-widget--jamboard {
  top: 100px;
  left: 120px;
  width: 640px;
  height: 480px;
}

.nebula-widget--people {
  top: 140px;
  right: 120px;
  left: auto;
  width: 300px;
  height: 360px;
}

.widget-resize-handle {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  opacity: 0.55;
}

.widget-resize-handle::before {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255, 255, 255, 0.7);
  border-bottom: 2px solid rgba(255, 255, 255, 0.7);
}
.nebula-widget--chat .window-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.chat-app__header {
  align-items: center;
  padding: 0.95rem 1rem;
}

.chat-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: transparent;
}

.chat-log {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem 1rem 0.75rem;
}

.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 0.55rem;
  max-width: 88%;
}

.chat-row--mine {
  align-self: flex-end;
  flex-direction: row-reverse;
  margin-left: auto;
}

.chat-row--theirs {
  align-self: flex-start;
}

.chat-avatar {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: #ecf3ff;
  background: linear-gradient(180deg, #6b8cff, #4a67d8);
}

.chat-bubble {
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem 0.85rem;
  border-radius: 18px;
  border: 1px solid transparent;
  box-shadow: none;
}

.chat-bubble--theirs {
  background: var(--rail-surface);
  border-color: var(--rail-border);
  border-bottom-left-radius: 6px;
}

.chat-bubble--mine {
  background: linear-gradient(180deg, var(--accent-btn-top), var(--accent-btn-bottom));
  color: #08111d;
  border-bottom-right-radius: 6px;
}

.chat-bubble__name {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
}

.chat-bubble__text {
  margin: 0;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.94rem;
}

.chat-bubble__time {
  font-size: 0.68rem;
  opacity: 0.72;
  justify-self: end;
}

.chat-compose {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.75rem 0.85rem 0.9rem;
  border-top: 1px solid var(--rail-border);
  background: color-mix(in srgb, var(--rail-bg) 92%, black);
  flex: none;
}

.chat-compose__input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--rail-border);
  border-radius: 999px;
  background: var(--rail-surface);
  color: var(--rail-text);
  padding: 0.8rem 1rem;
}

.chat-compose__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.chat-compose__send {
  flex: none;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--accent-btn-top), var(--accent-btn-bottom));
  color: #06101f;
  cursor: pointer;
}

.chat-compose__send svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chat-compose__send:hover {
  filter: brightness(1.05);
}

.window-titlebar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  cursor: move;
  user-select: none;
  border-bottom: 1px solid var(--rail-border);
  background: transparent;
  flex: none;
}

.window-titlebar__copy {
  min-width: 0;
}

.widget-subtitle {
  margin: 0.2rem 0 0;
  color: var(--rail-muted);
  font-size: 0.78rem;
}

.window-body {
  padding: 0.9rem 1rem 1.35rem;
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.window-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--rail-border);
  border-radius: 999px;
  background: var(--rail-surface);
  color: var(--rail-text);
  cursor: pointer;
  flex: none;
  line-height: 1;
}

.window-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.panel-head,
.shared-note__foot,
.timer-actions,
.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.panel-head {
  margin-bottom: 1rem;
}

.page-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rail-muted);
}

.panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--rail-text);
}

.section-title {
  font-size: 0.86rem;
  color: var(--rail-muted);
}

.nebula-widget .text-input {
  background: var(--rail-surface);
  border: 1px solid var(--rail-border);
  color: var(--rail-text);
}

.nebula-widget .text-input::placeholder {
  color: var(--rail-muted);
}

.nebula-widget .text-input:focus {
  border-color: rgba(132, 183, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(102, 163, 255, 0.16);
}

.nebula-widget .btn-primary {
  background: linear-gradient(180deg, var(--accent-btn-top), var(--accent-btn-bottom));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: #08111d;
}

.nebula-widget .btn-secondary,
.nebula-widget .btn-3d:not(.btn-primary) {
  background: var(--rail-surface);
  border: 1px solid var(--rail-border);
  color: var(--rail-text);
}

.feed-card {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: var(--rail-surface);
  border: 1px solid var(--rail-border);
  box-shadow: none;
  text-decoration: none;
  color: inherit;
}

.feed-card:hover,
.room-card--active {
  border-color: rgba(132, 183, 255, 0.45);
  background: rgba(132, 183, 255, 0.1);
}

.feed-card__icon {
  font-size: 1.15rem;
}

.feed-card__body {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.feed-card__title {
  font-weight: 700;
}

.feed-card__desc {
  font-size: 0.9rem;
  color: var(--rail-muted);
}

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--line-strong);
  background: rgba(132, 183, 255, 0.08);
}

.pill {
  color: var(--accent);
}

.status-pill--idle {
  color: var(--muted);
}

.status-pill--focusing {
  color: var(--success);
  border-color: rgba(84, 212, 164, 0.32);
  background: rgba(84, 212, 164, 0.12);
}

.status-pill--break {
  color: var(--warning);
  border-color: rgba(247, 201, 111, 0.28);
  background: rgba(247, 201, 111, 0.12);
}

.status-pill--offline {
  color: var(--danger);
  border-color: rgba(255, 142, 153, 0.28);
  background: rgba(255, 142, 153, 0.08);
}

.stack-form,
.mini-stack,
.focus-panel,
.ambience-panel,
.presence-panel,
.shared-note,
.chat-panel {
  display: grid;
  gap: 0.9rem;
}

.mini-stack + .mini-stack,
.room-list + .mini-stack {
  margin-top: 1.25rem;
}

.text-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-soft);
  color: var(--text);
  padding: 0.85rem 0.95rem;
}

.text-input::placeholder {
  color: color-mix(in srgb, var(--muted) 86%, transparent);
}

.text-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.text-area {
  resize: vertical;
  min-height: 112px;
}

.text-area--compact {
  min-height: 88px;
}

.btn-primary,
.btn-secondary,
.btn-3d {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  font-weight: 700;
}

.btn-primary {
  color: #08111d;
  background: linear-gradient(180deg, #a1c8ff 0%, #66a3ff 100%);
}

.btn-secondary,
.btn-3d:not(.btn-primary) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-3d:hover {
  transform: translateY(-1px);
}

.btn-primary:active,
.btn-secondary:active,
.btn-3d:active {
  transform: translateY(1px);
}

.room-list {
  display: grid;
  gap: 0.75rem;
}

.panel-title,
.page-title,
.section-title {
  margin: 0;
}

.page-title {
  font-size: clamp(2rem, 3.6vw, 2.9rem);
  line-height: 1.05;
}

.shared-note__foot {
  flex-wrap: wrap;
}

#room-notes-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.chat-panel {
  min-height: 0;
}

.presence-list {
  padding: 0.2rem 0;
}

.focus-clock {
  font-size: clamp(2.8rem, 8vw, 4.4rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  text-align: center;
}

.timer-actions {
  flex-wrap: wrap;
}

.timer-actions > * {
  flex: 1 1 120px;
}

.presence-list {
  display: grid;
  gap: 0.8rem;
}

.presence-item {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.presence-item__head {
  min-width: 0;
}

.presence-item__name {
  font-weight: 700;
}

.presence-item__task {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(148, 174, 216, 0.28);
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 900px) {
  .nebula-workspace {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .nebula-rail__mark {
    width: 42px;
    height: 42px;
  }

  .rail-item__label {
    font-size: 0.58rem;
    max-width: 72px;
  }

  .nebula-widget.is-open {
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .site-header__inner {
    flex-wrap: wrap;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }

  .site-header__nav {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .page-wrap {
    padding: 1.25rem 0.9rem 1.75rem;
  }

  body.nebula-fullscreen .page-wrap {
    padding: 0;
  }

  .auth-card {
    padding: 1rem;
  }

  .nebula-workspace {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .nebula-rail__brand {
    padding: 0.65rem 0.35rem 0.45rem;
  }

  .nebula-rail__mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .rail-item {
    padding: 0.42rem 0.1rem;
  }

  .rail-item__icon {
    width: 24px;
    height: 24px;
  }

  .rail-item__icon svg {
    width: 18px;
    height: 18px;
  }

  .rail-section-label {
    font-size: 0.52rem;
  }

  .nebula-viewport {
    min-height: 0;
  }

  .nebula-widget.is-open {
    position: static;
    display: flex;
    width: 100% !important;
    height: auto !important;
    min-height: 50dvh;
    margin: 0.75rem;
  }

  .widget-resize-handle {
    display: none;
  }

  .window-titlebar {
    cursor: default;
  }

  .panel-head,
  .shared-note__foot {
    align-items: flex-start;
    flex-direction: column;
  }
}

.palette-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.palette-swatch {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  padding: 0.5rem 0.35rem;
  border: 1px solid var(--rail-border);
  border-radius: 12px;
  background: var(--rail-surface);
  color: var(--rail-text);
  cursor: pointer;
}

.palette-swatch:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--rail-border));
}

.palette-swatch.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.palette-swatch__preview {
  width: 100%;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.palette-swatch__label {
  font-size: 0.68rem;
  color: var(--rail-muted);
}

.palette-swatch--nebula .palette-swatch__preview {
  background: linear-gradient(135deg, #242638 0%, #4578e8 100%);
}

.palette-swatch--aurora .palette-swatch__preview {
  background: linear-gradient(135deg, #1a2824 0%, #2bb893 100%);
}

.palette-swatch--ember .palette-swatch__preview {
  background: linear-gradient(135deg, #2a201c 0%, #e86a3a 100%);
}

.palette-swatch--rose .palette-swatch__preview {
  background: linear-gradient(135deg, #281c28 0%, #d66eb8 100%);
}

.palette-swatch--slate .palette-swatch__preview {
  background: linear-gradient(135deg, #222630 0%, #7a95b8 100%);
}

.rail-section-label {
  margin: 0;
  padding: 0 0.2rem;
  border-top: none;
  text-align: center;
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rail-muted);
}

.helper-copy {
  margin: 0;
  color: var(--rail-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.admin-panel,
.jamboard-panel {
  display: grid;
  gap: 1rem;
}

.admin-section {
  display: grid;
  gap: 0.65rem;
}

.admin-list {
  display: grid;
  gap: 0.55rem;
}

.admin-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--rail-border);
  border-radius: 12px;
  background: var(--rail-surface);
}

.admin-item__actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.jamboard-toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.jamboard-canvas {
  position: relative;
  min-height: 320px;
  border: 1px dashed var(--rail-border);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  overflow: auto;
}

.jam-sticky {
  position: absolute;
  display: grid;
  gap: 0.35rem;
  padding: 0.65rem 0.7rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
  color: #1f2430;
}

.jam-sticky__remove {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

.jam-sticky__text {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  color: inherit;
  font: inherit;
  line-height: 1.4;
}

.jam-sticky__text:focus {
  outline: none;
}

.jam-sticky__author {
  font-size: 0.68rem;
  opacity: 0.72;
}

.palette-swatch--frost .palette-swatch__preview {
  background: linear-gradient(135deg, #e8edf8 0%, #2f76ff 100%);
}
