:root {
  color-scheme: light;
  --bg: #f2f4f8;
  --bg-accent: radial-gradient(circle at top, rgba(176, 203, 255, 0.55), transparent 38%),
    linear-gradient(180deg, #f8fbff 0%, #edf1f7 100%);
  --card: rgba(255, 255, 255, 0.78);
  --card-border: rgba(15, 23, 42, 0.08);
  --text: #111827;
  --muted: #6b7280;
  --primary: #111827;
  --secondary: #ffffff;
  --accent: #3b82f6;
  --success: #0f9f6e;
  --shadow: 0 24px 60px rgba(17, 24, 39, 0.10);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-accent);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

.language-switcher {
  position: relative;
  z-index: 200;
}

.language-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  backdrop-filter: blur(18px);
}

.language-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.language-menu {
  position: fixed;
  top: 0;
  right: 0;
  min-width: 152px;
  padding: 8px;
  display: grid;
  gap: 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.12);
  backdrop-filter: blur(18px);
  z-index: 300;
}

.language-option {
  text-align: left;
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
}

.language-option:hover {
  background: rgba(59, 130, 246, 0.08);
}

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

.hidden {
  display: none !important;
}

.shell {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.join-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
}

.join-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(16px);
}

.panel {
  display: grid;
  gap: 16px;
}

.brand-block,
.meeting-card,
.join-form,
.status-strip,
.hero-card,
.transcript-panel,
.participants-panel {
  backdrop-filter: blur(22px);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.brand-block,
.meeting-card,
.join-form,
.hero-card,
.transcript-panel,
.participants-panel {
  padding: 22px;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 22px;
}

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

.eyebrow,
.label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

h1,
h2,
strong,
p {
  margin: 0;
}

h1,
h2 {
  font-size: clamp(32px, 8vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.subtitle,
.helper-text,
.role-caption {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.brand-caption {
  margin-top: 2px;
  text-align: right;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 600;
  font-size: 13.5px;
}

.meeting-card,
.timing,
.status-strip,
.action-grid,
.panel-header,
.meeting-list,
.join-stack,
.inline-fields,
.role-picker {
  display: grid;
  gap: 14px;
}

.meeting-list-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.filter-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--muted);
  cursor: pointer;
  transition: background 160ms, color 160ms;
}

.filter-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.meeting-list {
  gap: 12px;
}

.meeting-launch {
  width: 100%;
  text-align: left;
  cursor: pointer;
  padding: 0;
  border: 0;
  background: transparent;
}

.meeting-launch.meeting-card {
  padding: 18px 20px;
}

.meeting-launch:hover {
  transform: translateY(-1px);
}

.meeting-card {
  gap: 8px;
}

.meeting-card-content {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 16px;
  row-gap: 6px;
  width: 100%;
  align-items: center;
}

.meeting-card-content .meeting-title {
  align-self: center;
}

.meeting-card-content .meeting-chip {
  align-self: center;
  justify-self: end;
}

.meeting-card-content .meeting-organizer {
  align-self: center;
  margin: 0;
}

.meeting-card-content .meeting-time {
  align-self: center;
  justify-self: end;
  margin: 0;
}

.meeting-card-content .meeting-stats {
  grid-column: 1 / -1;
  justify-self: stretch;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.meeting-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.meeting-organizer {
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
  margin: -2px 0 0;
}

.meeting-time {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.meeting-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meeting-stat {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.meeting-stat strong {
  color: var(--text);
}

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

.meeting-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #2563eb;
  background: rgba(59, 130, 246, 0.12);
}

.chip-live  { color: #2563eb; background: rgba(59, 130, 246, 0.12); gap: 6px; }
.chip-next  { color: #d97706; background: rgba(245, 158, 11, 0.13); }
.chip-open  { color: #6b7280; background: rgba(107, 114, 128, 0.12); }

.wave-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.wave-bars span {
  display: block;
  width: 2.5px;
  border-radius: 2px;
  background: currentColor;
  animation: wave-pulse 1.1s ease-in-out infinite;
}

.wave-bars span:nth-child(1) { height: 5px;  animation-delay: 0s; }
.wave-bars span:nth-child(2) { height: 10px; animation-delay: 0.18s; }
.wave-bars span:nth-child(3) { height: 7px;  animation-delay: 0.36s; }
.wave-bars span:nth-child(4) { height: 4px;  animation-delay: 0.54s; }

@keyframes wave-pulse {
  0%, 100% { transform: scaleY(0.4); opacity: 0.5; }
  50%       { transform: scaleY(1);   opacity: 1; }
}

.modal-close-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -20px -20px 16px -20px;
  padding: 14px 16px 14px 20px;
  background: rgba(226, 232, 240, 0.95);
  border-bottom: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 28px 28px 0 0;
}

.modal-meeting-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.join-field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

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

.inline-fields {
  grid-template-columns: 1.2fr 0.8fr;
}

.join-form label,
.transcript-form {
  display: grid;
  gap: 8px;
}

.join-form {
  gap: 14px;
}

.join-form-modal {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  padding: 20px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(244, 248, 255, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 36px 80px rgba(15, 23, 42, 0.22);
}

.join-stack {
  gap: 10px;
}

.join-section {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.join-section-role,
.join-section-pin {
  gap: 12px;
}

.modal-header {
  margin-bottom: 4px;
}

#join-back {
  padding: 9px 15px;
  font-size: 14px;
}

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

.role-picker-modal {
  gap: 10px;
}

.role-option {
  position: relative;
  display: block;
}

.role-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.role-option span {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.09);
  background: rgba(255, 255, 255, 0.84);
}

.role-option small {
  color: var(--muted);
}

.role-option-plain span {
  place-items: center;
  min-height: 44px;
  padding: 10px 14px;
}

.role-option input:checked + span {
  border-color: rgba(59, 130, 246, 0.42);
  background: rgba(59, 130, 246, 0.10);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.pin-group {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pin-slot {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding-inline: 0;
  padding-block: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 160ms, background 160ms;
}

.pin-slot.filled {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.07);
}

.inline-fields-modal {
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
}

.inline-fields-modal label {
  gap: 7px;
}

.join-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 0;
  border-top: none;
}

.join-submit {
  min-width: 128px;
}

/* info-only 모드: 폼 내용 숨기고 상태 메시지만 표시 */
.join-form[data-info-only] .join-stack,
.join-form[data-info-only] .join-footer .join-submit {
  display: none;
}

.join-form[data-info-only] #join-status {
  font-size: 15px;
  font-weight: 600;
  color: var(--text) !important;
  padding: 20px 0 8px;
  text-align: center;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
  color: var(--text);
  transition: border-color 160ms, background 160ms;
}

input.filled,
select.filled {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.07);
}

textarea {
  resize: vertical;
  min-height: 88px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 15px 18px;
  font-weight: 600;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

button:active {
  transform: scale(0.98);
}

.primary-button {
  background: var(--primary);
  color: #fff;
}

.primary-button:disabled {
  background: rgba(15, 23, 42, 0.10);
  color: rgba(15, 23, 42, 0.32);
  cursor: not-allowed;
  transform: none;
}

.secondary-button {
  background: rgba(17, 24, 39, 0.08);
  color: var(--text);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.58);
  color: var(--text);
  border: 1px solid rgba(17, 24, 39, 0.08);
}

.room-header {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 16px;
  row-gap: 6px;
  align-items: center;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
  padding: 14px 18px;
}

.room-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  align-self: center;
}

.room-header #leave-button {
  justify-self: end;
  align-self: center;
  font-size: 13px;
  padding: 8px 14px;
}

.room-header-nickname {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  align-self: center;
}

.room-header-nick-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-header .role-chip {
  align-self: center;
}

.role-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.10);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.18);
}

.role-chip.presenter {
  background: rgba(15, 159, 110, 0.10);
  color: #0f9f6e;
  border-color: rgba(15, 159, 110, 0.2);
}

.action-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 80px 0 20px;
}

.action-grid.single-action {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
}

.action-round-btn {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  cursor: pointer;
  border: none;
  font-weight: 700;
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.38);
  transition: transform 180ms ease, box-shadow 180ms ease, background 200ms ease;
}

.action-round-btn:active {
  transform: scale(0.93);
}

.action-round-btn.active {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 6px 24px rgba(220, 38, 38, 0.45);
}

.action-round-btn .btn-icon {
  font-size: 28px;
  line-height: 1;
}

.action-round-btn .btn-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.status-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 10px;
}

.status-card {
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 4px;
  text-align: center;
}

.status-card > span:first-child {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.status-card strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-sublabel {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.transfer-btn {
  font-size: 14px;
  padding: 11px 20px;
}

.transfer-modal-panel {
  max-height: 70vh;
  overflow-y: auto;
}

.transfer-modal-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}

.transfer-list {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.transfer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.transfer-item-info strong {
  display: block;
  font-size: 14px;
}

.transfer-item-info span {
  font-size: 12px;
  color: var(--muted);
}

.hero-card-presenter {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(234, 243, 255, 0.96) 100%);
}

.hero-card-participant {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0%, rgba(240, 248, 243, 0.96) 100%);
}

.voice-visualizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 7px;
  height: 74px;
}

.voice-visualizer span {
  width: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #6ea8ff 0%, #0f9f6e 100%);
  height: 18px;
  opacity: 0.45;
  transform-origin: bottom;
}

.voice-visualizer.active span {
  animation: pulse-bars 1s ease-in-out infinite;
  opacity: 1;
}

.voice-visualizer.active span:nth-child(2) {
  animation-delay: 0.12s;
}

.voice-visualizer.active span:nth-child(3) {
  animation-delay: 0.24s;
}

.voice-visualizer.active span:nth-child(4) {
  animation-delay: 0.36s;
}

@keyframes pulse-bars {
  0%,
  100% {
    height: 18px;
  }
  50% {
    height: 68px;
  }
}

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

.single-action {
  grid-template-columns: 1fr;
}

.room-view {
  display: grid;
  gap: 16px;
}

.transcript-panel,
.participants-panel {
  gap: 18px;
}

.transcript-form {
  margin-top: 18px;
}

.transcript-list,
.participants-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.transcript-item,
.participant-item {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.transcript-meta,
.participant-top,
.participant-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.participant-item {
  display: grid;
  gap: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.badge.presenter {
  background: rgba(59, 130, 246, 0.14);
  color: #2563eb;
}

.badge.questioner {
  background: rgba(15, 159, 110, 0.14);
  color: var(--success);
}

.translation-preview {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 420px) {
  .shell {
    padding-inline: 12px;
  }

  .inline-fields,
  .hero-card,
  .action-grid,
  .timing {
    grid-template-columns: 1fr;
  }

  .inline-fields-modal {
    grid-template-columns: minmax(0, 1fr) 108px;
  }

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

  .join-form-modal {
    padding: 20px;
    border-radius: 26px;
  }

  .join-section {
    padding: 12px;
  }

  .status-strip {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
