* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
}

body.dialog-open {
  overflow: hidden;
}

.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 80;
  pointer-events: none;
}

.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #dbe3f0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.16);
  color: #0f172a;
  font-size: 13px;
  line-height: 1.6;
  transform: translateY(-8px);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.info {
  border-color: #bfdbfe;
}

.toast.success {
  border-color: #86efac;
}

.toast.error {
  border-color: #fca5a5;
  background: rgba(254, 242, 242, 0.98);
}

.app-dialog {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(4px);
}

.app-dialog-panel {
  position: relative;
  width: min(100%, 440px);
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.24);
  border: 1px solid #e2e8f0;
}

.app-dialog-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.app-dialog-description {
  margin-top: 8px;
  color: #64748b;
  font-size: 13px;
  line-height: 1.7;
}

.app-dialog-error {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  line-height: 1.6;
}

.app-dialog-input {
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
}

.app-dialog-input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

.app-dialog-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.app-dialog-button {
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.app-dialog-button.secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
}

#join-screen {
  min-height: 100vh;
  padding: 40px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top left, rgba(34, 197, 94, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.18), transparent 36%),
    linear-gradient(135deg, #f8fafc 0%, #eef4ff 46%, #f8fafc 100%);
}

.join-shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1fr);
  gap: 28px;
  align-items: stretch;
}

.join-hero,
.join-panel {
  min-width: 0;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.14);
}

.join-hero {
  padding: 34px 32px;
  background:
    radial-gradient(circle at top right, rgba(148, 163, 184, 0.26), transparent 26%),
    linear-gradient(145deg, #0f172a 0%, #132a4a 42%, #1d4ed8 100%);
  color: #f8fafc;
  position: relative;
}

.join-hero::after {
  content: '';
  position: absolute;
  inset: auto -14% -18% auto;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  filter: blur(1px);
}

.join-hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.26);
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.join-hero h1 {
  margin-top: 22px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.join-hero-copy {
  margin-top: 18px;
  max-width: 36ch;
  color: rgba(226, 232, 240, 0.9);
  font-size: 15px;
  line-height: 1.8;
}

.join-hero-points {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}

.join-hero-point {
  position: relative;
  z-index: 1;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(191, 219, 254, 0.18);
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(10px);
}

.join-hero-point strong {
  display: block;
  font-size: 14px;
  color: #ffffff;
}

.join-hero-point span {
  display: block;
  margin-top: 6px;
  color: rgba(226, 232, 240, 0.88);
  font-size: 13px;
  line-height: 1.7;
}

.join-panel {
  padding: 30px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
}

.join-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.join-panel-eyebrow {
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.join-panel-head h2 {
  margin-top: 8px;
  color: #0f172a;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.04em;
}

.join-form {
  margin-top: 24px;
}

.join-field {
  display: block;
}

.join-field + .join-field {
  margin-top: 14px;
}

.join-field-label {
  display: block;
  margin-bottom: 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.join-field input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d9e2ef;
  border-radius: 16px;
  background: #ffffff;
  color: #0f172a;
  font-size: 15px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.join-field input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 5px rgba(96, 165, 250, 0.18);
  transform: translateY(-1px);
}

.join-primary-button {
  width: 100%;
  margin-top: 18px;
  padding: 15px 18px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(29, 78, 216, 0.24);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.join-primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 48px rgba(29, 78, 216, 0.28);
  filter: saturate(1.04);
}

.join-hint {
  margin-top: 14px;
  color: #475569;
  font-size: 13px;
  line-height: 1.7;
}

.join-error {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13px;
  line-height: 1.6;
}

.join-history {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid #e2e8f0;
}

.join-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.join-history-title {
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
}

.join-history-subtitle {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.join-history-refresh {
  flex: 0 0 auto;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.join-history-refresh:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  transform: translateY(-1px);
}

.recent-rooms-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}

.recent-rooms-empty {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.recent-room-card {
  width: 100%;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid #d9e2ef;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.recent-room-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

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

.recent-room-id {
  color: #0f172a;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.recent-room-time {
  color: #64748b;
  font-size: 12px;
}

.recent-room-topic {
  margin-top: 8px;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

.recent-room-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recent-room-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

.recent-room-pill.running {
  background: #dcfce7;
  color: #166534;
}

.recent-room-pill.archived {
  background: #eef2ff;
  color: #4338ca;
}

.recent-room-pill.minutes-ready {
  background: #fef3c7;
  color: #92400e;
}

.recent-room-pill.minutes-empty {
  background: #f1f5f9;
  color: #475569;
}

#chat-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.header {
  background: white;
  padding: 16px 24px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header button {
  padding: 8px 16px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.main {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  min-height: 0;
}

.sidebar {
  width: 280px;
  background: white;
  border-left: 1px solid #ddd;
  padding: 24px 20px;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.sidebar h3 {
  margin-bottom: 16px;
  font-size: 14px;
  color: #666;
}

.message {
  margin-bottom: 16px;
  max-width: 920px;
  padding: 14px 16px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
  border: 1px solid #e5e7eb;
}

.message.agent {
  background: #f8fbff;
  border-left: 4px solid #3b82f6;
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.05);
}

.message.streaming {
  border-style: dashed;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
}

.message.self {
  margin-left: auto;
  background: #ffffff;
  border-right: 4px solid #2563eb;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  font-size: 12px;
  color: #666;
}

.message-author {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.message-sender {
  font-weight: bold;
  color: #333;
}

.message-meta {
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
}

.message-content {
  color: #333;
  line-height: 1.8;
  font-size: 15px;
  word-break: break-word;
}

.message-content p,
.message-content ul,
.message-content ol {
  margin: 0 0 10px;
}

.message-content p:last-child,
.message-content ul:last-child,
.message-content ol:last-child {
  margin-bottom: 0;
}

.message-content ul,
.message-content ol {
  padding-left: 22px;
}

.message-content li {
  margin-bottom: 6px;
}

.message-content h2,
.message-content h3,
.message-content h4 {
  margin: 0 0 10px;
  color: #111827;
}

.message-content strong {
  color: #111827;
}

.message-placeholder {
  color: #6b7280;
  font-style: italic;
}

.message-content code {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  background: #e5eefb;
  color: #1d4ed8;
  font-size: 13px;
}

.message-stream-status {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
}

.message-stream-status.error {
  color: #b91c1c;
}

.message-stream-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  animation: pending-pulse 1s ease-in-out infinite;
}

.message.stream-error {
  border-color: #fca5a5;
  background: #fef2f2;
}

.message.stream-error .message-stream-dot {
  animation: none;
}

.mention {
  color: #007bff;
  font-weight: bold;
}

.chat-footer {
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.meeting-toolbar {
  padding: 14px 24px 0;
  display: flex;
  gap: 10px;
  align-items: center;
  overflow-x: auto;
}

.meeting-toolbar button {
  padding: 6px 14px;
  font-size: 13px;
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #475569;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.meeting-toolbar button:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.input-area {
  padding: 14px 24px 18px;
  background: transparent;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.send-primary-btn {
  padding: 0 20px;
  height: 44px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.24);
}

.send-primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.send-primary-btn:active {
  transform: translateY(1px);
}

.discussion-template-select {
  min-width: 168px;
  padding: 12px 14px;
  border: 1px solid #d6deeb;
  border-radius: 8px;
  background: #f8fbff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
}

.discussion-template-select:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}

.composer {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.discussion-role-pool {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.discussion-role-empty {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.discussion-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #d6deeb;
  background: #f8fbff;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
}

.discussion-role-chip.selected {
  border-color: #93c5fd;
  background: #dbeafe;
  color: #1d4ed8;
}

.discussion-role-chip-handle {
  font-weight: 700;
}

.discussion-role-chip-label {
  font-weight: 600;
}

.pending-agent-status {
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pending-agent-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
}

.pending-agent-chip.slow {
  background: #fff7ed;
  border-color: #fdba74;
  color: #c2410c;
}

.pending-agent-chip.offline {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #475569;
}

.pending-agent-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.pending-agent-dot.spinning {
  animation: pending-pulse 1s ease-in-out infinite;
}

@keyframes pending-pulse {
  0% {
    transform: scale(0.8);
    opacity: 0.45;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.8);
    opacity: 0.45;
  }
}

.input-area input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.mention-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  background: #ffffff;
  border: 1px solid #dbe3f0;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
  padding: 8px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 30;
}

.mention-suggestion {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.mention-suggestion:hover,
.mention-suggestion.active {
  background: #eef6ff;
}

.mention-suggestion-handle {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #1d4ed8;
}

.mention-suggestion-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.input-area button:disabled,
.join-primary-button:disabled,
.join-history-refresh:disabled,
.recent-room-card:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.user-item {
  position: relative;
  padding: 12px 14px 12px 34px;
  margin-bottom: 8px;
  border-radius: 12px;
  font-size: 14px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.02);
}

.user-item::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px #d1fae5;
}

.user-item.agent {
  background: #f8fbff;
  border-color: #bfdbfe;
}

.user-item.agent::before {
  background: #3b82f6;
  box-shadow: 0 0 0 2px #dbeafe;
}

.user-name {
  font-weight: 700;
  color: #111827;
}

.user-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.discussion-status {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.discussion-empty {
  padding: 24px 16px;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.minutes-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.minutes-empty,
.minutes-empty-inline {
  padding: 24px 16px;
  border-radius: 14px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.minutes-empty-inline {
  padding: 10px 12px;
  background: #ffffff;
}

.minutes-card {
  padding: 14px;
  border-radius: 14px;
  background: #fffdf5;
  border: 1px solid #fcd34d;
  box-shadow: 0 10px 24px rgba(217, 119, 6, 0.08);
}

.minutes-card.loading {
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.minutes-card.error {
  background: #fef2f2;
  border-color: #fca5a5;
  box-shadow: none;
}

.minutes-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.minutes-actions-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.minutes-title {
  font-size: 14px;
  font-weight: 800;
  color: #111827;
}

.minutes-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.minutes-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.minutes-badge.loading {
  background: #dbeafe;
  color: #1d4ed8;
}

.minutes-badge.error {
  background: #fee2e2;
  color: #b91c1c;
}

.minutes-action-button {
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.minutes-action-button.secondary {
  background: #ffffff;
  color: #111827;
  border: 1px solid #d1d5db;
}

.minutes-section {
  margin-top: 14px;
}

.minutes-section-title {
  font-size: 12px;
  font-weight: 800;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.minutes-summary {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
  color: #374151;
}

.minutes-list {
  margin-top: 8px;
  padding-left: 18px;
}

.minutes-list-item {
  color: #374151;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.minutes-item-meta {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
}

.minutes-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.minutes-action-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #fde68a;
}

.minutes-action-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: #111827;
}

.minutes-action-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: #6b7280;
}

.minutes-priority {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.minutes-priority.priority-high {
  background: #fee2e2;
  color: #b91c1c;
}

.minutes-priority.priority-medium {
  background: #dbeafe;
  color: #1d4ed8;
}

.minutes-priority.priority-low {
  background: #dcfce7;
  color: #166534;
}

.minutes-note {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.6;
  color: #78716c;
}

.discussion-card {
  padding: 12px;
  border-radius: 14px;
  background: #f8fbff;
  border: 1px solid #dbeafe;
}

.discussion-notice {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  background: #ffffff;
}

.discussion-notice.info {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.discussion-notice.success {
  border-color: #86efac;
  background: #f0fdf4;
}

.discussion-notice.warning {
  border-color: #fdba74;
  background: #fff7ed;
}

.discussion-notice.error {
  border-color: #fca5a5;
  background: #fef2f2;
}

.discussion-notice-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.discussion-notice-detail {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: #475569;
}

.discussion-live {
  position: relative;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #bfdbfe;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  display: flex;
  gap: 12px;
  align-items: center;
  overflow: hidden;
}

.discussion-live::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: discussion-shimmer 2.8s linear infinite;
}

.discussion-live.streaming {
  border-color: #93c5fd;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.discussion-live.retrying {
  border-color: #fdba74;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
}

.discussion-live-dots,
.discussion-live-copy {
  position: relative;
  z-index: 1;
}

.discussion-live-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.discussion-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #2563eb;
  animation: pending-pulse 1.2s ease-in-out infinite;
}

.discussion-live-dot:nth-child(2) {
  animation-delay: 0.18s;
}

.discussion-live-dot:nth-child(3) {
  animation-delay: 0.36s;
}

.discussion-live-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.discussion-live-subtitle {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
}

.discussion-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.discussion-topic {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.5;
}

.discussion-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #dbeafe;
  color: #1d4ed8;
}

.discussion-badge.finished {
  background: #dcfce7;
  color: #166534;
}

.discussion-badge.cancelled {
  background: #fee2e2;
  color: #b91c1c;
}

.discussion-meta-row {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #475569;
}

.discussion-meta-row strong {
  color: #0f172a;
  text-align: right;
}

.discussion-template-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #64748b;
}

.discussion-progress {
  margin-top: 12px;
}

.discussion-metrics {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.discussion-metric {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  background: #ffffff;
}

.discussion-metric.info {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.discussion-metric.success {
  border-color: #86efac;
  background: #f0fdf4;
}

.discussion-metric.warning {
  border-color: #fdba74;
  background: #fff7ed;
}

.discussion-metric.danger {
  border-color: #fca5a5;
  background: #fef2f2;
}

.discussion-metric-value {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.discussion-metric-label {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #64748b;
}

.discussion-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.discussion-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 100%);
}

.discussion-progress-text {
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}

.discussion-turns {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discussion-turn {
  padding: 10px;
  border-radius: 12px;
  background: white;
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
}

.discussion-turn.in_progress {
  border-color: #60a5fa;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12), inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.discussion-turn.retrying {
  border-color: #fb923c;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.12), inset 0 0 0 1px rgba(249, 115, 22, 0.08);
}

.discussion-turn.in_progress::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: discussion-shimmer 3s linear infinite;
}

.discussion-turn.retrying::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 247, 237, 0.72) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: discussion-shimmer 2.6s linear infinite;
}

.discussion-turn.completed {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.discussion-turn.skipped {
  border-color: #fecaca;
  background: #fef2f2;
}

.discussion-turn.failed {
  border-color: #fca5a5;
  background: #fff1f2;
}

.discussion-turn-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.discussion-turn-agent {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.discussion-turn-status {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
}

.discussion-turn.completed .discussion-turn-status {
  color: #15803d;
}

.discussion-turn.retrying .discussion-turn-status {
  color: #c2410c;
}

.discussion-turn.failed .discussion-turn-status,
.discussion-turn.skipped .discussion-turn-status {
  color: #b91c1c;
}

.discussion-turn-phase,
.discussion-turn-target,
.discussion-turn-preview,
.discussion-turn-meta {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

.discussion-turn-preview.issue {
  color: #b91c1c;
}

.discussion-turn-live {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.discussion-turn-live.thinking {
  background: #eff6ff;
  color: #1d4ed8;
}

.discussion-turn-live.streaming {
  background: #dbeafe;
  color: #1e40af;
}

.discussion-turn-live.retrying {
  background: #ffedd5;
  color: #c2410c;
}

.discussion-turn-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  animation: pending-pulse 1.1s ease-in-out infinite;
}

.discussion-turn-retry-button {
  margin-top: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid #fdba74;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.discussion-turn-retry-button:hover {
  background: #ffedd5;
}

@keyframes discussion-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.system-message {
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
  margin: 16px auto;
  padding: 4px 12px;
  width: fit-content;
  max-width: 100%;
  letter-spacing: 0.02em;
}

.task-item {
  padding: 10px;
  margin-bottom: 8px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 12px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 1px solid #e5e7eb;
}

.task-text {
  line-height: 1.6;
  color: #334155;
}

.task-text.done {
  text-decoration: line-through;
  color: #999;
}

.task-status-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 54px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.task-status-toggle input[type="checkbox"] {
  margin-top: 2px;
  cursor: pointer;
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-input,
.task-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #dbe3f0;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
}

.task-input.done {
  text-decoration: line-through;
  color: #94a3b8;
}

.task-meta-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.task-actions-row {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}

.task-save-button {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.task-preview {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.6;
  color: #64748b;
}

@media (max-width: 1100px) {
  #join-screen {
    padding: 24px 18px;
  }

  .join-shell {
    grid-template-columns: 1fr;
  }

  .join-hero {
    min-height: 0;
  }

  .main {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-left: none;
    border-top: 1px solid #ddd;
  }

  .input-area {
    flex-wrap: wrap;
  }

  .input-area input {
    min-width: 240px;
  }

  .discussion-template-select {
    min-width: 220px;
  }

  .composer {
    min-width: 100%;
  }

  .message {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  #join-screen {
    padding: 12px;
  }

  .join-panel,
  .join-hero {
    border-radius: 24px;
    padding: 22px 20px;
  }

  .join-panel-head h2 {
    font-size: 24px;
  }

  .join-hero h1 {
    font-size: 34px;
  }

  .join-history-head {
    flex-direction: column;
    align-items: stretch;
  }

  .join-history-refresh,
  .join-primary-button {
    width: 100%;
  }

  .recent-rooms-list {
    max-height: none;
    padding-right: 0;
  }

  .toast-stack {
    left: 12px;
    right: 12px;
    top: 12px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }

  .header,
  .chat-area,
  .sidebar,
  .input-area {
    padding-left: 14px;
    padding-right: 14px;
  }

  .header {
    gap: 10px;
    align-items: flex-start;
  }

  .header h2 {
    font-size: 18px;
  }

  .input-area {
    gap: 8px;
  }

  .input-area button {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding: 10px 12px;
  }

  .discussion-template-select {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .minutes-title-row,
  .discussion-head,
  .discussion-meta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .minutes-actions-row {
    justify-content: stretch;
  }

  .minutes-action-button {
    flex: 1 1 calc(50% - 4px);
    text-align: center;
  }

  .discussion-metrics {
    grid-template-columns: 1fr;
  }

  .task-item {
    flex-direction: column;
  }

  .task-status-toggle {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    min-width: 0;
  }

  .task-meta-grid {
    grid-template-columns: 1fr;
  }

  .task-actions-row {
    flex-direction: column;
  }

  .task-save-button,
  .task-select {
    width: 100%;
  }

  .app-dialog {
    padding: 14px;
    align-items: flex-end;
  }

  .app-dialog-panel {
    width: 100%;
    max-width: none;
    padding: 18px;
    border-radius: 20px 20px 16px 16px;
  }

  .app-dialog-actions {
    flex-direction: column-reverse;
  }

  .app-dialog-button {
    width: 100%;
  }
}
