:root {
  --bg: #090909;
  --panel: rgba(14, 14, 14, 0.9);
  --panel-strong: #131313;
  --panel-soft: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f5f2ed;
  --muted: #8f8b85;
  --accent: #c42929;
  --accent-soft: rgba(196, 41, 41, 0.16);
  --success: #4ea67d;
  --shadow: 0 26px 60px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
  margin: 0;
  max-width: 100%;
  overscroll-behavior-y: none;
}

html.overlay-open,
body.overlay-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 0%, rgba(196, 41, 41, 0.12), transparent 28%),
    radial-gradient(circle at 82% 10%, rgba(130, 130, 130, 0.08), transparent 24%),
    linear-gradient(180deg, #050505 0%, #090909 40%, #0d0d0d 100%);
  overflow: hidden;
}

a {
  color: inherit;
}

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  min-height: 100dvh;
  height: 100dvh;
  position: relative;
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  padding: calc(24px + var(--safe-top)) calc(24px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(24px + var(--safe-left));
}

.app-shell.idea-overlay-open {
  overflow: hidden;
}

.app-veil,
.auth-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 120px 120px;
  mask-image: radial-gradient(circle at center, black 46%, transparent 100%);
  opacity: 0.35;
}

.layout {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.brand-title,
.auth-wordmark,
.hero-title {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 0.08em;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 4px 6px;
  position: relative;
  z-index: 20;
}

.brand-title {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 0.92;
  overflow-wrap: anywhere;
}

.brand-link {
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-button,
.profile-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 999px;
}

.profile-chip {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}

.avatar-chip {
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
}

.topbar-icon {
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 50%;
}

.page-stack,
.form-stack,
.list-stack,
.idea-listing {
  display: grid;
  gap: 18px;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 40%),
    rgba(12, 12, 12, 0.92);
  box-shadow: var(--shadow);
  overflow: visible;
  isolation: isolate;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.05), transparent 42%);
  pointer-events: none;
}

.idea-overlay-shell {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: calc(20px + var(--safe-top)) calc(20px + var(--safe-right)) calc(20px + var(--safe-bottom)) calc(20px + var(--safe-left));
}

.idea-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px);
}

.idea-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(1380px, 100%);
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 40px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 30px;
}

.framed-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.hero-strip,
.detail-hero,
.profile-hero,
.form-panel,
.thread-panel {
  padding: 24px;
}

.hero-strip {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  min-height: 210px;
  background:
    radial-gradient(circle at right top, rgba(196, 41, 41, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 50%),
    #0d0d0d;
}

.hero-title,
.auth-wordmark {
  font-size: clamp(54px, 9vw, 118px);
  line-height: 0.88;
  overflow-wrap: anywhere;
}

.hero-meta,
.profile-role-line,
.meta-line,
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-meta span,
.profile-role-line span,
.info-pill,
.status-chip,
.micro-copy {
  color: var(--muted);
}

.hero-meta span,
.profile-role-line span,
.info-pill {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.panel-head,
.idea-card-head,
.member-row,
.history-row,
.file-row,
.idea-author,
.member-info,
.comment-meta,
.chat-panel-head,
.audio-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.framed-panel > .panel-head {
  margin: 0;
}

.panel-head.inline {
  align-items: end;
}

.section-kicker,
.auth-note {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  line-height: 1.3;
}

.panel-title,
.auth-title,
.profile-name {
  margin: 0;
  font-size: clamp(16px, 2vw, 26px);
  line-height: 1.02;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.panel-title.small {
  font-size: 15px;
}

.micro-copy {
  font-size: 11px;
  line-height: 1.3;
}

.toolbar-grid,
.detail-layout,
.dual-block,
.stat-grid,
.avatar-grid,
.attachment-grid {
  display: grid;
  gap: 12px;
}

.toolbar-grid {
  grid-template-columns: 1.4fr repeat(2, minmax(160px, 0.8fr));
}

.toolbar-grid.link-grid {
  grid-template-columns: 0.8fr 1.6fr 160px;
}

.detail-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.95fr);
  gap: 14px;
}

.dual-block {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.stat-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.avatar-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.attachment-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin-top: 10px;
}

.schedule-grid-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  -webkit-overflow-scrolling: touch;
}

.schedule-grid {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 88px repeat(7, minmax(0, 1fr));
}

.schedule-grid-cell {
  min-height: 56px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.schedule-grid-cell:nth-child(8n) {
  border-right: 0;
}

.schedule-corner,
.schedule-day-head,
.schedule-hour-label {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
}

.schedule-day-head {
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.schedule-day-head span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.schedule-hour-label {
  font-size: 12px;
  color: var(--muted);
}

.schedule-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  background: rgba(255, 255, 255, 0.015);
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.schedule-slot.active {
  color: #fff5f5;
  background:
    linear-gradient(135deg, rgba(196, 41, 41, 0.28), rgba(119, 22, 22, 0.4)),
    rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 0 0 1px rgba(196, 41, 41, 0.26);
}

.schedule-slot span {
  font-size: 11px;
  line-height: 1.1;
}

.schedule-member-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.schedule-member-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.schedule-member-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.schedule-day-list {
  display: grid;
  gap: 8px;
}

.schedule-day-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.schedule-day-row span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.schedule-day-row strong {
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.schedule-recommendation {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(196, 41, 41, 0.22);
  background:
    radial-gradient(circle at top right, rgba(196, 41, 41, 0.16), transparent 28%),
    rgba(255, 255, 255, 0.025);
}

.schedule-recommendation strong {
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.05;
}

.schedule-recommendation-list {
  display: grid;
  gap: 12px;
}

.schedule-mobile-list {
  display: grid;
  gap: 12px;
}

.schedule-mobile-day {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.schedule-mobile-head {
  display: grid;
  gap: 4px;
}

.schedule-mobile-head strong {
  font-size: 15px;
  line-height: 1.1;
}

.schedule-mobile-head span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}

.schedule-mobile-hours {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.schedule-hour-chip {
  min-height: 38px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.02);
}

.schedule-hour-chip.active {
  color: #fff5f5;
  border-color: rgba(196, 41, 41, 0.24);
  background: linear-gradient(135deg, rgba(196, 41, 41, 0.28), rgba(119, 22, 22, 0.4));
}

.stat-cell,
.sub-panel,
.idea-card,
.comment-bubble,
.message-bubble,
.member-row,
.history-row,
.file-row,
.empty-state,
.attachment-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.025);
}

.sub-panel,
.stat-cell,
.member-row,
.history-row,
.file-row,
.empty-state {
  padding: 13px;
}

.framed-panel .sub-panel,
.framed-panel .stat-cell,
.framed-panel .history-row,
.framed-panel .file-row,
.framed-panel .empty-state,
.framed-panel .comment-bubble {
  min-width: 0;
}

.framed-panel .sub-panel h3 {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.15;
}

.framed-panel .list-stack,
.framed-panel .form-stack,
.framed-panel .dual-block,
.framed-panel .stat-grid,
.framed-panel .status-row {
  min-width: 0;
}

.framed-panel .panel-title,
.framed-panel .idea-copy,
.framed-panel .micro-copy,
.framed-panel strong,
.framed-panel a,
.framed-panel span,
.framed-panel div,
.framed-panel p,
.framed-panel h3 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.attachment-card {
  overflow: hidden;
}

.attachment-card.image {
  width: min(280px, 100%);
  background: transparent;
  border: 0;
}

.attachment-card.audio {
  width: 100%;
  grid-column: 1 / -1;
  background: transparent;
  border: 0;
}

.attachment-image-button {
  width: 100%;
  padding: 0;
  display: block;
  background: transparent;
}

.attachment-card img {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.voice-note-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 22px;
  background: rgba(196, 41, 41, 0.08);
  border: 1px solid rgba(196, 41, 41, 0.16);
}

.voice-note-card audio {
  display: none;
}

.voice-note-play {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff7f7;
  background: rgba(255, 255, 255, 0.08);
}

.voice-note-body {
  display: grid;
  gap: 8px;
}

.voice-note-progress {
  width: 100%;
  margin: 0;
  accent-color: #c42929;
}

.voice-note-time {
  font-size: 11px;
  color: var(--muted);
  line-height: 1;
}

.stat-cell span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-cell strong {
  font-size: 22px;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 8px;
}

.field.inline-action {
  align-content: end;
}

.field label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.input,
.textarea,
.select {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.styled-select {
  position: relative;
  z-index: 20;
  isolation: isolate;
}

.styled-select.open {
  z-index: 160;
}

.styled-select-trigger {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.styled-select.open .styled-select-trigger {
  border-color: rgba(196, 41, 41, 0.54);
  background: rgba(255, 255, 255, 0.05);
}

.styled-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 180;
  display: grid;
  gap: 0;
  padding: 8px;
  overflow: hidden;
  isolation: isolate;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 42%),
    rgba(14, 14, 14, 0.98);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.58);
}

.styled-select.up .styled-select-menu {
  top: auto;
  bottom: calc(100% + 8px);
}

.styled-select-option {
  position: relative;
  z-index: 1;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.01);
}

.styled-select-option.selected,
.styled-select-option:hover {
  background: rgba(196, 41, 41, 0.14);
  color: #fff8f8;
}

.textarea {
  min-height: 96px;
  resize: none;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: rgba(196, 41, 41, 0.54);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.file-input {
  display: none;
}

.file-picker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.file-picker-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(196, 41, 41, 0.12);
  color: #ffb4b4;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover,
.profile-chip:hover,
.chat-launcher:hover,
.avatar-choice:hover,
.menu-toggle:hover,
.file-picker:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.button.primary {
  color: #fff6f6;
  background: linear-gradient(135deg, #c42929, #771616);
  box-shadow: 0 14px 32px rgba(196, 41, 41, 0.22);
}

.button.subtle,
.button.ghost,
.icon-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.button.full {
  width: 100%;
}

.chat-send {
  width: 52px;
  min-width: 52px;
  padding: 0;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button:disabled,
.icon-button:disabled {
  opacity: 0.6;
  cursor: progress;
  transform: none;
}

.notice {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}

.notice.error {
  background: rgba(196, 41, 41, 0.12);
  border-color: rgba(196, 41, 41, 0.22);
}

.notice.success {
  background: rgba(78, 166, 125, 0.12);
  border-color: rgba(78, 166, 125, 0.22);
}

.auth-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  border-radius: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.96);
  box-shadow: 0 36px 80px rgba(0, 0, 0, 0.55);
}

.auth-cover,
.auth-form {
  padding: 34px;
}

.auth-cover {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 520px;
  background:
    radial-gradient(circle at 15% 15%, rgba(196, 41, 41, 0.2), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 35%),
    #070707;
}

.auth-graphic {
  position: absolute;
  inset: 24px 24px auto 24px;
  height: 220px;
  pointer-events: none;
}

.auth-rune {
  position: absolute;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(44px, 9vw, 96px);
  line-height: 1;
  color: rgba(255, 244, 232, 0.08);
  text-shadow: 0 0 24px rgba(196, 41, 41, 0.14);
  filter: drop-shadow(0 0 18px rgba(196, 41, 41, 0.16));
}

.auth-rune-a { top: 8px; left: 0; transform: rotate(-3deg); }
.auth-rune-b { top: 20px; left: 16%; transform: rotate(-1deg); }
.auth-rune-c { top: 34px; left: 32%; transform: rotate(2deg); }
.auth-rune-d { top: 56px; left: 49%; transform: rotate(-2deg); }
.auth-rune-e { top: 72px; left: 67%; transform: rotate(3deg); }
.auth-rune-f { top: 92px; left: 84%; transform: rotate(-2deg); }

.auth-wave {
  position: absolute;
  left: 0;
  right: 12%;
  bottom: 24px;
  height: 2px;
  background: linear-gradient(90deg, rgba(196, 41, 41, 0.45), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 20px rgba(196, 41, 41, 0.18);
}

.auth-form {
  display: grid;
  align-content: center;
  gap: 18px;
}

.idea-listing {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.idea-card {
  padding: 14px;
  display: grid;
  gap: 12px;
}

.idea-card-title {
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 700;
  line-height: 1.04;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.idea-copy {
  margin: 0;
  color: #c7c2bb;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.idea-copy.large {
  font-size: 13px;
  line-height: 1.45;
}

.status-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.status-chip.approved {
  color: #9dd2b6;
  border-color: rgba(78, 166, 125, 0.28);
  background: rgba(78, 166, 125, 0.08);
}

.status-chip.rejected {
  color: #f08f8f;
  border-color: rgba(196, 41, 41, 0.24);
  background: rgba(196, 41, 41, 0.08);
}

.avatar-mark {
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.avatar-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-mark.size-xs {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.avatar-mark.size-sm {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

.avatar-mark.size-md {
  width: 54px;
  height: 54px;
  font-size: 18px;
}

.avatar-mark.size-xl {
  width: 118px;
  height: 118px;
  font-size: 38px;
}

.avatar-eclipse { background: linear-gradient(135deg, #111111, #404040); }
.avatar-venom { background: linear-gradient(135deg, #1a1a1a, #7f1818); }
.avatar-signal { background: linear-gradient(135deg, #151515, #5338ac); }
.avatar-static { background: linear-gradient(135deg, #171717, #2f6b8b); }
.avatar-forge { background: linear-gradient(135deg, #1b1b1b, #a65f1b); }
.avatar-shard { background: linear-gradient(135deg, #121212, #5f5f5f); }

.profile-hero-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.panel-head > div,
.idea-author > div,
.member-info > div,
.profile-hero-main > div,
.hero-copy,
.brand-block {
  min-width: 0;
}

.avatar-choice {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
}

.avatar-choice.selected {
  border-color: rgba(196, 41, 41, 0.5);
  background: rgba(196, 41, 41, 0.08);
  box-shadow: inset 0 0 0 1px rgba(196, 41, 41, 0.22);
}

.member-link,
.member-directory-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.member-identity,
.idea-card-author {
  display: grid;
  gap: 6px;
}

.member-identity {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.member-link.muted {
  color: #c7c2bb;
}

.member-link.prominent {
  margin-top: 4px;
  font-size: 14px;
}

.member-link.prominent .member-link-copy strong {
  font-size: 14px;
}

.member-link-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  text-align: left;
}

.member-link-copy strong {
  font-size: 13px;
  line-height: 1.1;
}

.member-directory {
  display: grid;
  gap: 10px;
}

.member-directory-card {
  width: 100%;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.member-profile-bio {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: #d2cdc7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.activity-feed {
  display: grid;
  gap: 10px;
}

.activity-item {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.activity-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.activity-item-head strong {
  font-size: 14px;
  line-height: 1.2;
}

.activity-item-head span {
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}

.activity-copy {
  color: #d2cdc7;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.activity-link {
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f04a44;
  font: inherit;
  cursor: pointer;
}

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

.star-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: #b0aaa4;
}

.star-button.active {
  border-color: rgba(196, 41, 41, 0.4);
  background: rgba(196, 41, 41, 0.12);
  color: #ffd8d8;
}

.comment-bubble,
.message-bubble {
  padding: 12px 13px;
  display: grid;
  gap: 10px;
}

.message-bubble.mine {
  background: rgba(196, 41, 41, 0.08);
  border-color: rgba(196, 41, 41, 0.18);
}

.message-bubble.compact {
  border-radius: 18px;
}

.message-text {
  white-space: pre-wrap;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.image-preview-shell {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
}

.image-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
}

.image-preview-card {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: calc(100vh - 36px);
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 28px;
  border: 1px solid var(--line-strong);
  background: rgba(10, 10, 10, 0.96);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.image-preview-media {
  width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.image-preview-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.image-preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.thread-list,
.chat-panel-list {
  display: grid;
  gap: 12px;
  overflow: auto;
}

.thread-list {
  max-height: 420px;
}

.chat-panel-list {
  min-height: 0;
  padding-right: 4px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.comment-meta {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.subtle-empty {
  text-align: center;
  color: var(--muted);
}

.chat-launcher {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 220;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  color: #fff;
  background: rgba(12, 12, 12, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.chat-launcher.active {
  border-color: rgba(196, 41, 41, 0.4);
  box-shadow: 0 0 0 1px rgba(196, 41, 41, 0.16), 0 18px 40px rgba(0, 0, 0, 0.45);
}

.chat-launcher.open {
  opacity: 0;
  pointer-events: none;
}

.chat-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  font-size: 11px;
}

.chat-shell {
  position: fixed;
  right: 26px;
  bottom: 96px;
  z-index: 260;
  width: min(420px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 140px));
  pointer-events: none;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
}

.chat-shell.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-overlay-backdrop {
  display: none;
}

.chat-panel {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  border-radius: 28px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at top right, rgba(196, 41, 41, 0.1), transparent 24%),
    rgba(10, 10, 10, 0.96);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  overscroll-behavior: contain;
}

.chat-panel-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.chat-upload-row {
  grid-column: 1 / -1;
}

.chat-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.pending-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pending-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 34px;
  padding: 0 8px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.pending-file-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.pending-file-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}

.chat-panel-form .textarea {
  min-height: 72px;
}

@media (max-width: 1120px) {
  .detail-layout,
  .idea-listing,
  .toolbar-grid,
  .toolbar-grid.link-grid,
  .dual-block,
  .auth-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell,
  .auth-shell {
    padding: calc(14px + var(--safe-top)) calc(14px + var(--safe-right)) calc(14px + var(--safe-bottom)) calc(14px + var(--safe-left));
  }

  .hero-strip,
  .detail-hero,
  .profile-hero,
  .form-panel,
  .thread-panel,
  .auth-cover,
  .auth-form,
  .chat-panel {
    padding: 18px;
  }

  .idea-overlay-shell {
    padding: calc(8px + var(--safe-top)) calc(8px + var(--safe-right)) calc(8px + var(--safe-bottom)) calc(8px + var(--safe-left));
  }

  .idea-overlay-panel {
    width: 100%;
    max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 16px);
    border-radius: 24px;
  }

  .framed-panel {
    gap: 16px;
    padding: 16px;
  }

  .page-stack,
  .form-stack,
  .list-stack {
    min-width: 0;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .menu-toggle {
    display: none;
  }

  .topbar-actions {
    position: static;
    width: auto;
    max-width: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition: none;
    overflow: hidden;
    z-index: 51;
  }

  .topbar-actions.open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .nav-button,
  .profile-chip {
    width: auto;
    min-width: 0;
    max-width: none;
    justify-content: center;
    min-height: 40px;
    padding: 0;
  }

  .avatar-chip {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
  }

  .hero-strip,
  .panel-head,
  .idea-card-head,
  .member-row,
  .history-row,
  .file-row,
  .chat-panel-head,
  .profile-hero-main,
  .chat-panel-form,
  .chat-tools,
  .audio-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-shell {
    top: var(--safe-top);
    right: var(--safe-right);
    bottom: var(--safe-bottom);
    left: var(--safe-left);
    width: auto;
    max-width: none;
    height: auto;
    z-index: 260;
  }

  .chat-overlay-backdrop {
    display: block;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
  }

  .chat-panel {
    position: absolute;
    inset: 10px;
    border-radius: 24px;
    padding-bottom: calc(14px + var(--safe-bottom));
  }

  .chat-panel-form {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding-bottom: 0;
  }

  .chat-panel-form .textarea {
    min-height: 64px;
  }

  .chat-send {
    width: 100%;
    min-width: 100%;
    min-height: 44px;
    position: sticky;
    bottom: 0;
  }

  .chat-tools {
    grid-template-columns: 1fr;
  }

  .stat-grid.compact,
  .avatar-grid,
  .attachment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-member-list {
    grid-template-columns: 1fr;
  }

  .schedule-grid-shell {
    display: none;
  }

  .schedule-grid {
    min-width: 0;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .schedule-grid-cell {
    min-height: 0;
    padding: 0;
  }

  .schedule-day-head strong,
  .schedule-recommendation strong {
    font-size: 15px;
  }

  .schedule-day-head span,
  .schedule-hour-label,
  .schedule-day-row span,
  .schedule-day-row strong {
    font-size: 10px;
  }

  .schedule-day-head span {
    display: none;
  }

  .schedule-member-card,
  .schedule-recommendation {
    padding: 12px;
    border-radius: 18px;
  }

  .schedule-mobile-day {
    padding: 10px;
    border-radius: 16px;
  }

  .schedule-member-head {
    gap: 10px;
  }

  .schedule-day-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
  }

  .schedule-recommendation-list,
  .schedule-member-list,
  .schedule-day-list {
    gap: 10px;
  }

  .attachment-grid {
    align-items: start;
  }

  .attachment-card.audio {
    grid-column: 1 / -1;
  }

  .chat-launcher {
    right: 14px;
    bottom: 14px;
    z-index: 220;
  }

  .brand-title {
    font-size: 42px;
  }

  .topbar-icon,
  .avatar-chip {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .hero-title,
  .auth-wordmark {
    font-size: clamp(36px, 12vw, 64px);
  }

  .panel-title,
  .auth-title,
  .profile-name,
  .idea-card-title {
    font-size: clamp(14px, 5.2vw, 19px);
  }

  .section-kicker,
  .auth-note,
  .micro-copy,
  .hero-meta span,
  .profile-role-line span,
  .info-pill,
  .status-chip {
    font-size: 9px;
  }

  .input,
  .textarea,
  .select,
  .button,
  .styled-select-trigger {
    font-size: 13px;
  }

  .stat-cell strong {
    font-size: 18px;
  }

  .sub-panel h3,
  .thread-panel .panel-title,
  .panel h3 {
    font-size: 14px;
    line-height: 1.1;
  }

  .pending-file-name {
    max-width: 140px;
    font-size: 11px;
  }

  .auth-graphic {
    inset: 18px 18px auto 18px;
    height: 160px;
  }

  .auth-shell {
    min-height: 100dvh;
    align-items: start;
  }

  .auth-panel {
    width: 100%;
    max-width: 520px;
    border-radius: 26px;
  }

  .auth-cover {
    min-height: 280px;
    align-content: end;
  }

  .auth-form {
    align-content: start;
    gap: 14px;
  }

  .form-stack,
  .list-stack,
  .page-stack,
  .idea-listing {
    gap: 16px;
  }

  .panel-head,
  .idea-card-head,
  .member-row,
  .history-row,
  .file-row,
  .chat-panel-head,
  .profile-hero-main {
    gap: 12px;
  }

  .auth-rune-a { top: 2px; left: 0; }
  .auth-rune-b { top: 12px; left: 16%; }
  .auth-rune-c { top: 22px; left: 32%; }
  .auth-rune-d { top: 34px; left: 49%; }
  .auth-rune-e { top: 46px; left: 67%; }
  .auth-rune-f { top: 58px; left: 84%; }

  .star-rating {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-preview-shell {
    padding: 10px;
  }

  .image-preview-card {
    padding: 14px;
    border-radius: 22px;
  }

  .image-preview-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}
