/* selection highlight for two-click add */
.grid .tile.selected {
  outline: 3px solid #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.25);
}

:root {
  /* Colors */
  --bg: #A3B1A4;
  --surface: #FFFFFF;
  --ink: #2D2A26;
  --muted: #A3B1A4;
  --acc: #718472;
  --live: #718472;

  /* Typography */
  --font-family: 'Inter', sans-serif;
  --font-weight-normal: 400;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Spacing */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;

  /* Radius & Shadow */
  --radius: 14px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-family);
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2);
  background-color: var(--surface);
}

.logo {
  height: 32px;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  background-color: var(--live);
  color: white;
  padding: var(--space-1) var(--space-2);
  border-radius: 999px;
  font-weight: var(--font-weight-semibold);
}

.dot {
  width: 8px;
  height: 8px;
  background-color: white;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.canvas {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
  min-height: 0;
}

.upper {
  flex: 1.0;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-2);
  min-height: 0;
}

.video-panel {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-2);
  min-height: 0;
}

.order-panel {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.video-panel {
  position: relative;
}

#remoteVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

.pip {
  position: absolute;
  bottom: var(--space-2);
  left: var(--space-2);
  width: 90px;
  height: 120px;
  border: 2px solid white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 10;
  transform: scaleX(-1);
  object-fit: cover;
}

.order-panel .billCard{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:var(--space-2);display:flex;flex-direction:column;flex:1;min-height:0}
.order-panel .billHead{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;padding-top:0;margin-top:0}
.order-panel .billItems{list-style:none;margin:0;padding:0;flex:1;overflow-y:auto}
.order-panel .billItems li{display:grid;grid-template-columns:40px 1fr auto;gap:8px;align-items:center;padding:4px 0;border-bottom:1px dashed rgb(157, 149, 149)}
.order-panel .billItems img{width:40px;height:40px;border-radius:8px;object-fit:cover}
.order-panel .billFoot{margin-top:10px;display:flex;flex-direction:column;gap:6px}
.order-panel .billFoot .row{display:flex;justify-content:space-between}
.order-panel .billFoot .row.total{font-weight:700}

.menu {
  flex: 2;
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tabs {
  flex-shrink: 0;
  display: flex;
  gap: var(--space-2);
  border-bottom: 1px solid var(--muted);
}

.tab {
  background: none;
  border: none;
  padding: var(--space-1) 0;
  font-size: 16px;
  font-weight: var(--font-weight-semibold);
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  color: var(--ink);
  border-bottom: 3px solid var(--acc);
}

.grid {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: var(--space-2);
  padding-top: var(--space-2);
  min-height: 0;
  overflow-y: auto;
}

.tile {
  background-color: white;
  border: 1px solid var(--muted);
  border-radius: var(--radius);
  padding: var(--space-1);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tile:hover {
  border-color: var(--ink);
}

.tile img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius);
}

.name {
  font-weight: var(--font-weight-semibold);
  margin-top: var(--space-1);
  flex-grow: 1;
}

.price {
  color: var(--muted);
  font-weight: var(--font-weight-bold);
}

@media (max-width: 768px) {
  .canvas {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
  }

  .upper {
    flex: 1;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-1);
  }

  .menu {
    flex: 2;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-1);
  }

  .topbar {
    padding: var(--space-1);
  }

  .logo {
    height: 24px;
  }

  .live-pill {
    padding: 4px 8px;
    font-size: 12px;
  }

  .tab {
    font-size: 14px;
    padding: 6px 0;
  }

  .tile {
    padding: 4px;
  }

  .name {
    font-size: 13px;
  }

  .price {
    font-size: 12px;
  }

  .video-panel, .order-panel, .menu {
    padding: var(--space-1);
  }

  .billHead h3 {
    font-size: 16px;
  }
  .order-panel .billItems img {
    display: none;
  }
  .order-panel .billItems li {
    grid-template-columns: 1fr auto;
    font-size: 12px;
  }
  .order-panel .billFoot {
    font-size: 13px;
  }
}

