.p-share {
  --ps-surface: #101211;
  --ps-panel: #191b1a;
  --ps-line: #343935;
  --ps-text: #f7f8f7;
  --ps-secondary: #b4b9b6;
  --ps-accent: #3ade8b;
  box-sizing: border-box;
  width: min(calc(100% - 32px), 750px);
  max-width: none;
  max-height: min(90dvh, 780px);
  padding: 0;
  border: 1px solid #373c39;
  border-radius: .9rem;
  background: var(--ps-surface);
  color: var(--ps-text);
  font: inherit;
  color-scheme: dark;
  box-shadow: 0 20px 70px #000a;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #505652 var(--ps-surface);
}
.p-share * { box-sizing: border-box; }
.p-share [hidden] { display: none !important; }
.p-share::backdrop { background: rgb(0 0 0 / .72); backdrop-filter: blur(4px); }
.ps-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--ps-line); }
.ps-head h2 { margin: 0; font-size: clamp(1.35rem, 3.2vw, 1.65rem); font-weight: 680; line-height: 1.25; letter-spacing: -.035em; }
.ps-close {
  flex: none;
  width: 2rem;
  height: 2rem;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--ps-line);
  border-radius: .45rem;
  background: transparent;
  color: var(--ps-secondary);
  cursor: pointer;
}
.p-share svg { width: 20px; height: 20px; flex-shrink: 0; }
.ps-grid { display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); gap: clamp(18px, 3.2vw, 28px); align-items: start; padding: 1.4rem 1.5rem 1.5rem; }
.ps-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: .6rem;
  overflow: hidden;
  background: #0b0d0c;
  border: 1px solid var(--ps-line);
}
.ps-preview canvas { display: block; width: 100%; height: 100%; }
.ps-load { padding: 1rem; text-align: center; line-height: 1.55; color: var(--ps-secondary); }
.ps-retry { background: var(--ps-panel); border: 1px solid var(--ps-line); border-radius: .45rem; padding: .5rem .8rem; color: var(--ps-text); }
.ps-date { margin: 0 0 .5rem; color: var(--ps-accent); font-size: .875rem; font-weight: 600; }
.ps-details { min-width: 0; }
.ps-details h3 { margin: 0 0 1.15rem; font-size: 1.35rem; line-height: 1.35; letter-spacing: -.025em; }
.ps-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .5rem; }
.ps-network, .ps-copy, .ps-save {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  padding: .55rem .65rem;
  border-radius: .5rem;
  font: inherit;
  font-weight: 600;
  font-size: .94rem;
  color: var(--ps-text);
  background: var(--ps-panel);
  border: 1px solid var(--ps-line);
  text-decoration: none;
  cursor: pointer;
}
.ps-network:hover, .ps-close:hover, .ps-copy:hover, .ps-retry:hover { border-color: #626a64; background: #272b28; }
.p-share :is(button, a, input):focus-visible { outline: 2px solid var(--ps-accent); outline-offset: 3px; }
.ps-url { display: block; margin: 1.1rem 0 .5rem; padding-top: 1rem; border-top: 1px solid var(--ps-line); font-size: .875rem; color: var(--ps-secondary); }
.ps-url input {
  display: block;
  width: 100%;
  margin-top: .4rem;
  padding: .7rem .8rem;
  font: inherit;
  font-size: .95rem;
  color: var(--ps-text);
  border: 1px solid #454a46;
  border-radius: .45rem;
  background: #0c0e0d;
  text-overflow: ellipsis;
}
.ps-copy, .ps-save { width: 100%; }
.ps-save { margin-top: .5rem; color: #092015; background: var(--ps-accent); border-color: var(--ps-accent); }
.ps-save:not(:disabled):hover { background: #64e8a2; }
.p-share button:disabled { opacity: .55; cursor: wait; }
.ps-feedback { margin: .65rem 0 0; line-height: 1.5; color: var(--ps-secondary); font-size: .875rem; }
.ps-feedback:empty { display: none; }
.ps-warning { margin: 0; padding: 1.2rem 1.5rem; color: #ffaca7; }
.p-share:is(:lang(th),:lang(my)) { line-height: 1.7; overflow-wrap: anywhere; }
.p-share:is(:lang(th),:lang(my)) :is(h2,h3,button,a,p,label) { line-height: 1.65; letter-spacing: normal; }
@media (max-width: 600px) {
  .p-share { width: min(calc(100% - 24px), 440px); max-height: 92dvh; }
  .ps-head { padding: 1rem 1.15rem; }
  .ps-grid { grid-template-columns: 1fr; gap: 1rem; padding: 1rem 1.15rem 1.15rem; }
  .ps-preview { width: min(100%, 208px); justify-self: center; }
  .ps-details h3 { font-size: 1.15rem; margin-bottom: .9rem; }
  .ps-url { margin-top: .85rem; }
}
