/* Ride Exchange «share my listing» (exshare.js): the share button on the owner's listing and the share dialog. Phone: bottom sheet (exchange.css .ex-sheet); tablet/desktop: centred dialog (desktop.css). */
.ex-shr { display: flex; margin: 12px 0 2px; }
.ex-shb { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); font: 700 14px/1 Vazirmatn, sans-serif; cursor: pointer; }
.ex-shb .ms { font-size: 20px; color: var(--accent); }
.ex-shb:hover { border-color: var(--accent); }
.ex-shb:focus-visible, .xs-b:focus-visible, .xs-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* «my listings» list: the share action sits under the card (the card itself is a button, so no nested button) */
.ex-cw { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ex-cw > .ex-card { width: 100%; }
.ex-act { display: flex; justify-content: flex-end; }
/* dialog */
.xs { display: flex; flex-direction: column; }
.xs-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 10px; }
.xs-hd h3 { margin: 0; font-size: 17px; }
.xs-x { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--panel-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.xs-prev { display: grid; place-items: center; background: var(--panel-2); border-radius: 18px; padding: 10px; margin: 0 0 14px; min-height: 180px; }
.xs-prev img { display: block; max-width: 100%; max-height: min(42vh, 300px); width: auto; height: auto; border-radius: 12px; box-shadow: 0 8px 24px rgba(11, 16, 48, .28); }
.xs-sk { display: block; width: 150px; height: 188px; border-radius: 12px; background: linear-gradient(100deg, rgba(128, 128, 150, .16) 30%, rgba(128, 128, 150, .3) 50%, rgba(128, 128, 150, .16) 70%); background-size: 220% 100%; animation: xs-sh 1.3s linear infinite; }
@keyframes xs-sh { to { background-position: -220% 0; } }
@media (prefers-reduced-motion: reduce) { .xs-sk { animation: none; } }
.xs-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.xs-b { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 12px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--panel); color: var(--text); font: 700 14.5px/1.2 Vazirmatn, sans-serif; cursor: pointer; text-align: center; }
.xs-b[hidden] { display: none; }
.xs-b .ms { font-size: 22px; flex: none; color: var(--muted); }
.xs-b.main { grid-column: 1 / -1; background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.xs-b.main .ms { color: var(--accent-ink); }
.xs-b:disabled { opacity: .5; cursor: default; }
.xs-safe { display: flex; gap: 8px; align-items: flex-start; margin: 14px 2px 2px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.xs-safe .ms { font-size: 18px; flex: none; color: var(--accent); margin-top: 2px; }
@media (min-width: 700px) {
  body.desk .ex-sheet.xs { width: min(760px, 100%); display: grid; grid-template-columns: 260px minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 22px; align-items: start; }
  .xs-grab, .xs > .ex-grab { display: none; }
  .xs-hd { grid-column: 1 / -1; }
  .xs-prev { grid-column: 1; grid-row: 2 / span 2; margin: 0; align-self: stretch; }
  .xs-prev img { max-height: 380px; }
  .xs-acts { grid-column: 2; grid-row: 2; }
  .xs-safe { grid-column: 2; grid-row: 3; }
}
@media (max-width: 380px) { .xs-b { font-size: 13.5px; padding: 0 8px; gap: 6px; } }
/* Ride Carry: the same share button / dialog (carry.js «my activity» list + own listing page) */
.ex-cw > .cy-card { width: 100%; }
.ex-shr + h3, .ex-shr + .cy-card { margin-top: 12px; }

/* card format choice (Vertical | Horizontal): a segmented radiogroup between the preview and the actions */
.xs-seg { display: flex; background: var(--panel-2); border-radius: 22px; padding: 4px; gap: 4px; margin: 0 0 12px; }
.xs-sg { flex: 1; min-width: 0; min-height: 44px; border: 0; border-radius: 18px; background: none; color: var(--muted); font: 700 14px/1.2 Vazirmatn, sans-serif; display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; padding: 0 10px; }
.xs-sg .ms { font-size: 20px; flex: none; }
.xs-sg[aria-checked=true] { background: var(--accent); color: var(--accent-ink); }
.xs-sg:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.xs-sg:disabled { cursor: default; }
.xs-prev.xs-wait img { opacity: .45; transition: opacity .15s; }
@media (min-width: 700px) {
  body.desk .ex-sheet.xs { grid-template-rows: auto auto auto 1fr; }
  .xs-prev { grid-row: 2 / span 3; }
  .xs-seg { grid-column: 2; grid-row: 2; }
  .xs-acts { grid-row: 3; }
  .xs-safe { grid-row: 4; }
  body.desk .ex-sheet.xs.xs-og { grid-template-columns: minmax(0, 1fr); width: min(640px, 100%); }
  .xs-og .xs-prev, .xs-og .xs-seg, .xs-og .xs-acts, .xs-og .xs-safe { grid-column: 1; grid-row: auto; }
  .xs-og .xs-prev { margin: 0 0 14px; }
  .xs-og .xs-prev img { max-height: 300px; }
}
