/* Administration console — dense, calm, operator-first. Same family as
   workspace.css. Meaning-named classes; layered cascade; system stacks. */

  .admin-main {
    max-width: 860px;
    margin: 0 auto;
    padding: 48px 20px 96px;
  }

  .admin-title {
    font-size: clamp(1.6rem, 4vw, 2.1rem);
    margin: 0 0 6px;
  }

  .admin-lede {
    color: color-mix(in srgb, currentColor 62%, transparent);
    margin: 0 0 32px;
  }

  .admin-section {
    margin: 0 0 40px;
  }

  .admin-section > h2 {
    font-size: 1.15rem;
    margin: 0 0 10px;
  }

  .admin-note {
    font-size: 0.9rem;
    color: color-mix(in srgb, currentColor 60%, transparent);
    margin: 0 0 12px;
  }

  .mono-inline {
    font-family: ui-monospace, monospace;
    font-size: 0.85em;
  }

  .admin-prompt {
    border: 1px dashed color-mix(in srgb, currentColor 30%, transparent);
    border-radius: 14px;
    padding: 36px 24px;
    text-align: center;
  }

  .admin-identity {
    border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
    border-radius: 12px;
    padding: 14px 16px;
  }

  .admin-inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 14px;

    & .admin-field { flex: 1 1 200px; }
  }

  .admin-field {
    font: inherit;
    padding: 9px 12px;
    border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    min-width: 0;
  }

  .admin-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
  }

  .admin-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
    border-radius: 10px;
    padding: 10px 14px;

    & .admin-ref {
      font: 0.8rem/1.4 ui-monospace, monospace;
      overflow-wrap: anywhere;
    }

    & .admin-tag {
      font-size: 0.75rem;
      font-weight: 600;
      border-radius: 999px;
      padding: 2px 10px;
      background: color-mix(in srgb, currentColor 10%, transparent);
    }

    & .admin-tag[data-kind="admin"] {
      color: #a33327;
      background: color-mix(in srgb, #a33327 14%, transparent);
    }

    & .admin-tag[data-kind="test"] {
      color: #2e6b3f;
      background: color-mix(in srgb, #2e6b3f 14%, transparent);
    }

    & .admin-tag[data-kind="live"] {
      color: #2e6b3f;
      background: color-mix(in srgb, #2e6b3f 14%, transparent);
    }

    & .admin-spacer { margin-inline-start: auto; }

    & .admin-actions {
      display: flex;
      gap: 8px;
      flex-basis: 100%;
    }
  }

  .admin-empty {
    color: color-mix(in srgb, currentColor 58%, transparent);
  }

  .admin-status {
    display: block;
    min-height: 1.5em;
    font-size: 0.92rem;
  }

  .admin-status[data-tone="error"] {
    color: #a33327;
  }

  .viewas-banner {
    border: 2px solid #2e6b3f;
    border-radius: 12px;
    padding: 16px 20px;
    background: color-mix(in srgb, #2e6b3f 12%, transparent);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;

    & p { margin: 0; flex: 1 1 320px; }
  }

  .cp-editor-text {
    width: 100%;
    min-height: 50vh;
    font: 0.85rem/1.5 ui-monospace, monospace;
    padding: 10px;
    border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    box-sizing: border-box;
  }

/* ---------- Webnetes — storefront editor ---------- */

.webnetes-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(360px, 1.1fr);
  gap: 22px;
  align-items: start;
}
.wn-fields-col { display: flex; flex-direction: column; gap: 8px; }
.wn-field { display: flex; flex-direction: column; gap: 3px; }
.wn-field label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--soft); }
.wn-field input, .wn-field textarea {
  font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 7px;
  padding: 6px 9px; outline: none; width: 100%;
}
.wn-field input:focus, .wn-field textarea:focus { border-color: var(--stim-blue, #2D5DA8); }
.wn-field textarea { resize: vertical; }
.wn-story-id {
  margin-top: 10px; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--mark);
  border-top: 1px dashed var(--rule); padding-top: 10px;
}
.wn-preview-col { position: sticky; top: 12px; }
.wn-preview-label { margin-top: 0; }
#wn-preview {
  width: 100%; height: 68vh;
  border: 1px solid var(--rule); border-radius: 10px;
  background: var(--paper);
}
@media (max-width: 980px) { .webnetes-grid { grid-template-columns: 1fr; } #wn-preview { height: 50vh; } }

/* W4: gallery image rows — src · caption · upload · remove */
.wn-gallery-row { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 6px; align-items: center; }
.wn-gallery-row input { min-width: 0; }

/* ---- the Instagram chooser (social-proof layer) ---- */
.wn-ig-add { margin-top: 6px; background: none; border: 1px solid var(--rule); color: var(--ink); padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.wn-ig-panel { margin-top: 8px; border-left: 2px solid var(--accent, #D9C15A); padding-left: 10px; }
.wn-ig-sub { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--soft); margin: 8px 0 4px; }
.wn-ig-media { display: flex; gap: 6px; flex-wrap: wrap; }
.wn-ig-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 1px solid transparent; }
.wn-ig-thumb:hover { border-color: var(--accent, #D9C15A); }
.wn-ig-reels { font-size: 11px; color: var(--soft); margin-top: 4px; }
.wn-ig-fact { margin: 4px 0 2px; font-style: italic; font-size: 12px; color: var(--ink); }
.wn-ig-fact-row { margin-bottom: 6px; }
.wn-ig-fact-actions { display: flex; gap: 6px; }
.wn-ig-use { background: none; border: none; color: var(--accent, #D9C15A); cursor: pointer; font-size: 11px; padding: 0; }
.wn-ig-loading { font-size: 12px; color: var(--soft); }
