.soe-dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  width: min(760px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  margin: 0;
  padding: 0;
  overflow: auto;
  transform: translate(-50%, -50%);
  border: 1px solid #3c444a;
  border-radius: 14px;
  background: #0f1316;
  color: #f4f7f9;
  box-shadow: 0 30px 90px #000;
}

.soe-dialog::backdrop { background: rgba(0, 0, 0, .82); backdrop-filter: blur(4px); }
.soe-dialog__head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: .75rem .95rem; border-bottom: 1px solid #252c31; background: #151a1e; }
.soe-dialog__head h2 { margin: 0; font: 400 1.7rem 'Bebas Neue', sans-serif; letter-spacing: .025em; }
.soe-dialog__head button { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid #3e464d; border-radius: 7px; background: #292e33; color: #fff; cursor: pointer; }

.soe-dialog input,
.soe-dialog textarea,
.soe-dialog select {
  width: 100%;
  padding: .68rem .72rem;
  border: 1px solid #30383e;
  border-radius: 8px;
  outline: 0;
  background: #090c0e;
  color: #fff;
  font: 500 .82rem Roboto, sans-serif;
}

.soe-dialog input:focus,
.soe-dialog textarea:focus,
.soe-dialog select:focus { border-color: #e04b8d; }

.soe-dialog button,
.soe-replace,
.soe-small-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 .72rem;
  border: 1px solid #343c42;
  border-radius: 7px;
  background: #23292d;
  color: #f3f6f8;
  font: 700 .72rem Roboto, sans-serif;
  cursor: pointer;
  box-sizing: border-box;
}

.soe-dialog .is-primary { border-color: #e04b8d; background: #e04b8d; color: #24060f; }
.soe-dialog .is-danger { border-color: #d93645; background: #d93645; color: #fff; }
.soe-dialog .is-danger:hover { border-color: #ee4755; background: #ee4755; }
.soe-dialog input[type="file"],
.soe-small-button input,
.soe-replace input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.soe-profile-dialog { width: min(500px, calc(100% - 24px)); }
.soe-profile-form { display: grid; grid-template-columns: 148px minmax(0, 1fr); align-items: stretch; gap: .85rem; padding: .85rem .9rem .9rem; }
.soe-profile-identity { display: grid; grid-template-rows: 100px 40px 38px; gap: .55rem; }
.soe-avatar-editor { display: grid; grid-template-rows: 52px 28px; justify-items: center; gap: .3rem; padding: .4rem .5rem; border: 1px solid #30383e; border-radius: 8px; background: #090c0e; }
.soe-avatar { display: grid; width: 52px; height: 52px; place-items: center; overflow: hidden; border-radius: 22%; color: #e04b8d; font: 400 2rem 'Bebas Neue', sans-serif; }
.soe-avatar img { width: 100%; height: 100%; object-fit: cover; }
.soe-avatar-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; width: 100%; min-width: 0; }
.soe-small-button { position: relative; width: 100%; height: 28px; min-height: 28px; padding: 0 .35rem; border-radius: 5px; font-size: .64rem; }
.soe-avatar-actions > .soe-small-button { min-width: 0; height: 28px; min-height: 28px; padding: 0 .25rem; }
.soe-profile-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; min-width: 0; }
.soe-profile-actions button { width: 100%; min-width: 0; height: 38px; min-height: 38px; padding: 0; }
.soe-bio { position: relative; height: 196px; }
.soe-bio textarea { height: 196px; resize: none; }
.soe-bio small { position: absolute; right: .6rem; bottom: .45rem; color: #e04b8d; font: 700 .66rem Roboto, sans-serif; }
.soe-profile-links { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; min-width: 0; margin: 0; padding: .7rem; border: 1px solid #252c31; border-radius: 9px; background: #11161a; }
.soe-profile-links legend { padding: 0 .28rem; color: #e04b8d; font: 800 .65rem Roboto, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.soe-profile-link { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: .5rem; min-width: 0; }
.soe-profile-link img { width: 24px; height: 24px; border-radius: 7px; object-fit: contain; box-shadow: 0 4px 14px color-mix(in srgb, var(--soe-link) 28%, transparent); }
.soe-profile-link input { min-width: 0; min-height: 36px; padding: .5rem .58rem; font-size: .72rem; }
.soe-status { grid-column: 1 / -1; min-height: 0; margin: -.45rem 0 0; color: #9ca7af; font: 500 .7rem Roboto, sans-serif; }

.soe-showcase-dialog { width: min(852px, calc(100% - 28px)); }
.soe-showcase-dialog[data-kind="tv"] { --soe-accent: #6fb4ff; }
.soe-showcase-dialog[data-kind="movie"] { --soe-accent: #ffc65c; }
.soe-showcase-dialog[data-kind="collection"] { --soe-accent: #00c6a7; }
.soe-showcase-dialog[data-kind="other"] { --soe-accent: #e04b8d; }
.soe-showcase-dialog .is-primary { border-color: var(--soe-accent); background: var(--soe-accent); }
.soe-showcase-form { display: grid; grid-template-columns: 420px 380px; align-items: start; gap: 1rem; padding: 1rem; }
.soe-showcase-form > input[type="hidden"],
.soe-showcase-form > .soe-status,
.soe-showcase-form > .soe-footer { grid-column: 1 / -1; }
.soe-media { display: grid; align-content: start; gap: .65rem; padding: .7rem; border-radius: 10px; background: #090c0e; }
.soe-preview { display: grid; aspect-ratio: 1 / 1; place-items: center; overflow: hidden; border-radius: 7px; background: #050607; }
.soe-preview img { width: 100%; height: 100%; object-fit: contain; }
.soe-replace { position: relative; width: 100%; }
.soe-fields { display: grid; width: 100%; gap: .7rem; min-width: 0; padding: .1rem; }
.soe-group--details > #soe-title { font-size: 1rem; font-weight: 700; }
.soe-description-field { display: grid; gap: .3rem; color: var(--soe-accent, #e04b8d); font: 800 .64rem Roboto, sans-serif; letter-spacing: .07em; text-transform: uppercase; }
.soe-description-field textarea { min-height: 76px; letter-spacing: 0; resize: vertical; text-transform: none; }
.soe-selects { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.soe-selects label,
.soe-tags-field { display: grid; gap: .3rem; color: var(--soe-accent, #e04b8d); font: 800 .64rem Roboto, sans-serif; letter-spacing: .07em; text-transform: uppercase; }
.soe-selects select,
.soe-tags-field input { letter-spacing: 0; text-transform: none; }
.soe-group { display: grid; gap: .65rem; width: 100%; padding: .75rem; border-radius: 8px; background: #14191d; }
.soe-group h3 { margin: 0; color: var(--soe-accent, #e04b8d); font: 800 .68rem Roboto, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.soe-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.soe-counts label { display: grid; gap: .25rem; color: #bfc8ce; font: 700 .64rem Roboto, sans-serif; }
.soe-counts input,
.soe-links input { min-height: 36px; padding: .55rem .6rem; }
.soe-links { display: grid; grid-template-columns: .65fr 1.35fr; gap: .5rem; }
.soe-footer { position: sticky; bottom: -1rem; display: grid; grid-template-columns: 92px 1fr 92px 112px; align-items: center; gap: .55rem; margin: 0 -1rem -1rem; padding: .8rem 1rem; background: #151a1e; }
.soe-footer button { width: 100%; height: 38px; min-height: 38px; padding: 0 .6rem; }

.sc-tile-wrap { --sc-owner-accent: #e04b8d; position: relative; min-width: 0; }
.sc-tile-wrap[data-kind="tv"] { --sc-owner-accent: #6fb4ff; }
.sc-tile-wrap[data-kind="movie"] { --sc-owner-accent: #ffc65c; }
.sc-tile-wrap[data-kind="collection"] { --sc-owner-accent: #00c6a7; }
.sc-tile-wrap .sc-tile { height: 100%; }
.sc-owner-edit {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
  min-height: 30px;
  padding: 0 .65rem;
  border: 0;
  border-radius: 6px;
  background: var(--sc-owner-accent);
  color: #061016;
  font: 800 .7rem Roboto, sans-serif;
  cursor: pointer;
}

.sc-owner-visibility { position: absolute; top: 12px; left: 12px; z-index: 3; padding: .38rem .55rem; border-radius: 5px; background: #252b30; color: #dce4e8; font: 800 .64rem Roboto, sans-serif; text-transform: uppercase; }

@media (max-width: 780px) {
  .soe-showcase-form { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .soe-dialog {
    inset: 50% auto auto 50%;
    width: min(380px, calc(100% - 20px));
    max-height: calc(100dvh - 24px);
    transform: translate(-50%, -50%);
    border: 1px solid #3c444a;
    border-radius: 12px;
    box-sizing: border-box;
  }

  .soe-profile-dialog {
    width: min(360px, calc(100% - 20px));
  }

  .soe-dialog__head {
    padding: .6rem .75rem;
  }

  .soe-dialog__head h2 {
    font-size: 1.45rem;
  }

  .soe-dialog input,
  .soe-dialog textarea,
  .soe-dialog select {
    min-height: 40px;
    padding: .48rem .58rem;
    font-size: 1rem;
  }

  .soe-dialog button,
  .soe-replace,
  .soe-small-button {
    min-height: 36px;
  }

  .soe-showcase-form,
  .soe-profile-form { grid-template-columns: minmax(0, 1fr); }

  .soe-profile-form {
    gap: .55rem;
    padding: .65rem;
  }

  .soe-profile-identity {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-rows: 40px 34px;
    gap: .4rem .5rem;
  }

  .soe-avatar-editor {
    grid-row: 1 / 3;
    grid-template-rows: 44px 24px;
    gap: .2rem;
    padding: .28rem;
  }

  .soe-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.65rem;
  }

  .soe-avatar-actions {
    gap: .2rem;
  }

  .soe-avatar-actions > .soe-small-button {
    height: 24px;
    min-height: 24px;
    padding: 0 .15rem;
    font-size: .56rem;
  }

  .soe-profile-actions {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .4rem;
    width: 100%;
  }

  .soe-profile-actions button {
    width: 100%;
    min-width: 0;
    height: 34px;
    min-height: 34px;
    padding: 0 .6rem;
    font-size: .64rem;
  }

  .soe-bio,
  .soe-bio textarea {
    height: 104px;
  }

  .soe-profile-links { grid-template-columns: minmax(0, 1fr); gap: .5rem; padding: .55rem; }
  .soe-profile-link { grid-template-columns: 24px minmax(0, 1fr); }
  .soe-profile-link input { min-height: 36px; font-size: .76rem; }

  .soe-showcase-form {
    gap: .4rem;
    padding: .65rem;
  }

  .soe-media {
    display: block;
    padding: 0 0 .35rem;
    background: none;
  }

  .soe-media .soe-preview {
    display: none;
  }

  .soe-media .soe-replace {
    width: 100%;
    min-height: 38px;
    border-style: dashed;
    background: transparent;
    color: var(--soe-accent, #e04b8d);
    font-size: .66rem;
  }

  .soe-fields {
    gap: 0;
    padding: 0;
  }

  .soe-group {
    gap: .5rem;
    padding: .7rem 0;
    border-top: 1px solid #252c31;
    border-radius: 0;
    background: none;
  }

  .soe-group:first-child {
    border-top: 0;
  }

  .soe-group h3,
  .soe-description-field,
  .soe-selects label,
  .soe-tags-field {
    font-size: .58rem;
    letter-spacing: .065em;
  }

  .soe-description-field textarea {
    min-height: 58px;
  }

  .soe-selects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem;
  }

  .soe-links {
    grid-template-columns: .72fr 1.28fr;
    gap: .4rem;
  }

  .soe-counts {
    gap: .4rem;
  }

  .soe-counts label {
    font-size: .58rem;
  }

  .soe-counts input,
  .soe-links input {
    min-height: 38px;
  }

  .soe-footer {
    bottom: -.65rem;
    grid-template-columns: .8fr .8fr 1.15fr;
    gap: .4rem;
    margin: 0 -.65rem -.65rem;
    padding: .55rem .65rem;
  }
  .soe-footer > span { display: none; }
  .soe-footer .is-danger { grid-column: auto; }

  .soe-footer button {
    min-width: 0;
    height: 36px;
    min-height: 36px;
    padding: 0 .35rem;
    font-size: .62rem;
  }
}

.soe-confirm {
  width: min(420px, calc(100% - 28px));
  padding: 1.35rem 1.35rem 1.15rem;
  text-align: center;
}

.soe-confirm__title {
  margin: 0 0 .55rem;
  color: #e04b8d;
  font: 400 1.85rem 'Bebas Neue', sans-serif;
  letter-spacing: .03em;
  line-height: 1;
}

.soe-confirm[data-tone="danger"] .soe-confirm__title { color: #ff6b74; }

.soe-confirm__text {
  margin: 0 0 1.3rem;
  color: #fff;
  font-size: .95rem;
  line-height: 1.5;
}

.soe-confirm__actions {
  display: flex;
  justify-content: center;
  gap: .6rem;
}

.soe-confirm__actions button {
  min-width: 120px;
  height: 40px;
  min-height: 40px;
}
