:root {
  --bg: #f6f4f1;
  --panel: #ffffff;
  --text: #1f1b17;
  --muted: #756f68;
  --line: #e5ddd4;
  --accent: #c9784b;
  --accent-dark: #a85f38;
  --side: #181612;
  --radius: 8px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Dedicated slider administration */
.slider-list-page { display: grid; gap: 16px; }

.slider-list__item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
}

.slider-list__thumb {
  width: 96px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f4eee8;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.slider-list__thumb img { width: 100%; height: 100%; object-fit: cover; }
.slider-list__main { display: grid; gap: 4px; min-width: 0; }
.slider-list__main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slider-list__main small { color: var(--muted); }
.slider-list__meta { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.slider-list__edit { white-space: nowrap; }

.slide-editor--page { display: grid; gap: 18px; }

.slide-edit-header {
  position: sticky;
  top: 0;
  z-index: 90;
  margin: -4px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(31,27,23,.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.slide-edit-header__main,
.slide-edit-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.slide-edit-header__title { display: grid; gap: 2px; min-width: 0; }
.slide-edit-header__title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slide-edit-header__title span,
.slide-save-state { color: var(--muted); font-size: .82rem; font-weight: 600; }

.slide-save-state {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfaf8;
  white-space: nowrap;
}

.slide-page-builder { display: grid; gap: 16px; }

.slide-page-tabs {
  position: sticky;
  top: 76px;
  z-index: 80;
  padding: 8px 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px 8px 0 0;
  background: rgba(246,244,241,.96);
  backdrop-filter: blur(8px);
}

.slide-page-tabs .nav-link { font-weight: 700; color: var(--muted); }
.slide-page-tabs .nav-link.active { color: var(--accent); }
.slide-responsive-switch .responsive-mode-control { padding: 0; border: 0; background: transparent; }
.slide-page-tabs__content > .tab-pane { padding-top: 0; }
.slide-device-panel { display: grid; gap: 16px; }
.slide-preset-group--compact { margin: 0; }
.slide-preset-group--compact .slide-preset-group__label {
  display: inline-flex;
  align-items: center;
}

.portfolio-admin {
  display: grid;
  gap: 18px;
}

.portfolio-admin__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
}

.portfolio-admin__card {
  overflow: hidden;
}

.portfolio-admin__thumb {
  min-height: 180px;
  background: #f3eee8;
  overflow: hidden;
}

.portfolio-admin__thumb img {
  width: 100%;
  height: auto;
  display: block;
}

.portfolio-admin__switches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 14px;
}

@media (max-width: 900px) {
  .slider-list__item {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .slider-list__thumb {
    width: 72px;
  }

  .slider-list__meta,
  .slider-list__edit {
    grid-column: 2;
    justify-self: start;
  }

  .slide-edit-header {
    align-items: stretch;
    flex-direction: column;
    top: 0;
  }

  .slide-edit-header__actions {
    flex-wrap: wrap;
  }

  .slide-page-tabs {
    top: 128px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .slide-page-tabs .nav-link {
    white-space: nowrap;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

a { color: inherit; text-decoration: none; }

.admin-side {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  padding: 28px 22px;
  background: var(--side);
  color: #f7f1eb;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: width .25s ease, padding .25s ease;
}

.admin-side.compact {
  width: 70px;
  padding: 22px 12px;
  align-items: center;
}

.admin-side__toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 6px;
  background: rgba(255,255,255,.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  align-self: flex-start;
}

.admin-side.compact .admin-side__toggle {
  align-self: center;
}

.admin-side__toggle i {
  font-size: .95rem;
  line-height: 1;
}

.admin-side h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 500;
}

.admin-side.compact h1,
.admin-side.compact .menu-label {
  display: none;
}

.admin-side nav {
  display: grid;
  gap: 6px;
}

.admin-side a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  color: rgba(255,255,255,.72);
}

.admin-side.compact .menu-item {
  justify-content: center;
  width: 46px;
}

.menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-width: 20px;
  height: 20px;
  font-size: .98rem;
}

.admin-side a:hover,
.admin-side a.is-active {
  color: #fff;
  background: rgba(255,255,255,.1);
}

.view-site { margin-top: auto; }
.logout { color: #e8b5a1 !important; }

.admin-main {
  margin-left: 250px;
  padding: 32px;
  transition: margin-left .25s ease;
}

body.admin-compact .admin-main {
  margin-left: 70px;
}

.admin-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.admin-head span {
  color: var(--muted);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.admin-head h2 {
  margin: 4px 0 0;
  font-size: 2rem;
  font-weight: 500;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 10px 30px rgba(31,27,23,.04);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-grid section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.form-grid section:last-of-type {
  grid-column: 1 / -1;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.template-grid > section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: #fff;
}

.template-grid__content {
  grid-column: 1 / -1;
}

.template-editor h3 small {
  color: var(--muted);
  font-weight: 500;
}

h3 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 600;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: .82rem;
  margin-bottom: 13px;
}

input,
textarea,
select {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.file-input {
  margin-top: 8px;
  min-height: 36px;
  padding: 6px;
  font-size: .8rem;
  color: var(--muted);
  background: #fbfaf8;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

textarea.large {
  min-height: 180px;
}

.wysiwyg-editor {
  display: grid;
  gap: 12px;
}

.wysiwyg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wysiwyg-toolbar button {
  padding: 8px 12px;
  background: #f6f4f1;
  color: var(--text);
  border: 1px solid var(--line);
}

.wysiwyg-toolbar button:hover {
  background: #efe8df;
}

.wysiwyg-surface {
  min-height: 240px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  line-height: 1.7;
}

.wysiwyg-surface:focus {
  outline: 2px solid rgba(201, 120, 75, .18);
  outline-offset: 2px;
}

.wysiwyg-surface h2,
.wysiwyg-surface h3,
.wysiwyg-surface p {
  margin: 0 0 12px;
}

.wysiwyg-surface ul,
.wysiwyg-surface ol {
  margin: 0 0 12px 18px;
}

.admin-switch {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  margin: 0 0 13px;
  color: var(--text);
}

.admin-switch .form-check-input {
  appearance: none;
  -webkit-appearance: none;
  float: none;
  flex: 0 0 auto;
  position: relative;
  width: 2.8rem;
  height: 1.55rem;
  min-height: 1.55rem;
  margin: 0;
  margin-left: 0;
  border-color: rgba(117, 111, 104, .35);
  background-color: #e8dfd5;
  background-image: none;
  box-shadow: none;
  cursor: pointer;
  border-radius: 999px;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.admin-switch .form-check-input::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 10px rgba(28, 28, 28, .18);
  transform: translateY(-50%);
  transition: transform .2s ease;
}

.admin-switch .form-check-input:focus {
  border-color: rgba(201, 120, 75, .45);
  box-shadow: 0 0 0 .2rem rgba(201, 120, 75, .16);
}

.admin-switch .form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}

.admin-switch .form-check-input:checked::before {
  transform: translate(1.18rem, -50%);
}

.admin-switch .form-check-label {
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}

.admin-switch--inline {
  margin: 0;
}

button,
.primary,
.secondary {
  border: 0;
  border-radius: 6px;
  padding: 11px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.secondary {
  background: var(--side);
}

button:hover,
.primary:hover {
  background: var(--accent-dark);
}

.notice {
  padding: 10px 14px;
  border-radius: 6px;
  background: #e8f5ee;
  color: #256341;
}

.notice--error {
  background: #fae8e4;
  color: #9e3426;
  margin-bottom: 16px;
}

.admin-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  padding: 13px 20px 13px 14px;
  border-radius: 10px;
  background: #e4f5ec;
  color: #1d5c37;
  font-size: .95rem;
  font-weight: 600;
  box-shadow: 0 6px 28px rgba(0,0,0,.18);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 180px;
  border-left: 4px solid #2e9e5b;
}

.admin-toast::before {
  content: '✓';
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
}

.admin-toast.is-visible {
  opacity: 1;
  transform: none;
}

.admin-toast.is-error {
  background: #fae8e4;
  color: #9e3426;
  border-left-color: #c0392b;
}

.admin-toast.is-error::before {
  content: '✕';
}

.slide-editor__submit.is-saved {
  background: #2a8c54 !important;
  border-color: #2a8c54 !important;
  color: #fff !important;
}

/* ── Slide presets ─────────────────────────────────────────────── */
.slide-preset-group {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  margin-right: auto;
}

.slide-preset-group__label {
  font-size: 0.72rem;
  color: #aaa;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 2px;
}

.slide-preset-btn {
  font-size: 0.75rem;
  padding: 4px 11px;
  border: 1px solid #d8d0c8;
  border-radius: 6px;
  background: #f8f5f2;
  color: #888;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}

.slide-preset-btn:hover {
  background: #f0e8e0;
  color: #555;
  border-color: #c0b8b0;
}

.slide-preset-btn.has-data {
  border-color: var(--admin-accent, #b07050);
  background: #fdf7f2;
  color: var(--admin-accent, #b07050);
  font-weight: 600;
}

.slide-preset-btn.has-data::before {
  content: '● ';
  font-size: 0.45rem;
  vertical-align: middle;
  line-height: 1;
}

.slide-preset-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 200;
  background: #fff;
  border: 1px solid #e0d8d0;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(31,27,23,.14);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 240px;
}

.slide-preset-popover[hidden] { display: none; }

.slide-preset-popover button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  color: #444;
  transition: background .12s;
}

.slide-preset-popover button:hover { background: #f5f0eb; }

.slide-preset-popover button[data-preset-action="clear"] { color: #b44; }

.slide-preset-popover button[data-preset-action="clear"]:hover { background: #fff5f5; }

.slide-preset-popover__sep {
  height: 1px;
  background: #e8e0d8;
  margin: 3px 8px;
}

.stack {
  display: grid;
  gap: 16px;
}

.row-editor h3 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.slide-editor {
  display: block;
}

.slide-editor__details {
  padding: 0;
  overflow: hidden;
}

.slide-editor__summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  cursor: pointer;
  list-style: none;
}

.slide-editor__summary::-webkit-details-marker {
  display: none;
}

.slide-editor__summary::after {
  content: "\f078";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: .7rem;
  flex: 0 0 auto;
  margin-left: auto;
  transition: transform .2s ease;
}

.slide-editor__details[open] .slide-editor__summary {
  border-bottom: 1px solid var(--line);
}

.slide-editor__details[open] .slide-editor__summary::after {
  transform: rotate(180deg);
}

/* Info (title + meta) */
.slide-editor__summary-info {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 5px;
}

.slide-editor__summary-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-editor__summary-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Badges */
.slide-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  background: #f0ebe4;
  color: var(--muted);
  border: 1px solid var(--line);
}

.slide-badge--type {
  background: var(--side);
  color: rgba(255,255,255,.85);
  border-color: var(--side);
}

.slide-badge--new {
  background: #e8f5ee;
  color: #256341;
  border-color: #b8ddc9;
}

/* Active toggle in summary */
.slide-editor__summary-switch {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

.slide-editor__summary-switch .form-check-input {
  float: none;
  margin-left: 0;
}

.slide-editor__summary-switch .form-check-label {
  display: none;
}

/* Body + footer */
.slide-editor__body {
  padding: 22px;
}

.slide-editor__footer {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
  padding: 12px 22px;
  display: flex;
  justify-content: flex-end;
  z-index: 20;
  box-shadow: 0 -4px 20px rgba(31,27,23,.07);
}

.slide-builder {
  display: grid;
  gap: 18px;
}

.slide-builder__content {
  display: grid;
  gap: 18px;
}

.slide-media-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.slide-media-card__head h6,
.slide-responsive-builder__groups h6 {
  margin: 0 0 6px;
  font-size: .95rem;
}

.slide-media-card__head p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
}

.slide-media-card__preview,
.slide-media-preview {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfaf8;
}

.slide-media-card__preview {
  display: grid;
  place-items: center;
  min-height: 160px;
  margin-bottom: 14px;
  overflow: hidden;
}

.slide-media-card__preview img,
.slide-media-preview__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slide-media-card__preview span {
  color: var(--muted);
  font-size: .84rem;
}

.slide-media-preview {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  padding: 12px;
}

.slide-media-preview__thumb {
  min-height: 88px;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .8rem;
}

.slide-media-preview__meta {
  display: grid;
  align-content: center;
  gap: 4px;
}

.slide-media-preview__meta strong {
  font-size: .9rem;
}

.slide-media-preview__meta p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
}

.range-field__body {
  display: grid;
  gap: 10px;
}

.slide-field-groups {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.field-accordion {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf8;
  overflow: hidden;
}

.field-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-weight: 700;
}

.field-accordion summary::-webkit-details-marker {
  display: none;
}

.field-accordion summary::after {
  content: "+";
  color: var(--muted);
  font-size: 1rem;
}

.field-accordion[open] summary {
  border-bottom: 1px solid var(--line);
}

.field-accordion[open] summary::after {
  content: "-";
}

.field-accordion .fields {
  padding: 16px;
}

.fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.anchor-grid-field {
  margin: 0 0 13px;
  padding: 0;
  border: 0;
}

.anchor-grid-field legend {
  color: var(--muted);
  font-size: .82rem;
  margin-bottom: 7px;
}

.anchor-grid {
  display: grid;
  grid-template-columns: repeat(3, 34px);
  gap: 6px;
}

.anchor-grid label {
  margin: 0;
}

.anchor-grid input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.anchor-grid span {
  display: block;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfaf8;
}

.anchor-grid input:checked + span {
  border-color: var(--accent);
  background: var(--accent);
}

.color-control {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
}

.color-control input[type="color"] {
  width: 42px;
  min-height: 42px;
  padding: 4px;
  border-radius: 50%;
}

.color-meta {
  display: grid;
  gap: 2px;
  font-size: .78rem;
}

.color-meta em {
  color: var(--muted);
  font-style: normal;
}

.color-copy {
  padding: 9px 10px;
  background: var(--side);
  font-size: .78rem;
}

.fields label:has(textarea) {
  grid-column: span 2;
}

.message {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.message:first-child { padding-top: 0; }
.message:last-child { border-bottom: 0; }

.message strong,
.message a,
.message span {
  display: inline-block;
  margin-right: 14px;
}

.message span { color: var(--muted); }
.message p { margin: 10px 0 0; color: var(--text); }

.services-preview-admin > .fields {
  margin-bottom: 22px;
}

.services-preview-list {
  display: grid;
  gap: 16px;
  margin-bottom: 20px;
}

.services-preview-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fbfaf8;
}

.services-preview-item h4 {
  margin: 0 0 14px;
  font-size: .95rem;
  font-weight: 600;
}

.slider-position-control {
  display: grid;
  gap: 10px;
}

.slider-position-control__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.slider-position-control__switch {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.slider-position-control__button {
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}

.slider-position-control__button.is-active {
  background: var(--accent);
  color: #fff;
}

.slider-position-control__note {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
}

.slider-position-control__free {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.slider-position-control__anchor.is-hidden,
.slider-position-control__free.is-hidden,
.slider-position-control__note.is-hidden {
  display: none;
}

.responsive-mode-control {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf8;
}

.responsive-mode-control__bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.responsive-mode-control__switch-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.responsive-mode-control__switch-state {
  min-width: 32px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--muted);
  text-align: right;
}

.responsive-mode-control__subtext {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .82rem;
}

.slide-device-picker {
  display: grid;
  gap: 10px;
}

.slide-device-picker__label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.slide-device-picker__group {
  width: 100%;
}

.slide-device-picker__group > .btn {
  flex: 1 1 0;
}

.slide-device-picker__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.responsive-mode-control__switch {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.responsive-mode-control__note {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
}

.slide-responsive-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.slide-responsive-layout__nav {
  position: sticky;
  top: 18px;
}

.slide-responsive-layout__nav .list-group-item {
  border-color: var(--line);
  font-weight: 600;
  color: var(--text);
  background: #fff;
}

.slide-responsive-layout__nav .list-group-item.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.slide-responsive-accordion {
  display: grid;
  gap: 14px;
}

.slide-responsive-accordion .accordion-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.slide-responsive-accordion .accordion-button {
  font-weight: 700;
  color: var(--text);
  background: #fff;
}

.slide-responsive-accordion .accordion-button:not(.collapsed) {
  color: var(--text);
  background: #fbfaf8;
  box-shadow: none;
}

.slide-responsive-accordion .accordion-button:focus {
  box-shadow: 0 0 0 .2rem rgba(201, 120, 75, .16);
}

.slide-responsive-accordion .accordion-body {
  background: #fff;
}

.is-hidden {
  display: none !important;
}

.slider-placement {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-placement__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.slider-placement__head .form-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0;
  white-space: nowrap;
}

.slider-placement__label {
  font-size: .7rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.slider-placement__frame {
  display: inline-grid;
  grid-template-columns: repeat(3, 26px);
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  flex-shrink: 0;
}

.slider-placement__zone {
  width: 26px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid #d8d0c8;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}

.slider-placement__zone::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c5bab2;
  pointer-events: none;
}

.slider-placement__zone:hover {
  border-color: var(--accent);
  background: rgba(201,120,75,.08);
}

.slider-placement__zone:hover::before {
  background: var(--accent);
}

.slider-placement__zone.is-selected {
  background: var(--accent);
  border-color: var(--accent);
}

.slider-placement__zone.is-selected::before {
  background: #fff;
}

.admin-login {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-box {
  width: min(420px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.login-box h1 {
  margin: 0 0 6px;
}

.login-box p {
  margin: 0 0 22px;
  color: var(--muted);
}

@media (max-width: 900px) {
  /* Force compact sidebar (icons only, fixed) at narrow widths */
  .admin-side {
    width: 70px;
    padding: 22px 12px;
    align-items: center;
  }

  .admin-side h1,
  .admin-side .menu-label {
    display: none;
  }

  .admin-side .menu-item {
    justify-content: center;
    width: 46px;
  }

  .admin-side__toggle {
    align-self: center;
  }

  .admin-main {
    margin-left: 70px;
    padding: 20px;
  }

  body.admin-compact .admin-main {
    margin-left: 70px;
  }

  .form-grid,
  .fields,

  .fields label:has(textarea),
  .form-grid section:last-of-type {
    grid-column: auto;
  }

  .slide-responsive-builder__groups,
  .slide-responsive-layout,
  .slide-media-preview {
    grid-template-columns: 1fr;
  }

  .slide-device-picker__group {
    flex-direction: column;
  }

  .slide-responsive-layout__nav {
    position: static;
  }
}

/* ── Placement panel ─────────────────────────────────────────── */

.placement-accordion .accordion-button {
  font-weight: 600;
  font-size: .88rem;
  color: var(--text);
  background: #fbfaf8;
  padding: 12px 16px;
}

.placement-accordion .accordion-button:not(.collapsed) {
  color: var(--accent);
  background: #fff8f4;
  box-shadow: none;
}

.placement-accordion .accordion-button:focus {
  box-shadow: 0 0 0 .2rem rgba(201,120,75,.16);
}

.placement-accordion .accordion-body {
  background: #fff;
  padding: 16px;
}

.placement-accordion .accordion-item {
  border: 1px solid var(--line);
  border-radius: var(--radius) !important;
  overflow: hidden;
  margin-bottom: 8px;
}

.placement-accordion .accordion-item:last-child {
  margin-bottom: 0;
}

.placement-responsive-section {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.placement-responsive-section__header {
  padding: 10px 14px;
  background: #fff8f0;
  border-radius: var(--radius);
  border: 1px solid #ffe0c0;
}

/* Slide builder sections */
.slide-builder {
  display: grid;
  gap: 16px;
}

/* Bootstrap nav-tabs inside card headers */
.card-header > .nav-tabs {
  margin-bottom: -1px;
}

.card-header > .nav-tabs .nav-link {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 600;
  border-radius: 6px 6px 0 0;
}

.card-header > .nav-tabs .nav-link.active {
  color: var(--accent);
  border-color: var(--line) var(--line) #fff;
}

/* Bootstrap form controls integration */
.form-label {
  color: var(--muted);
  font-size: .82rem;
  margin-bottom: 5px;
}

/* Tab pane spacing */
.tab-pane {
  padding-top: 4px;
}

/* Slide media card preview inside medias tab */
.slide-media-card__preview {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfaf8;
  overflow: hidden;
  margin-bottom: 10px;
}

.slide-media-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive device section inside placement */
.slide-device-tabs {
  display: grid;
  gap: 14px;
}

.slide-device-tabs__panel {
  display: none;
}

.slide-device-tabs__panel.is-active {
  display: block;
}

/* ── Tab Éléments (Logo / CTA / Filigrane) ───────────────────── */

.slide-elements {
  display: grid;
  gap: 0;
}

.slide-element {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.slide-element:first-child {
  padding-top: 4px;
}

.slide-element:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.slide-element__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.slide-element__label {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
}

.slide-element__preview {
  max-height: 52px;
  border-radius: 5px;
  border: 1px solid var(--line);
}

/* ── Range inputs ─────────────────────────────────────────────── */

input[type="range"] {
  accent-color: var(--accent);
  height: 20px;
  cursor: pointer;
}

/* ── Bootstrap btn overrides pour cohérence accent ───────────── */

.btn-primary {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-dark);
  --bs-btn-hover-border-color: var(--accent-dark);
  --bs-btn-active-bg: var(--accent-dark);
  --bs-btn-focus-shadow-rgb: 201, 120, 75;
}

/* ── Slide list spacing ───────────────────────────────────────── */

.stack > .slide-editor + .slide-editor {
  margin-top: 8px;
}

/* ── Position control free X/Y fields ────────────────────────── */

.slider-position-control__free label {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 0;
}

.slider-position-control__free input {
  margin-top: 5px;
}

/* ── Sticky action bar ───────────────────────────────────────── */

.admin-sticky-bar {
  position: fixed;
  bottom: 82px;
  right: 24px;
  z-index: 150;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(31,27,23,.13), 0 2px 8px rgba(31,27,23,.06);
  padding: 13px 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  width: 268px;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.admin-sticky-bar.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: all;
}

.admin-sticky-bar__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.admin-sticky-bar__icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #f5f0ea;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .68rem;
  color: var(--muted);
  flex-shrink: 0;
}

.admin-sticky-bar__slide-name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.admin-sticky-bar__presets {
  display: flex;
  align-items: center;
  gap: 5px;
  position: relative;
}

.admin-sticky-bar__presets-label {
  font-size: .68rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-right: 2px;
  white-space: nowrap;
}

.admin-sticky-bar__popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 10;
  background: var(--panel);
  border: 1px solid #e0d8d0;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(31,27,23,.15);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 230px;
  white-space: nowrap;
}

.admin-sticky-bar__popover button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: .83rem;
  cursor: pointer;
  color: #444;
  transition: background .12s;
  font-family: var(--font);
}

.admin-sticky-bar__popover button:hover {
  background: #f5f0eb;
}

.admin-sticky-bar__popover button.is-destructive {
  color: #b44;
}

.admin-sticky-bar__popover button.is-destructive:hover {
  background: #fff5f5;
}

.admin-sticky-bar__popover-sep {
  height: 1px;
  background: var(--line);
  margin: 3px 0;
}

.admin-sticky-bar__save {
  width: 100%;
  font-size: .83rem;
  padding: 9px 14px;
}
