/* Gyxen Docs CMS — editor UI */
:root {
  --ed-purple: #670ef2;
  --ed-purple-dark: #4f0abf;
  --ed-purple-soft: #f3e8ff;
  --ed-border: #e5e7eb;
  --ed-text: #111827;
  --ed-muted: #6b7280;
  --ed-bg: #f1f5f9;
  --ed-radius: 12px;
  --ed-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(103, 14, 242, 0.06);
}

* { box-sizing: border-box; }

body.ed-body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--ed-bg);
  color: var(--ed-text);
  line-height: 1.5;
}

/* —— Login (compact — CMS host only) —— */
.ed-body--login {
  background: linear-gradient(160deg, #f3e8ff 0%, #f1f5f9 45%, #e0e7ff 100%);
  min-height: 100vh;
}

.ed-login-simple {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
}

.ed-login-simple__foot {
  margin: 1.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--ed-muted);
  text-align: center;
}

.ed-login-simple__foot a {
  color: var(--ed-purple);
  text-decoration: none;
  font-weight: 600;
}

.ed-login-simple__foot a:hover {
  text-decoration: underline;
}

.ed-login-card__brand--center {
  flex-direction: column;
  text-align: center;
  margin-bottom: 1.5rem;
}

.ed-login-card__brand--center strong {
  margin-top: 0.75rem;
}

/* —— Login (legacy split layout) —— */
.ed-login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .ed-login-page { grid-template-columns: 1fr 1fr; }
}

.ed-login-hero {
  display: none;
  background: linear-gradient(145deg, #670ef2 0%, #4f0abf 45%, #1e1b4b 100%);
  color: #fff;
  padding: 3rem;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

@media (min-width: 900px) {
  .ed-login-hero { display: flex; }
}

.ed-login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.12), transparent 50%);
}

.ed-login-hero__inner { position: relative; z-index: 1; max-width: 420px; }

.ed-login-hero img { height: 36px; margin-bottom: 2rem; filter: brightness(0) invert(1); }

.ed-login-hero h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.ed-login-hero p { margin: 0; opacity: 0.9; font-size: 1.05rem; line-height: 1.6; }

.ed-login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.ed-login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: var(--ed-radius);
  padding: 2rem;
  box-shadow: var(--ed-shadow);
  border: 1px solid var(--ed-border);
}

.ed-login-card__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.ed-login-card__brand img { width: 40px; height: 40px; }

.ed-login-card__brand strong { font-size: 1.15rem; display: block; }

.ed-login-card__brand span { font-size: 0.875rem; color: var(--ed-muted); }

/* —— Header —— */
.ed-header {
  background: #fff;
  border-bottom: 1px solid var(--ed-border);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.ed-header__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.ed-header__brand img { height: 28px; }

.ed-header__brand strong { font-size: 0.9rem; letter-spacing: 0.04em; }

.ed-header__brand span { color: var(--ed-muted); font-size: 0.75rem; font-weight: 500; }

.ed-header nav {
  margin-left: auto;
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.ed-header nav a {
  color: var(--ed-text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8125rem;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}

.ed-header nav a:hover {
  background: var(--ed-purple-soft);
  color: var(--ed-purple);
}

.ed-header nav a.is-active {
  background: var(--ed-purple-soft);
  color: var(--ed-purple);
}

/* —— Layout —— */
.ed-main { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }

.ed-page-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ed-page-sub { margin: 0 0 1.25rem; color: var(--ed-muted); font-size: 0.9rem; }

/* —— Cards —— */
.ed-card {
  background: #fff;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--ed-shadow);
}

.ed-card h2, .ed-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.ed-card--clickable {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: border-color 0.15s, transform 0.15s;
}

.ed-card--clickable:hover {
  border-color: var(--ed-purple);
  transform: translateY(-1px);
}

.ed-card--highlight {
  border-color: #c4b5fd;
  background: linear-gradient(135deg, #faf5ff 0%, #fff 55%);
  box-shadow: var(--ed-shadow), 0 0 0 1px rgba(103, 14, 242, 0.08);
}

.ed-card--highlight:hover {
  border-color: var(--ed-purple);
}

.ed-muted { margin: 0 0 1rem; color: var(--ed-muted); font-size: 0.875rem; }

.ed-lang-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}
.ed-lang-tabs__btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--ed-border);
  background: #fff;
  color: inherit;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 650;
}
.ed-lang-tabs__btn:hover { border-color: var(--ed-purple); color: var(--ed-purple); }
.ed-lang-tabs__btn.is-on {
  background: #f3e8ff;
  border-color: #670ef2;
  color: #670ef2;
}

.ed-grid { display: grid; gap: 1rem; }

@media (min-width: 640px) {
  .ed-grid--2 { grid-template-columns: 1fr 1fr; }
  .ed-grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* —— Buttons —— */
.ed-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  background: var(--ed-purple);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.875rem;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}

.ed-btn:hover { background: var(--ed-purple-dark); color: #fff; }

.ed-btn:active { transform: scale(0.98); }

.ed-btn--ghost {
  background: #fff;
  color: var(--ed-purple);
  border: 1px solid var(--ed-purple);
}

.ed-btn--ghost:hover { background: var(--ed-purple-soft); }

.ed-btn--sm { padding: 0.35rem 0.7rem; font-size: 0.8125rem; }

.ed-btn--danger { background: #dc2626; border-color: #dc2626; }

.ed-btn--danger:hover { background: #b91c1c; }

.ed-btn-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }

/* —— Forms —— */
.ed-field { margin-bottom: 1.1rem; }

.ed-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.8125rem;
  color: var(--ed-text);
}

.ed-field input[type="text"],
.ed-field input[type="url"],
.ed-field input[type="password"],
.ed-field input[type="email"],
.ed-field input[type="file"],
.ed-field select,
.ed-field textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--ed-border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ed-field input:focus,
.ed-field select:focus,
.ed-field textarea:focus {
  outline: none;
  border-color: var(--ed-purple);
  box-shadow: 0 0 0 3px rgba(103, 14, 242, 0.15);
}

.ed-field textarea.editor-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  min-height: 320px;
  line-height: 1.55;
}

.ed-field .helptext { font-size: 0.75rem; color: var(--ed-muted); margin-top: 0.3rem; display: block; }

.ed-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
}

.ed-check input { width: auto; accent-color: var(--ed-purple); }

.errorlist { color: #dc2626; margin: 0 0 0.5rem; padding-left: 1.1rem; font-size: 0.8125rem; }

/* —— Messages —— */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }

.messages li {
  padding: 0.75rem 1rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  font-size: 0.875rem;
}

/* —— Lists —— */
.ed-list { list-style: none; padding: 0; margin: 0; }

.ed-list li {
  border-bottom: 1px solid var(--ed-border);
  padding: 0.9rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.ed-list li:last-child { border-bottom: none; }

/* —— Media grid —— */
.ed-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.ed-media-item {
  border: 1px solid var(--ed-border);
  border-radius: 10px;
  overflow: hidden;
  background: #f9fafb;
  transition: border-color 0.15s;
}

.ed-media-item:hover { border-color: var(--ed-purple); }

.ed-media-item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  background: #e5e7eb;
}

.ed-media-item__body { padding: 0.5rem; }

.ed-media-item__name {
  font-size: 0.7rem;
  word-break: break-all;
  color: var(--ed-muted);
  margin-bottom: 0.4rem;
}

/* —— Nav builder —— */
.ed-nav-builder { display: flex; flex-direction: column; gap: 0.75rem; }

.ed-nav-item {
  border: 1px solid var(--ed-border);
  border-radius: 10px;
  background: #fafafa;
  overflow: hidden;
}

.ed-nav-item__head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  background: #fff;
  border-bottom: 1px solid var(--ed-border);
}

.ed-nav-item__type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ed-purple);
  background: var(--ed-purple-soft);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  flex-shrink: 0;
}

.ed-nav-item__body { padding: 0.85rem; }

.ed-nav-item__actions { margin-left: auto; display: flex; gap: 0.25rem; }

.ed-nav-children {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--ed-border);
}

.ed-nav-children__title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ed-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.ed-nav-child {
  background: #fff;
  border: 1px solid var(--ed-border);
  border-radius: 8px;
  padding: 0.65rem;
  margin-bottom: 0.5rem;
}

.ed-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem;
  background: #f9fafb;
  border: 1px solid var(--ed-border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
}

/* —— Image picker modal —— */
.ed-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ed-modal.is-open { display: flex; }

.ed-modal__panel {
  background: #fff;
  border-radius: var(--ed-radius);
  max-width: 720px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  padding: 1.25rem;
}

.ed-modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.ed-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ed-muted);
  line-height: 1;
}

/* —— Dashboard tiles —— */
.ed-tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--ed-purple-soft);
  color: var(--ed-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

code {
  background: #f3f4f6;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.ed-split-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.ed-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ed-muted);
  margin: 1.25rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--ed-border);
}

.ed-section-title:first-child { margin-top: 0; }

body.ed-body--edit .ed-main {
  max-width: none;
  padding: 1.25rem 1.25rem 2.5rem;
}
.ed-edit-shell {
  display: grid;
  grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.ed-edit-col { min-width: 0; }
.ed-page-nav {
  position: sticky;
  top: 1rem;
  background: #fff;
  border: 1px solid var(--ed-border);
  border-radius: 12px;
  padding: 0.85rem 0.7rem 1rem;
  max-height: calc(100vh - 5rem);
  overflow: auto;
  box-shadow: var(--ed-shadow);
}
.ed-page-nav__title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ed-muted);
}
.ed-page-nav__lang {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ed-muted);
}
.ed-page-nav__lang select {
  font: inherit;
  font-weight: 650;
  color: var(--ed-text);
  border: 1px solid var(--ed-border);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  background: #fff;
}
.ed-page-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ed-page-nav__item { margin: 0 0 0.35rem; }
.ed-page-nav__page,
.ed-page-nav__sub {
  display: block;
  text-decoration: none;
  color: var(--ed-text);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
}
.ed-page-nav__page:hover,
.ed-page-nav__sub:hover { background: var(--ed-purple-soft); color: var(--ed-purple); }
.ed-page-nav__page.is-on,
.ed-page-nav__sub.is-on {
  background: #f3e8ff;
  color: #670ef2;
}
.ed-page-nav__subs {
  display: none;
  list-style: none;
  margin: 0.2rem 0 0.35rem;
  padding: 0 0 0 0.55rem;
  border-left: 2px solid #ede9fe;
}
.ed-page-nav__item.is-current .ed-page-nav__subs,
.ed-page-nav__item.is-open .ed-page-nav__subs { display: block; }
.ed-page-nav__sub {
  font-weight: 550;
  color: #4b5563;
  font-size: 0.78rem;
}
.ed-page-nav__sub.is-nested { padding-left: 0.9rem; font-weight: 500; }
.ed-page-nav__tools {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.85rem;
}
.ed-table-pop {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #f3e8ff;
  border-bottom: 1px solid #ddd6fe;
  font-size: 0.8125rem;
}
.ed-table-pop[hidden] { display: none !important; }
.ed-table-pop label { display: flex; align-items: center; gap: 0.35rem; font-weight: 650; }
.ed-table-pop input {
  width: 3.4rem;
  padding: 0.25rem 0.35rem;
  border: 1px solid #ddd6fe;
  border-radius: 6px;
}
.ed-visual-wrap {
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}
.ed-visual {
  overflow-x: hidden;
  max-width: 100%;
  min-width: 0;
  width: 100%;
}
.ed-visual img,
.ed-visual video,
.ed-visual iframe {
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  display: block;
}
.ed-table-wrap {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  margin: 1rem 0;
  -webkit-overflow-scrolling: touch;
}
.ed-visual table {
  width: max-content;
  min-width: 100%;
  max-width: none;
}
.ed-visual h1.is-jump,
.ed-visual h2.is-jump,
.ed-visual h3.is-jump,
.ed-visual h4.is-jump {
  outline: 2px solid #670ef2;
  background: #f3e8ff;
  border-radius: 6px;
}
.ed-card { min-width: 0; overflow: hidden; }
@media (max-width: 900px) {
  .ed-edit-shell { grid-template-columns: 1fr; }
  .ed-page-nav { position: static; max-height: none; }
}

.ed-visual-wrap {
  border: 1px solid var(--ed-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 0.85rem;
}
.ed-rich-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  background: #111827;
  border-bottom: 2px solid #670ef2;
}
.ed-rich-toolbar__group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  padding-right: 0.55rem;
  margin-right: 0.2rem;
  border-right: 1px solid #374151;
}
.ed-rich-toolbar__group--end {
  border-right: none;
  margin-left: auto;
  padding-right: 0;
}
.ed-rich-toolbar button,
.ed-rich-toolbar select {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  color: #f9fafb;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
  padding: 0.32rem 0.55rem;
  cursor: pointer;
}
.ed-rich-toolbar select {
  max-width: 11rem;
}
.ed-rich-toolbar button:hover,
.ed-rich-toolbar select:hover {
  background: #670ef2;
  border-color: #670ef2;
}
.ed-visual {
  min-height: 28rem;
  padding: 1.1rem 1.25rem 2rem;
  outline: none;
  line-height: 1.65;
}
.ed-visual:focus {
  box-shadow: inset 0 0 0 2px rgba(103, 14, 242, 0.22);
}
.ed-visual h1, .ed-visual h2, .ed-visual h3, .ed-visual h4 {
  margin: 1.1rem 0 0.45rem;
  line-height: 1.3;
}
.ed-visual p { margin: 0 0 0.85rem; }
.ed-visual img { max-width: 100% !important; height: auto !important; border-radius: 6px; }
.ed-visual table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.ed-visual th, .ed-visual td {
  border: 1px solid #e5e7eb;
  padding: 0.5rem 0.7rem;
  text-align: left;
}
.ed-visual th { background: #f9fafb; }
.ed-visual .gyxen-cols {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}
.ed-visual .gyxen-cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ed-visual .gyxen-cols--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ed-visual .gyxen-cols__col {
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border: 1px dashed #c4b5fd;
  border-radius: 8px;
  background: #faf5ff;
}
.ed-visual .gyxen-tabs {
  margin: 1rem 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}
.ed-visual .gyxen-tabs__nav { display: flex; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.ed-visual .gyxen-tabs__tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.75rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.ed-visual .gyxen-tabs__tab.is-active { color: #670ef2; border-bottom: 2px solid #670ef2; }
.ed-visual .gyxen-tabs__panel { display: none; padding: 0.85rem 1rem; }
.ed-visual .gyxen-tabs__panel.is-active { display: block; }
.ed-visual .gyxen-video { margin: 1rem 0; background: #000; border-radius: 8px; overflow: hidden; }
.ed-visual .gyxen-video iframe,
.ed-visual .gyxen-video video { display: block; width: 100%; min-height: 180px; border: 0; }
.ed-visual-wrap.is-markdown .ed-visual { display: none; }
.ed-md-details {
  margin: 0;
  color: var(--ed-muted);
  font-size: 0.875rem;
}
.ed-md-details summary { cursor: pointer; font-weight: 650; }
.ed-visual-wrap.is-markdown + .ed-md-details { display: block; }
@media (max-width: 720px) {
  .ed-visual .gyxen-cols--2,
  .ed-visual .gyxen-cols--3 { grid-template-columns: 1fr; }
}

/* —— Office-style studio (Fluent ribbon + paper) —— */
body.ed-body--edit {
  background: #f3f2f1;
  --gyxen-edit-bar-h: 36px;
  --gyxen-chrome-top: calc(36px + 60px);
}
body.ed-body--edit .gyxen-edit-bar { position: fixed; top: 0; }
body.ed-body--edit .gyxen-header {
  position: fixed;
  top: 36px;
  left: 0;
  right: 0;
}
body.ed-body--edit .ed-studio.gyxen-layout {
  padding-top: var(--gyxen-chrome-top);
  min-height: 100vh;
}
body.ed-body--edit .gyxen-sidebar {
  height: calc(100vh - var(--gyxen-chrome-top));
  top: var(--gyxen-chrome-top);
  background: #fff;
}
body.ed-body--edit .gyxen-edit-bar__btn {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0.15rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
}
body.ed-body--edit .gyxen-edit-bar__btn:hover { background: rgba(255, 255, 255, 0.28); }
body.ed-body--edit .gyxen-nav__add {
  display: block;
  width: calc(100% - 0.5rem);
  margin: 0.25rem 0.25rem 0;
  text-align: center;
}

.ed-more {
  position: relative;
}
.ed-more__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  background: none;
  border: 0;
  color: #fff;
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.ed-more__btn:hover { text-decoration: underline; }
.ed-more .gyxen-lang__caret {
  width: 0.85rem;
  height: 0.85rem;
  color: #fff;
}
.gyxen-edit-bar .ed-more .gyxen-lang__menu a {
  color: #323130 !important;
  text-decoration: none !important;
}

.ed-office {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #f3f2f1;
  max-width: none !important;
  width: auto !important;
}
.ed-office__form {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--gyxen-chrome-top));
  min-width: 0;
}
.ed-statusbar {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
}

.ed-ribbon {
  position: sticky;
  top: var(--gyxen-chrome-top);
  z-index: 50;
  background: #fff;
  border-bottom: 1px solid #e1dfdd;
}
.ed-ribbon__tabs {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0 0.75rem;
  min-height: 32px;
  background: #fff;
  border-bottom: 1px solid #edebe9;
}
.ed-ribbon__tab {
  appearance: none;
  background: none !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  min-height: 32px !important;
  padding: 0 0.7rem !important;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #323130;
  cursor: pointer;
}
.ed-ribbon__tab:hover { background: #f3f2f1 !important; }
.ed-ribbon__tab.is-active {
  color: #185abd;
  border-bottom-color: #185abd !important;
}
.ed-ribbon__tabs-grow { flex: 1; }
.ed-ribbon__inner {
  display: none;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  padding: 0.28rem 0.5rem;
  overflow-x: auto;
  background: #faf9f8;
}
.ed-ribbon__inner.is-active { display: flex; }
.ed-ribbon__inner[hidden] { display: none !important; }
.ed-ribbon__group {
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 0.45rem;
  border-right: 1px solid #e1dfdd;
  flex: 0 0 auto;
}
.ed-ribbon__group:last-child { border-right: 0; }
.ed-ribbon__cmds {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: nowrap;
}
.ed-ribbon__vsplit {
  width: 1px;
  height: 18px;
  background: #e1dfdd;
  margin: 0 0.3rem;
}
.ed-ribbon__inner button,
.ed-ribbon__inner select {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: #323130;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  min-height: 26px;
  padding: 0.15rem 0.4rem;
  cursor: pointer;
  white-space: nowrap;
}
.ed-ribbon__inner select {
  background: #fff;
  border-color: #d2d0ce;
  max-width: 132px;
}
.ed-ribbon__size { max-width: 56px !important; }
.ed-ribbon__inner button:hover,
.ed-ribbon__inner select:hover {
  background: #e1dfdd;
  border-color: #c8c6c4;
}
.ed-ribbon__save {
  background: #185abd !important;
  border: 1px solid #185abd !important;
  color: #fff !important;
  font: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.2rem 0.85rem !important;
  border-radius: 4px;
  min-height: 26px;
  cursor: pointer;
}
.ed-ribbon__save:hover { background: #134b96 !important; }
.ed-ribbon .ed-table-pop {
  margin: 0 0.5rem 0.4rem;
  border: 1px solid #e1dfdd;
  border-radius: 4px;
  background: #fff;
}
.ed-lang-menu {
  padding: 0.75rem 0.75rem 0.5rem;
  border-bottom: 1px solid #edebe9;
}
.ed-lang-menu__title {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #605e5c;
}
.ed-lang-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.25rem;
  border-radius: 4px;
  text-decoration: none;
  color: #323130;
  border: 1px solid transparent;
  font-size: 0.8125rem;
  font-weight: 650;
}
.ed-lang-menu__item:hover { background: #f3f2f1; }
.ed-lang-menu__item.is-active {
  background: #deecf9;
  border-color: #c7e0f4;
  color: #185abd;
}
.ed-lang-menu__code {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #605e5c;
}
.ed-lang-menu__item.is-active .ed-lang-menu__code { color: #185abd; }
.ed-statusbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  min-height: 28px;
  padding: 0.2rem 0.85rem;
  background: #f3f2f1;
  border-top: 1px solid #e1dfdd;
  font-size: 0.75rem;
  color: #605e5c;
}
.ed-statusbar__label { font-weight: 700; }
.ed-statusbar__lang {
  color: #323130;
  text-decoration: none;
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
  font-weight: 650;
}
.ed-statusbar__lang:hover { background: #e1dfdd; }
.ed-statusbar__lang.is-active {
  background: #fff;
  color: #185abd;
  box-shadow: 0 0 0 1px #c7e0f4;
}
.ed-statusbar__file { margin-left: auto; min-width: 0; }
.ed-statusbar__file code { font-size: 0.7rem; color: #605e5c; }

.ed-canvas {
  flex: 1 1 auto;
  overflow: auto;
  padding: 1.25rem 1rem 3rem;
  min-width: 0;
}
.ed-paper {
  max-width: 816px;
  width: 100%;
  margin: 0 auto;
  background: #fff;
  min-height: calc(100vh - var(--gyxen-chrome-top) - 9rem);
  padding: 2.25rem 3rem 3rem;
  box-shadow: 0 1.6px 3.6px rgba(0, 0, 0, 0.13), 0 0.3px 0.9px rgba(0, 0, 0, 0.1);
  border-radius: 2px;
}
.ed-paper.gyxen-main {
  max-width: 816px;
  padding: 2.25rem 3rem 3rem;
}
.ed-studio-messages { margin: 0 0 1rem; padding: 0; }
.ed-studio .ed-visual-wrap {
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
  background: transparent;
}
.ed-studio .ed-visual {
  min-height: 28rem;
  padding: 0;
  outline: none;
  line-height: 1.7;
  font-size: 16px;
}
.ed-studio .ed-visual:focus { box-shadow: none; }
.ed-studio-meta {
  margin: 1.75rem 0 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #edebe9;
  color: #605e5c;
  font-size: 0.875rem;
}
.ed-studio-meta summary,
.ed-md-details summary {
  cursor: pointer;
  font-weight: 650;
  color: #323130;
}
.ed-studio-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #edebe9;
}
.ed-statusbar__md {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 650;
  color: #605e5c;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
}
.ed-lang-file { margin: 0; flex: 1 1 auto; min-width: 0; font-size: 0.75rem; color: #605e5c; }
.ed-lang-file code {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.2rem 0.45rem;
  background: #faf9f8;
  border: 1px solid #edebe9;
  border-radius: 4px;
  font-size: 0.72rem;
  color: #605e5c;
}
.ed-btn--danger-ghost {
  background: #fff;
  color: #a4262c;
  border: 1px solid #f1c6c8;
  margin-left: auto;
}
.ed-btn--danger-ghost:hover { background: #fde7e9; color: #a4262c; }
.ed-studio .gyxen-nav__link.is-nested { padding-left: 1.15rem; font-size: 0.78rem; }

@media (max-width: 996px) {
  body.ed-body--edit .gyxen-sidebar {
    position: relative;
    top: 0;
    width: 100%;
    height: auto;
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid #e1dfdd;
  }
  body.ed-body--edit .gyxen-layout-inner { flex-direction: column; }
  .ed-paper.gyxen-main { padding: 1.25rem 1.15rem 2rem; }
  .ed-ribbon__group--end { margin-left: 0; }
}
