.ops-body {
  background: #f8f5ef;
  color: #343b33;
  font-size: 16px;
  margin: 0;
}
.ops-body * {
  box-sizing: border-box;
}
.ops-body #workbench {
  max-width: 720px;
  margin: auto;
  padding: 16px 16px calc(100px + env(safe-area-inset-bottom));
}
.ops-header,
.ops-row,
.ops-tools,
.ops-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ops-header {
  justify-content: space-between;
  padding: 4px 0 18px;
}
.ops-header a {
  color: #385944;
  text-decoration: none;
}
.ops-breadcrumb {
  gap: 5px;
  font-size: 13px;
}
.ops-breadcrumb button {
  padding: 6px;
  min-height: 36px;
}
.ops-body h1 {
  font-size: 24px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  margin: 16px 0 8px;
}
.ops-body h2 {
  font-size: 19px;
}
.ops-body h3 {
  font-size: 16px;
}
.ops-body button,
.ops-body .upload-button,
.ops-body a.subtle {
  font: inherit;
  min-height: 44px;
  white-space: normal;
}
.ops-body .link,
.ops-body small,
.ops-hint {
  font-size: 13px;
}
.ops-status {
  min-height: 36px;
  line-height: 1.5;
  font-size: 14px;
  color: #36533c;
  overflow-wrap: anywhere;
}
.ops-tools {
  gap: 4px;
  margin-bottom: 12px;
}
.ops-tools button {
  padding: 7px;
}
.ops-panel {
  padding: 18px;
  border-radius: 18px;
}
.ops-panel fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.ops-body .editor-field {
  margin-bottom: 18px;
  min-width: 0;
  flex: 1;
}
.ops-body input:not([type='checkbox']),
.ops-body textarea,
.ops-body select {
  font-size: 16px;
  width: 100%;
  min-width: 0;
}
.ops-body textarea {
  line-height: 1.6;
}
.ops-media {
  border-top: 1px solid #e1e6dd;
  padding: 8px 0 20px;
}
.ops-body audio {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 12px 0;
}
.ops-body audio[hidden] {
  display: none;
}
.ops-image {
  width: 100px;
  max-width: 100%;
  border-radius: 12px;
}
.ops-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: #f6f8f2;
  border: 1px solid #e0e6da;
  border-radius: 12px;
  padding: 14px;
  margin: 8px 0;
  color: inherit;
  overflow-wrap: anywhere;
}
.ops-item small {
  display: block;
  margin-top: 5px;
  color: #63705c;
}
.ops-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 720px;
  display: flex;
  gap: 8px;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  background: #fffdf8;
  border-top: 1px solid #dfdfd4;
  z-index: 2;
}
.ops-footer button {
  flex: 1;
  padding: 10px 5px;
  font-size: 14px;
}
.ops-body dialog {
  width: calc(100% - 24px);
  max-width: 620px;
  max-height: 88dvh;
  overflow: auto;
  padding: 20px;
  border: 0;
  border-radius: 20px;
  color: inherit;
}
.ops-body dialog::backdrop {
  background: #17231988;
}
.ops-body dialog pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
}
/* The recorder also opens inside the parent-interface editor, outside .ops-body. */
dialog.ops-recorder {
  inset: max(12px, env(safe-area-inset-top, 0px)) 0 max(12px, env(safe-area-inset-bottom, 0px));
  margin: auto;
  width: min(560px, calc(100% - 24px));
  height: fit-content;
  max-height: calc(
    100dvh - max(12px, env(safe-area-inset-top, 0px)) - max(12px, env(safe-area-inset-bottom, 0px))
  );
  padding: 18px;
  border: 0;
  border-radius: 18px;
  overflow: auto;
  background: #fffdf8;
  color: #343b33;
  font-size: 16px;
  line-height: 1.5;
}
.ops-recorder [hidden] {
  display: none !important;
}
.ops-recorder p {
  margin: 10px 0;
}
.ops-record-header {
  position: sticky;
  top: -18px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -18px -18px 12px;
  padding: 12px 18px;
  background: #fffdf8;
  border-bottom: 1px solid #e1e6dd;
}
.ops-record-header h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}
.ops-recorder button,
.ops-recorder a.subtle {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  width: auto;
  padding: 10px 14px;
  border: 1px solid #cedbd1;
  border-radius: 10px;
  background: #f2f7f3;
  color: #2f5d50;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}
.ops-record-header [data-record-close] {
  flex: none;
  white-space: nowrap;
}
.ops-recorder .primary {
  border-color: #2f5d50;
  background: #2f5d50;
  color: white;
}
.ops-recorder audio {
  display: block;
  width: 100%;
  margin: 12px 0;
}
.ops-recorder meter {
  width: 100%;
  height: 20px;
}
.ops-record-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ops-record-buttons [hidden] {
  display: none;
}
.ops-time {
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}
.ops-native-mic,
.ops-mic {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
  font-size: 14px;
}
.ops-native-mic select,
.ops-native-recovery select,
.ops-mic select {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  font: inherit;
  border-radius: 10px;
}
.ops-mic-ios {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff1d6;
  color: #614211;
  font-size: 14px;
}
.ops-mic[hidden],
.ops-raw[hidden],
.ops-mic-ios[hidden] {
  display: none;
}
.ops-mic-current {
  margin: 4px 0;
  font-size: 13px;
  font-weight: 600;
}
.ops-mic-external {
  color: #167342;
  font-weight: 700;
}
.ops-mic-internal {
  color: #805320;
}
.ops-native-recovery[hidden] {
  display: none;
}
.ops-raw {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.ops-pending {
  width: 100%;
  padding: 12px;
  border: 1px solid #dfbd7e;
  border-radius: 12px;
  background: #fff1d6;
  color: #614211;
  margin-bottom: 12px;
}
.ops-body details {
  margin: 16px 0;
}
.ops-body summary {
  cursor: pointer;
  min-height: 40px;
  font-size: 14px;
}
.ops-body .upload-button {
  padding: 10px 14px;
}
.ops-body .panel {
  overflow: visible;
}
.ops-body .ops-row > a {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.ops-body [role='alert'] {
  color: #8e3529;
}
@media (max-width: 350px) {
  .ops-body #workbench {
    padding-left: 10px;
    padding-right: 10px;
  }
  .ops-panel {
    padding: 13px;
  }
  .ops-body h1 {
    font-size: 22px;
  }
  .ops-footer {
    gap: 5px;
  }
  .ops-footer button {
    font-size: 13px;
  }
  .ops-header {
    gap: 4px;
  }
  .ops-header button {
    font-size: 13px;
  }
}

.ops-image-dialog,
.ops-asset-dialog {
  width: min(94vw, 520px);
  padding: 22px;
  border: 0;
  border-radius: 20px;
  max-height: 90vh;
  overflow: auto;
  color: #293d38;
  background: #faf7ef;
}
.ops-image-dialog canvas {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px auto;
  border-radius: 12px;
}
.ops-image-dialog input[type='range'] {
  width: 100%;
  min-height: 40px;
  padding: 0;
}
.ops-asset-list {
  max-height: 55vh;
  overflow: auto;
}
.ops-asset {
  margin: 10px 0;
  padding: 12px;
  overflow-wrap: anywhere;
}
.ops-asset audio,
.ops-timeline audio {
  width: 100%;
}
.ops-asset img {
  max-height: 180px;
}
.ops-timeline {
  margin-top: 24px;
}
.ops-next-step {
  margin: 12px 0 24px;
  padding: 16px;
  border: 1px solid #cbd8c4;
  border-radius: 14px;
  background: #f0f5e9;
}
.ops-next-step h2 {
  margin: 0 0 8px;
}
.ops-next-step p {
  line-height: 1.6;
  margin: 0 0 12px;
}
.ops-next-step button {
  width: 100%;
}
.ops-timeline > img {
  margin-top: 12px;
}
.ops-timeline > .ops-image,
.ops-story-preview .ops-image {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
}
.support-admin-body .support-fields {
  display: grid;
  gap: 14px;
}
.support-admin-body .support-fields input,
.support-admin-body .support-fields textarea,
.support-admin-body .support-fields select {
  font-size: 16px;
  min-width: 0;
  width: 100%;
}
.support-admin-body .support-faq-row {
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #e6e0d6;
}
.support-admin-body .support-publish {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 0;
  background: #f8f5ef;
}
.support-answer {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* One clear recording action, with recovery/export actions on their own rows. */
.ops-recorder .ops-record-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.ops-record-buttons > * {
  min-width: 0;
  width: 100%;
  justify-content: center;
  text-align: center;
}
.ops-recorder [data-record-start],
.ops-recorder [data-record-stop],
.ops-recorder [data-record-use] {
  grid-column: 1 / -1;
  min-height: 54px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 650;
}
.ops-recorder [data-record-stop] {
  background: #b8403a;
  border-color: #b8403a;
}
.ops-recorder [data-record-start]::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 10px;
}
.ops-recorder [data-record-stop]::before {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: currentColor;
  margin-right: 10px;
}
.ops-recorder [data-record-use] {
  order: -2;
}
.ops-recorder[data-record-state='ready'] [data-record-start] {
  order: -1;
  background: #fff;
  border-color: #dbe2de;
  color: #376553;
  min-height: 48px;
  font-size: 14px;
}
.ops-recorder[data-record-state='ready'] [data-record-start]::before {
  display: none;
}
.ops-recorder [data-record-pause] {
  grid-column: 1 / -1;
}
.ops-recorder [data-record-export],
.ops-recorder [data-record-discard] {
  border-color: transparent;
  padding: 10px 3px;
  font-size: 13px;
  background: #f5f7f5;
}
.ops-recorder audio {
  width: 100%;
  margin-top: 12px;
}
