.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
  position: relative;
}

.workspace-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background-color: var(--bg);
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 24px 24px;
}

.workspace-spinner {
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--spinner-track);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.workspace-loading-label {
  font-family: var(--font-mono);
  font-size: var(--fs-body-lg);
  color: var(--muted);
  letter-spacing: 0.08em;
}

.app-empty {
  padding: 2rem 1rem;
  font-family: var(--font-mono);
  font-size: var(--fs-title-sm);
  color: var(--muted);
  text-align: center;
  line-height: 1.7;

  /* centering */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.app {
  width: 100%;
  max-width: 100%;
  padding: 2rem 2rem 2rem 2rem;
  padding-right: 2rem;
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.workspace-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: flex-end;
  background: transparent;
  pointer-events: none;
}

.workspace-footer-content {
  pointer-events: auto;
  padding: 0.35rem 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--fs-label-xs);
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--bg);
}

.workspace-footer .copyright-symbol {
  font-size: 1.1em;
  vertical-align: baseline;
}

/* region ── Layout ─────────────────────────────────────────────────────────── */
.main-layout {
  display: flex;
  gap: 1.5rem;
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - 8rem);
  position: relative;
}

.left-col {
  display: flex;
  flex-direction: column;
  flex: 0 0 820px;
  min-width: 500px;
  gap: 1.5rem;
  position: relative;
}

.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.btn-play {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  justify-content: center;
  font-size: var(--fs-content);
  color: var(--accent);
  flex-shrink: 0;
}

.btn-play:hover {
  background: var(--accent-subtle);
  box-shadow: 0 0 16px var(--accent-border);
}


.project-title-bar {
  flex-shrink: 0;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.project-title-bar .title-left {
  flex: 1;
  min-width: 0;
}

.project-server-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.project-cloud-badge {
  display: inline-flex;
  align-items: center;
  height: 32px;
  box-sizing: border-box;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid;
  white-space: nowrap;
  opacity: 0.85;
}
.project-cloud-badge.local {
  color: var(--muted);
  border-color: var(--muted-border);
}
.project-cloud-badge.server {
  color: var(--accent2);
  border-color: var(--accent2-border);
  background: var(--accent2-faint);
}
.project-cloud-badge.modified {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-faint);
}
.project-cloud-badge.uploading {
  color: var(--muted);
  border-color: var(--muted-border);
}
.project-cloud-badge.mode-owner {
  color: var(--muted);
  border-color: var(--muted-border);
}
.project-cloud-badge.mode-editor {
  color: var(--accent2);
  border-color: var(--accent2-border);
  background: var(--accent2-faint);
}
.project-cloud-badge.mode-readonly {
  color: #ff9999;
  border-color: rgba(255, 119, 119, 0.4);
  background: rgba(255, 119, 119, 0.05);
}

.project-header-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.project-header-actions .sample-btn {
  height: 32px;
  box-sizing: border-box;
  padding: 0 10px;
  border-radius: 5px;
  font-size: var(--fs-label);
}

.header-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
  opacity: 0.75;
}
.header-action-btn:hover {
  border-color: var(--border);
  background: var(--hover-overlay);
  opacity: 1;
}
.header-action-btn:disabled {
  opacity: 0.22;
  cursor: default;
}
.header-action-btn:disabled:hover {
  border-color: transparent;
  background: transparent;
  opacity: 0.22;
}
.header-action-btn.active {
  border-color: var(--accent-border);
  background: var(--accent-subtle);
  opacity: 1;
}
.header-action-btn.active:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
}
.header-action-btn img {
  display: block;
  width: 17px;
  height: 17px;
}

.header-action-btn.uploading {
  cursor: default;
  opacity: 0.65;
}
.header-action-btn.uploading img {
  display: none;
}
.header-action-btn.uploading::after {
  content: '';
  display: block;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--spinner-track);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.project-push-btn {
  font-family: var(--font-mono);
  font-size: var(--fs-secondary);
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--accent-border);
  background: var(--accent-faint);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.project-push-btn:hover {
  background: var(--accent-subtle);
  border-color: var(--accent);
}

.project-title {
  font-family: var(--font-mono);
  font-size: var(--fs-title-lg);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
  cursor: text;
  border-radius: 3px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background 0.15s;
  display: inline-block;
}
.project-title:hover { background: var(--hover-overlay); }

.project-title-input {
  font-family: var(--font-mono);
  font-size: var(--fs-title-lg);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1.5px solid var(--accent);
  outline: none;
  padding: 2px 4px;
  margin: -2px -4px;
  width: 100%;
  max-width: 600px;
}

/* Shared styles for editable speaker name — used in legend and transcript */
.speaker-name {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 2px;
  padding: 1px 3px;
  margin: -1px -3px;
  transition: background 0.15s;
}

.speaker-name:hover { background: var(--hover-overlay); }

.speaker-name-input {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: var(--text);
  outline: none;
  padding: 1px 4px;
  width: 10em;
}

/* Override transcript speaker-label to use same editable style */
.speaker-label {
  font-family: var(--font-mono);
  font-size: var(--fs-secondary);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 0.5rem;
  padding: 0.2rem 0;
}