:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --bg-accent: #eef2f8;
  --card: rgba(255, 255, 255, 0.9);
  --card-border: rgba(148, 163, 184, 0.25);
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --secondary: #f1f5f9;
  --danger: #fee2e2;
  --success: #22c55e;
  --ring: rgba(79, 70, 229, 0.25);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

body {
  background: radial-gradient(circle at top, #ffffff 0%, var(--bg) 45%, #e9eef7 100%);
  color: var(--text);
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px;
  background: linear-gradient(120deg, #0f172a 0%, #1e1b4b 70%);
  color: #f8fafc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-header h1 {
  font-size: 24px;
  margin-bottom: 4px;
}

.subtitle {
  font-size: 14px;
  color: #cbd5f5;
}

.header-actions button {
  margin-left: 12px;
}

.app-layout {
  display: block;
  padding: 24px 32px 36px;
}

.room-panel {
  background: var(--card);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(6px);
}

.room-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1.4fr) minmax(300px, 0.7fr);
  gap: 18px;
  align-items: stretch;
}

.conference-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 16px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.topic {
  max-width: 500px;
  font-size: 14px;
  color: var(--muted);
}

.room-meta {
  display: flex;
  gap: 12px;
}

.room-meta .label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.room-meta .value {
  font-weight: 600;
}

.room {
  position: relative;
  height: 640px;
  background: radial-gradient(circle at top, #f8fafc 0%, var(--bg-accent) 60%, #dde5f1 100%);
  border-radius: 18px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.chair-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 24px;
}

.seat {
  width: 110px;
  height: 62px;
  background: linear-gradient(180deg, #e6c4a2 0%, #c79666 100%);
  border-radius: 14px;
  color: #1f2937;
  border: 1px solid rgba(120, 82, 46, 0.45);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  position: relative;
}

.seat::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.seat::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 14px;
  width: 14px;
  height: 12px;
  background: #a87445;
  border-radius: 0 0 6px 6px;
  box-shadow: calc(100% - 28px) 0 0 0 #a87445;
}

.chair-seat {
  background: linear-gradient(180deg, #e2b785 0%, #c08855 100%);
  color: #1f2937;
  border: 1px solid rgba(120, 82, 46, 0.5);
}

.seat-label {
  font-weight: 600;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 1;
}

.gavel-pair {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

.gavel {
  position: relative;
  width: 18px;
  height: 8px;
  background: #8b4a1c;
  border-radius: 3px 3px 4px 4px;
  box-shadow: inset 0 0 0 1px rgba(60, 30, 10, 0.3);
}

.gavel::before {
  content: "";
  position: absolute;
  right: -10px;
  top: 4px;
  width: 12px;
  height: 3px;
  background: #b36a2e;
  border-radius: 4px;
  transform: rotate(18deg);
}

.gavel::after {
  content: "";
  position: absolute;
  left: 2px;
  top: -3px;
  width: 10px;
  height: 6px;
  background: #7a3e16;
  border-radius: 3px;
}

.podium {
  width: 120px;
  height: 68px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 136px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.delegate-ring {
  position: absolute;
  inset: 220px 30px 28px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  align-items: center;
}

.delegate-seat {
  height: 72px;
  background: linear-gradient(180deg, #e6c4a2 0%, #c79666 100%);
  border-radius: 14px;
  border: 1px solid rgba(120, 82, 46, 0.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 8px;
  font-size: 12px;
  position: relative;
}

.delegate-seat::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 8px;
  height: 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
}

.delegate-seat::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 16px;
  width: 14px;
  height: 12px;
  background: #a87445;
  border-radius: 0 0 6px 6px;
  box-shadow: calc(100% - 32px) 0 0 0 #a87445;
}

.delegate-seat.highlight {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--ring);
}

.delegate-name {
  font-weight: 600;
  color: #1f2937;
  z-index: 1;
}

.placard {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 1;
  font-size: 16px;
}

.placard.at-podium {
  position: absolute;
  top: -8px;
  right: -8px;
  transform: scale(1.1);
  background: rgba(245, 158, 11, 0.2);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 6px 12px rgba(245, 158, 11, 0.25);
}

.placard.consulting {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.45);
  color: #15803d;
}

.chair-bubble {
  position: absolute;
  top: 96px;
  right: 26px;
  max-width: 260px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 16px;
  padding: 10px 12px;
  font-size: 12px;
  color: #1f2937;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  z-index: 2;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.actions-panel {
  max-height: 640px;
  overflow-y: auto;
  padding-right: 4px;
}

.setup-panel {
  display: none;
}

.setup-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(200px, 1fr));
  gap: 16px;
  align-items: end;
  margin-bottom: 16px;
}

.setup-bar h3 {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.setup-bar .field {
  margin-bottom: 0;
}

.panel-section {
  background: var(--card);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(6px);
}

.panel-section h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}

select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(248, 250, 252, 0.9);
  color: #0f172a;
}

.subissues ul {
  list-style: disc;
  margin-left: 18px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.is-hidden {
  display: none;
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--secondary);
  color: #0f172a;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.18);
}

.primary {
  background: linear-gradient(120deg, var(--primary), var(--primary-strong));
  color: #ffffff;
}

.secondary {
  background: rgba(254, 243, 199, 0.85);
}

.danger {
  background: var(--danger);
  color: #991b1b;
}

.status-card {
  background: rgba(248, 250, 252, 0.8);
  border-radius: 14px;
  padding: 12px;
  font-size: 13px;
}

.progress {
  height: 8px;
  background: rgba(148, 163, 184, 0.25);
  border-radius: 6px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-large {
  height: 10px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(120deg, var(--primary), #38bdf8);
  transition: width 0.2s ease;
}

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

.button-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-button {
  background: rgba(99, 102, 241, 0.12);
  text-align: left;
}

.muted {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.point-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.point-button {
  background: rgba(226, 232, 240, 0.7);
  text-align: left;
}

.point-select {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  color: #0f172a;
}

.note-notification {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.1);
  color: #166534;
  min-height: 34px;
  display: flex;
  align-items: center;
}

.log {
  height: 180px;
  overflow-y: auto;
  background: rgba(248, 250, 252, 0.8);
  border-radius: 14px;
  padding: 10px;
  font-size: 12px;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-entry {
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.7);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-message {
  color: #1f2937;
  line-height: 1.35;
}

.log-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
  font-weight: 600;
}

.tag.motion {
  background: rgba(99, 102, 241, 0.15);
  color: #4338ca;
}

.tag.point {
  background: rgba(14, 165, 233, 0.15);
  color: #0369a1;
}

.tag.note {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}

.tag.system {
  background: rgba(148, 163, 184, 0.2);
  color: #64748b;
}

.help {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  color: #4338ca;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  position: relative;
  cursor: pointer;
}

.help:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 24px;
  right: 0;
  background: #0f172a;
  color: #f8fafc;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  width: 200px;
  z-index: 10;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: rgba(255, 255, 255, 0.95);
  padding: 20px;
  border-radius: 18px;
  width: min(420px, 90vw);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(226, 232, 240, 0.7);
}

.modal-actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.modal-actions button {
  flex: 1;
  min-width: 120px;
}
