:root {
  color-scheme: light;
  --bg: #fafafc;
  --panel: #ffffff;
  --panel-soft: rgba(255, 255, 255, 0.74);
  --text: #171719;
  --muted: #6e6e73;
  --line: rgba(23, 23, 25, 0.08);
  --primary: #ff4d8d;
  --secondary: #ff7a59;
  --green: #2fbf71;
  --danger: #b42318;
  --shadow: 0 18px 54px rgba(19, 20, 28, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 77, 141, 0.035), transparent 280px),
    var(--bg);
}

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

button {
  border: 0;
  border-radius: 15px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(255, 77, 141, 0.18);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbfd;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  font-size: 13px;
  font-weight: 650;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 77, 141, 0.44);
  box-shadow: 0 0 0 4px rgba(255, 77, 141, 0.08);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 28% 20%, rgba(255, 77, 141, 0.12), transparent 28%),
    radial-gradient(circle at 68% 80%, rgba(255, 122, 89, 0.11), transparent 30%),
    var(--bg);
}

.login-brand {
  position: fixed;
  top: 24px;
  left: 26px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 12px 26px rgba(255, 77, 141, 0.22);
}

.login-card {
  width: min(480px, 100%);
  display: grid;
  gap: 16px;
  padding: 30px;
  border-radius: 34px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: 0 28px 80px rgba(22, 23, 30, 0.12);
  backdrop-filter: blur(26px);
}

.login-card h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.76);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(24px);
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rail-brand strong {
  display: block;
  line-height: 1.05;
}

.rail-brand small,
.rail-footer {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.rail-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.nav-item,
.text-button,
.icon-button,
.danger {
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
}

.nav-item {
  text-align: left;
  padding: 11px 12px;
}

.nav-item.is-active {
  color: var(--primary);
  background: rgba(255, 77, 141, 0.08);
  border-color: rgba(255, 77, 141, 0.12);
}

.rail-footer {
  display: grid;
  gap: 8px;
}

.text-button {
  width: fit-content;
  padding: 0;
  color: var(--primary);
}

.studio {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 22px;
}

.studio-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.studio-header h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.02;
}

.header-actions {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 146px auto;
  gap: 10px;
  width: min(660px, 100%);
}

.status-banner {
  border-radius: 18px;
  padding: 12px 14px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(20, 20, 30, 0.05);
  font-weight: 800;
}

.status-banner.error {
  color: var(--danger);
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metrics-row article,
.panel {
  background: var(--panel-soft);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.metrics-row article {
  display: grid;
  gap: 5px;
  border-radius: 20px;
  padding: 14px 16px;
}

.metrics-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.metrics-row strong {
  font-size: 26px;
}

.cms-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.76fr) minmax(420px, 1.15fr) minmax(320px, 0.86fr);
  gap: 16px;
  align-items: start;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 16px;
}

.panel-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h3 {
  margin: 0;
  font-size: 19px;
}

.panel-title.compact {
  align-items: center;
}

.icon-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 12px;
  background: white;
  border-color: var(--line);
}

.places-list,
.media-list {
  display: grid;
  gap: 10px;
}

.place-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  padding: 10px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.place-card:hover,
.place-card.is-active {
  transform: translateY(-1px);
  border-color: rgba(255, 77, 141, 0.34);
  box-shadow: 0 12px 28px rgba(255, 77, 141, 0.10);
}

.place-head {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.thumb {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 77, 141, 0.12), rgba(255, 122, 89, 0.12));
}

.place-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.22;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border-radius: 999px;
  background: rgba(23, 23, 25, 0.045);
  color: var(--muted);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.chip.hot {
  color: var(--primary);
  background: rgba(255, 77, 141, 0.08);
}

.editor-column {
  display: grid;
  gap: 14px;
}

.editor-actions {
  display: flex;
  gap: 8px;
}

.danger {
  color: var(--danger);
  background: white;
  border-color: rgba(180, 35, 24, 0.14);
}

.editor-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: 17px;
  background: rgba(23, 23, 25, 0.045);
}

.editor-tab {
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

.editor-tab.is-active {
  color: var(--text);
  background: white;
  box-shadow: 0 8px 18px rgba(20, 20, 30, 0.07);
}

.editor-section {
  display: none;
  gap: 12px;
}

.editor-section.is-active {
  display: grid;
}

.field-grid {
  display: grid;
  gap: 12px;
}

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

.switch-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
}

.switch-line input {
  width: auto;
}

.preview-column {
  display: grid;
  gap: 16px;
}

.phone-preview {
  display: grid;
  gap: 12px;
}

.app-card-preview {
  overflow: hidden;
  border-radius: 26px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 18px 36px rgba(20, 20, 30, 0.09);
}

.preview-cover {
  position: relative;
  height: 210px;
  background: linear-gradient(135deg, rgba(255, 77, 141, 0.18), rgba(255, 122, 89, 0.10));
}

.preview-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-pill {
  position: absolute;
  left: 12px;
  bottom: 12px;
  color: white;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 850;
}

.preview-rating {
  position: absolute;
  right: 12px;
  bottom: 12px;
  color: white;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 850;
}

.preview-body {
  display: grid;
  gap: 10px;
  padding: 13px;
}

.preview-body h4 {
  margin: 0;
  font-size: 17px;
  line-height: 1.18;
}

.preview-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.preview-quote {
  border-radius: 14px;
  background: var(--bg);
  padding: 10px;
  color: rgba(23, 23, 25, 0.78);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.38;
}

.upload-form {
  display: grid;
  gap: 10px;
}

.media-card {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: white;
  padding: 9px;
}

.media-card img,
.media-card video {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 13px;
  background: #eee;
}

.media-card strong {
  display: block;
  font-size: 13px;
}

.media-card code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

@media (max-width: 1240px) {
  .cms-grid {
    grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
  }

  .preview-column {
    grid-column: 1 / -1;
    grid-template-columns: 360px minmax(0, 1fr);
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    height: auto;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .rail-nav {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
  }

  .studio-header {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions,
  .cms-grid,
  .preview-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .studio,
  .rail {
    padding: 14px;
  }

  .metrics-row,
  .field-grid.two {
    grid-template-columns: 1fr;
  }

  .login-card {
    padding: 22px;
  }
}
