/* My Website editor (/website) */
.ws-ed-main {
  max-width: 1280px;
  width: min(100% - 32px, 1280px);
  margin: 0 auto;
  padding: 28px 0 60px;
}
.ws-ed-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.ws-ed-head__links {
  display: flex;
  gap: 8px;
}
.ws-editor-page [hidden] {
  display: none !important;
}

/* Locked */
.ws-locked {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}
.ws-locked__icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
}
.ws-locked .bill-actions {
  justify-content: center;
}

/* Picker */
.ws-picker__grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  margin-top: 16px;
}
.ws-pick {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--portal-border, rgba(0, 0, 0, 0.08));
  background: #fff;
  overflow: hidden;
  text-align: left;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.ws-pick:hover {
  transform: translateY(-2px);
  border-color: var(--portal-accent, #2563eb);
}
.ws-pick.is-current {
  border-color: var(--portal-accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.ws-pick__preview {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f1f5f9;
}
.ws-pick__frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  height: 960px;
  border: 0;
  transform-origin: 0 0;
  pointer-events: none;
}
.ws-pick__body {
  padding: 12px 14px 14px;
}
.ws-pick__name {
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.ws-pick__name small {
  font-weight: 500;
  color: var(--portal-text-muted, #64748b);
}
.ws-pick__audience {
  font-size: 0.85rem;
  color: var(--portal-text-muted, #64748b);
  margin: 4px 0 8px;
}
.ws-pick__links {
  display: flex;
  gap: 10px;
  font-size: 0.85rem;
}
.ws-pick__links a {
  color: var(--portal-accent, #2563eb);
  text-decoration: none;
}

/* Editor */
.ws-ed__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  position: sticky;
  top: 8px;
  z-index: 5;
}
.ws-ed__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.ws-ed__status {
  font-size: 0.85rem;
  color: var(--portal-text-muted, #64748b);
}
.ws-ed__status.is-dirty {
  color: #b45309;
}
.ws-ed__link {
  font-size: 0.85rem;
  color: var(--portal-accent, #2563eb);
  text-decoration: none;
  font-weight: 600;
}
.ws-ed__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.ws-ed__publish {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--portal-border, rgba(0, 0, 0, 0.08));
  background: #fff;
  cursor: pointer;
}
.ws-ed__publish input {
  accent-color: #16a34a;
  width: 16px;
  height: 16px;
}
.ws-ed__note {
  margin: 10px 4px 0;
}
.ws-ed__body {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}
@media (min-width: 1080px) {
  .ws-ed__body {
    grid-template-columns: minmax(360px, 480px) 1fr;
  }
}

/* Form */
.ws-ed__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ws-sec {
  border-radius: 14px;
  border: 1px solid var(--portal-border, rgba(0, 0, 0, 0.08));
  background: #fff;
}
.ws-sec > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ws-sec > summary::-webkit-details-marker {
  display: none;
}
.ws-sec > summary::after {
  content: "+";
  color: var(--portal-text-muted, #64748b);
  font-size: 1.2rem;
}
.ws-sec[open] > summary::after {
  content: "−";
}
.ws-sec__kind {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--portal-text-muted, #64748b);
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f5f9;
}
.ws-sec__body {
  padding: 4px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--portal-border, rgba(0, 0, 0, 0.06));
}
.ws-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--portal-text, #0a2540);
}
.ws-field input[type="text"],
.ws-field input[type="url"],
.ws-field input[type="email"],
.ws-field input[type="tel"],
.ws-field textarea {
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--portal-border, rgba(0, 0, 0, 0.12));
  font: inherit;
  font-size: 0.92rem;
  background: #fff;
}
.ws-field textarea {
  min-height: 84px;
  resize: vertical;
}
.ws-field input:focus,
.ws-field textarea:focus {
  outline: none;
  border-color: var(--portal-accent, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}
.ws-field__hint {
  font-size: 0.75rem;
  color: var(--portal-text-muted, #64748b);
  margin-top: 3px;
}
.ws-field__count {
  float: right;
  font-weight: 400;
  color: var(--portal-text-muted, #94a3b8);
}

/* Image field */
.ws-image {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ws-image__thumb {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 1px dashed var(--portal-border, rgba(0, 0, 0, 0.15));
  background: #f8fafc center/cover no-repeat;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 1.4rem;
  flex: none;
}
.ws-image__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ws-image input[type="file"] {
  display: none;
}
.ws-image .mkt-btn {
  padding: 6px 12px;
  font-size: 0.82rem;
  min-height: 0;
}
.ws-image__status {
  font-size: 0.78rem;
  color: var(--portal-text-muted, #64748b);
}

/* List field */
.ws-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ws-list__item {
  border-radius: 12px;
  border: 1px solid var(--portal-border, rgba(0, 0, 0, 0.08));
  background: #f8fafc;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ws-list__item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--portal-text-muted, #64748b);
}
.ws-list__item-head button,
.ws-list__add {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--portal-border, rgba(0, 0, 0, 0.12));
  background: #fff;
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
}
.ws-list__item-head button:hover {
  border-color: #dc2626;
  color: #dc2626;
}
.ws-list__add {
  align-self: flex-start;
  color: var(--portal-accent, #2563eb);
}
.ws-list__add[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Preview */
.ws-ed__preview {
  border-radius: 16px;
  border: 1px solid var(--portal-border, rgba(0, 0, 0, 0.08));
  background: #fff;
  overflow: hidden;
  position: sticky;
  top: 84px;
}
.ws-ed__preview-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--portal-text-muted, #64748b);
  border-bottom: 1px solid var(--portal-border, rgba(0, 0, 0, 0.06));
  background: #f8fafc;
}
.ws-ed__preview-modes button {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  color: inherit;
}
.ws-ed__preview-modes button.is-active {
  background: #fff;
  border-color: var(--portal-border, rgba(0, 0, 0, 0.12));
  color: var(--portal-text, #0a2540);
}
.ws-ed__preview-frame-wrap {
  background: #e2e8f0;
  padding: 0;
  display: flex;
  justify-content: center;
  height: min(78vh, 860px);
}
#ws-ed-preview {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
  transition: width 0.2s ease;
}

.ws-ed__danger {
  margin-top: 26px;
  text-align: right;
}
.ws-ed__delete {
  color: #b91c1c;
  border-color: rgba(185, 28, 28, 0.3);
}
