.space-view {
  --space-shell-surface: color-mix(in oklab, var(--surface-1, #0f172a) 92%, rgba(255, 255, 255, 0.04));
  --space-shell-surface-strong: color-mix(in oklab, var(--surface-2, #131c33) 96%, rgba(255, 255, 255, 0.06));
  --space-shell-surface-soft: color-mix(in oklab, var(--surface-2, #131c33) 82%, transparent);
  --space-shell-border: rgba(255, 255, 255, 0.1);
  --space-shell-border-strong: rgba(255, 255, 255, 0.18);
  --space-shell-ink: var(--ink, rgba(255, 255, 255, 0.96));
  --space-shell-muted: rgba(255, 255, 255, 0.64);
  --space-shell-faint: rgba(255, 255, 255, 0.42);
  --space-shell-shadow:
    0 20px 48px rgba(0, 0, 0, 0.24),
    0 8px 18px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 0;
  color: var(--space-shell-ink);
}

[data-theme="light"] .space-view {
  --space-shell-surface: rgba(255, 255, 255, 0.92);
  --space-shell-surface-strong: rgba(255, 255, 255, 0.98);
  --space-shell-surface-soft: rgba(248, 250, 255, 0.88);
  --space-shell-border: rgba(17, 24, 39, 0.08);
  --space-shell-border-strong: rgba(17, 24, 39, 0.14);
  --space-shell-muted: rgba(17, 24, 39, 0.62);
  --space-shell-faint: rgba(17, 24, 39, 0.42);
  --space-shell-shadow:
    0 18px 40px rgba(56, 72, 112, 0.12),
    0 6px 14px rgba(56, 72, 112, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

body[data-route="space"] #app {
  max-width: min(1380px, calc(100vw - 24px));
}

.space-view > * {
  animation: space-section-enter 420ms var(--ease-out) both;
}

@keyframes space-section-enter {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.space-header,
.space-module-tabs,
.space-profile-hero,
.space-overview-card,
.space-quick-card,
.space-disclosure,
.space-wall-composer,
.space-wish-composer,
.space-music-composer,
.space-message-box,
.space-post-card,
.space-wish-card,
.space-music-card,
.space-edit-box,
.space-post-attachment,
.space-attach-item,
.space-music-embed-panel,
.empty-state {
  border: 1px solid var(--space-shell-border);
  background: var(--space-shell-surface);
  box-shadow: var(--space-shell-shadow);
  backdrop-filter: blur(18px) saturate(1.06);
  -webkit-backdrop-filter: blur(18px) saturate(1.06);
}

.space-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border-radius: 28px;
}

.space-header-title {
  display: grid;
  gap: 10px;
}

.space-header-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--space-shell-faint);
}

.space-header-name {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 1.15rem + 1.6vw, 2.4rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
  font-weight: 800;
  color: var(--space-shell-ink);
}

.space-header-sub {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.45;
  color: var(--space-shell-muted);
  max-width: 46ch;
}

.space-viewer-switch {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.space-viewer-chip,
.space-module-tab,
.space-chip {
  appearance: none;
  border: 1px solid var(--space-shell-border);
  border-radius: 999px;
  background: color-mix(in oklab, var(--space-shell-surface-strong) 88%, transparent);
  color: var(--space-shell-muted);
  font-family: var(--font-body);
  font-weight: 700;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
}

.space-viewer-chip:hover,
.space-module-tab:hover,
.space-chip:hover {
  border-color: var(--space-shell-border-strong);
  color: var(--space-shell-ink);
  transform: translateY(-1px);
}

.space-viewer-chip.active,
.space-module-tab.active,
.space-chip.active {
  background: color-mix(in oklab, var(--accent-shared) 18%, var(--space-shell-surface-strong));
  border-color: color-mix(in oklab, var(--accent-shared) 26%, var(--space-shell-border));
  color: var(--space-shell-ink);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.space-viewer-chip {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.space-header-right {
  display: grid;
  justify-items: end;
  gap: 12px;
}

.space-header-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.space-header-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  border: 1px solid var(--space-shell-border);
  background: var(--space-shell-surface-strong);
  color: var(--space-shell-ink);
  font-size: 16px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
}

.theme-toggle:hover {
  border-color: var(--space-shell-border-strong);
  background: color-mix(in oklab, var(--space-shell-surface-strong) 92%, transparent);
}

.connection-dot {
  width: 12px;
  height: 12px;
  border: 1px solid var(--space-shell-border-strong);
  background: rgba(148, 163, 184, 0.48);
  box-shadow: none;
}

.connection-dot.online {
  background: var(--success, #53c88f);
  box-shadow: 0 0 0 5px rgba(83, 200, 143, 0.14);
}

.space-module-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  padding: 6px;
  border-radius: 24px;
}

.space-module-tab {
  min-height: 48px;
  padding: 0 14px;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.space-module-tab-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
}

.space-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.space-section-copy {
  display: grid;
  gap: 6px;
}

.space-section-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--space-shell-faint);
}

.space-section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 0.95rem + 0.6vw, 1.5rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: var(--space-shell-ink);
  text-transform: none;
}

.space-section-sub {
  margin: 0;
  color: var(--space-shell-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.space-section-meta,
.space-overview-inline-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.space-section-metric {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid var(--space-shell-border);
  background: color-mix(in oklab, var(--space-shell-surface-strong) 90%, transparent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.space-section-metric-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--space-shell-ink);
}

.space-section-metric-label {
  font-size: 0.8rem;
  color: var(--space-shell-muted);
  text-transform: lowercase;
}

.space-overview {
  display: grid;
  gap: 18px;
}

.space-profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.92fr);
  gap: 16px;
  border-radius: 30px;
  padding: 24px;
  align-items: stretch;
}

.space-overview-main {
  display: grid;
  gap: 16px;
}

.space-overview-primary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  align-items: flex-start;
}

.space-overview-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.space-overview-kicker {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--space-shell-faint);
}

.space-overview-note {
  margin: 0;
  color: var(--space-shell-muted);
  font-size: 0.98rem;
  line-height: 1.55;
  max-width: 58ch;
}

.space-overview-cues {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.space-overview-cue,
.space-overview-focus-cue,
.space-overview-card-state,
.space-quick-card-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--space-shell-border);
  background: color-mix(in oklab, var(--space-shell-surface-strong) 92%, transparent);
  color: var(--space-shell-muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.space-overview-focus {
  display: grid;
  align-content: start;
  align-self: stretch;
  gap: 14px;
  border-radius: 26px;
  padding: 20px;
  border: 1px solid color-mix(in oklab, var(--accent-shared) 24%, var(--space-shell-border));
  background:
    linear-gradient(
      155deg,
      color-mix(in oklab, var(--accent-shared) 15%, var(--space-shell-surface-strong)) 0%,
      color-mix(in oklab, var(--space-shell-surface) 94%, transparent) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 20px 46px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.space-overview-focus-kicker,
.space-overview-summary-kicker,
.space-overview-card-kicker,
.space-quick-card-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--space-shell-faint);
}

.space-overview-focus-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.38rem, 1rem + 1vw, 1.92rem);
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 800;
  color: var(--space-shell-ink);
}

.space-overview-focus-copy {
  margin: 0;
  color: var(--space-shell-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.space-overview-focus-cues,
.space-overview-focus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.space-avatar-block {
  display: grid;
  align-items: flex-start;
  gap: 10px;
}

.space-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 108px;
  overflow: hidden;
  border: 1px solid var(--space-shell-border-strong);
  border-radius: 28px;
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.92) 0, rgba(255, 255, 255, 0.72) 22%, transparent 52%),
    linear-gradient(155deg, color-mix(in oklab, var(--accent-shared) 8%, var(--space-shell-surface-strong)) 0%, color-mix(in oklab, var(--space-shell-surface) 94%, transparent) 100%);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
}

.space-avatar-initials {
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: clamp(1.8rem, 1.45rem + 0.9vw, 2.45rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.08em;
  transform: translateY(-0.03em);
  color: var(--space-shell-ink);
}

.space-avatar img,
.space-mini-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.space-avatar-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.space-profile-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.3rem + 1.8vw, 2.9rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.06em;
  text-align: left;
  color: var(--space-shell-ink);
}

.space-overview-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.space-overview-summary-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 132px;
  padding: 16px 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--space-shell-border);
  background:
    linear-gradient(
      155deg,
      color-mix(in oklab, var(--space-shell-surface-strong) 94%, transparent) 0%,
      color-mix(in oklab, var(--space-shell-surface) 92%, transparent) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 24px rgba(0, 0, 0, 0.08);
}

.space-overview-summary-card.is-accent {
  border-color: color-mix(in oklab, var(--accent-shared) 24%, var(--space-shell-border));
  background:
    linear-gradient(
      155deg,
      color-mix(in oklab, var(--accent-shared) 10%, var(--space-shell-surface-strong)) 0%,
      color-mix(in oklab, var(--space-shell-surface) 92%, transparent) 100%
    );
}

.space-overview-summary-value {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 1.1rem + 1vw, 2rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 800;
  color: var(--space-shell-ink);
}

.space-overview-summary-label {
  display: block;
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--space-shell-ink);
}

.space-overview-summary-note {
  display: block;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--space-shell-muted);
}

.space-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 14px;
}

.space-overview-card {
  border-radius: 24px;
  padding: 20px;
  display: grid;
  gap: 14px;
  align-content: start;
}

.space-overview-card--status {
  background:
    linear-gradient(
      155deg,
      color-mix(in oklab, var(--accent-shared) 8%, var(--space-shell-surface-strong)) 0%,
      color-mix(in oklab, var(--space-shell-surface) 94%, transparent) 100%
    );
}

.space-overview-card--bio {
  background:
    linear-gradient(
      155deg,
      color-mix(in oklab, #f3d2cb 8%, var(--space-shell-surface-strong)) 0%,
      color-mix(in oklab, var(--space-shell-surface) 94%, transparent) 100%
    );
}

.space-overview-card--rhythm {
  background:
    linear-gradient(
      155deg,
      color-mix(in oklab, var(--accent-shared) 12%, var(--space-shell-surface-strong)) 0%,
      color-mix(in oklab, var(--space-shell-surface) 92%, transparent) 100%
    );
}

.space-overview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.space-overview-card-head-copy {
  display: grid;
  gap: 6px;
}

.space-overview-card-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.space-overview-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--space-shell-ink);
}

.space-overview-card-text {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--space-shell-ink);
  white-space: pre-wrap;
}

.space-overview-card-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--space-shell-muted);
  line-height: 1.4;
}

.space-overview-editor {
  display: grid;
  gap: 12px;
}

.space-status-emoji-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.space-status-emoji-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--space-shell-border);
  border-radius: 16px;
  background: color-mix(in oklab, var(--space-shell-surface-strong) 90%, transparent);
  font-size: 18px;
}

.space-status-emoji-btn:hover {
  border-color: var(--space-shell-border-strong);
  background: color-mix(in oklab, var(--space-shell-surface-strong) 94%, transparent);
  transform: translateY(-1px);
}

.space-status-emoji-btn.active {
  background: color-mix(in oklab, var(--accent-shared) 18%, var(--space-shell-surface-strong));
  border-color: color-mix(in oklab, var(--accent-shared) 28%, var(--space-shell-border));
  box-shadow: none;
}

.space-overview-card--rhythm {
  align-content: start;
}

.space-overview-card--rhythm .space-overview-inline-metrics {
  justify-content: flex-start;
}

.space-days-counter {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: flex-start;
  border: 1px solid var(--space-shell-border);
  background: color-mix(in oklab, var(--space-shell-surface-strong) 94%, transparent);
  border-radius: 20px;
  box-shadow: none;
  padding: 14px 16px;
  margin-top: 0;
}

.space-days-counter-label {
  display: block;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
  text-wrap: pretty;
  color: var(--space-shell-muted);
  letter-spacing: 0.02em;
}

.space-days-counter-value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.72rem, 1.34rem + 0.9vw, 2.34rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 800;
  color: var(--space-shell-ink);
  text-wrap: pretty;
}

.space-days-counter-meta {
  margin: 0;
  color: var(--space-shell-muted);
  font-size: 0.88rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.space-days-counter-note {
  margin: 0;
  color: color-mix(in oklab, var(--accent-shared) 68%, var(--space-shell-muted));
  font-size: 0.86rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.space-partner-status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--space-shell-muted);
  text-align: left;
  padding: 0;
}

.space-quick-actions,
.space-wall-section,
.space-wish-section,
.space-music-section,
.space-message-section {
  display: grid;
  gap: 14px;
}

.space-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.space-quick-card {
  appearance: none;
  border-radius: 24px;
  padding: 18px 18px 20px;
  display: grid;
  gap: 10px;
  align-content: start;
  text-align: left;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
  background:
    linear-gradient(
      155deg,
      color-mix(in oklab, var(--space-shell-surface-strong) 94%, transparent) 0%,
      color-mix(in oklab, var(--space-shell-surface) 92%, transparent) 100%
    );
}

.space-quick-card:hover {
  transform: translateY(-3px);
  border-color: var(--space-shell-border-strong);
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.space-quick-card.is-lead {
  grid-column: span 2;
  min-height: 204px;
  border-color: color-mix(in oklab, var(--accent-shared) 24%, var(--space-shell-border));
  background:
    linear-gradient(
      160deg,
      color-mix(in oklab, var(--accent-shared) 12%, var(--space-shell-surface-strong)) 0%,
      color-mix(in oklab, var(--space-shell-surface) 92%, transparent) 100%
    );
}

.space-quick-card.is-primary .space-quick-card-meta {
  color: var(--space-shell-ink);
  border-color: color-mix(in oklab, var(--accent-shared) 28%, var(--space-shell-border));
  background: color-mix(in oklab, var(--accent-shared) 14%, var(--space-shell-surface-strong));
}

.space-quick-card-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.space-quick-card-title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
  color: var(--space-shell-ink);
}

.space-quick-card-note {
  color: var(--space-shell-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.space-quick-card-foot {
  margin-top: auto;
  font-size: 0.82rem;
  font-weight: 800;
  color: color-mix(in oklab, var(--accent-shared) 74%, var(--space-shell-ink));
}

[data-theme="light"] .space-overview-cue,
[data-theme="light"] .space-overview-focus-cue,
[data-theme="light"] .space-overview-card-state,
[data-theme="light"] .space-quick-card-meta {
  border-color: rgba(92, 104, 142, 0.16);
  background: linear-gradient(180deg, rgba(245, 247, 255, 0.98), rgba(237, 241, 255, 0.94));
  color: rgba(35, 44, 74, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 20px rgba(80, 96, 140, 0.08);
}

[data-theme="light"] .space-overview-focus {
  border-color: rgba(142, 128, 214, 0.22);
  background:
    linear-gradient(
      160deg,
      rgba(245, 242, 255, 0.98) 0%,
      rgba(236, 244, 255, 0.94) 52%,
      rgba(255, 255, 255, 0.98) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 24px 56px rgba(88, 104, 152, 0.14);
}

[data-theme="light"] .space-overview-summary-card {
  border-color: rgba(86, 100, 140, 0.1);
  background:
    linear-gradient(
      160deg,
      rgba(255, 255, 255, 0.98) 0%,
      rgba(244, 247, 255, 0.95) 100%
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 18px 34px rgba(88, 104, 152, 0.08);
}

[data-theme="light"] .space-overview-summary-card.is-accent {
  border-color: rgba(142, 128, 214, 0.18);
  background:
    linear-gradient(
      160deg,
      rgba(244, 240, 255, 0.98) 0%,
      rgba(248, 250, 255, 0.96) 100%
    );
}

.space-disclosure {
  display: grid;
  gap: 0;
  border-radius: 24px;
  overflow: hidden;
}

.space-disclosure-toggle {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  width: 100%;
  min-height: 68px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  cursor: pointer;
}

.space-disclosure-copy {
  display: grid;
  gap: 4px;
}

.space-disclosure-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--space-shell-ink);
}

.space-disclosure-summary,
.space-disclosure-caret {
  font-size: 0.84rem;
  color: var(--space-shell-muted);
  line-height: 1.4;
}

.space-disclosure-body {
  padding: 0 18px 18px;
}

.space-wall-composer,
.space-wish-composer,
.space-music-composer,
.space-message-box,
.space-edit-box {
  border-radius: 22px;
  padding: 18px;
  gap: 12px;
}

.space-feed-list,
.space-music-list {
  gap: 12px;
}

.space-feed-list {
  display: grid;
}

.space-dream-list {
  justify-items: start;
  gap: 16px;
}

.space-post-card,
.space-wish-card,
.space-music-card {
  border-radius: 22px;
  padding: 18px;
  gap: 12px;
  box-shadow: var(--space-shell-shadow);
}

.space-wish-card {
  display: grid;
  align-content: start;
  gap: 16px;
  width: min(100%, 860px);
  max-width: 100%;
  border: 1px solid var(--space-shell-border);
  background:
    linear-gradient(
      165deg,
      color-mix(in oklab, rgba(255, 255, 255, 0.82) 82%, var(--space-shell-surface-strong)) 0%,
      color-mix(in oklab, var(--accent-shared) 5%, var(--space-shell-surface-strong)) 28%,
      color-mix(in oklab, var(--space-shell-surface) 96%, transparent) 100%
    );
}

.space-post-card:hover,
.space-wish-card:hover,
.space-music-card:hover {
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.space-wish-card:hover {
  transform: translateY(-2px);
}

.space-post-card.is-pinned,
.space-music-card--embed {
  border-color: color-mix(in oklab, var(--accent-shared) 24%, var(--space-shell-border));
}

.space-post-card.is-pinned::before {
  height: 2px;
  background: color-mix(in oklab, var(--accent-shared) 74%, transparent);
}

.space-post-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.space-post-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 10px;
}

.space-post-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: start;
}

.space-mini-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid var(--space-shell-border);
  background: color-mix(in oklab, var(--space-shell-surface-strong) 90%, transparent);
  color: var(--space-shell-ink);
}

.space-mini-avatar .space-avatar-initials {
  font-size: 0.96rem;
  letter-spacing: -0.05em;
  transform: none;
}

.space-post-author,
.space-post-title,
.space-dream-title,
.space-music-embed-title {
  color: var(--space-shell-ink);
}

.space-dream-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.18rem, 1rem + 0.4vw, 1.42rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  font-weight: 800;
  text-wrap: balance;
}

.space-post-author {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.15;
  font-weight: 800;
}

.space-post-time {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
}

.space-post-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 0.98rem + 0.28vw, 1.28rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 800;
  text-wrap: balance;
}

.space-post-text {
  margin: 0;
  line-height: 1.62;
  white-space: pre-wrap;
}

.space-post-time,
.space-post-attach-kind,
.space-attach-item-sub,
.space-comment-time,
.space-comment-reply-target,
.space-dream-badge.muted,
.space-music-embed-kicker,
.space-music-embed-sub {
  color: var(--space-shell-faint);
}

.space-post-text,
.space-dream-note,
.space-comment-text,
.space-attach-item-url,
.space-post-attach-title,
.space-attach-item-title,
.space-music-embed-note {
  color: var(--space-shell-muted);
}

.space-dream-note {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.62;
}

.space-post-mood,
.space-post-pin,
.space-dream-badge,
.space-post-attach-kind {
  border: 1px solid var(--space-shell-border);
  border-radius: 999px;
  background: color-mix(in oklab, var(--space-shell-surface-strong) 90%, transparent);
}

.space-dream-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.space-dream-badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--space-shell-ink);
  white-space: nowrap;
}

.space-post-mood,
.space-post-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.space-post-pin {
  color: var(--space-shell-ink);
  background: color-mix(in oklab, var(--accent-shared) 16%, var(--space-shell-surface-strong));
}

.space-post-actions,
.space-post-attach-actions,
.space-composer-actions,
.space-attach-controls,
.space-filter-row,
.space-mood-row,
.space-reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.space-post-actions,
.space-comment-section {
  border-top: 1px solid var(--space-shell-border);
  padding-top: 12px;
}

.space-wish-card .space-post-actions {
  justify-content: flex-end;
  margin-top: 2px;
  padding-top: 14px;
}

.space-btn {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--space-shell-border);
  border-radius: 16px;
  background: color-mix(in oklab, var(--space-shell-surface-strong) 90%, transparent);
  color: var(--space-shell-ink);
  box-shadow: none;
  font-size: 0.92rem;
  font-weight: 700;
}

.space-btn:hover {
  border-color: var(--space-shell-border-strong);
  background: color-mix(in oklab, var(--space-shell-surface-strong) 96%, transparent);
  box-shadow: none;
}

.space-btn:active {
  transform: translateY(0);
}

.space-btn.solid {
  background: linear-gradient(
    135deg,
    color-mix(in oklab, var(--accent-shared) 26%, var(--space-shell-surface-strong)),
    color-mix(in oklab, var(--space-shell-surface-strong) 92%, transparent)
  );
  color: var(--space-shell-ink);
  border-color: color-mix(in oklab, var(--accent-shared) 28%, var(--space-shell-border));
}

.space-btn.mini {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.8rem;
  border-radius: 12px;
}

.space-btn.danger,
.space-comment-delete {
  color: #ff8d8d;
  border-color: rgba(255, 141, 141, 0.32);
  background: rgba(255, 94, 94, 0.08);
}

[data-theme="light"] .space-btn.danger,
[data-theme="light"] .space-comment-delete {
  color: #d93a3a;
  background: rgba(217, 58, 58, 0.08);
}

.space-chip {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.84rem;
}

.space-input,
.space-textarea,
.space-status-text-input {
  width: 100%;
  border: 1px solid var(--space-shell-border);
  border-radius: 16px;
  background: color-mix(in oklab, var(--space-shell-surface-strong) 92%, transparent);
  color: var(--space-shell-ink);
  font-family: var(--font-body);
  box-shadow: none;
}

.space-input {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.94rem;
}

.space-textarea {
  min-height: 110px;
  padding: 14px;
  font-size: 0.94rem;
}

.space-status-text-input {
  max-width: none;
  text-align: left;
}

.space-input::placeholder,
.space-textarea::placeholder,
.space-status-text-input::placeholder {
  color: var(--space-shell-faint);
}

.space-input:focus,
.space-textarea:focus,
.space-status-text-input:focus,
.space-btn:focus-visible,
.space-chip:focus-visible,
.space-module-tab:focus-visible,
.space-viewer-chip:focus-visible,
.space-quick-card:focus-visible,
.space-disclosure-toggle:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--accent-shared) 62%, white);
  outline-offset: 2px;
}

.space-post-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.space-post-attachment,
.space-attach-item {
  display: grid;
  align-content: start;
  gap: 10px;
  border-radius: 18px;
  padding: 12px;
  border: 1px solid var(--space-shell-border);
  background: color-mix(in oklab, var(--space-shell-surface-strong) 92%, transparent);
}

.space-post-attach-kind {
  margin: 0;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.space-post-attach-title,
.space-attach-item-title {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.45;
  font-weight: 700;
  color: var(--space-shell-ink);
  overflow-wrap: anywhere;
}

.space-attach-item-sub,
.space-attach-item-url {
  margin: 0;
}

.space-comment-list,
.space-comment-replies {
  gap: 8px;
}

.space-comment-list {
  display: grid;
  gap: 10px;
}

.space-comment-item {
  display: flex;
  align-items: stretch;
  border-radius: 16px;
  border: 1px solid var(--space-shell-border);
  padding: 12px 14px;
  background: color-mix(in oklab, var(--space-shell-surface-strong) 92%, transparent);
}

.space-comment-item:hover {
  background: color-mix(in oklab, var(--accent-shared) 5%, var(--space-shell-surface-strong));
  border-color: var(--space-shell-border-strong);
}

.space-comment-item.is-reply {
  background: color-mix(in oklab, var(--space-shell-surface-soft) 96%, transparent);
}

.space-comment-replies {
  padding-left: 12px;
  border-left: 1px solid var(--space-shell-border);
}

.space-comment-body {
  display: grid;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.space-comment-author {
  color: var(--space-shell-ink);
  font-weight: 800;
}

.space-comment-text {
  margin: 0;
  line-height: 1.55;
  color: var(--space-shell-ink);
}

.space-comment-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.space-comment-action,
.space-comment-delete {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1px solid var(--space-shell-border);
  background: color-mix(in oklab, var(--space-shell-surface-strong) 90%, transparent);
  font-size: 0.76rem;
  font-weight: 700;
}

.space-comment-reply-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--space-shell-border);
  border-radius: 16px;
  background: color-mix(in oklab, var(--space-shell-surface-strong) 92%, transparent);
}

.space-comment-reply-cancel {
  color: var(--space-shell-muted);
}

.space-comment-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.space-comment-input-row .space-input {
  min-height: 48px;
}

.space-comment-input-row .space-btn {
  min-width: 48px;
  padding-inline: 14px;
}

.space-dream-list,
.space-music-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.space-music-list.space-music-list--embed {
  grid-template-columns: minmax(0, 1fr);
}

.space-wish-card.is-done {
  opacity: 0.9;
  border-style: solid;
  background:
    linear-gradient(
      165deg,
      color-mix(in oklab, #70d6a7 7%, var(--space-shell-surface-strong)) 0%,
      color-mix(in oklab, var(--space-shell-surface) 94%, transparent) 100%
    );
}

.space-dream-media {
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid color-mix(in oklab, var(--space-shell-border) 92%, white 6%);
  background: color-mix(in oklab, var(--space-shell-surface-strong) 96%, transparent);
}

.space-dream-media img,
.space-dream-preview img,
.space-post-attach-preview {
  border-radius: 18px;
}

.space-post-attach-preview {
  display: grid;
  gap: 10px;
}

.space-post-attach-preview img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
}

.space-post-attach-preview .space-btn {
  width: fit-content;
}

.space-dream-media img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

.space-dream-preview {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  border: 1px solid var(--space-shell-border);
}

.space-dream-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--space-shell-border);
  background: color-mix(in oklab, var(--space-shell-surface-strong) 94%, transparent);
  color: var(--space-shell-ink);
  font-weight: 700;
  text-decoration: none;
}

.space-dream-link:hover {
  border-color: var(--space-shell-border-strong);
  background: color-mix(in oklab, var(--accent-shared) 8%, var(--space-shell-surface-strong));
}

.space-wish-reaction-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.space-wish-reaction-bar .space-reaction-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 14px;
  gap: 6px;
  font-size: 0.82rem;
}

.space-wish-reaction-bar .space-reaction-add {
  width: 34px;
  height: 34px;
  border-radius: 14px;
}

.space-wish-reaction-picker {
  width: 100%;
  max-width: none;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
}

.space-wish-reaction-pick-btn {
  min-height: 34px;
  padding: 0 12px;
}

.space-music-embed-panel {
  border-radius: 24px;
  padding: 16px;
  background:
    linear-gradient(155deg, color-mix(in oklab, var(--accent-shared) 12%, var(--space-shell-surface-strong)) 0%, var(--space-shell-surface) 100%);
}

.space-music-embed-panel::before {
  opacity: 0.16;
}

.space-music-embed-state {
  border-radius: 999px;
  border: 1px solid var(--space-shell-border);
  padding: 0 10px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--space-shell-muted);
  background: color-mix(in oklab, var(--space-shell-surface-strong) 88%, transparent);
}

.space-music-embed-state.is-live {
  color: var(--space-shell-ink);
  border-color: color-mix(in oklab, var(--accent-shared) 28%, var(--space-shell-border));
}

.space-music-embed-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.empty-state {
  min-height: 180px;
  gap: 10px;
  padding: 28px 20px;
  border-style: solid;
  border-radius: 24px;
  color: var(--space-shell-muted);
}

.empty-state p:not(.empty-state-icon) {
  font-family: var(--font-body);
  font-style: normal;
  color: var(--space-shell-muted);
}

.space-focus-spotlight {
  box-shadow:
    0 0 0 2px color-mix(in oklab, var(--accent-shared) 28%, transparent),
    0 20px 42px rgba(0, 0, 0, 0.18);
}

@media (max-width: 1080px) {
  .space-profile-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .space-overview-grid,
  .space-quick-grid,
  .space-music-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .space-header,
  .space-section-head {
    grid-template-columns: 1fr;
  }

  .space-header-right,
  .space-section-meta {
    justify-items: start;
  }

  .space-header-metrics,
  .space-section-meta,
  .space-overview-inline-metrics {
    justify-content: flex-start;
  }

  .space-overview-grid,
  .space-quick-grid,
  .space-music-list {
    grid-template-columns: 1fr;
  }

  .space-overview-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .space-quick-card.is-lead {
    grid-column: span 1;
  }
}

@media (max-width: 640px) {
  .space-view {
    gap: 14px;
  }

  .space-header,
  .space-module-tabs,
  .space-profile-hero,
  .space-overview-card,
  .space-disclosure,
  .space-wall-composer,
  .space-wish-composer,
  .space-music-composer,
  .space-message-box,
  .space-post-card,
  .space-wish-card,
  .space-music-card,
  .space-edit-box,
  .empty-state {
    border-radius: 22px;
  }

  .space-header {
    padding: 16px;
  }

  .space-profile-hero,
  .space-overview-card,
  .space-wall-composer,
  .space-wish-composer,
  .space-music-composer,
  .space-message-box,
  .space-post-card,
  .space-wish-card,
  .space-music-card,
  .space-edit-box {
    padding: 16px;
  }

  .space-overview-primary {
    grid-template-columns: 1fr;
  }

  .space-avatar-block {
    align-items: flex-start;
  }

  .space-overview-stat-grid {
    grid-template-columns: 1fr;
  }

  .space-module-tabs {
    display: flex;
    overflow-x: auto;
    padding: 4px;
    scrollbar-width: none;
  }

  .space-module-tabs::-webkit-scrollbar {
    display: none;
  }

  .space-module-tab {
    flex: 0 0 auto;
    min-width: 120px;
    min-height: 44px;
    padding: 0 12px;
  }

  .space-header-name,
  .space-profile-name {
    font-size: clamp(1.7rem, 1.3rem + 3vw, 2.2rem);
  }

  .space-post-actions,
  .space-composer-actions,
  .space-filter-row,
  .space-attach-controls,
  .space-post-attach-actions,
  .space-music-embed-actions {
    align-items: stretch;
  }

  .space-post-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .space-post-meta {
    flex: 1 1 calc(100% - 52px);
  }

  .space-post-mood,
  .space-post-pin {
    order: 3;
  }

  .space-btn,
  .space-chip,
  .space-viewer-chip {
    min-height: 42px;
  }

  .space-comment-input-row {
    grid-template-columns: 1fr;
  }
}
