/* SpaceGram 3.1 core surfaces: panels, overlays, rows, call "More" sheet.
   Colours only from theme variables (themes.css). */

.sg-panel {
  position: fixed;
  top: var(--lg-edge-top, 0px);
  right: 0;
  bottom: var(--lg-edge-bottom, 0px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  background: var(--surface);
  color: var(--text);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: sg-slide-in 0.2s var(--ease, ease) both;
}
.sg-panel-wide { width: min(720px, 100vw); }
.sg-over-call.sg-panel,
.sg-over-call.sg-overlay { z-index: 2050; }

@media (max-width: 900px) {
  .sg-panel,
  .sg-panel-wide {
    left: 0;
    width: 100vw;
    border-left: 0;
  }
}

.sg-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.sg-panel-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sg-panel-actions { display: flex; gap: 4px; }
.sg-panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px 24px;
  overscroll-behavior: contain;
}
.sg-panel-foot {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
}

.sg-overlay {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: flex;
  flex-direction: column;
  padding: var(--lg-edge-top, 0px) var(--lg-edge-right, 0px) var(--lg-edge-bottom, 0px) var(--lg-edge-left, 0px);
  background: var(--bg-root);
  color: var(--text);
}

.sg-section { margin: 0 0 18px; }
.sg-section-title {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.sg-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.sg-row:last-child { border-bottom: 0; }
.sg-row-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}
.sg-row-label { font-size: 15px; }
.sg-row-hint { color: var(--muted); font-size: 12px; line-height: 1.4; }
.sg-row select {
  max-width: 50%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  background: var(--input-bg, var(--surface-2));
  color: var(--text);
  font: inherit;
}

.sg-empty,
.sg-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 12px;
  color: var(--muted);
  text-align: center;
}
.sg-error p { margin: 0; color: var(--danger); }
.sg-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: sg-spin 0.8s linear infinite;
}
.sg-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* call "More" sheet (WP0b) */
.sg-call-tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.sg-call-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 72px;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.sg-call-tool:hover { background: var(--hover); }

@keyframes sg-slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sg-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .sg-panel { animation: none; }
}

.sg-call-sheet {
  position: absolute;
  right: 12px;
  bottom: 96px;
  left: 12px;
  z-index: 5;
  max-width: 420px;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 20px);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
