:root {
  color-scheme: light;
  --admin-accent: #5b5bd6;
  --admin-accent-dark: #4747b8;
  --admin-accent-soft: #eeeeff;
  --admin-bg: #f5f6fa;
  --admin-danger: #c43232;
  --admin-danger-soft: #fff0f0;
  --admin-ink: #171923;
  --admin-line: #e2e5ec;
  --admin-muted: #667085;
  --admin-sidebar: #151722;
  --admin-sidebar-muted: #979cad;
  --admin-success: #087a55;
  --admin-success-soft: #eafbf4;
  --admin-surface: #ffffff;
  --admin-warning: #b55d12;
  --admin-shadow: 0 16px 45px rgb(21 23 34 / 8%);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: var(--admin-bg);
}

body {
  margin: 0;
  color: var(--admin-ink);
  background: var(--admin-bg);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

select {
  padding-right: 2.65rem;
  background-image:
    linear-gradient(45deg, transparent 50%, #697386 50%),
    linear-gradient(135deg, #697386 50%, transparent 50%);
  background-position:
    calc(100% - 1.05rem) 50%,
    calc(100% - 0.75rem) 50%;
  background-repeat: no-repeat;
  background-size:
    0.34rem 0.34rem,
    0.34rem 0.34rem;
  appearance: none;
}

select:disabled {
  color: var(--admin-muted);
  background-color: #f2f3f6;
  cursor: not-allowed;
}

a {
  color: var(--admin-accent-dark);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--admin-ink);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 3vw, 2.15rem);
}

h2 {
  font-size: 1.2rem;
}

p {
  color: #4c5568;
}

code {
  padding: 0.12rem 0.3rem;
  border-radius: 0.3rem;
  background: #f0f1f5;
  font:
    0.82rem ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.5rem;
  color: #fff;
  background: var(--admin-accent);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.admin-shell {
  display: grid;
  grid-template-columns: 17.5rem minmax(0, 1fr);
  min-height: 100vh;
}

.admin-backdrop {
  display: none;
}

.admin-sidebar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.15rem;
  color: #fff;
  background: var(--admin-sidebar);
}

.admin-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.3rem;
  padding: 0 0.35rem 1rem;
}

.admin-brand > a,
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.72rem;
  color: inherit;
  text-decoration: none;
}

.admin-brand-mark {
  display: grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.72rem;
  color: #fff;
  background: linear-gradient(145deg, #7777ee, #4d4dc8);
  box-shadow: 0 7px 18px rgb(91 91 214 / 32%);
  font-size: 1.05rem;
  font-weight: 850;
}

.admin-brand strong,
.auth-brand strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.admin-brand small,
.auth-brand small {
  display: block;
  color: var(--admin-sidebar-muted);
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-navigation {
  display: grid;
  gap: 0.4rem;
  margin-top: 1rem;
}

.admin-navigation a {
  position: relative;
  display: grid;
  grid-template-columns: 0.22rem minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  min-height: 4rem;
  padding: 0.62rem 0.75rem 0.62rem 0.45rem;
  border-radius: 0.75rem;
  color: #d9dce5;
  text-decoration: none;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.admin-navigation a:hover {
  color: #fff;
  background: rgb(255 255 255 / 6%);
  transform: translateX(2px);
}

.admin-navigation a.active {
  color: #fff;
  background: rgb(119 119 238 / 15%);
}

.nav-indicator {
  width: 0.2rem;
  height: 1.8rem;
  border-radius: 99px;
  background: transparent;
}

.active .nav-indicator {
  background: #8585f1;
}

.admin-navigation strong,
.admin-navigation small {
  display: block;
}

.admin-navigation strong {
  font-size: 0.91rem;
}

.admin-navigation small {
  margin-top: 0.08rem;
  color: var(--admin-sidebar-muted);
  font-size: 0.73rem;
}

.sidebar-account {
  display: grid;
  gap: 0.65rem;
  margin-top: auto;
  padding: 1rem 0.75rem 0.25rem;
  border-top: 1px solid rgb(255 255 255 / 9%);
}

.sidebar-account > span {
  overflow: hidden;
  color: #cdd0da;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account form,
.admin-topbar form {
  margin: 0;
}

.sidebar-logout,
.topbar-logout {
  min-height: auto;
  padding: 0;
  border: 0;
  color: #aeb3c2;
  background: transparent;
  font-weight: 650;
  cursor: pointer;
}

.sidebar-logout:hover,
.topbar-logout:hover {
  color: #fff;
  background: transparent;
  box-shadow: none;
}

.sidebar-close,
.admin-topbar {
  display: none;
}

.admin-workspace {
  min-width: 0;
}

.admin-main {
  width: min(82rem, calc(100% - 3rem));
  margin: 0 auto;
  padding: 2.4rem 0 4rem;
}

.page-heading {
  margin-bottom: 1.4rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--admin-accent);
  font-size: 0.71rem;
  font-weight: 850;
  letter-spacing: 0.105em;
  text-transform: uppercase;
}

.admin-content {
  padding: clamp(1.15rem, 2.5vw, 2rem);
  border: 1px solid var(--admin-line);
  border-radius: 1.05rem;
  background: var(--admin-surface);
  box-shadow: var(--admin-shadow);
}

.lead {
  margin: 0.2rem 0 0;
  font-size: 1.02rem;
}

.toolbar,
.actions,
.row-actions,
.block-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.toolbar,
.actions {
  justify-content: space-between;
}

.row-actions,
.block-actions {
  justify-content: flex-end;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.55rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 0.65rem;
  color: #fff;
  background: var(--admin-accent);
  box-shadow: 0 1px 2px rgb(21 23 34 / 8%);
  font-weight: 740;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.button:hover,
button:hover {
  color: #fff;
  background: var(--admin-accent-dark);
  box-shadow: 0 6px 16px rgb(71 71 184 / 20%);
}

.button:active,
button:active {
  transform: translateY(1px);
}

.button:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(91 91 214 / 25%);
  outline-offset: 2px;
}

.secondary,
.subtle {
  color: #42429f;
  background: var(--admin-accent-soft);
  box-shadow: none;
}

.secondary:hover,
.subtle:hover {
  color: #35358b;
  background: #dfdfff;
  box-shadow: none;
}

.child {
  background: #087e8b;
}

.child:hover {
  background: #086b76;
}

.warning {
  background: var(--admin-warning);
}

.danger {
  background: var(--admin-danger);
}

.danger-text {
  color: var(--admin-danger);
  background: var(--admin-danger-soft);
  box-shadow: none;
}

.error,
.success {
  padding: 0.8rem 1rem;
  border-radius: 0.7rem;
  font-weight: 550;
}

.error {
  color: #a82424;
  background: var(--admin-danger-soft);
}

.error:empty {
  display: none;
}

.success {
  color: var(--admin-success);
  background: var(--admin-success-soft);
}

.hint,
.muted,
small {
  color: var(--admin-muted);
}

.stack,
.generated-fields,
.builder-list,
.repeater {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.42rem;
  margin: 0.8rem 0;
  color: #384152;
  font-weight: 670;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.68rem 0.78rem;
  border: 1px solid #ccd1dc;
  border-radius: 0.65rem;
  color: var(--admin-ink);
  background: #fff;
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7777df;
  box-shadow: 0 0 0 3px rgb(91 91 214 / 12%);
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

fieldset,
.field,
.repeater-item {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--admin-line);
  border-radius: 0.8rem;
  background: #fff;
}

legend {
  padding: 0 0.4rem;
  font-weight: 750;
}

.check,
.switch {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
}

.check input,
.switch input[type="checkbox"] {
  width: auto;
  min-height: auto;
}

.table-wrap {
  overflow: auto;
  margin-top: 1.4rem;
  border: 1px solid var(--admin-line);
  border-radius: 0.8rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: #f8f9fb;
}

th,
td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--admin-line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #586174;
  font-size: 0.74rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafaff;
}

.tree {
  display: block;
  padding-left: calc(var(--depth) * 1.2rem);
  font-weight: 750;
}

.status {
  display: inline-block;
  padding: 0.24rem 0.56rem;
  border-radius: 999px;
  color: #566072;
  background: #f0f1f5;
  font-size: 0.77rem;
  font-weight: 750;
}

.status.on {
  color: var(--admin-success);
  background: var(--admin-success-soft);
}

.status.collection {
  color: #42429f;
  background: var(--admin-accent-soft);
}

.compact {
  min-height: 2.15rem;
  padding: 0.46rem 0.72rem;
  font-size: 0.82rem;
}

.crud-toolbar {
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #dfe1f7;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #fafaff, #f5f7fc);
}

.crud-toolbar .lead {
  max-width: 44rem;
}

.crud-intro {
  margin-bottom: 1.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--admin-line);
}

.crud-intro p {
  margin: 0;
}

.crud-table {
  margin-top: 1rem;
  box-shadow: 0 8px 28px rgb(21 23 34 / 5%);
}

.crud-table th:last-child,
.crud-table td:last-child {
  text-align: right;
}

.page-cell small {
  display: block;
  margin-top: 0.15rem;
  padding-left: calc(var(--depth, 0) * 1.2rem);
}

.table-empty {
  padding: 2rem;
  color: var(--admin-muted);
  text-align: center !important;
}

.crud-form {
  gap: 1.35rem;
}

.form-section {
  padding: clamp(1rem, 2vw, 1.35rem);
  border: 1px solid var(--admin-line);
  border-radius: 0.95rem;
  background: #fbfbfd;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.section-heading > p {
  max-width: 30rem;
  color: var(--admin-muted);
  font-size: 0.86rem;
  text-align: right;
}

.settings-grid,
.robots-grid,
.danger-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.settings-grid > div,
.settings-grid > label,
.toggle-card,
.robots-grid > label {
  margin: 0;
}

.toggle-card {
  grid-column: 1 / -1;
  padding: 0.85rem 1rem;
  border: 1px solid #dcdff1;
  border-radius: 0.75rem;
  background: #fff;
}

.toggle-card span,
.robots-grid .check span {
  display: grid;
  gap: 0.1rem;
}

.toggle-card small,
.robots-grid small {
  font-weight: 450;
}

.technical-path {
  display: grid;
  gap: 0.42rem;
}

.technical-path > span {
  color: #384152;
  font-weight: 670;
}

.technical-path code {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.68rem 0.78rem;
  border: 1px solid #d7dbe5;
  border-radius: 0.65rem;
  color: #42429f;
  background: #f2f2ff;
}

.locale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 23rem), 1fr));
  gap: 1rem;
}

.form-card {
  padding: 1.1rem;
  border-color: #dfe2ea;
  box-shadow: 0 4px 14px rgb(21 23 34 / 3%);
}

.form-card legend {
  color: #33354b;
}

.form-card legend code {
  color: #5050aa;
  background: var(--admin-accent-soft);
}

.robots-grid .check {
  min-height: 4.5rem;
  margin: 0;
  padding: 0.8rem;
  border: 1px solid var(--admin-line);
  border-radius: 0.7rem;
  background: #fafbfc;
}

.form-actions {
  position: sticky;
  z-index: 5;
  bottom: 1rem;
  justify-content: flex-end;
  padding: 0.8rem;
  border: 1px solid rgb(226 229 236 / 90%);
  border-radius: 0.85rem;
  background: rgb(255 255 255 / 92%);
  box-shadow: 0 10px 30px rgb(21 23 34 / 10%);
  backdrop-filter: blur(12px);
}

.dashboard-links,
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin-top: 1.6rem;
}

.dashboard-links a,
.picker-card {
  display: grid;
  gap: 0.25rem;
  padding: 1.25rem;
  border: 1px solid var(--admin-line);
  border-radius: 0.85rem;
  color: var(--admin-ink);
  background: #fff;
  text-decoration: none;
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.dashboard-links a:hover,
.picker-card:hover {
  border-color: #b5b5ed;
  box-shadow: 0 12px 28px rgb(21 23 34 / 9%);
  transform: translateY(-2px);
}

.dashboard-links span {
  font-weight: 760;
}

.dashboard-links small,
.picker-card small {
  display: block;
  font-weight: 450;
}

.builder-list {
  margin-top: 1.4rem;
}

.builder-item {
  display: grid;
  grid-template-columns: auto minmax(12rem, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--admin-line);
  border-radius: 0.85rem;
  background: #fff;
}

.builder-item.dragging {
  opacity: 0.45;
}

.builder-item.disabled {
  background: #f8f9fb;
}

.drag-handle {
  min-height: auto;
  padding: 0.4rem;
  color: #9399a8;
  background: transparent;
  box-shadow: none;
  cursor: grab;
}

.block-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.block-summary small {
  display: block;
}

.position {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.52rem;
  color: #525c6e;
  background: #f0f1f5;
  font-weight: 750;
}

.block-actions form {
  margin: 0;
}

.block-actions .button,
.block-actions button {
  min-height: 2.15rem;
  padding: 0.45rem 0.68rem;
  font-size: 0.83rem;
}

.order-form {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.order-form button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.empty-state {
  padding: 2.6rem 1rem;
  border: 1px dashed #c6cad4;
  border-radius: 0.85rem;
  background: #fbfbfd;
  text-align: center;
}

.picker-card {
  grid-template-rows: 9rem auto;
  overflow: hidden;
  padding: 0;
}

.picker-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.picker-card > span:last-child {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
}

.block-icon {
  display: grid;
  place-items: center;
  color: #4848aa;
  background: #eeeefe;
  font-weight: 850;
}

.field {
  display: grid;
  gap: 0.55rem;
}

.field-heading {
  display: grid;
  gap: 0.12rem;
  font-weight: 750;
}

.field-heading small {
  font-weight: 450;
}

.required {
  color: var(--admin-danger);
}

.locale-tabs {
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--admin-line);
}

.locale-tab {
  min-height: 2.15rem;
  padding: 0.38rem 0.65rem;
  border-radius: 0.45rem 0.45rem 0 0;
  color: var(--admin-muted);
  background: transparent;
  box-shadow: none;
  white-space: nowrap;
}

.locale-tab.active {
  color: #42429f;
  background: var(--admin-accent-soft);
}

.locale-panel {
  display: none;
  padding-top: 0.65rem;
}

.locale-panel.active {
  display: block;
}

.repeater-item {
  position: relative;
}

.repeater-item > .icon-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  min-height: 2rem;
  padding: 0.3rem 0.5rem;
}

.alt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.7rem;
  margin-top: 0.6rem;
}

.alt-grid label {
  font-size: 0.83rem;
}

.media-field-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.media-field-control .button {
  white-space: nowrap;
}

.media-upload {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) auto;
  gap: 1rem;
  align-items: end;
  margin-top: 1.2rem;
  padding: 1rem;
  border: 1px dashed #bfc3df;
  border-radius: 0.85rem;
  background: #fafaff;
}

.media-upload label {
  margin: 0;
}

.media-upload > div {
  display: grid;
  gap: 0.3rem;
}

.media-grid,
.media-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1rem;
}

.media-grid {
  margin-top: 1.2rem;
}

.media-empty {
  grid-column: 1 / -1;
}

.media-card,
.media-picker-card {
  overflow: hidden;
  border: 1px solid var(--admin-line);
  border-radius: 0.85rem;
  background: #fff;
}

.media-card > img,
.media-picker-card > img,
.media-card > .media-file-icon,
.media-picker-card > .media-file-icon {
  width: 100%;
  height: 9rem;
  object-fit: cover;
}

.media-file-icon {
  display: grid;
  place-items: center;
  color: #4b4ba7;
  background: linear-gradient(145deg, #f3f3ff, #e7e9f5);
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.media-card-body {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem;
}

.media-card-body > strong,
.media-picker-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.media-card-actions form {
  margin: 0;
}

.media-dialog {
  width: min(64rem, calc(100% - 2rem));
  max-height: min(48rem, calc(100vh - 2rem));
  padding: 1.2rem;
  border: 0;
  border-radius: 1rem;
  box-shadow: 0 30px 80px rgb(21 23 34 / 28%);
}

.media-dialog::backdrop {
  background: rgb(21 23 34 / 58%);
  backdrop-filter: blur(3px);
}

.media-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.media-dialog-heading h2 {
  margin: 0;
}

.dialog-close {
  width: 2.4rem;
  min-height: 2.4rem;
  padding: 0;
  color: #555d6f;
  background: #f1f2f6;
  box-shadow: none;
  font-size: 1.35rem;
}

.media-picker-card {
  display: grid;
  padding: 0;
  color: var(--admin-ink);
  text-align: left;
  box-shadow: none;
}

.media-picker-card:hover {
  color: var(--admin-ink);
  border-color: #a9a9e7;
  background: #fff;
  box-shadow: 0 10px 24px rgb(21 23 34 / 10%);
}

.media-picker-card > span:last-child {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem;
}

.media-dialog-footer {
  margin-top: 1rem;
}

.footer-actions {
  margin-top: 1.5rem;
}

.danger-zone {
  margin-top: 2rem;
  padding: 1.25rem;
  border: 1px solid #f1bcbc;
  border-radius: 0.95rem;
  background: #fffafa;
}

.danger-zone .eyebrow,
.danger-zone h2 {
  color: #9e2929;
}

.danger-action {
  padding: 1rem;
  border: 1px solid #ead7c5;
  border-radius: 0.8rem;
  background: #fff;
}

.danger-action h3 {
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

.danger-action p {
  min-height: 2.7rem;
  margin-bottom: 0.65rem;
  font-size: 0.85rem;
}

.delete-action {
  border-color: #efcaca;
}

hr {
  margin: 1.8rem 0;
  border: 0;
  border-top: 1px solid var(--admin-line);
}

/* EasyMDE is vendored locally; these rules connect it to the admin design. */
.EasyMDEContainer {
  overflow: hidden;
  border: 1px solid #ccd1dc;
  border-radius: 0.72rem;
  background: #fff;
}

.EasyMDEContainer .editor-toolbar {
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
  padding: 0.42rem;
  border: 0;
  border-bottom: 1px solid var(--admin-line);
  border-radius: 0;
  background: #f8f9fb;
  white-space: nowrap;
}

.EasyMDEContainer .editor-toolbar button {
  width: auto;
  min-width: 2rem;
  height: 2rem;
  min-height: 2rem;
  padding: 0.25rem 0.48rem;
  border: 0;
  border-radius: 0.38rem;
  color: #424b5d;
  background: transparent;
  box-shadow: none;
  font-size: 0.76rem;
  font-weight: 780;
}

.EasyMDEContainer .editor-toolbar button:hover,
.EasyMDEContainer .editor-toolbar button.active {
  color: #3f3f9b;
  background: #e6e6ff;
}

.EasyMDEContainer .editor-toolbar.disabled-for-preview .cms-mde-preview {
  pointer-events: auto;
  opacity: 1;
}

.EasyMDEContainer .editor-toolbar i.separator {
  border-color: var(--admin-line);
}

.EasyMDEContainer .CodeMirror {
  min-height: 15rem;
  border: 0;
  color: #242735;
  font:
    0.9rem/1.65 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
}

.EasyMDEContainer .CodeMirror-focused {
  box-shadow: inset 0 0 0 2px rgb(91 91 214 / 18%);
}

.EasyMDEContainer .editor-statusbar {
  padding: 0.35rem 0.7rem;
  border-top: 1px solid var(--admin-line);
  color: var(--admin-muted);
  background: #fafbfc;
}

.EasyMDEContainer .editor-preview,
.EasyMDEContainer .editor-preview-side {
  background: #fff;
}

.EasyMDEContainer .editor-preview-side {
  border-color: var(--admin-line);
}

.EasyMDEContainer .CodeMirror-fullscreen,
.EasyMDEContainer .editor-preview-side,
.EasyMDEContainer .editor-toolbar.fullscreen {
  z-index: 80;
}

.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 15% 10%,
      rgb(119 119 238 / 16%),
      transparent 30rem
    ),
    radial-gradient(
      circle at 90% 80%,
      rgb(65 154 174 / 12%),
      transparent 28rem
    ),
    #f5f6fa;
}

.auth-shell {
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.auth-card {
  width: min(29rem, 100%);
  padding: clamp(1.5rem, 5vw, 2.35rem);
  border: 1px solid var(--admin-line);
  border-radius: 1.15rem;
  background: rgb(255 255 255 / 95%);
  box-shadow: 0 24px 70px rgb(21 23 34 / 12%);
}

.auth-brand {
  margin-bottom: 2.3rem;
  color: var(--admin-ink);
}

.auth-brand small {
  color: var(--admin-muted);
}

.auth-heading {
  margin-bottom: 1.5rem;
}

.auth-caption {
  margin: 1.1rem 0 0;
  color: #7b8292;
  font-size: 0.78rem;
}

.auth-card form > button[type="submit"]:last-child {
  width: 100%;
  margin-top: 0.45rem;
}

@media (max-width: 920px) {
  .admin-shell {
    display: block;
  }

  .admin-sidebar {
    position: fixed;
    left: 0;
    width: min(19rem, calc(100vw - 3rem));
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  .menu-open .admin-sidebar {
    transform: translateX(0);
  }

  .admin-backdrop {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: block;
    visibility: hidden;
    background: rgb(21 23 34 / 48%);
    opacity: 0;
    transition:
      opacity 0.2s ease,
      visibility 0.2s ease;
  }

  .menu-open .admin-backdrop {
    visibility: visible;
    opacity: 1;
  }

  .menu-locked {
    overflow: hidden;
  }

  .sidebar-close {
    display: inline-grid;
    place-items: center;
    width: 2.2rem;
    min-height: 2.2rem;
    padding: 0;
    color: #cdd0da;
    background: transparent;
    box-shadow: none;
    font-size: 1.5rem;
  }

  .admin-topbar {
    position: sticky;
    z-index: 15;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--admin-line);
    background: rgb(255 255 255 / 94%);
    backdrop-filter: blur(14px);
  }

  .menu-toggle {
    display: grid;
    gap: 0.25rem;
    width: 2.25rem;
    min-height: 2.25rem;
    padding: 0.48rem;
    background: var(--admin-sidebar);
    box-shadow: none;
  }

  .menu-toggle span {
    height: 2px;
    border-radius: 3px;
    background: #fff;
  }

  .mobile-brand {
    color: var(--admin-ink);
    font-weight: 800;
    text-decoration: none;
  }

  .topbar-logout {
    color: var(--admin-muted);
  }

  .topbar-logout:hover {
    color: var(--admin-ink);
  }

  .admin-main {
    width: min(100% - 2rem, 76rem);
    padding-top: 1.6rem;
  }
}

@media (max-width: 700px) {
  .admin-content {
    padding: 1rem;
    border-radius: 0.85rem;
  }

  .toolbar,
  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar > .button,
  .actions > .button,
  .actions > button {
    width: 100%;
  }

  .section-heading {
    display: grid;
  }

  .section-heading > p {
    text-align: left;
  }

  .settings-grid,
  .robots-grid,
  .danger-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    position: static;
    flex-direction: column-reverse;
  }

  .media-field-control,
  .media-upload {
    grid-template-columns: 1fr;
  }

  .media-field-control .button,
  .media-upload button {
    width: 100%;
  }

  .media-grid,
  .media-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .media-card > img,
  .media-picker-card > img,
  .media-card > .media-file-icon,
  .media-picker-card > .media-file-icon {
    height: 7rem;
  }

  .crud-table th,
  .crud-table td {
    padding: 0.75rem;
  }

  .row-actions {
    align-items: stretch;
    flex-direction: column;
    white-space: normal;
  }

  .row-actions .button,
  .row-actions button {
    width: 100%;
  }

  .builder-item {
    grid-template-columns: auto 1fr;
  }

  .block-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .block-actions > * {
    flex: 1;
  }

  .block-actions .button,
  .block-actions button {
    width: 100%;
  }

  .picker-grid,
  .dashboard-links {
    grid-template-columns: 1fr;
  }

  th:nth-child(2),
  td:nth-child(2) {
    display: none;
  }

  .tree {
    padding-left: calc(var(--depth) * 0.65rem);
  }

  .EasyMDEContainer .cms-mde-side-by-side,
  .EasyMDEContainer .cms-mde-fullscreen {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.navigation-editor,
.navigation-list,
.navigation-children {
  display: grid;
  gap: 0.55rem;
}

.navigation-menu {
  box-shadow: var(--admin-shadow);
}

.navigation-menu-heading {
  align-items: center;
}

.navigation-menu > label {
  max-width: 28rem;
  margin-bottom: 1.25rem;
}

.navigation-item {
  overflow: hidden;
  border: 1px solid var(--admin-line);
  border-left: 0.2rem solid var(--admin-accent);
  border-radius: 0.7rem;
  background: var(--admin-surface);
  box-shadow: 0 4px 14px rgb(21 23 34 / 4%);
}

.navigation-item.dragging {
  opacity: 0.45;
}

.navigation-item.drag-over > .navigation-item-row {
  background: var(--admin-accent-soft);
  box-shadow: inset 0 0 0 1px var(--admin-accent);
}

.navigation-item-row,
.navigation-item-actions {
  display: flex;
  align-items: center;
}

.navigation-item-row {
  min-height: 3.4rem;
  gap: 0.7rem;
  padding: 0.5rem 0.65rem;
}

.navigation-item-summary {
  display: grid;
  min-width: 0;
  margin-right: auto;
  gap: 0.08rem;
}

.navigation-item-summary strong,
.navigation-item-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigation-item-summary small {
  color: var(--admin-muted);
  font-size: 0.76rem;
}

.drag-handle {
  display: grid;
  flex: 0 0 1.65rem;
  width: 1.65rem;
  min-height: 2.25rem;
  place-items: center;
  color: var(--admin-muted);
  font-weight: 800;
  letter-spacing: -0.25em;
  cursor: grab;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.navigation-item-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 0.35rem;
}

.navigation-item-actions .button {
  min-height: 2rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.76rem;
}

.icon-button {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.2rem;
  border: 1px solid var(--admin-line);
  border-radius: 0.45rem;
  color: var(--admin-ink);
  background: #fff;
  cursor: pointer;
}

.navigation-children {
  margin: 0.1rem 0.45rem 0.5rem 1.35rem;
  padding-left: 0.75rem;
  border-left: 1px dashed #c9cddd;
}

.navigation-dialog {
  width: min(44rem, calc(100% - 2rem));
  max-height: min(46rem, calc(100vh - 2rem));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 1rem;
  background: var(--admin-surface);
  box-shadow: 0 30px 80px rgb(21 23 34 / 28%);
}

.navigation-dialog::backdrop {
  background: rgb(21 23 34 / 58%);
  backdrop-filter: blur(3px);
}

.navigation-dialog-form {
  max-height: min(46rem, calc(100vh - 2rem));
  padding: 1.25rem;
  overflow: auto;
}

.navigation-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.navigation-dialog-heading h2 {
  margin: 0;
}

.navigation-dialog-fields,
.navigation-dialog-labels {
  display: grid;
  gap: 0.85rem;
}

.navigation-dialog-labels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.navigation-dialog-footer {
  justify-content: flex-end;
  padding-top: 0.25rem;
  border-top: 1px solid var(--admin-line);
}

.code-editor {
  min-height: 10rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  tab-size: 2;
}

.code-editor.tall {
  min-height: 20rem;
}

.settings-submenu {
  position: sticky;
  z-index: 5;
  top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  padding: 0.55rem;
  border: 1px solid var(--admin-line);
  border-radius: 0.8rem;
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--admin-shadow);
  backdrop-filter: blur(14px);
  overflow-x: auto;
}

.settings-submenu a {
  flex: 0 0 auto;
  padding: 0.6rem 0.85rem;
  border-radius: 0.55rem;
  color: var(--admin-muted);
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
}

.settings-submenu a:hover,
.settings-submenu a:focus-visible {
  color: var(--admin-accent);
  background: var(--admin-accent-soft);
}

.settings-component {
  scroll-margin-top: 6rem;
}

.text-file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.redirect-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.redirect-form {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(12rem, 1.4fr) 7rem auto auto;
  gap: 0.75rem;
  align-items: end;
}

.redirect-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.media-lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  padding: 0;
  border: 0;
  background: rgb(8 10 16 / 96%);
}

.media-lightbox::backdrop {
  background: rgb(8 10 16 / 80%);
}

.media-lightbox figure {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 4rem 1.25rem 2rem;
}

.media-lightbox img {
  max-width: 100%;
  max-height: calc(100dvh - 7rem);
  object-fit: contain;
  border-radius: 0.65rem;
  box-shadow: 0 2rem 5rem rgb(0 0 0 / 45%);
}

.media-lightbox figcaption {
  color: #fff;
  font-size: 0.85rem;
}

.media-lightbox-close {
  position: fixed;
  z-index: 2;
  top: 1rem;
  right: 1rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 50%;
  color: #fff;
  background: rgb(255 255 255 / 10%);
  font-size: 1.5rem;
}

.toggle-grid,
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.compact-check {
  min-height: 2.8rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--admin-line);
  border-radius: 0.65rem;
  background: #fafbfc;
  overflow-wrap: anywhere;
}

@media (max-width: 60rem) {
  .redirect-form,
  .redirect-card,
  .text-file-grid {
    grid-template-columns: 1fr;
  }

  .navigation-item-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .navigation-item-summary {
    padding-top: 0.25rem;
  }

  .navigation-item-actions {
    width: 100%;
    padding-left: 2.35rem;
  }
}

@media (max-width: 42rem) {
  .navigation-dialog-labels {
    grid-template-columns: 1fr;
  }

  .navigation-item-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .navigation-children {
    margin-left: 0.7rem;
    padding-left: 0.45rem;
  }

  .navigation-dialog {
    width: calc(100% - 1rem);
    max-height: calc(100vh - 1rem);
  }

  .navigation-dialog-form {
    max-height: calc(100vh - 1rem);
    padding: 1rem;
  }
}
