.fm-main { padding-block: 24px 64px; }

.fm-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 20px;
}
.fm-topbar h1 { font-size: 26px; line-height: 1.2; }
.fm-topbar p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.fm-topbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.license-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
}
.license-pill.is-pro {
  background: #e8f3ef;
  border-color: #9ec9b9;
  color: var(--green-dark);
}

.button-secondary {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.button-secondary:hover { border-color: var(--green); color: var(--green-dark); }
.button-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.button-small { min-height: 31px; padding: 4px 10px; font-size: 12px; }
.button-compact { min-height: 38px; padding: 7px 16px; font-size: 13px; cursor: pointer; }
.button:disabled { opacity: 0.55; cursor: not-allowed; }

.fm-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 310px;
  gap: 18px;
  align-items: start;
}

.fm-panel {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.panel-header h2 { font-size: 16px; font-weight: 650; }
.panel-sub { font-size: 12px; color: var(--muted); }

.group + .group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.group-title {
  font-size: 11.5px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}

.field-stack { display: flex; flex-direction: column; gap: 10px; }
.field-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.row-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.select-input,
.text-input {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-family: inherit;
}

.dropzone {
  border: 1.5px dashed #9ab5aa;
  border-radius: 6px;
  padding: 16px 12px;
  text-align: center;
  background: #f9fbfa;
  cursor: pointer;
}
.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--green);
  background: #edf6f3;
}
.dropzone strong { display: block; font-size: 13.5px; color: var(--ink); }
.dropzone span { font-size: 12px; color: var(--muted); }
.sr-only-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.queue-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.queue-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
}
.queue-item.is-active {
  border-color: var(--green);
  background: #eef6f3;
}
.queue-meta { min-width: 0; }
.queue-name {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-dims { font-size: 11px; color: var(--muted); }
.queue-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 2px 5px;
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.scene-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.scene-btn.is-active {
  border-color: var(--green);
  background: #ebf5f1;
}
.scene-btn-title { font-size: 12px; font-weight: 650; color: var(--ink); }
.scene-btn-tag { font-size: 10.5px; color: var(--muted); }
.scene-btn-tag.is-pro { color: #8c5a00; font-weight: 600; }

.mockup-stage {
  background: #ebefed;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
}
.mockup-canvas {
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  background: #fff;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.12);
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  cursor: pointer;
}

.scene-checks {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.export-cta { width: 100%; cursor: pointer; }
.export-sub-cta { width: 100%; margin-top: 8px; }

.notice-box {
  margin-top: 10px;
  padding: 9px 11px;
  border-radius: 5px;
  font-size: 12.5px;
  line-height: 1.45;
}
.notice-info { background: #eef6f3; border: 1px solid #b6d6c9; color: #134d3e; }
.notice-error { background: #fdf0f0; border: 1px solid #e6b8b8; color: #8b2626; }
.notice-pro { background: #fff9eb; border: 1px solid #e8d094; color: #694400; }
.notice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.workspace-toast { margin-bottom: 14px; }

.feature-bullets {
  margin: 12px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.studio-dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  max-width: 520px;
  width: calc(100% - 28px);
}
.dialog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.close-dialog {
  border: none;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
  color: var(--muted);
}
.studio-dialog-body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.dialog-section h3 { margin: 0 0 6px; font-size: 15px; }
.dialog-section p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.key-row { display: flex; gap: 8px; }
.dialog-btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.device-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.device-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; padding: 6px 8px; background: var(--soft); border-radius: 4px; }

@media (max-width: 1020px) {
  .fm-grid { grid-template-columns: 1fr; }
  .scene-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
