.settings-main {
  width: min(1540px, 100%);
  margin: 0 auto;
  padding: 30px 30px 64px;
}

.settings-intro {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 30px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 15%, color-mix(in srgb, var(--blue) 58%, transparent), transparent 28%),
    linear-gradient(112deg, var(--navy) 0%, var(--navy-2) 65%, var(--blue) 120%);
  box-shadow: var(--shadow);
}
.settings-load-state { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid #dbe5f3; border-radius: 14px; background: #f8fbff; color: #385476; }
.settings-load-state[hidden] { display: none; }
.settings-load-state.is-error { border-color: #efd6ad; background: #fffaf1; color: #805b24; }
.settings-load-state__mark { width: 13px; height: 13px; flex: 0 0 auto; border: 2px solid #bfd0e8; border-top-color: var(--blue); border-radius: 50%; animation: settings-load-spin .8s linear infinite; }
.settings-load-state.is-error .settings-load-state__mark { border: 0; border-radius: 0; animation: none; }
.settings-load-state.is-error .settings-load-state__mark::before { content: "!"; display: grid; width: 22px; height: 22px; place-items: center; border-radius: 7px; background: #fff0d2; font-weight: 900; }
.settings-load-state div { min-width: 0; flex: 1; }
.settings-load-state strong { display: block; color: inherit; font-size: 13px; }
.settings-load-state p { margin: 3px 0 0; color: inherit; font-size: 11px; line-height: 1.45; }
.settings-load-state button { flex: 0 0 auto; }
@keyframes settings-load-spin { to { transform: rotate(360deg); } }

.settings-intro::after {
  content: "";
  position: absolute;
  width: 250px;
  height: 250px;
  right: -68px;
  bottom: -160px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(255, 255, 255, .035), 0 0 0 72px rgba(255, 255, 255, .02);
}

.settings-intro > * { position: relative; z-index: 1; }
.settings-intro h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.04em; }
.settings-intro p:not(.eyebrow) { max-width: 680px; margin: 10px 0 0; color: #d8e8fb; font-size: 13px; line-height: 1.65; }
.owner-badge {
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.11);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.settings-layout {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .7fr);
  gap: 18px;
  align-items: start;
}

.settings-stack { display: grid; gap: 18px; }
.settings-card,
.preview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(31, 62, 104, .055);
}

.settings-card { padding: 22px; }
.settings-card__head,
.preview-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.settings-card__head h2,
.preview-card__head h2 {
  display: inline-block;
  margin: 0 0 0 8px;
  font-size: 16px;
  letter-spacing: -.02em;
}

.settings-card__head p {
  margin: 7px 0 0 38px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.55;
}

.settings-step {
  width: 29px;
  height: 29px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 9px;
  font-weight: 900;
}

.secondary-button,
.primary-button,
.upload-button {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
}

.secondary-button {
  padding: 9px 11px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 9.5px;
}

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

.color-field {
  padding: 14px;
  border: 1px solid #e3eaf3;
  border-radius: 13px;
  background: #fbfcfe;
}

.color-field > span {
  display: block;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 750;
}

.color-field > div {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
}

.color-field input[type="color"] {
  width: 44px;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
}

.color-field input:not([type="color"]) {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.asset-grid {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}

.asset-field {
  min-height: 118px;
  padding: 14px;
  display: grid;
  grid-template-columns: 80px minmax(170px, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid #e3eaf3;
  border-radius: 14px;
  background: #fbfcfe;
}

.asset-preview {
  width: 80px;
  height: 72px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #bfd0e7;
  border-radius: 13px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 11px;
  font-weight: 900;
}

.asset-preview.is-small {
  width: 64px;
  height: 64px;
  margin: 0 8px;
}

.asset-preview img {
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
}

.asset-copy strong { display: block; font-size: 12px; }
.asset-copy span { display: block; margin-top: 5px; color: var(--muted); font-size: 9.5px; line-height: 1.5; }

.asset-actions {
  min-width: 112px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px 10px;
}

.upload-button {
  position: relative;
  overflow: hidden;
  padding: 9px 11px;
  color: #fff;
  background: var(--blue);
  font-size: 9.5px;
}

.upload-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.text-danger,
.text-button-inline {
  padding: 4px 0;
  border: 0;
  background: transparent;
  font-size: 9px;
  font-weight: 750;
  cursor: pointer;
}

.text-danger { color: #c83b4c; }
.text-button-inline { color: var(--blue); }

.timezone-setting {
  margin-top: 22px;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, .65fr);
  gap: 14px;
  align-items: center;
  border: 1px solid #e3eaf3;
  border-radius: 14px;
  background: #fbfcfe;
}
.timezone-setting label > span {
  display: block;
  margin-bottom: 9px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 750;
}
.timezone-setting select {
  width: 100%;
  height: 44px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
}
.timezone-setting select:focus {
  border-color: var(--blue);
  outline: 3px solid color-mix(in srgb, var(--blue) 12%, transparent);
}
.timezone-copy {
  min-height: 64px;
  padding: 11px 12px;
  display: grid;
  align-content: center;
  gap: 5px;
  border-radius: 11px;
  background: var(--blue-soft);
}
.timezone-copy strong { color: var(--blue-2); font-size: 11px; }
.timezone-copy span { color: #61718a; font-size: 9px; line-height: 1.5; }

.preview-card {
  position: sticky;
  top: 96px;
  padding: 20px;
}

.preview-card__head { align-items: center; }
.save-state {
  padding: 6px 9px;
  border-radius: 999px;
  color: #65748b;
  background: #f0f3f7;
  font-size: 8.5px;
  font-weight: 800;
}

.save-state.is-dirty { color: #b66b00; background: #fff2d8; }
.save-state.is-saved { color: #0d8a60; background: #e8f7f0; }

.dashboard-preview {
  --preview-primary: #2563eb;
  --preview-primary-dark: #1d4ed8;
  --preview-sidebar-start: #082a56;
  --preview-sidebar-end: #0b356e;
  --preview-canvas: #f3f7fc;
  min-height: 330px;
  margin-top: 18px;
  display: grid;
  grid-template-columns: 76px 1fr;
  overflow: hidden;
  border: 1px solid #d9e3ef;
  border-radius: 15px;
  background: var(--preview-canvas);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.65);
}

.preview-sidebar {
  padding: 14px 10px;
  display: grid;
  align-content: start;
  gap: 11px;
  background: linear-gradient(180deg, var(--preview-sidebar-start), var(--preview-sidebar-end));
}

.preview-logo {
  width: 100%;
  height: 40px;
  margin: 0 0 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
}

.preview-logo img {
  width: 100%;
  height: 100%;
  padding: 0 5px;
  object-fit: contain;
  object-position: center;
}
.preview-sidebar > span {
  height: 24px;
  border-radius: 7px;
  background: rgba(255,255,255,.08);
}
.preview-sidebar > span.is-active { background: var(--preview-primary); }

.preview-content { padding: 12px; }
.preview-topbar {
  height: 28px;
  margin: -12px -12px 13px;
  border-bottom: 1px solid #dce5f1;
  background: #fff;
}

.preview-hero {
  height: 104px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(125deg, var(--preview-sidebar-start), var(--preview-primary));
}

.preview-hero strong { font-size: 13px; }
.preview-hero small { margin-top: 6px; color: rgba(255,255,255,.74); font-size: 7px; }
.preview-cards {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.preview-cards i {
  height: 76px;
  border: 1px solid #dde5ef;
  border-radius: 9px;
  background: #fff;
}
.preview-cards i:first-child { box-shadow: inset 0 3px var(--preview-primary); }
.preview-note { margin: 13px 0 0; color: var(--muted); font-size: 9.5px; line-height: 1.5; }

.settings-actions {
  margin-top: 18px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 30px rgba(31,62,104,.08);
}

.settings-actions strong { display: block; font-size: 11px; }
.settings-actions span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.primary-button {
  min-width: 132px;
  padding: 12px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 9px 20px color-mix(in srgb, var(--blue) 26%, transparent);
  font-size: 11px;
}
.primary-button:disabled { opacity: .58; cursor: wait; }

@media (max-width: 1120px) {
  .settings-layout { grid-template-columns: 1fr; }
  .preview-card { position: static; }
  .dashboard-preview { min-height: 280px; }
}

@media (max-width: 720px) {
  .settings-main { padding: 20px 16px 44px; }
  .settings-intro { align-items: flex-start; flex-direction: column; padding: 24px 20px; }
  .color-grid { grid-template-columns: 1fr; }
  .asset-field { grid-template-columns: 72px minmax(0, 1fr); }
  .timezone-setting { grid-template-columns: 1fr; }
  .asset-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .settings-card__head { flex-direction: column; }
  .settings-card__head p { margin-left: 0; }
}

@media (max-width: 480px) {
  .settings-card { padding: 16px; }
  .asset-field { grid-template-columns: 1fr; }
  .asset-preview, .asset-preview.is-small { margin: 0; }
  .settings-actions { align-items: stretch; flex-direction: column; }
  .primary-button { width: 100%; }
  .dashboard-preview { grid-template-columns: 62px 1fr; }
}
