:root {
  --bg: #fff;
  --bg-frame-overlay: linear-gradient(to bottom, #fff 16%, #efeef1 80%);
  --bg-article-overlay: linear-gradient(
    to bottom,
    transparent 58%,
    #00000015 70%,
    #00000088 100%
  );
  --clr-white: #fff;
  --clr-black: #000101;
  --clr-red: #ff5168;
  --clr-green: #38ca78;
  --clr-blue: #47b9ff;
  --clr-notification: #f3c87b;
}

@layer reset, base, layout, frame, header, nav, content, footer, screens, mobile, desktop, admin, utilities;

@layer reset {
  *,
  *::before,
  *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
}

@layer base {
  * {
    font-family: "Poppins", sans-serif;
  }

  body {
    background-color: var(--bg);
    display: grid;
    place-content: center;
    min-height: 100dvh;
  }

  button {
    font: inherit;
  }

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

@layer layout {
  .app-shell {
    min-height: 100dvh;
    display: grid;
    place-items: center;
  }
}

@layer frame {
  .frame {
    width: 320px;
    height: 640px;
    background: url("https://raw.githubusercontent.com/gngian10/Swipe-App/refs/heads/main/images/frame.webp")
      no-repeat center/cover;
    position: relative;
    display: flex;
  }

  .container {
    position: relative;
    width: 100%;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas:
      "header"
      "nav"
      "cards"
      "footer";

    padding: 0 8px;
    margin: 0 23px;
    overflow: hidden;

    &::before {
      content: "";
      position: absolute;
      inset: 23px 0;
      background: var(--bg-frame-overlay);
      border-radius: 32px;
      z-index: -9;
    }
  }
}

@layer header {
  header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-around;
    color: var(--clr-black);
    margin: 30px 0 8px;
    gap: 136px;

    span {
      font-size: 11px;
      font-weight: 600;
      line-height: 1.5;
    }

    .header__icons {
      display: flex;
      align-items: center;
    }
  }
}

@layer nav {
  nav {
    grid-area: nav;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }

  .nav__button {
    width: 28px;
    height: 28px;
    border: 0;
    background-color: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
  }

  .nav__notifications {
    display: flex;
    align-items: center;
    position: relative;

    figure {
      width: 32px;
      height: 32px;
      background-color: var(--clr-white);
      border-radius: 50%;
      padding: 7px;
      box-shadow: -2px 2px 3px rgba(0, 0, 0, 0.2);
      z-index: 9;
    }

    span {
      position: absolute;
      left: 15px;
      width: 56px;
      display: flex;
      justify-content: end;
      background-color: var(--clr-notification);
      color: var(--clr-white);
      font-size: 14px;
      font-weight: 600;
      padding: 4px 8px;
      border-radius: 20px;
      transition: transform 0.2s ease;
    }
  }

  .nav__icons {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;

    &::before {
      content: "";
      position: absolute;
      right: 16px;
      top: 6px;
      background-color: var(--clr-red);
      width: 8px;
      height: 8px;
      border-radius: 50%;
    }
  }
}

@layer content {
  .cards {
    grid-area: cards;
    position: relative;
    width: 100%;
    height: 100%;

    p {
      height: 100%;
      text-align: center;
      font-size: 12px;
      color: var(--clr-black);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
    }

    &.is-empty p {
      opacity: 1;
    }
  }

  article {
    position: absolute;
    inset: 0;
    cursor: grab;
    user-select: none;
    border-radius: 16px;
    overflow: hidden;
    will-change: transform;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
    touch-action: pan-y;

    &.is-back {
      animation: return-card 0.24s ease both;
    }

    &.gone-left,
    &.gone-right,
    &.gone-up,
    &.reset-state {
      transition: transform 0.2s ease;
    }

    &.gone-left {
      transform: translateX(-150%) rotate(-35deg) !important;
    }

    &.gone-right {
      transform: translateX(150%) rotate(35deg) !important;
    }

    &.gone-up {
      transform: translateY(-150%) rotate(-6deg) !important;
    }

    &.reset-state {
      transform: translateX(0) !important;
    }

    &:active {
      cursor: grabbing;
    }
  }

  .article__content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: var(--bg-article-overlay);
    color: var(--clr-white);
    padding: 8px;

    h2 {
      margin-bottom: 6px;
      line-height: 1;
    }

    div {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      font-size: 12px;
      margin-bottom: 2px;
      text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
    }
  }

  .choice-btn {
    position: absolute;
    top: 32px;
    right: 16px;
    background-color: transparent;
    color: var(--clr-black);
    border-radius: 8px;
    border: 4px solid;
    opacity: 0;
    padding: 4px 8px;
    font-size: 24px;
    font-weight: 700;
    width: fit-content;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    pointer-events: none;

    &.nope {
      border-color: #ff6e63;
      color: #ff6e63;
      rotate: 30deg;
    }

    &.like {
      border-color: #63ff68;
      color: #63ff68;
      left: 16px;
      rotate: -30deg;
    }

    &.super {
      border-color: var(--clr-blue);
      color: var(--clr-blue);
      left: 48px;
      right: auto;
      rotate: -12deg;
    }
  }
}

@layer footer {
  footer {
    grid-area: footer;
    margin: 16px 0 36px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    justify-items: center;
    justify-content: center;

    button {
      background: url("https://raw.githubusercontent.com/gngian10/Swipe-App/refs/heads/main/images/icons.webp")
        no-repeat;
      background-position: 0px 0px;
      background-size: 175px;
      width: 35px;
      height: 35px;
      border: 0;
      cursor: pointer;
      transition: scale 0.2s ease, opacity 0.2s ease;
      filter: drop-shadow(0 1px 0.5px rgba(0, 0, 0, 0.1));

      &.is-big {
        background-size: 250px;
        width: 50px;
        height: 50px;
      }

      &:hover {
        scale: 1.2;
      }

      &:active {
        scale: 0.98;
      }

      &:disabled {
        opacity: 0.45;
        cursor: default;
        scale: 1;
      }

      &.undo {
        background-position: -140px;
      }

      &.remove {
        background-position: -150px;
      }

      &.star {
        background-position: -70px;
      }

      &.favorite {
        background-position: -50px;
      }

      &.zap {
        background-position: 0px;
      }
    }
  }
}

@layer screens {
  .screen {
    position: absolute;
    inset: 23px 0;
    z-index: 20;
    display: none;
    padding: 72px 18px 76px;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 32px;
    scrollbar-width: none;
  }

  .screen::-webkit-scrollbar,
  .panel-body::-webkit-scrollbar {
    display: none;
  }

  .screen.is-open {
    display: block;
  }

  .login-screen {
    padding-top: 96px;
  }

  .auth-card,
  .register-card {
    display: grid;
    gap: 10px;
    color: var(--clr-black);
  }

  .auth-card {
    img {
      width: 46px;
      height: 46px;
      justify-self: center;
      padding: 9px;
      border-radius: 50%;
      background: var(--clr-white);
      box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    }

    .admin-login {
      color: #656b78;
      background: #eef0f5;
    }
  }

  .auth-card h1,
  .register-card h1 {
    text-align: center;
    font-size: 22px;
    line-height: 1;
    margin-bottom: 8px;
  }

  .register-card h1 {
    font-size: 20px;
    margin-bottom: 2px;
  }

  .auth-card label,
  .register-card label {
    display: grid;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #6f7480;
  }

  .auth-card input,
  .register-card input,
  .register-card select {
    width: 100%;
    border: 1px solid #e0e3ea;
    border-radius: 8px;
    padding: 9px 11px;
    font-size: 12px;
    color: var(--clr-black);
    outline: 0;
    background: var(--clr-white);
  }

  .auth-card button,
  .register-card button {
    border: 0;
    border-radius: 999px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 700;
    color: var(--clr-white);
    background: linear-gradient(135deg, #ff5168, #f3c87b);
  }

  .show-register,
  .show-login {
    color: #656b78 !important;
    background: #eef0f5 !important;
  }

  .auth-error,
  .register-message {
    min-height: 16px;
    font-size: 11px;
    text-align: center;
    color: var(--clr-red);
  }

  .register-message.is-success {
    color: var(--clr-green);
  }

  .register-card {
    display: none;
    gap: 5px;
  }

  .login-screen.is-registering {
    padding: 42px 18px 46px;
    overflow: auto;
  }

  .login-screen.is-registering .register-card input,
  .login-screen.is-registering .register-card select {
    padding: 7px 10px;
  }

  .login-screen.is-registering .register-card button {
    padding: 8px 10px;
  }

  .login-screen.is-registering .auth-card {
    display: none;
  }

  .login-screen.is-registering .register-card {
    display: grid;
  }

  .panel-screen {
    padding: 70px 14px 76px;
    background: rgba(248, 249, 252, 0.97);
  }

  .panel {
    height: 100%;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 10px;
    color: var(--clr-black);
  }

  .panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .panel-title {
    font-size: 18px;
  }

  .close-panel {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    color: #6f7480;
    background: #e7eaf0;
    cursor: pointer;
    font-weight: 700;
  }

  .panel-body {
    overflow: auto;
    display: grid;
    align-content: start;
    gap: 8px;
    padding-right: 2px;
  }

  .stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat,
  .match-row,
  .history-row,
  .profile-card,
  .admin-row {
    border-radius: 8px;
    background: var(--clr-white);
    padding: 10px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.07);
  }

  .stat strong {
    display: block;
    font-size: 20px;
    line-height: 1;
  }

  .stat-button {
    border: 0;
    text-align: left;
    cursor: pointer;
    transition: transform 0.16s ease, outline-color 0.16s ease;
  }

  .stat-button:hover {
    outline: 2px solid #f3c87b;
  }

  .stat-button:active {
    transform: scale(0.97);
  }

  .stat span,
  .profile-card span,
  .admin-row span {
    font-size: 11px;
    color: #767c89;
  }

  .match-row {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 9px;
    align-items: center;
    width: 100%;
    border: 0;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
  }

  .match-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.1);
  }

  .history-row {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 10px;
    align-items: center;
  }

  .match-row img,
  .history-row img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
  }

  .match-row strong,
  .history-row strong,
  .admin-row strong {
    display: block;
    font-size: 13px;
  }

  .match-row p,
  .history-row span {
    font-size: 11px;
    color: #767c89;
  }

  .profile-card {
    display: grid;
    gap: 6px;
  }

  .profile-summary {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 12px;
    align-items: center;
  }

  .profile-photo-preview {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    color: #9aa0ad;
    background: #eef0f5;
    font-size: 22px;
    font-weight: 700;
  }

  .profile-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .photos-intro {
    display: grid;
    gap: 5px;
    border-radius: 8px;
    background: var(--clr-white);
    padding: 12px;
    text-align: center;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.07);
  }

  .photos-intro strong {
    font-size: 20px;
  }

  .photos-intro span,
  .photo-help {
    color: #767c89;
    font-size: 12px;
    line-height: 1.45;
  }

  .photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .photo-slot {
    aspect-ratio: 0.78;
    position: relative;
    overflow: hidden;
    border: 2px dashed #ff6a82;
    border-radius: 10px;
    background: #ffecef;
    cursor: pointer;
  }

  .photo-slot[data-photo-id] {
    cursor: grab;
    touch-action: none;
  }

  .photo-slot[data-photo-id]:active {
    cursor: grabbing;
  }

  .photo-slot.is-empty {
    display: grid;
    place-items: center;
  }

  .photo-slot.is-empty span {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--clr-red);
    font-size: 28px;
    line-height: 1;
  }

  .photo-slot input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
  }

  .photo-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .photo-slot.is-selected {
    border-style: solid;
    border-color: var(--clr-green);
  }

  .photo-slot.is-dragging {
    opacity: 0.72;
    transform: scale(0.96);
  }

  .photo-main-badge,
  .photo-drag-hint {
    position: absolute;
    left: 6px;
    z-index: 2;
    border-radius: 999px;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  }

  .photo-main-badge {
    top: 6px;
    padding: 7px 9px;
    background: #14b86a;
    box-shadow: 0 4px 10px rgba(20, 184, 106, 0.35);
  }

  .photo-drag-hint {
    top: 34px;
    padding: 5px 7px;
    background: rgba(0, 1, 1, 0.48);
    font-size: 9px;
  }

  .photo-actions {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    display: flex;
    gap: 5px;
  }

  .photo-actions button {
    flex: 1;
    min-width: 0;
    border: 0;
    border-radius: 999px;
    padding: 7px 8px;
    color: #fff;
    background: rgba(255, 81, 104, 0.94);
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
  }

  .photo-slot.is-selected .photo-actions button:first-child {
    background: rgba(56, 202, 120, 0.95);
  }

  .photo-actions button:last-child {
    flex: 0 0 30px;
    background: rgba(0, 1, 1, 0.65);
  }

  .profile-card button,
  .admin-row button,
  .plan-card button {
    border: 0;
    border-radius: 999px;
    padding: 8px 10px;
    color: var(--clr-white);
    background: var(--clr-red);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
  }

  .admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .admin-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .admin-actions button {
    padding: 6px 8px;
  }

  .admin-row.is-blocked {
    opacity: 0.58;
  }

  .admin-form {
    display: grid;
    grid-template-columns: 1fr 72px 56px;
    gap: 6px;
  }

  .admin-form-wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-form input,
  .admin-form select {
    min-width: 0;
    border: 1px solid #e0e3ea;
    border-radius: 8px;
    padding: 8px;
    font-size: 11px;
  }

  .admin-form label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #767c89;
  }

  .admin-form button {
    border: 0;
    border-radius: 8px;
    color: var(--clr-white);
    background: var(--clr-green);
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
  }

  .plan-card {
    display: grid;
    gap: 8px;
    border-radius: 8px;
    background: var(--clr-white);
    padding: 12px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.07);
  }

  .plan-card.is-current {
    outline: 2px solid #f3c87b;
  }

  .plan-card div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .plan-card strong {
    font-size: 15px;
  }

  .plan-card span,
  .plan-card p {
    font-size: 11px;
    color: #767c89;
  }

  .plan-card p {
    line-height: 1.35;
  }

  .plan-card button:disabled {
    color: #767c89;
    background: #eef0f5;
    cursor: default;
  }

  .chat-profile {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    align-items: center;
    border-radius: 8px;
    background: var(--clr-white);
    padding: 10px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.07);
  }

  .chat-profile img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
  }

  .chat-profile strong {
    display: block;
    font-size: 13px;
  }

  .chat-profile span {
    font-size: 11px;
    color: #767c89;
  }

  .chat-thread {
    display: grid;
    gap: 7px;
  }

  .chat-bubble {
    max-width: 86%;
    justify-self: start;
    border-radius: 12px 12px 12px 4px;
    background: var(--clr-white);
    padding: 9px 10px;
    color: var(--clr-black);
    font-size: 12px;
    line-height: 1.35;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  }

  .chat-bubble.is-me {
    justify-self: end;
    border-radius: 12px 12px 4px 12px;
    color: var(--clr-white);
    background: var(--clr-red);
  }

  .chat-form {
    display: grid;
    grid-template-columns: 1fr 58px;
    gap: 6px;
  }

  .chat-form input {
    min-width: 0;
    border: 1px solid #e0e3ea;
    border-radius: 999px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .chat-form button {
    border: 0;
    border-radius: 999px;
    color: var(--clr-white);
    background: var(--clr-red);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
  }
}

@layer mobile {
  @media (max-width: 899px) {
    html,
    body {
      width: 100%;
      min-height: 100%;
      overflow: hidden;
      background: #fff;
    }

    body {
      display: block;
      min-height: 100dvh;
    }

    .app-shell {
      width: 100vw;
      height: 100dvh;
      min-height: 100dvh;
      display: block;
    }

    .desktop-sidebar {
      display: none !important;
    }

    .frame {
      width: 100vw;
      height: 100dvh;
      min-height: 100dvh;
      display: flex;
      background: none;
    }

    .container {
      width: 100%;
      min-height: 100%;
      margin: 0;
      padding: max(12px, env(safe-area-inset-top)) 18px max(12px, env(safe-area-inset-bottom));
      grid-template-rows: auto minmax(0, 1fr) auto;
      grid-template-areas:
        "nav"
        "cards"
        "footer";
      overflow: hidden;
    }

    .container::before {
      inset: 0;
      border-radius: 0;
      background: var(--bg-frame-overlay);
    }

    header {
      display: none;
    }

    nav {
      margin: 2px 0 18px;
      padding: 0 2px;
    }

    .nav__button {
      width: 36px;
      height: 36px;
    }

    .nav__button svg {
      width: 30px;
      height: 30px;
    }

    .nav__notifications figure {
      width: 44px;
      height: 44px;
      padding: 9px;
    }

    .nav__notifications span {
      left: 24px;
      width: 64px;
      min-height: 31px;
      align-items: center;
      font-size: 16px;
    }

    .nav__icons {
      gap: 18px;
    }

    .nav__icons::before {
      right: 20px;
      top: 5px;
      width: 10px;
      height: 10px;
    }

    .cards {
      min-height: 0;
      padding: 0;
    }

    .cards p {
      font-size: 16px;
      line-height: 1.45;
      padding: 0 26px;
    }

    article {
      inset: 0;
      border-radius: 18px;
      box-shadow: 0 16px 28px rgba(0, 0, 0, 0.16);
    }

    .article__content {
      padding: 16px;
    }

    .article__content h2 {
      margin-bottom: 10px;
      font-size: clamp(32px, 8vw, 46px);
    }

    .article__content div {
      gap: 9px;
      margin-bottom: 6px;
      font-size: clamp(15px, 4vw, 19px);
    }

    .article__content svg {
      width: 20px;
      height: 20px;
      flex: 0 0 auto;
    }

    .choice-btn {
      top: 28px;
      font-size: 30px;
    }

    footer {
      margin: 18px 0 0;
      grid-template-columns: repeat(5, minmax(48px, 1fr));
      gap: 6px;
    }

    footer button {
      width: 46px;
      height: 46px;
      background-size: 230px;
      justify-self: center;
    }

    footer button.is-big {
      width: 64px;
      height: 64px;
      background-size: 320px;
    }

    footer button.undo {
      background-position: -184px;
    }

    footer button.remove {
      background-position: -192px;
    }

    footer button.star {
      background-position: -92px;
    }

    footer button.favorite {
      background-position: -64px;
    }

    .screen {
      inset: 0;
      border-radius: 0;
      padding: max(78px, calc(env(safe-area-inset-top) + 54px)) 22px max(92px, calc(env(safe-area-inset-bottom) + 72px));
    }

    .login-screen {
      padding-top: max(92px, calc(env(safe-area-inset-top) + 72px));
    }

    .auth-card {
      gap: 14px;
    }

    .auth-card img {
      width: 60px;
      height: 60px;
      padding: 12px;
    }

    .auth-card h1,
    .register-card h1 {
      font-size: clamp(32px, 9vw, 44px);
    }

    .auth-card label,
    .register-card label {
      font-size: 16px;
    }

    .auth-card input,
    .register-card input,
    .register-card select {
      min-height: 58px;
      border-radius: 14px;
      padding: 12px 16px;
      font-size: 18px;
    }

    .auth-card button,
    .register-card button {
      min-height: 58px;
      font-size: 20px;
    }

    .auth-error,
    .register-message {
      font-size: 15px;
    }

    .login-screen.is-registering {
      padding: max(38px, env(safe-area-inset-top)) 18px max(32px, env(safe-area-inset-bottom));
    }

    .login-screen.is-registering .register-card {
      gap: 8px;
    }

    .login-screen.is-registering .register-card h1 {
      font-size: 28px;
    }

    .login-screen.is-registering .register-card input,
    .login-screen.is-registering .register-card select {
      min-height: 46px;
      padding: 8px 12px;
      font-size: 15px;
    }

    .login-screen.is-registering .register-card button {
      min-height: 46px;
      padding: 8px 12px;
      font-size: 16px;
    }

    .panel-screen {
      padding: max(70px, calc(env(safe-area-inset-top) + 50px)) 18px max(86px, calc(env(safe-area-inset-bottom) + 70px));
    }

    .panel-title {
      font-size: 26px;
    }

    .close-panel {
      width: 38px;
      height: 38px;
      font-size: 18px;
    }

    .panel-body {
      gap: 12px;
    }

    .profile-card,
    .stat,
    .match-row,
    .history-row,
    .admin-row,
    .plan-card,
    .chat-profile {
      border-radius: 14px;
      padding: 14px;
    }

    .profile-summary {
      grid-template-columns: 72px 1fr;
    }

    .profile-photo-preview {
      width: 72px;
      height: 72px;
      font-size: 28px;
    }

    .photos-intro {
      border-radius: 14px;
      padding: 16px;
    }

    .photos-intro strong {
      font-size: 24px;
    }

    .photos-intro span,
    .photo-help {
      font-size: 15px;
    }

    .photo-grid {
      gap: 12px;
    }

    .photo-slot {
      border-radius: 14px;
    }

    .photo-main-badge {
      left: 8px;
      top: 8px;
      padding: 8px 10px;
      font-size: 11px;
    }

    .photo-drag-hint {
      display: none;
    }

    .photo-slot.is-empty span {
      width: 46px;
      height: 46px;
      font-size: 32px;
    }

    .photo-actions {
      left: 8px;
      right: 8px;
      bottom: 8px;
    }

    .photo-actions button {
      min-height: 34px;
      font-size: 12px;
    }

    .stat strong {
      font-size: 28px;
    }

    .stat span,
    .profile-card span,
    .admin-row span,
    .plan-card span,
    .plan-card p,
    .chat-profile span {
      font-size: 14px;
    }

    .profile-card button,
    .admin-row button,
    .plan-card button {
      min-height: 44px;
      font-size: 15px;
    }

    .match-row {
      grid-template-columns: 58px 1fr;
    }

    .history-row {
      grid-template-columns: 58px 1fr;
    }

    .match-row img,
    .history-row img,
    .chat-profile img {
      width: 58px;
      height: 58px;
    }

    .match-row strong,
    .history-row strong,
    .admin-row strong,
    .chat-profile strong {
      font-size: 17px;
    }

    .match-row p,
    .history-row span {
      font-size: 14px;
    }

    .chat-bubble {
      font-size: 15px;
      padding: 11px 13px;
    }

    .chat-form {
      grid-template-columns: 1fr 72px;
    }

    .chat-form input,
    .chat-form button {
      min-height: 46px;
      font-size: 14px;
    }
  }
}

@layer desktop {
  .desktop-sidebar {
    display: none;
  }

  @media (min-width: 900px) {
    body {
      display: block;
      min-height: 100dvh;
      background: #fff;
    }

    .app-shell {
      min-height: 100dvh;
      display: grid;
      grid-template-columns: 440px minmax(0, 1fr);
      align-items: center;
      justify-items: start;
      place-items: initial;
    }

    .frame {
      justify-self: center;
      transform: translateX(clamp(48px, 7vw, 150px));
    }

    .desktop-sidebar {
      width: 440px;
      height: 100dvh;
      display: grid;
      grid-template-rows: auto auto 1fr;
      background: #f4f5f8;
      border-right: 1px solid #dfe2e8;
      overflow: hidden;
    }

    .desktop-sidebar.is-hidden {
      visibility: hidden;
    }

    .desktop-topbar {
      min-height: 106px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 22px 14px;
      background: linear-gradient(135deg, #ec3b82 0%, #ff454b 100%);
    }

    .desktop-avatar {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      display: grid;
      place-items: center;
      background: #f0f2f6;
      border: 3px solid rgba(255, 255, 255, 0.72);
      color: #c6ccd6;
      font-size: 30px;
      font-weight: 700;
      overflow: hidden;
      padding: 0;
    }

    .desktop-avatar img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .desktop-avatar span {
      display: grid;
      place-items: center;
      width: 100%;
      height: 100%;
    }

    .desktop-actions {
      display: flex;
      gap: 14px;
    }

    .desktop-actions button {
      width: 50px;
      height: 50px;
      border: 0;
      border-radius: 50%;
      display: grid;
      place-items: center;
      color: var(--clr-white);
      background: rgba(99, 17, 38, 0.52);
      cursor: pointer;
      font-size: 0;
      font-weight: 700;
    }

    .desktop-actions button::before {
      content: "";
      width: 25px;
      height: 25px;
      display: block;
      background: var(--clr-white);
      -webkit-mask-repeat: no-repeat;
      -webkit-mask-position: center;
      -webkit-mask-size: contain;
      mask-repeat: no-repeat;
      mask-position: center;
      mask-size: contain;
    }

    .desktop-actions [data-desktop-plans]::before {
      -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M8 6V5a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3v1h3a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3Zm2 0h4V5a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v1Zm1 5v5h2v-5h-2Z'/%3E%3C/svg%3E");
      mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M8 6V5a3 3 0 0 1 3-3h2a3 3 0 0 1 3 3v1h3a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3Zm2 0h4V5a1 1 0 0 0-1-1h-2a1 1 0 0 0-1 1v1Zm1 5v5h2v-5h-2Z'/%3E%3C/svg%3E");
    }

    .desktop-actions [data-desktop-safety]::before {
      -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2 20 5.5V11c0 5.1-3.3 9.4-8 11-4.7-1.6-8-5.9-8-11V5.5L12 2Zm3.7 7.3-4.6 4.6-2-2-1.4 1.4 3.4 3.4 6-6-1.4-1.4Z'/%3E%3C/svg%3E");
      mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2 20 5.5V11c0 5.1-3.3 9.4-8 11-4.7-1.6-8-5.9-8-11V5.5L12 2Zm3.7 7.3-4.6 4.6-2-2-1.4 1.4 3.4 3.4 6-6-1.4-1.4Z'/%3E%3C/svg%3E");
    }

    .desktop-tabs {
      display: flex;
      align-items: end;
      gap: 28px;
      padding: 18px 30px 0;
      background: var(--clr-white);
      border-bottom: 1px solid #eceef3;
    }

    .desktop-tab {
      position: relative;
      border: 0;
      background: transparent;
      padding: 0 0 14px;
      color: #9aa0ad;
      cursor: pointer;
      font-size: 16px;
      font-weight: 700;
    }

    .desktop-tab.is-active {
      color: #f03765;
    }

    .desktop-tab.is-active::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: -1px;
      height: 2px;
      background: #f03765;
    }

    .desktop-count {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 30px;
      height: 28px;
      margin-left: 5px;
      padding: 0 8px;
      border-radius: 999px;
      color: var(--clr-white);
      background: #f03765;
      font-size: 13px;
    }

    .desktop-list {
      overflow: auto;
      padding: 16px 0;
      scrollbar-width: thin;
      scrollbar-color: #8b8d93 transparent;
    }

    .desktop-row {
      width: 100%;
      display: grid;
      grid-template-columns: 72px 1fr;
      gap: 16px;
      align-items: center;
      border: 0;
      background: transparent;
      padding: 10px 20px;
      text-align: left;
      cursor: pointer;
    }

    .desktop-row:hover,
    .desktop-row.is-active {
      background: #eceef3;
    }

    .desktop-row img {
      width: 56px;
      height: 56px;
      border-radius: 50%;
      object-fit: cover;
      background: #e3e6ec;
    }

    .desktop-row strong {
      display: block;
      max-width: 280px;
      overflow: hidden;
      color: #05070b;
      font-size: 20px;
      line-height: 1.1;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .desktop-row p {
      max-width: 292px;
      margin-top: 7px;
      overflow: hidden;
      color: #596273;
      font-size: 19px;
      line-height: 1.2;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .desktop-row p::before {
      content: "↩";
      margin-right: 8px;
      color: #596273;
    }

    .desktop-match-grid {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      padding: 16px 18px;
    }

    .desktop-match-card {
      min-height: 142px;
      border: 0;
      border-radius: 8px;
      overflow: hidden;
      position: relative;
      cursor: pointer;
      background: #dfe3eb;
    }

    .desktop-match-card img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .desktop-match-card span {
      position: absolute;
      left: 8px;
      right: 8px;
      bottom: 8px;
      overflow: hidden;
      color: var(--clr-white);
      font-size: 14px;
      font-weight: 700;
      text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .desktop-empty {
      padding: 30px;
      color: #6e7584;
      font-size: 15px;
      line-height: 1.45;
    }
  }
}

@layer admin {
  .admin-dashboard-shell {
    display: none;
  }

  body.is-admin-mode {
    display: block;
    min-height: 100dvh;
    overflow: hidden;
    background: #d1d5db;
  }

  body.is-admin-mode .app-shell {
    display: none;
  }

  body.is-admin-mode .admin-dashboard-shell {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 24px;
    padding: 24px;
    background: #d1d5db;
    color: #111827;
  }

  .admin-rail,
  .admin-sidebar {
    height: calc(100dvh - 48px);
    overflow: hidden;
    color: #9ca3af;
    background: #111827;
    border-radius: 6px;
  }

  .admin-rail {
    display: none;
    flex-direction: column;
    align-items: center;
  }

  .admin-sidebar {
    display: flex;
    flex-direction: column;
    padding: 0 10px;
  }

  .admin-brand,
  .admin-account {
    min-height: 64px;
    display: flex;
    align-items: center;
    color: #d1d5db;
    text-decoration: none;
  }

  .admin-brand {
    gap: 12px;
    padding: 0 12px;
    font-weight: 700;
  }

  .admin-brand span {
    color: #f9fafb;
    font-size: 15px;
  }

  .admin-brand small {
    display: block;
    margin-top: 2px;
    color: #8c96a8;
    font-size: 11px;
    font-weight: 600;
  }

  .admin-brand-icon,
  .admin-rail-link,
  .admin-account {
    justify-content: center;
  }

  .admin-brand-icon svg,
  .admin-nav-link svg,
  .admin-rail-link svg,
  .admin-account svg {
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
  }

  .admin-rail-group,
  .admin-nav-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid #374151;
  }

  .admin-rail-link,
  .admin-nav-link,
  .admin-account {
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }

  .admin-rail-link {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
  }

  .admin-nav-link {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
  }

  .admin-rail-link:hover,
  .admin-nav-link:hover,
  .admin-account:hover,
  .admin-rail-link.is-active,
  .admin-nav-link.is-active {
    color: #f9fafb;
    background: #374151;
  }

  .admin-account {
    width: calc(100% + 20px);
    margin: auto -10px 0;
    gap: 10px;
    background: #1f2937;
    font-size: 14px;
    font-weight: 600;
  }

  .admin-main {
    height: calc(100dvh - 48px);
    overflow: auto;
    padding: 28px;
    border-radius: 8px;
    background: #f8fafc;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  }

  .admin-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
  }

  .admin-eyebrow {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .admin-topbar h1 {
    margin-top: 4px;
    color: #0f172a;
    font-size: 30px;
    line-height: 1.15;
  }

  .admin-topbar p {
    max-width: 760px;
    margin-top: 8px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
  }

  .admin-logout {
    min-width: 120px;
    border: 0;
    border-radius: 6px;
    padding: 12px 16px;
    color: #fff;
    background: #ef476f;
    cursor: pointer;
    font-weight: 700;
  }

  .admin-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
  }

  .admin-stat-card,
  .admin-card,
  .admin-panel {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
  }

  .admin-stat-card {
    padding: 18px;
  }

  .admin-stat-card strong {
    display: block;
    color: #0f172a;
    font-size: 30px;
    line-height: 1;
  }

  .admin-stat-card span {
    display: block;
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
  }

  .admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
    gap: 20px;
  }

  .admin-card,
  .admin-panel {
    padding: 20px;
  }

  .admin-card h2,
  .admin-panel h2 {
    color: #111827;
    font-size: 18px;
    line-height: 1.25;
  }

  .admin-card > p,
  .admin-panel > p {
    margin-top: 6px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
  }

  .admin-table {
    width: 100%;
    margin-top: 16px;
    border-collapse: collapse;
    font-size: 13px;
  }

  .admin-table th,
  .admin-table td {
    padding: 13px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
  }

  .admin-table th {
    color: #64748b;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .admin-table strong {
    display: block;
    color: #111827;
    font-size: 14px;
  }

  .admin-table span {
    color: #64748b;
  }

  .admin-status {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 12px;
    font-weight: 700;
  }

  .admin-status.is-approved {
    background: #dcfce7;
    color: #166534;
  }

  .admin-status.is-pending {
    background: #fef3c7;
    color: #92400e;
  }

  .admin-status.is-blocked {
    background: #fee2e2;
    color: #991b1b;
  }

  .admin-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .admin-row-actions button,
  .admin-form button,
  .admin-inline-select button {
    border: 0;
    border-radius: 6px;
    padding: 9px 11px;
    color: #fff;
    background: #334155;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
  }

  .admin-row-actions button:hover,
  .admin-form button:hover,
  .admin-inline-select button:hover,
  .admin-logout:hover {
    filter: brightness(0.96);
  }

  .admin-row-actions [data-status="approved"],
  .admin-form button {
    background: #22c55e;
  }

  .admin-row-actions [data-status="blocked"] {
    background: #ef4444;
  }

  .admin-inline-select {
    display: flex;
    gap: 8px;
  }

  .admin-inline-select select,
  .admin-form input,
  .admin-form select {
    width: 100%;
    min-height: 42px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0 12px;
    color: #0f172a;
    background: #fff;
    font: inherit;
    font-size: 13px;
  }

  .admin-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
  }

  .admin-form label {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
  }

  .admin-form label input {
    width: auto;
    min-height: 0;
  }

  .admin-form button {
    min-height: 44px;
    grid-column: 1 / -1;
  }

  .admin-plan-list,
  .admin-compact-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
  }

  .admin-plan-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
  }

  .admin-plan-row strong {
    color: #111827;
    font-size: 14px;
  }

  .admin-plan-row span,
  .admin-plan-row p {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
  }

  .admin-muted {
    color: #64748b;
    font-size: 13px;
    line-height: 1.5;
  }

  .admin-error {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 6px;
    color: #991b1b;
    background: #fee2e2;
    font-size: 13px;
    font-weight: 600;
  }

  @media (max-width: 1100px) {
    body.is-admin-mode {
      overflow: auto;
    }

    body.is-admin-mode .admin-dashboard-shell {
      grid-template-columns: 64px minmax(0, 1fr);
      padding: 14px;
      gap: 14px;
    }

    .admin-sidebar {
      display: none;
    }

    .admin-rail {
      display: flex;
    }

    .admin-rail,
    .admin-main {
      height: auto;
      min-height: calc(100dvh - 28px);
    }

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

    .admin-grid {
      grid-template-columns: 1fr;
    }
  }

  @media (max-width: 700px) {
    body.is-admin-mode .admin-dashboard-shell {
      grid-template-columns: 1fr;
      padding: 0;
    }

    .admin-rail {
      display: none;
    }

    .admin-main {
      min-height: 100dvh;
      border-radius: 0;
      padding: 18px;
    }

    .admin-topbar {
      flex-direction: column;
    }

    .admin-stats,
    .admin-form {
      grid-template-columns: 1fr;
    }

    .admin-table {
      display: block;
      overflow-x: auto;
      white-space: nowrap;
    }
  }
}

@layer utilities {
  .center {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .pulse {
    animation: pulse 0.32s ease;
  }
}

@keyframes pulse {
  50% {
    transform: scale(1.08);
  }
}

@keyframes return-card {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
