:root {
  --ed-bg: #0b0908;
  --ed-panel: rgba(255, 249, 242, 0.94);
  --ed-ink: #1a1424;
  --ed-muted: #6f667a;
  --ed-line: rgba(42, 28, 52, 0.12);
  --ed-accent: #7c4dff;
  --ed-accent-ink: #fff;
  --ed-radius: 12px;
  --ed-leather: url("/assets/materials/hm-pebble-leather-tile.jpg");
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: #f7f1e8;
  background-color: #0a0a0a;
  background-image: var(--ed-leather);
  background-size: 384px 480px;
  background-position: 0 0;
  background-repeat: repeat;
  background-attachment: scroll;
}
.ed-top {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  background: rgba(12, 10, 9, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  color: #f7f1e8;
}
.ed-brand { display: flex; gap: .65rem; align-items: center; }
.ed-brand img { border-radius: 8px; }
.ed-brand strong { display: block; font-size: .95rem; }
.ed-brand span { color: rgba(247, 241, 232, 0.62); font-size: .78rem; }
.ed-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.ed-key {
  display: grid;
  gap: .2rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(247, 241, 232, 0.55);
}
.ed-key input {
  font: inherit;
  font-size: .85rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  padding: .45rem .65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  min-width: 10rem;
}
.ed-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 999px;
  padding: .5rem .9rem;
  font: inherit;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  text-decoration: none;
}
.ed-btn-primary {
  background: var(--ed-accent);
  border-color: transparent;
  color: var(--ed-accent-ink);
}
.ed-btn:disabled { opacity: .5; cursor: wait; }
.ed-help {
  margin: 0 0 .75rem;
  padding: .65rem .75rem;
  font-size: .8rem;
  line-height: 1.45;
  color: var(--ed-muted);
  background: rgba(124, 77, 255, 0.06);
  border: 1px solid var(--ed-line);
  border-radius: 10px;
}
.ed-help code {
  font-size: .78em;
  color: var(--ed-ink);
}
.ed-banner {
  margin: 0;
  padding: .65rem 1rem;
  font-size: .85rem;
  color: var(--ed-ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 249, 242, 0.92);
  backdrop-filter: blur(8px);
}
.ed-banner code {
  font-size: .8em;
  background: rgba(124,77,255,.08);
  padding: .1rem .35rem;
  border-radius: 4px;
}
.ed-status {
  margin: 0;
  padding: .55rem 1rem;
  font-size: .88rem;
  font-weight: 600;
  background: #eefbf3;
  color: #0f6b3e;
  border-bottom: 1px solid #bfe8cf;
}
.ed-status.is-error {
  background: #fff1f4;
  color: #b0003a;
  border-color: #f3c0cd;
}
.ed-layout {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  min-height: calc(100vh - 120px);
}
@media (max-width: 960px) {
  .ed-layout { grid-template-columns: 1fr; }
  .ed-preview-wrap { min-height: 60vh; }
}
.ed-panel {
  border-right: 1px solid var(--ed-line);
  background: var(--ed-panel);
  color: var(--ed-ink);
  overflow: auto;
  max-height: calc(100vh - 120px);
  padding-bottom: 2rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ed-panel details {
  border-bottom: 1px solid var(--ed-line);
}
.ed-panel summary {
  cursor: pointer;
  padding: .85rem 1rem;
  font-weight: 700;
  list-style: none;
}
.ed-panel summary em {
  font-weight: 500;
  color: var(--ed-muted);
  font-style: normal;
  font-size: .8rem;
}
.ed-panel summary::-webkit-details-marker { display: none; }
.ed-fields {
  padding: 0 1rem 1rem;
  display: grid;
  gap: .65rem;
}
.ed-field {
  display: grid;
  gap: .25rem;
}
.ed-field label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ed-muted);
}
.ed-field input,
.ed-field textarea,
.ed-field select {
  font: inherit;
  font-size: .9rem;
  padding: .55rem .65rem;
  border-radius: 8px;
  border: 1px solid var(--ed-line);
  background: #faf8fc;
}
.ed-field textarea { min-height: 4.5rem; resize: vertical; }
.ed-sections {
  list-style: none;
  margin: 0;
  padding: 0 1rem .75rem;
  display: grid;
  gap: .4rem;
}
.ed-sec-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem .65rem;
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  background: #faf8fc;
  cursor: grab;
  user-select: none;
}
.ed-sec-item.is-active {
  border-color: rgba(124,77,255,.45);
  box-shadow: 0 0 0 2px rgba(124,77,255,.12);
}
.ed-sec-item.is-dragging { opacity: .45; }
.ed-sec-handle {
  color: var(--ed-muted);
  font-size: .85rem;
  letter-spacing: -.05em;
}
.ed-sec-item strong { font-size: .88rem; }
.ed-sec-item span {
  margin-left: auto;
  font-size: .72rem;
  color: var(--ed-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ed-preview-wrap {
  display: flex;
  flex-direction: column;
  background: #ddd6e8;
}
.ed-preview-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem .85rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--ed-muted);
  background: rgba(255,255,255,.7);
  border-bottom: 1px solid var(--ed-line);
}
.ed-preview-bar a { color: var(--ed-accent); }
.ed-preview {
  flex: 1;
  width: 100%;
  border: 0;
  background: #fff;
  min-height: 70vh;
}
.ed-spoke-card {
  border: 1px solid var(--ed-line);
  border-radius: 10px;
  padding: .65rem;
  display: grid;
  gap: .5rem;
  background: #faf8fc;
}
.ed-spoke-card h4 {
  margin: 0;
  font-size: .85rem;
}

/* Common-law TM on admin brand lockups. Never the registered mark. */
.tm,
.ed-brand strong::after,
.ed-gate-brand strong::after {
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0;
  line-height: 1;
  color: inherit;
  opacity: 0.7;
}
.tm {
  display: inline-block;
  font-size: 0.65em;
  vertical-align: super;
  margin-left: 0.08em;
}
.ed-brand strong::after,
.ed-gate-brand strong::after {
  content: "\2122";
  display: inline-block;
  font-size: 0.65em;
  vertical-align: super;
  margin-left: 0.08em;
}
.brand-mark {
  position: relative;
  display: inline-flex;
}
.brand-mark::after {
  content: "\2122";
  position: absolute;
  top: -0.2rem;
  right: -0.42rem;
  font-size: 0.55rem;
  font-weight: 600;
  line-height: 1;
  color: #f7f1e8;
  opacity: 0.75;
}
