:root {
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      background: #f5f5f7;
      color: #111827;
    }

    .app {
      max-width: 1200px;
      margin: 0 auto;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    header {
      padding: 1rem 1.5rem;
      background: #111827;
      color: #f9fafb;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
    }

    header h1 {
      font-size: 1.1rem;
      margin: 0;
      font-weight: 600;
    }

    header .subtitle {
      font-size: 0.85rem;
      opacity: 0.9;
    }

    main {
      flex: 1;
      display: grid;
      grid-template-columns: 2fr 1fr;
      gap: 1rem;
      padding: 1rem;
    }

    @media (max-width: 900px) {
      main {
        grid-template-columns: 1fr;
      }
    }

    /* Seating chart */

    .chart-card {
      background: #ffffff;
      border-radius: 0.75rem;
      padding: 1rem;
      box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }

    .chart-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;
    }

    .chart-header h2 {
      margin: 0;
      font-size: 0.95rem;
      font-weight: 600;
    }

    .chip {
      border-radius: 999px;
      padding: 0.25rem 0.7rem;
      font-size: 0.8rem;
      background: #e5e7eb;
      color: #111827;
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
    }

    .chip span.label {
      font-weight: 500;
    }

    .chart-container {
      position: relative;
      flex: 1;
      min-height: 520px;
      border-radius: 0.75rem;
      border: 1px solid #e5e7eb;
      background: radial-gradient(circle at top, #f9fafb, #e5e7eb);
      overflow: hidden;
      padding: 1rem;
    }

    #seating-chart {
      position: relative;
      width: 100%;
      height: 100%;
    }

    .seat {
      position: absolute;
      width: 32px;
      height: 32px;
      border-radius: 999px;
      border: 2px solid #9ca3af;
      background: #f9fafb;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.7rem;
      cursor: pointer;
      transition: box-shadow 0.18s ease, transform 0.18s ease, border-color 0.18s ease,
        background 0.18s ease;
    }

    .seat:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
    }

    .seat[data-occupied="false"] {
      background: repeating-linear-gradient(
        45deg,
        #e5e7eb,
        #e5e7eb 4px,
        #f9fafb 4px,
        #f9fafb 8px
      );
      border-style: dashed;
      color: #9ca3af;
    }

    .seat-label {
      pointer-events: none;
    }

    .seat--highlight-group {
      border-color: #f97316;
      box-shadow: 0 0 0 4px rgba(248, 171, 84, 0.6);
      background: #fffbeb;
      z-index: 2;
    }

    .seat--highlight-individual {
      border-color: #2563eb;
      box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.7);
      background: #eff6ff;
      z-index: 3;
      transform: scale(1.08);
    }

    .instructor-desk {
      position: absolute;
      width: 80px;
      height: 36px;
      border-radius: 0.5rem;
      border: 2px dashed #9ca3af;
      background: rgba(248, 250, 252, 0.9);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 0.7rem;
      color: #6b7280;
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
    }

    .screen-label {
      position: absolute;
      top: 4px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 0.75rem;
      color: #4b5563;
      letter-spacing: 0.05em;
      text-transform: uppercase;
    }

    /* Sidebar */

    .sidebar {
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }

    .panel {
      background: #ffffff;
      border-radius: 0.75rem;
      padding: 0.8rem 0.9rem;
      box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      font-size: 0.82rem;
    }

    .panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.5rem;
    }

    .panel-header h3 {
      margin: 0;
      font-size: 0.85rem;
      font-weight: 600;
    }

    .panel-header small {
      color: #6b7280;
      font-size: 0.7rem;
    }

    .field-row {
      display: flex;
      gap: 0.4rem;
      align-items: center;
    }

    .field-row input[type="text"],
    .field-row input[type="number"],
    .field-row select {
      flex: 1;
      padding: 0.35rem 0.5rem;
      border-radius: 0.45rem;
      border: 1px solid #d1d5db;
      font-size: 0.8rem;
      outline: none;
    }

    .field-row input:focus,
    .field-row select:focus {
      border-color: #2563eb;
      box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
    }

    button {
      border: none;
      border-radius: 0.45rem;
      padding: 0.35rem 0.7rem;
      font-size: 0.8rem;
      cursor: pointer;
      background: #2563eb;
      color: #f9fafb;
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
      white-space: nowrap;
      transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.12s ease;
    }

    button.secondary {
      background: #e5e7eb;
      color: #111827;
    }

    button.outline {
      background: transparent;
      border: 1px solid #d1d5db;
      color: #111827;
    }

    button:active {
      transform: translateY(1px);
      box-shadow: none;
    }

    .roster-list {
      max-height: 140px;
      overflow: auto;
      border-radius: 0.5rem;
      border: 1px solid #e5e7eb;
      background: #f9fafb;
      padding: 0.4rem 0.5rem;
    }

    .roster-item {
      padding: 0.25rem 0.15rem;
      border-bottom: 1px solid #e5e7eb;
      display: flex;
      flex-direction: column;
      gap: 0.1rem;
    }

    .roster-item:last-child {
      border-bottom: none;
    }

    .roster-item span.name {
      font-weight: 500;
      font-size: 0.8rem;
    }

    .roster-item span.meta {
      font-size: 0.75rem;
      color: #6b7280;
    }

    .info-grid {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 0.2rem 0.5rem;
      font-size: 0.8rem;
    }

    .badge {
      border-radius: 999px;
      padding: 0.15rem 0.45rem;
      font-size: 0.72rem;
      background: #eef2ff;
      color: #3730a3;
      display: inline-flex;
      align-items: center;
      gap: 0.25rem;
    }

    .toggle-row {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      font-size: 0.8rem;
    }

    .toggle-row input[type="checkbox"] {
      width: 16px;
      height: 16px;
    }

    .note {
      font-size: 0.72rem;
      color: #6b7280;
    }

    .pill-row {
      display: flex;
      flex-wrap: wrap;
      gap: 0.35rem;
    }

    .pill {
      border-radius: 999px;
      padding: 0.15rem 0.45rem;
      font-size: 0.7rem;
      border: 1px solid #d1d5db;
      background: #f9fafb;
    }
      /* Fullscreen mode (projector-friendly) */
    .fullscreen-mode header,
    .fullscreen-mode .sidebar {
      display: none !important;
    }

    .fullscreen-mode .app {
      max-width: none;
      margin: 0;
    }

    .fullscreen-mode main {
      grid-template-columns: 1fr !important;
      padding: 0.5rem !important;
      height: 100vh;
    }

    .fullscreen-mode .chart-card {
      height: calc(100vh - 1rem);
    }

    .fullscreen-overlay {
      position: absolute;
      top: 0.75rem;
      left: 50%;
      transform: translateX(-50%);
      z-index: 50;
      width: min(760px, calc(100% - 1.5rem));
      pointer-events: auto;
    }

    .fullscreen-overlay-inner {
      display: flex;
      gap: 0.5rem;
      align-items: center;
      padding: 0.6rem 0.75rem;
      border-radius: 0.85rem;
      background: rgba(255, 255, 255, 0.92);
      box-shadow: 0 14px 35px rgba(15, 23, 42, 0.18);
      border: 1px solid rgba(226, 232, 240, 0.9);
      backdrop-filter: blur(8px);
    }

    .fullscreen-overlay-inner input {
      flex: 1;
      padding: 0.55rem 0.7rem;
      font-size: 0.9rem;
    }
      /* Pan + Zoom */
    .chart-toolbar{
      margin-top: 0.6rem;
      display:flex;
      gap:0.45rem;
      align-items:center;
      flex-wrap:wrap;
    }
    .chart-toolbar button{
      padding: 0.3rem 0.6rem;
      font-size: 0.8rem;
    }
    .chart-container{
      overflow: auto;
      cursor: grab;
      -webkit-overflow-scrolling: touch;
    }
    .chart-container.dragging{
      cursor: grabbing;
    }
    #seating-chart{
      transform-origin: 0 0;
      will-change: transform;
    }
      /* Pan + Zoom (stable translate+scale) */
    .chart-container { cursor: grab; touch-action: none; }
    .chart-container.dragging { cursor: grabbing; }
    #seating-chart { transform-origin: 0 0; }
