/* fxbyfox.com — share a picture (js/share.js). Uses the app's tokens from app.css. */
.share-sheet { max-height: calc(100vh - var(--sat) - 24px); max-height: calc(100dvh - var(--sat) - 24px); }
.sh-body { display: flex; flex-direction: column; gap: 12px; min-height: 0; flex: 1; }
.sh-head { display: flex; align-items: center; justify-content: space-between; }
.sh-head b { font-size: 19px; flex: 1; }
.sh-all { margin-right: 8px; padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--accent); background: var(--accent-soft); }
.sh-view { margin-right: 6px; }
.sh-view .ic-list, .sh-view[aria-pressed="true"] .ic-grid { display: none; }
.sh-view[aria-pressed="true"] .ic-list { display: block; }
.sh-preview { flex: none; display: grid; place-items: center; }
.sh-preview canvas {
  display: block; max-width: 100%; max-height: 34vh; width: auto; height: auto; border-radius: 14px;
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(0, 0, 0, .25);
}
/* a provider's option for the picture: a line with a switch */
.sh-opt {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 11px 12px 11px 14px; border-radius: 14px; background: var(--card); text-align: left; font-size: 15px; font-weight: 600; color: var(--text);
}
.sh-opt i { flex: none; position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--line); transition: background .15s; }
.sh-opt i::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s;
}
.sh-opt[aria-checked="true"] i { background: var(--accent); }
.sh-opt[aria-checked="true"] i::after { transform: translateX(18px); }
.sh-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sh-list {
  flex: 1; min-height: 60px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 6px; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad);
}
.sh-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; text-align: left;
  background: var(--card); border-radius: 14px;
}
.sh-item .flag { width: 34px; height: 34px; font-size: 12px; }
.sh-item .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sh-item .t b { font-size: 16px; }
.sh-item .t small { font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-item .ck {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); color: transparent; transition: background .15s, border-color .15s;
}
.sh-item .ck svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.sh-item.on .ck { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* 6+ currencies: two columns of short items (flag, code, the country under it) */
.sh-list.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 6px; }
/* all the items one size and every name inside its item: js (fitNames) makes a long word smaller, breaks it if it must,
   and gives the items the height of the tallest */
.sh-list.grid li { min-width: 0; }
.sh-list.grid .sh-item .t b { line-height: 1.2; }
.sh-list.grid .sh-item .t b.brk { -webkit-hyphens: auto; hyphens: auto; overflow-wrap: anywhere; } /* syllables where the browser knows the language */
.sh-list.grid .sh-item { gap: 8px; padding: 8px 10px; }
.sh-list.grid .sh-item .flag { width: 28px; height: 28px; font-size: 11px; }
.sh-list.grid .sh-item .t b { font-size: 15px; }
.sh-list.grid .sh-item .t small { font-size: 11.5px; }
.sh-list.grid .sh-item .ck { width: 22px; height: 22px; }
.sh-list.grid .sh-item .ck svg { width: 13px; height: 13px; }
.sh-send {
  flex: none; width: 100%; padding: 15px; border-radius: 16px; font-weight: 700; font-size: 17px;
  background: var(--accent); color: var(--accent-ink);
}
.sh-send:active { transform: scale(.98); }
@media (min-width: 960px) {
  /* as tall as what is in it (no empty space under the button), never taller than the window */
  .share-sheet { height: auto; max-height: min(860px, calc(100vh - 60px)); width: 480px; }
  .sh-list { flex: 0 1 auto; }
  .sh-preview canvas { max-height: 380px; }
  /* the chart picture has no list under it: it gets the room */
  .share-sheet.chart .sh-preview canvas { max-height: min(640px, calc(100vh - 220px)); }
  .share-sheet .sh-item { background: var(--card-2); }
}
