@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

:root {
  --brand: #a9c5f2;
  --brand-deep: #5d8be0;
  --brand-soft: #dce8fb;
  --ink: #0b1220;
  --ink-soft: #1a2436;
  --muted: #717c8c;
  --bg: #ffffff;
  --bg-soft: #f5f8fe;
  --line: rgba(11, 18, 32, 0.12);
  --line-soft: rgba(11, 18, 32, 0.07);
  --live: #3d9b6a;
  --draft: #9aa5b5;
  --danger: #d64565;
  --radius: 16px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --side: 72px;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
}

*, *::before, *::after { box-sizing: border-box; }

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

::selection {
  background: var(--brand);
  color: var(--ink);
}

.dash {
  display: grid;
  grid-template-columns: var(--side) 1fr;
  min-height: 100vh;
  position: relative;
}

.dash__glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 45% at 10% -5%, rgba(169, 197, 242, 0.35), transparent 55%),
    radial-gradient(ellipse 40% 35% at 95% 100%, rgba(93, 139, 224, 0.12), transparent 50%);
  z-index: 0;
}

.dash-side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-6) 0 var(--sp-5);
  border-right: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  z-index: 2;
}

.dash-brand {
  width: 40px;
  height: 40px;
  margin-bottom: var(--sp-8);
}

.dash-brand img { width: 100%; height: 100%; object-fit: contain; }

.dash-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex: 1;
}

.dash-nav__item {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--muted);
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}

.dash-nav__item svg { width: 20px; height: 20px; }

.dash-nav__item:hover {
  color: var(--brand-deep);
  background: var(--bg-soft);
}

.dash-nav__item.is-active {
  color: var(--ink);
  background: linear-gradient(135deg, rgba(169, 197, 242, 0.45), rgba(93, 139, 224, 0.2));
}

.dash-nav__item--out { margin-top: auto; }

.dash-main {
  position: relative;
  z-index: 1;
  min-width: 0;
  background: var(--bg-soft);
}

.dash-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  padding: var(--sp-6) clamp(var(--sp-5), 4vw, var(--sp-10)) var(--sp-5);
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
}

.dash-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dash-head__title {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

.dash-back {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--bg);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.dash-back svg { width: 18px; height: 18px; }

.dash-back:hover {
  color: var(--brand-deep);
  border-color: rgba(93, 139, 224, 0.35);
  background: var(--bg-soft);
}

.dash-head__actions {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  flex-wrap: wrap;
}

.dash-content {
  padding: var(--sp-6) clamp(var(--sp-5), 4vw, var(--sp-10)) var(--sp-10);
  max-width: 1120px;
}

.dash-content--wide {
  max-width: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 40px;
  padding: 0.625rem 1.125rem;
  border-radius: 999px;
  border: none;
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease);
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn--fill {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(93, 139, 224, 0.25);
}

.btn--fill:hover {
  box-shadow: 0 6px 22px rgba(93, 139, 224, 0.35);
}

.btn--ghost {
  background: var(--bg);
  color: var(--brand-deep);
  border: 1px solid var(--line);
}

.btn--ghost:hover {
  background: var(--bg-soft);
  border-color: rgba(93, 139, 224, 0.3);
}

.btn--icon {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 10px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
}

.btn--sm {
  min-height: 32px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}

.btn--icon:hover {
  color: var(--brand-deep);
  border-color: rgba(93, 139, 224, 0.35);
  background: var(--brand-soft);
}

.btn--danger {
  background: var(--bg);
  color: var(--danger);
  border: 1px solid rgba(214, 69, 101, 0.25);
}

.btn svg { width: 16px; height: 16px; }

/* Toast */
.toast {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid rgba(61, 155, 106, 0.3);
  color: var(--live);
  font-size: 0.85rem;
  box-shadow: 0 8px 30px rgba(11, 18, 32, 0.08);
  animation: toast-in 0.35s var(--ease);
}

.toast--err {
  border-color: rgba(214, 69, 101, 0.3);
  color: var(--danger);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Project grid */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-5);
}

.proj-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.proj-card__hit {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.proj-card__hit:focus-visible {
  outline: 2px solid var(--brand-deep);
  outline-offset: -2px;
}

.proj-card:hover {
  border-color: rgba(93, 139, 224, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(93, 139, 224, 0.12);
}

.proj-card__thumb {
  aspect-ratio: 16 / 9;
  background: var(--bg-soft);
  overflow: hidden;
}

.proj-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease);
}

.proj-card__thumb-empty {
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(169, 197, 242, 0.35), rgba(220, 232, 251, 0.8)),
    repeating-linear-gradient(-45deg, rgba(93, 139, 224, 0.08) 0 10px, transparent 10px 20px);
}

.proj-card:hover .proj-card__thumb img {
  transform: scale(1.04);
}

.proj-card__body {
  padding: var(--sp-5);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.proj-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.proj-card__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.proj-card__status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 0.35rem;
  flex-shrink: 0;
}

.proj-card__status--live { background: var(--live); box-shadow: 0 0 0 3px rgba(61, 155, 106, 0.15); }
.proj-card__status--draft { background: var(--draft); }

.proj-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.chip {
  font-size: 0.6875rem;
  padding: 0.3rem 0.625rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  border: 1px solid rgba(93, 139, 224, 0.15);
  font-weight: 500;
}

.chip--star::before { content: '★ '; opacity: 0.7; }

.chip--muted {
  background: rgba(11, 18, 32, 0.05);
  color: var(--muted);
  border-color: var(--line);
}

.proj-card__foot {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  border-top: 1px solid var(--line-soft);
}

.proj-card__order {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--muted);
  align-self: center;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
  background: var(--bg-soft);
}

.login-page .dash__glow { position: absolute; }

.login-card {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  padding: var(--sp-10) var(--sp-8);
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(93, 139, 224, 0.12);
  text-align: center;
}

.login-card__logo {
  width: 52px;
  margin: 0 auto var(--sp-6);
}

.login-card h1 {
  margin: 0 0 var(--sp-8);
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.login-card .field {
  text-align: left;
  margin-bottom: var(--sp-5);
}

.login-card .field:last-of-type {
  margin-bottom: var(--sp-6);
}

.login-card .btn {
  width: 100%;
  margin-top: 0;
  padding: 0.75rem var(--sp-5);
}

.toast--inline {
  position: static;
  margin-bottom: var(--sp-5);
  box-shadow: none;
  animation: none;
}

.login-card .toast--err {
  margin-bottom: var(--sp-5);
}

.login-card__hint {
  margin: 0 0 var(--sp-5);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.login-card__hint a {
  color: var(--brand-deep);
}

/* Form */
.form {
  width: 100%;
}

.form--project {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  width: 100%;
}

.form--project .form-tabs {
  margin-bottom: 0;
}

.form--project .form-pane.is-active {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5);
  align-items: start;
}

.form--project .form-pane.is-active > .panel--full {
  grid-column: 1 / -1;
}

@media (max-width: 960px) {
  .form--project .form-pane.is-active {
    grid-template-columns: 1fr;
  }
}

.form-tabs {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
  overflow-x: auto;
  padding-bottom: var(--sp-1);
}

.form-tab {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.form-tab:hover { color: var(--ink); }

.form-tab.is-active {
  color: var(--brand-deep);
  background: var(--brand-soft);
  border-color: rgba(93, 139, 224, 0.25);
}

.form-pane { display: none; }
.form-pane.is-active {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.panel {
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: var(--sp-6);
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.panel--stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.field {
  display: block;
  margin-bottom: 0;
}

.panel .field + .field,
.panel--stack .field {
  margin-top: 0;
}

.field span {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-bottom: var(--sp-2);
  font-weight: 500;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 0.75rem 0.875rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: rgba(93, 139, 224, 0.5);
  box-shadow: 0 0 0 3px rgba(169, 197, 242, 0.35);
}

.field input::placeholder,
.field textarea::placeholder { color: #a0aab8; }

.field textarea {
  min-height: 5.5rem;
  line-height: 1.5;
  resize: vertical;
}

.field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
}

.field-row .field {
  margin-bottom: 0;
}

.toggles {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.toggle {
  position: relative;
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle span {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg-soft);
  transition: all 0.2s var(--ease);
}

.toggle input:checked + span {
  color: var(--brand-deep);
  border-color: rgba(93, 139, 224, 0.35);
  background: var(--brand-soft);
}

.toggle--cat input:checked + span {
  color: var(--ink);
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  border-color: transparent;
}

.upload-zone {
  border: 1px dashed rgba(93, 139, 224, 0.4);
  border-radius: 12px;
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
  cursor: pointer;
  background: var(--bg-soft);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.upload-zone + .upload-zone {
  margin-top: var(--sp-4);
}

.preview {
  width: 100%;
  max-width: 240px;
  border-radius: 12px;
  margin-bottom: var(--sp-5);
  border: 1px solid var(--line-soft);
}

.preview-wrap {
  margin-bottom: var(--sp-4);
}

.preview-wrap .preview[hidden] {
  display: none;
}

.media-thumb--pending {
  outline: 2px dashed rgba(93, 139, 224, 0.55);
  outline-offset: -2px;
}

.media-thumb__badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  background: rgba(11, 18, 32, 0.78);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.media-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
}

.media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.media-thumb__remove:hover {
  background: #fff;
}

.admin-gallery-preview {
  margin-bottom: var(--sp-5);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line-soft);
}

.admin-gallery-preview .field-hint {
  margin-bottom: var(--sp-4);
}

.admin-gallery-preview .proj-gallery {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.admin-gallery-preview .proj-gallery-scroll {
  margin-inline: 0;
  width: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}

.admin-gallery-preview .proj-gallery-scroll__item img {
  height: clamp(120px, 22vh, 180px);
  max-width: min(320px, 72vw);
}

.proj-gallery-scroll {
  overflow: hidden;
}

.proj-gallery-scroll__track {
  display: flex;
  gap: 0.85rem;
  width: max-content;
  padding-block: 0.25rem;
  animation: projGalleryScroll var(--gallery-duration, 30s) linear infinite;
  will-change: transform;
}

.proj-gallery-scroll:hover .proj-gallery-scroll__track {
  animation-play-state: paused;
}

.proj-gallery-scroll__item {
  flex: 0 0 auto;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  background: var(--bg-soft);
}

.proj-gallery-scroll__item img {
  display: block;
  object-fit: cover;
}

@keyframes projGalleryScroll {
  to { transform: translateX(-50%); }
}

.upload-zone:hover {
  border-color: var(--brand-deep);
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.upload-zone input { display: none; }

.repeat { display: flex; flex-direction: column; gap: var(--sp-3); }

.repeat__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  align-items: start;
}

.repeat__row--2 { grid-template-columns: 1fr 1fr auto; }

.repeat__row input,
.repeat__row textarea {
  width: 100%;
  padding: 0.6875rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.85rem;
}

.repeat__row textarea { resize: vertical; min-height: 2.5rem; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  margin-top: 2px;
}

.icon-btn:hover { color: var(--danger); background: rgba(214, 69, 101, 0.08); }

.panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: 0;
}

.panel__head + .repeat,
.panel__head + .toggles,
.panel__head + .field-row,
.panel__head + .preview,
.panel__head + .media-grid,
.panel__head + .admin-gallery-preview,
.panel__head + .upload-zone {
  margin-top: 0;
}

.panel__head span {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 500;
}

.form-foot {
  position: sticky;
  bottom: 0;
  padding: var(--sp-6) 0 var(--sp-2);
  margin-top: var(--sp-6);
  background: linear-gradient(180deg, transparent, var(--bg-soft) 40%);
}

.empty {
  text-align: center;
  padding: var(--sp-10) var(--sp-5);
  color: var(--muted);
  font-size: 0.9375rem;
}

.empty .btn {
  margin-top: var(--sp-5);
}

.visibility-note {
  margin-bottom: var(--sp-5);
  padding: var(--sp-4) var(--sp-5);
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--bg);
}

.visibility-note p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.visibility-note__hint {
  margin-top: 0.35rem !important;
  color: var(--muted) !important;
  font-size: 0.82rem !important;
}

/* Settings */
.settings {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  max-width: 560px;
}

.settings--wide {
  max-width: 720px;
}

.cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.settings-row__info.p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.settings-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}

.settings-row__info {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  min-width: 0;
}

.settings-row__label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 500;
}

.settings-row__info p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.45;
}

.settings-row__info strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s var(--ease), visibility 0.25s var(--ease);
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal[hidden] { display: none; }
.modal.is-open[hidden] { display: grid; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, 0.35);
  backdrop-filter: blur(4px);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: var(--bg);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: var(--sp-6);
  box-shadow: 0 24px 64px rgba(93, 139, 224, 0.18);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s var(--ease);
}

.modal.is-open .modal__dialog {
  transform: translateY(0) scale(1);
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.modal__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.modal__close {
  margin-top: 0;
}

.modal__error {
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 10px;
  background: rgba(214, 69, 101, 0.08);
  border: 1px solid rgba(214, 69, 101, 0.2);
  color: var(--danger);
  font-size: 0.875rem;
}

.modal__form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
  padding-top: var(--sp-2);
}

@media (max-width: 768px) {
  .dash { grid-template-columns: 1fr; }

  .dash-side {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    right: 0;
    height: auto;
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    border-right: none;
    border-top: 1px solid var(--line-soft);
  }

  .dash-brand { display: none; }
  .dash-nav { flex-direction: row; flex: none; }
  .dash-nav__item--out { margin-top: 0; }
  .dash-main { padding-bottom: 72px; }

  .field-row,
  .repeat__row,
  .repeat__row--2 { grid-template-columns: 1fr; }

  .settings-row {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-row .btn {
    width: 100%;
  }

  .modal__actions {
    flex-direction: column-reverse;
  }

  .modal__actions .btn {
    width: 100%;
  }
}
