.pdm-panel,
.pdm-panel[hidden] {
  display: none;
}

@media (max-width: 540px) {
  .pdm-panel[hidden] {
    display: none !important;
  }

  .pdm-panel:not([hidden]) {
    display: block;
    width: 100%;
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid #ded8e8;
    border-radius: 16px;
    background: #fff;
    color: #271d37;
    box-shadow: 0 18px 45px rgba(47, 31, 75, .12);
    animation: pdm-reveal .24s ease-out both;
  }

  .project-demo.pdm-is-open > .pd-mobile-launch {
    display: none;
  }

  .pdm-panel button,
  .pdm-panel input,
  .pdm-panel select {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .pdm-panel button {
    min-height: 44px;
    cursor: pointer;
  }

  .pdm-panel button:disabled {
    opacity: .45;
  }

  .pdm-panel :is(button, input, select):focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
  }

  .pdm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    background: linear-gradient(145deg, #17143b, #0f0e2e);
    color: #fff;
  }

  .pdm-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .pdm-brand > span:last-child,
  .pdm-brand strong,
  .pdm-brand small {
    display: block;
  }

  .pdm-brand strong {
    font-size: 13px;
    font-weight: 650;
  }

  .pdm-brand small {
    margin-top: 2px;
    color: #b9aecf;
    font-size: 10px;
  }

  .pdm-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 10px;
    background: rgba(139, 92, 246, .22);
    color: #ddd2ff;
    font-size: 16px;
    font-weight: 750;
  }

  .pdm-close {
    min-height: 40px !important;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 9px;
    background: rgba(255, 255, 255, .08);
    color: #e8e3f3;
    font-size: 11px !important;
    font-weight: 650;
  }

  .pdm-content {
    padding: 18px 14px 16px;
  }

  .pdm-intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .pdm-intro [data-pdm-eyebrow] {
    display: block;
    color: #81748f;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 1.3px;
  }

  .pdm-intro h3 {
    margin-top: 5px;
    color: #1f1730;
    font-size: 21px;
    line-height: 1.2;
  }

  .pdm-live {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #756a80;
    font-size: 10px;
    white-space: nowrap;
  }

  .pdm-live i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7c3aed;
    box-shadow: 0 0 0 3px #ede7fa;
  }

  .pdm-workflows,
  .pdm-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
    padding: 3px;
    border: 1px solid #e7e3eb;
    border-radius: 10px;
    background: #f4f2f7;
  }

  .pdm-workflows {
    margin-top: 17px;
  }

  .pdm-workflows button,
  .pdm-filters button {
    min-width: 0;
    padding: 5px 2px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #756a80;
    font-size: 11px;
    font-weight: 600;
  }

  .pdm-workflows button[aria-pressed="true"],
  .pdm-filters button[aria-pressed="true"] {
    background: #fff;
    color: #6d32bd;
    box-shadow: 0 1px 5px rgba(38, 25, 53, .13);
  }

  .pdm-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 16px;
    padding: 14px 0;
    border-top: 1px solid #ece8f0;
    border-bottom: 1px solid #ece8f0;
  }

  .pdm-stats div {
    min-width: 0;
    padding-left: 12px;
    border-left: 1px solid #e5e0e9;
  }

  .pdm-stats div:first-child {
    padding-left: 0;
    border-left: 0;
  }

  .pdm-stats strong,
  .pdm-stats span {
    display: block;
  }

  .pdm-stats strong {
    color: #2b203d;
    font-size: 24px;
    line-height: 1;
  }

  .pdm-stats div:first-child strong {
    color: #6d32bd;
  }

  .pdm-stats span {
    margin-top: 6px;
    color: #81758b;
    font-size: 10px;
  }

  .pdm-actions {
    display: grid;
    gap: 10px;
    margin-top: 16px;
  }

  .pdm-add,
  .pdm-save {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #7c3aed;
    border-radius: 9px;
    background: #7c3aed;
    color: #fff;
    font-size: 12px !important;
    font-weight: 650;
  }

  .pdm-form {
    margin-top: 12px;
    padding: 14px;
    border: 1px solid #ded1ed;
    border-radius: 11px;
    background: #faf8fc;
  }

  .pdm-form[hidden] {
    display: none !important;
  }

  .pdm-form h4 {
    margin-bottom: 12px;
    font-size: 14px;
  }

  .pdm-form label,
  .pdm-form label > span {
    display: block;
  }

  .pdm-form label + label {
    margin-top: 11px;
  }

  .pdm-form label > span {
    margin-bottom: 5px;
    color: #6f617b;
    font-size: 11px;
    font-weight: 600;
  }

  .pdm-form input {
    width: 100%;
    min-height: 46px;
    padding: 10px 11px;
    border: 1px solid #dcd4e3;
    border-radius: 8px;
    background: #fff;
    color: #251a30;
    font-size: 16px;
  }

  .pdm-form > div {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 8px;
    margin-top: 13px;
  }

  .pdm-cancel {
    padding: 8px;
    border: 1px solid #ded8e8;
    border-radius: 9px;
    background: #fff;
    color: #5f526b;
    font-size: 11px !important;
    font-weight: 600;
  }

  .pdm-list {
    display: grid;
    gap: 9px;
    margin-top: 14px;
    padding: 0;
    list-style: none;
  }

  .pdm-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 132px;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e8e3ec;
    border-radius: 10px;
    background: #fff;
  }

  .pdm-row div {
    min-width: 0;
  }

  .pdm-row strong,
  .pdm-row span {
    display: block;
    overflow-wrap: anywhere;
  }

  .pdm-row strong {
    color: #2a2035;
    font-size: 12px;
    font-weight: 650;
  }

  .pdm-row span {
    margin-top: 4px;
    color: #82778c;
    font-size: 10px;
  }

  .pdm-row select {
    width: 100%;
    min-height: 46px;
    padding: 7px 8px;
    border: 1px solid #ded3ee;
    border-radius: 8px;
    background: #f3edfb;
    color: #6f39b3;
    font-size: 16px;
  }

  .pdm-row select[data-state="0"] {
    border-color: #e3dfe7;
    background: #f5f4f7;
    color: #716878;
  }

  .pdm-row select[data-state="2"] {
    border-color: #cfe8db;
    background: #eaf7f0;
    color: #23724f;
  }

  .pdm-empty {
    padding: 18px 12px;
    border: 1px dashed #d9d0e1;
    border-radius: 10px;
    color: #75677f;
    font-size: 12px;
    text-align: center;
  }

  .pdm-feedback {
    min-height: 34px;
    margin: 13px 0 0;
    color: #776a82;
    font-size: 11px;
    line-height: 1.5;
  }

  .pdm-reset {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e2dce7;
    border-radius: 9px;
    background: #f8f6fa;
    color: #69438d;
    font-size: 11px !important;
    font-weight: 600;
  }

  @keyframes pdm-reveal {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

@media (max-width: 370px) {
  .pdm-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) and (prefers-reduced-motion: reduce) {
  .pdm-panel:not([hidden]) {
    animation: none;
  }
}
