#workspace-forms-panel {
  --nf-edge: clamp(14px, 3vw, 24px);
  color: var(--text);
}

#workspace-forms-panel [hidden] { display: none !important; }

.nf-shell {
  display: grid;
  align-content: start;
  gap: 14px;
  max-width: 720px;
  min-width: 0;
  margin-inline: auto;
  padding: var(--nf-edge);
}

.nf-shell :is(h2, h3, p, ul, ol, dl, dd) { margin: 0; }
.nf-shell :is(ul, ol) { padding: 0; list-style: none; }
.nf-top,
.nf-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

#workspace-forms-panel .nf-top {
  justify-content: space-between;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  gap: 12px;
}
.nf-top-detail { gap: 6px; }
#workspace-forms-panel .nf-heading {
  min-width: 0;
  margin: 0;
  color: var(--text);
  font-size: clamp(22px, 4vw, 28px);
  line-height: 1.12;
  letter-spacing: -.035em;
  font-weight: 680;
  text-transform: none;
  overflow-wrap: anywhere;
}

.nf-section-title { font-size: 15px; font-weight: 670; }
.nf-shell .nf-muted { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.nf-shell .nf-status { color: var(--muted); font-size: 13px; }
.nf-shell .nf-status:empty { height: 0; margin-block-start: -14px; }
.nf-shell .nf-status[data-kind="error"] { color: var(--err); }
.nf-shell .nf-status[data-kind="success"] { color: var(--accent2); }

#workspace-forms-panel :is(.nf-button, .nf-tab, .nf-row) {
  min-height: 42px;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#workspace-forms-panel .nf-primary {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 20%, var(--panel));
  color: var(--text);
}

#workspace-forms-panel :is(.nf-button, .nf-tab, .nf-row):hover:enabled {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
}

.nf-shell :is(button, a, select, input, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nf-shell button:disabled { cursor: default; opacity: .52; }
#workspace-forms-panel .nf-back { padding-inline: 0; border-color: transparent; background: transparent; }
.nf-shell .nf-back::before { content: "‹"; margin-inline-end: 6px; font-size: 17px; line-height: 0; }
#workspace-forms-panel .nf-add { justify-self: start; border-style: dashed; }
.nf-pill {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 620;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 7px;
}

.nf-shell .nf-list { display: grid; gap: 6px; }
#workspace-forms-panel .nf-row {
  width: 100%;
  text-align: start;
  padding: 12px;
  display: grid;
  gap: 2px;
}

.nf-row strong { font-size: 15px; font-weight: 660; }
.nf-empty {
  display: grid;
  gap: 5px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 9px;
}

.nf-empty h3 { font-size: 15px; }
.nf-empty p, .nf-wait { color: var(--muted); font-size: 13px; }
.nf-wait { padding: var(--nf-edge); }

.nf-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

#workspace-forms-panel .nf-tab {
  flex: 1 1 auto;
  background: transparent;
  border-color: transparent;
  padding-inline: 6px;
  border-end-start-radius: 0;
  border-end-end-radius: 0;
  color: var(--muted);
  border-bottom-width: 2px;
}

#workspace-forms-panel .nf-tab[aria-pressed="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.nf-editor,
.nf-question,
.nf-responses,
.nf-sharing,
.nf-preview,
.nf-visibility {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
}

.nf-control {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  font-size: 13px;
}

.nf-control-name { font-weight: 620; overflow-wrap: anywhere; }
.nf-shell .nf-control :is(input, select, textarea) {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: var(--bg);
  color: var(--text);
}

.nf-shell textarea { resize: vertical; }
.nf-shell .nf-question {
  padding: 8px 13px 13px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
}

.nf-question legend { padding: 0 5px; color: var(--muted); font-size: 12px; font-weight: 630; }
.nf-question-settings {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.nf-shell .nf-check {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 42px;
  font-size: 13px;
}

.nf-check input { width: 16px; height: 16px; accent-color: var(--accent); }
.nf-question-actions { gap: 5px; }
#workspace-forms-panel .nf-question-actions .nf-button { background: transparent; }
.nf-visibility { grid-template-columns: repeat(auto-fit, minmax(min(118px, 100%), 1fr)); gap: 8px; }

.nf-sharing { border-top: 1px solid var(--line); padding-block-start: 14px; }
.nf-sharing .nf-view-link { color: var(--accent); justify-self: start; font-size: 13px; }
.nf-confirm {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent);
  border-radius: 7px;
  background: var(--panel);
  font-size: 13px;
}

.nf-preview {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  padding: clamp(14px, 4vw, 22px);
  gap: 16px;
}

.nf-preview h3 { font-size: 22px; letter-spacing: -.02em; line-height: 1.22; overflow-wrap: anywhere; }
.nf-preview p { white-space: pre-wrap; }
.nf-responses > .nf-button { justify-self: start; }
.nf-shell .nf-response-list { display: grid; gap: 10px; }
.nf-response {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  background: var(--panel);
}

.nf-response dl { display: grid; gap: 3px; margin-block-start: 9px; }
.nf-response dt { font-size: 13px; font-weight: 620; overflow-wrap: anywhere; }
.nf-response dd {
  margin-block-end: 7px;
  font-size: 14px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  #workspace-forms-panel :is(.nf-button, .nf-tab, .nf-row, .nf-control input, .nf-control select, .nf-control textarea) {
    min-height: 44px;
  }
  .nf-shell .nf-control :is(input, select, textarea) { font-size: 16px; }
}

.nf-preview .nf-button { justify-self: start; }
.nf-preview .nf-test-confirmation { color: var(--accent2); }
