.pisell-pos-card-dialog {
  .pisell-pos-card-dialog__header {
    padding-block: 24px 16px;
  }

  .pisell-pos-card-dialog__title {
    color: #000;
    font-size: 20px;
    line-height: 28px;
  }

  .pisell-pos-card-dialog__body {
    overscroll-behavior: contain;
    padding-block-end: 16px;
  }

  .pisell-pos-card-dialog__footer {
    padding-block: 10px;
  }

  .pisell-pos-card-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;

    > button {
      min-height: 48px;
      padding-inline: 16px;
      font-size: 16px;
    }
  }
}

.pisell-pos-member-card-dialog {
  --member-card-accent: #6943bd;
  --member-card-action-border: #a98fdf;

  > .pisell-lowcode-floating-layer-content:focus {
    outline: none;
  }

  .pisell-lowcode-floating-layer-close:focus-visible {
    outline: 2px solid var(--member-card-accent);
    outline-offset: 2px;
  }

  .pisell-pos-card-dialog__body {
    padding-block: 16px 20px;
  }

  .pisell-pos-card-dialog__footer {
    padding-block: 14px;
  }

  .pisell-pos-card-dialog__actions {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    align-items: stretch;

    > button {
      display: inline-flex;
      box-sizing: border-box;
      min-width: 0;
      height: auto;
      min-height: 48px;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 8px 12px;
      border: 1px solid var(--member-card-action-border);
      border-radius: 8px;
      color: var(--member-card-accent);
      background: #fff;
      box-shadow: none;
      font-size: 14px;
      font-weight: 600;
      line-height: 20px;
      text-align: center;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    > button:not(:disabled):hover {
      border-color: var(--member-card-accent);
      color: var(--member-card-accent);
      background: #f6f2ff;
    }

    > button:focus-visible {
      outline: 2px solid var(--member-card-accent);
      outline-offset: 2px;
    }

    > button:disabled {
      border-color: #d9dce3;
      color: #667085;
      background: #f6f7f9;
      cursor: default;
    }
  }

  @media (max-width: 520px) {
    .pisell-pos-card-dialog__body,
    .pisell-pos-card-dialog__footer {
      padding-inline: 12px;
    }

    .pisell-pos-card-dialog__actions {
      gap: 8px;

      > button {
        gap: 4px;
        padding-inline: 4px;
        font-size: 12px;
      }
    }
  }
}

.pisell-pos-member-top-up-options {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;

  > li > button {
    display: flex;
    height: auto;
    min-height: 56px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    text-align: start;
    white-space: normal;
    overflow-wrap: anywhere;

    > span {
      display: grid;
      min-width: 0;
      gap: 2px;
    }

    small {
      color: #667085;
    }
  }
}

.pisell-pos-card-details {
  display: grid;
  gap: 14px;
  container-type: inline-size;
  color: #101828;
  overflow-wrap: anywhere;

  h3 {
    margin: 0;
  }

  &__fields {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 0;
    color: #685259;
    font-size: 13px;

    > div {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: 0 6px;
    }

    dd {
      margin: 0;
    }
  }

  &__balance-footer > small {
    display: block;
    color: #667085;
    font-size: 12px;
  }

  &__section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;

    h3 {
      font-size: 16px;
    }

    > span {
      color: #667085;
    }
  }

  &__balances {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;

    > li {
      display: flex;
      min-width: 0;
      flex-direction: column;
      overflow: hidden;
      border: 1px solid #d0d5dd;
      border-radius: 12px;
      background: #f6f7f9;
    }
  }

  &__balance-card {
    position: relative;

    .pisell-wallet-pass-card {
      isolation: isolate;
      width: 100%;
      height: auto;
      border: 0;
      border-radius: 0;

      > .pisell-wallet-pass-card-body {
        box-sizing: border-box;
        height: auto;
        min-height: 144px;
        row-gap: 10px;
        padding-block: 12px;
      }
    }

    &[data-has-qr-code] {
      .pisell-card-amount-info-wrap,
      .pisell-card-code-wrap {
        padding-inline-end: 60px;
      }
    }
  }

  &__balance-qr {
    position: absolute;
    z-index: 1;
    inset-inline-end: 10px;
    inset-block-end: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;

    > .pisell-lowcode-qrcode,
    > .ant-qrcode {
      padding: 6px;
    }
  }

  &__balance-footer {
    display: grid;
    flex: 1;
    align-content: end;
    gap: 8px;
    padding: 12px 16px 16px;
    border-top: 1px solid #e4e7ec;
  }

  &__balance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;

    > button {
      min-width: 88px;
      min-height: 44px;
    }
  }

  &__qr {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin: 0;
    color: #101828;
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
  }

  @container (max-width: 540px) {
    &__balances {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  @media (max-width: 520px) {
    &__balances {
      grid-template-columns: minmax(0, 1fr);
    }
  }
}

.pisell-pos-physical-card-dialog {
  --physical-card-ink: #27344c;
  --physical-card-muted: #66758d;
  --physical-card-line: #e0e3ed;
  --physical-card-purple: #744bc8;
  --physical-card-green: #23765d;
  --physical-card-red: #9a2539;
  --physical-card-amber: #875912;

  .pisell-pos-card-dialog__footer {
    padding-block: 24px;
  }

  .pisell-pos-card-dialog__actions {
    align-items: stretch;

    > button {
      flex: 1 1 0;
      min-width: 0;
      min-height: 56px;
      height: auto;
      padding: 8px 16px;
      line-height: 24px;
      white-space: normal;
      overflow-wrap: anywhere;
    }

    > .pisell-pos-physical-card__next {
      flex-basis: 100%;
    }
  }

  @media (max-width: 560px) {
    .pisell-pos-card-dialog__footer {
      padding: 12px;
    }
  }
}

.pisell-pos-physical-card {
  color: var(--physical-card-ink);
  overflow-wrap: anywhere;

  h2,
  h3,
  p,
  dl,
  dd {
    margin: 0;
  }

  &__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1.08fr);
    align-items: start;
    gap: 18px;
    min-height: 255px;

    &[data-complete='true'] {
      grid-template-columns: minmax(0, 460px);
      justify-content: center;
      align-items: center;
    }
  }

  &__status {
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 13px 6px;
    text-align: center;

    h2 {
      color: inherit;
      font-size: 23px;
      font-weight: 650;
      line-height: 1.32;
    }

    p {
      margin: 12px auto 0;
      max-width: 36ch;
      color: var(--physical-card-muted);
      font-size: 15px;
      line-height: 1.55;
    }

    &[data-tone='detected'] .pisell-pos-physical-card__reader-art {
      border-color: #9ac7ae;
      background: #eef7f2;
    }

    &[data-tone='busy'] .pisell-pos-physical-card__reader-art {
      border-color: #c6bae1;
      background: #f8f5fd;
    }

    &[data-tone='error'] {
      padding: 17px 12px;
      border-color: #edc0c8;
      color: var(--physical-card-red);
      background: #fff4f6;

      p {
        color: #832a39;
      }
    }

    &[data-tone='warning'] {
      padding: 18px 12px;
      border-color: #e6c586;
      color: var(--physical-card-amber);
      background: #fff7e6;

      p {
        color: inherit;
      }
    }

    &[data-tone='success'] {
      color: var(--physical-card-green);
    }
  }

  &__status-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 2px auto 14px;
    place-items: center;
    border-radius: 50%;
    color: inherit;
    background: #ffebbf;
    font-size: 31px;
  }

  [data-tone='success'] &__status-icon {
    background: #e7f5ed;
  }

  &__number {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    font-variant-numeric: tabular-nums;
  }

  &__reader-art {
    position: relative;
    display: grid;
    width: 176px;
    max-width: 100%;
    height: 126px;
    margin: 0 auto 17px;
    place-items: center;
    overflow: hidden;
    border: 1px dashed #d9d0e6;
    border-radius: 11px;
    background: #f5f2f9;
  }

  &__reader-device {
    position: relative;
    display: grid;
    box-sizing: border-box;
    width: 78px;
    height: 98px;
    place-items: center;
    border: 1px solid #3c4b60;
    border-radius: 10px;
    color: #c3b7da;
    background: linear-gradient(135deg, #34445a, #1b293d);
    box-shadow: 3px 5px 10px #25314f16;
    font-size: 31px;

    > span {
      transform: rotate(-35deg);
    }

    &::after {
      position: absolute;
      bottom: 10px;
      width: 20px;
      height: 3px;
      border-radius: 3px;
      background: #9bd6b7;
      content: '';
    }
  }

  &__reader-card {
    position: absolute;
    top: 39px;
    left: 50%;
    display: flex;
    box-sizing: border-box;
    flex-direction: column;
    justify-content: space-between;
    width: 131px;
    height: 76px;
    padding: 11px 13px;
    border: 1px solid #d4c5e6;
    border-radius: 8px;
    color: #705b8a;
    background: linear-gradient(135deg, #fff, #f0eaf9);
    box-shadow: 0 5px 11px #38275120;
    text-align: start;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    transform: translateX(-53%) rotate(-8deg);

    span {
      letter-spacing: 0.05em;
    }

    &--extra {
      top: 24px;
      background: #e3d7ef;
      transform: translateX(-39%) rotate(8deg);
    }
  }

  &__place-arrow {
    position: absolute;
    top: 12px;
    inset-inline-start: 16px;
    color: #9379b5;
    font-size: 28px;
  }

  &__link {
    display: grid;
    align-self: center;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid #e2d3f2;
    border-radius: 50%;
    color: var(--physical-card-purple);
    background: #f3ecfc;
    font-size: 24px;

    &[data-tone='error'] {
      border-color: #ebbdc6;
      color: var(--physical-card-red);
      background: #fff0f4;
    }

    &[data-tone='warning'] {
      border-color: #eed298;
      color: var(--physical-card-amber);
      background: #fff6e2;
    }

    &[data-tone='success'] {
      border-color: #c6e3d5;
      color: var(--physical-card-green);
      background: #edf7f2;
    }
  }

  &__selection {
    display: grid;
    gap: 10px;
    min-width: 0;

    h2 {
      margin-bottom: 3px;
      color: var(--physical-card-ink);
      font-size: 18px;
      font-weight: 650;
      line-height: 1.4;
    }
  }

  &__selection select {
    width: 100%;
    min-height: 40px;
    padding-inline: 10px 25px;
    border: 1px solid #d9cedf;
    border-radius: 8px;
    color: var(--physical-card-ink);
    background: #fff;
    font: inherit;
  }

  &__member {
    padding: 22px;
    border: 1px solid #efc8d0;
    border-radius: 15px;
    color: #8d2033;
    background: linear-gradient(140deg, #fdf5f7 0%, #fff 76%, #f9e7ec 100%);

    h3 {
      color: inherit;
      font-size: 25px;
      font-weight: 700;
      line-height: 1.25;
    }

    dt {
      color: #896d79;
      font-size: 12px;
    }

    > p {
      margin-top: 9px;
      color: #896d79;
      font-size: 13px;
    }
  }

  &__shop {
    margin-bottom: 15px;
    color: #a2586a;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  &__member &__holder {
    margin-top: 20px;

    dd {
      display: inline-block;
      margin-top: 6px;
      padding: 5px 12px;
      border-radius: 20px;
      color: #fff;
      background: #302a30;
      font-size: 16px;
      font-weight: 650;
    }
  }

  &__member p&__member-type {
    margin-top: 12px;
    color: #785c66;
    font-size: 14px;
  }

  &__member &__code {
    margin-top: 21px;

    dd {
      margin-top: 3px;
      color: #493943;
      font-size: 17px;
      font-weight: 650;
      font-variant-numeric: tabular-nums;
    }
  }

  &__link-state,
  &__lookup {
    display: flex;
    align-items: center;
    min-height: 38px;
    gap: 9px;
    padding: 8px 12px;
    border-radius: 8px;
    color: #936012;
    background: #fff3df;
    font-size: 14px;

    > span[role='img'] {
      flex: none;
      font-size: 17px;
    }

    &[data-linked='true'] {
      color: var(--physical-card-green);
      background: #edf7f2;
    }
  }

  &__link-state[data-unknown='true'],
  &__lookup {
    color: var(--physical-card-muted);
    background: #f4f5fa;
  }

  &__footer-note {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-inline-end: auto;
    color: var(--physical-card-muted);
    font-size: 14px;
  }

  @media (max-width: 700px) {
    &__layout {
      grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
      gap: 12px;
    }

    &__link {
      width: 34px;
      height: 34px;
      font-size: 20px;
    }
  }

  @media (max-width: 560px) {
    &__layout {
      grid-template-columns: minmax(0, 1fr);
      min-height: 0;
    }

    &__link {
      justify-self: center;
    }

    &__member {
      padding: 16px 18px;
    }

    &__status h2,
    &__member h3 {
      font-size: 20px;
    }

    &__status p {
      font-size: 14px;
    }
  }
}
