/* Styles taken from the archive app (tokens, base, header, tabs, cards, ext, sheet), plus the pages of this one at the end. */
/* Plain and flat: a near-black page (dark always), gray text levels, one red. */
:root {
  color-scheme: dark;
  --bg: #0f0f0f;
  --fg: #f1f1f1;
  --fg-2: #aaaaaa;
  --fg-3: #717171;
  --line: #2b2b2b;
  --fill: #1f1f1f;
  --fill-2: #2e2e2e;
  --hover: rgba(255, 255, 255, 0.08);
  --press: rgba(255, 255, 255, 0.14);
  --ink: #f1f1f1;
  --on-ink: #0f0f0f;
  --pop: #222222;
  --accent: #ff4e3a;
  --link: #3ea6ff;
  --danger: #f28b82;
  --on-danger: #2b0b08;
  --note-bg: #2a2210;
  --note-fg: #ecd39b;
  --alert-bg: #351816;
  --alert-fg: #f5b8b0;
  --shadow-pop: 0 6px 24px rgba(0, 0, 0, 0.6);

  --font: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Segoe UI", Roboto, "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Roboto Mono", monospace;
  --r-s: 4px;
  --r-m: 8px;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --content-max: 1280px;
  --bar-h: 56px;
  --tabbar-h: 56px;

  /* Over pictures and videos: always white on black, whatever the theme. */
  --on-media: #fff;
  --media-bg: #000;

  /* Layers, lowest first. */
  --z-mini: 18;
  --z-bar: 20;
  --z-float: 30;
  --z-over: 40;
  --z-viewer: 50;
  --z-sheet: 60;
  --z-menu: 70; /* over a sheet: タグを選ぶ opens one from inside it */
  --z-peek: 80;
  --z-guide: 85;
  --z-demo: 90;
  --z-contact: 94;
}

/* Text sizes still used by the gate, sheets and dialogs. */
.t-title-l { font-size: 18px; line-height: 26px; font-weight: 600; }
.t-title-m { font-size: 16px; line-height: 24px; font-weight: 600; }
.t-title-s { font-size: 14px; line-height: 20px; font-weight: 600; }
.t-body-l { font-size: 15px; line-height: 24px; }
.t-body-m { font-size: 14px; line-height: 22px; }
.t-body-s { font-size: 12px; line-height: 17px; }
.t-label-l { font-size: 14px; line-height: 20px; font-weight: 600; }

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body.locked {
  overflow: hidden;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

button:disabled {
  cursor: default;
}

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.nowrap {
  display: inline-block;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-m);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}

.btn svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-left: -2px;
}

.btn-filled {
  background: var(--ink);
  color: var(--on-ink);
}

.btn-tonal {
  background: var(--fill);
  color: var(--fg);
}

.btn-demo {
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--fg);
}

.btn-text {
  padding: 0 12px;
  color: var(--fg);
}

.btn-danger {
  background: var(--danger);
  color: var(--on-danger);
}

@media (hover: hover) {
  .btn-filled:hover:not(:disabled),
  .btn-danger:hover:not(:disabled) {
    opacity: 0.86;
  }
  .btn-tonal:hover:not(:disabled) {
    background: var(--fill-2);
  }
  .btn-demo:hover:not(:disabled),
  .btn-text:hover:not(:disabled) {
    background: var(--hover);
  }
}

.btn:active:not(:disabled) {
  opacity: 0.72;
}

.btn-filled:disabled,
.btn-tonal:disabled,
.btn-danger:disabled {
  background: var(--fill);
  color: var(--fg-3);
}

.btn-wide {
  width: 100%;
  height: 48px;
}

.icon-btn {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--fg);
}

@media (hover: hover) {
  .icon-btn:hover {
    background: var(--hover);
  }
}

.icon-btn:active {
  background: var(--press);
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

/* ---------- header ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: var(--z-bar);
  padding-top: var(--sat);
  background: var(--bg);
}

.header.scrolled {
  box-shadow: 0 1px 0 var(--line);
}

.app-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: var(--bar-h);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 calc(8px + var(--sar)) 0 calc(8px + var(--sal));
}

/* .watch-title: a folder's name, beside 戻る on the watch page */
.app-bar-title,
.watch-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 600;
}

.app-bar-title.root {
  flex: 1 0 auto;
  padding-left: 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* the sites of the ダウンロード tab, in place of the app bar */
.site-tabs {
  display: flex;
  max-width: var(--content-max);
  height: 48px;
  margin: 0 auto 10px;
  padding: 0 calc(8px + var(--sar)) 0 calc(8px + var(--sal));
  box-shadow: inset 0 -1px 0 var(--line);
}

/* the site names: they share the width when they fit, and scroll sideways when not (a phone) */
.site-tab-row {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.site-tab-row::-webkit-scrollbar {
  display: none;
}

.site-tab {
  position: relative;
  flex: 1 0 auto;
  padding: 0 12px;
  white-space: nowrap;
  color: var(--fg-2);
  font-size: 15px;
  font-weight: 600;
}

.site-tab.on {
  color: var(--fg);
  font-weight: 700;
}

.site-tab.on::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 48px;
  height: 3px;
  margin-left: -24px;
  border-radius: 3px 3px 0 0;
  background: var(--fg);
}

.site-tab:active {
  opacity: 0.6;
}

/* the tabs are links (each site has its own address) */
a.site-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
}

/* リンクから保存: at the end of the sites */

/* ---------- page ---------- */

/* Pages sit above the bottom tabs. */
.page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 12px calc(16px + var(--sar)) calc(var(--tabbar-h) + 32px + var(--sab)) calc(16px + var(--sal));
}

.msg-card,
.access-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 20px;
  border-radius: var(--r-m);
}

.msg-card {
  padding: 12px 6px 12px 14px;
  background: var(--fill);
}

.msg-card p {
  flex: 1;
  margin: 0;
  padding-top: 2px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg-card p::first-line {
  font-weight: 700;
}

.msg-card .icon-btn {
  width: 32px;
  height: 32px;
  color: var(--fg-2);
}

.msg-card .icon-btn svg {
  width: 20px;
  height: 20px;
}

.access-card {
  padding: 10px 14px;
  background: var(--note-bg);
  color: var(--note-fg);
}

.access-card.urgent {
  background: var(--alert-bg);
  color: var(--alert-fg);
}

.access-card p {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.empty {
  padding: 72px 16px;
  text-align: center;
  color: var(--fg-2);
}

.empty p {
  margin: 0;
}

.screens-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ---------- bottom tabs ---------- */

/* nothing scrolled into view hides under the bar (pages have room for it, see .page) */

/* ---------- chips (sort, period, list) ---------- */

.chip-row {
  position: relative;
  display: flex;
  gap: 8px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 calc(16px + var(--sar)) 10px calc(16px + var(--sal));
  overflow-x: auto;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-m);
  background: var(--fill);
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

@media (hover: hover) {
  .chip:hover:not(.on) {
    background: var(--fill-2);
  }
}

.chip.on {
  background: var(--ink);
  color: var(--on-ink);
}

/* a second row: smaller, so the header stays short */
.chip-row + .chip-row .chip {
  height: 28px;
  padding: 0 10px;
  font-size: 13px;
}

.chip-bar {
  display: flex;
  align-items: center;
  max-width: var(--content-max);
  margin: 0 auto;
}

.chip-bar .chip-row {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.chip-note {
  flex: none;
  padding: 0 calc(16px + var(--sar)) 10px 0;
  color: var(--fg-3);
  font-size: 12px;
}

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 10px;
}

.cards-end {
  margin: 0;
  padding: 40px 16px 16px;
  text-align: center;
  color: var(--fg-2);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.cards-end .btn {
  letter-spacing: normal;
}

/* a row like a list loading more; room below for the bar and the join button at the bottom right */
.cards-end-dm {
  padding-bottom: 40px;
}

.cards-end-dm .spinner,
.cards-end-wait .spinner {
  width: 14px;
  height: 14px;
  color: var(--fg-2);
}

.cards-end-wait {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (min-width: 600px) {
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 28px 16px;
  }
}

@media (min-width: 1200px) {
  .cards {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  color: var(--fg);
  text-align: left;
}

/* Same top edge as a folder's stack, so the pictures in a row line up. */
.card:not(.is-folder) {
  padding-top: 6px;
}

.card:active .frame {
  opacity: 0.8;
}

@media (hover: hover) {
  .card:hover .thumb {
    filter: brightness(0.92);
  }
}

.frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  isolation: isolate;
  border-radius: 6px;
  background: var(--fill);
}

.frame img {
  pointer-events: none;
}

/* Still loading: a slow, soft pulse (opacity only, so it stays off the main thread). */
.frame.wait::before,
.sk-line::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--fill-2);
  animation: pulse 1.1s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    opacity: 0;
  }
}

.skeleton .card {
  pointer-events: none;
}

.sk-line {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--r-s);
  background: var(--fill);
}

.sk-title {
  width: 120px;
  height: 22px;
  margin-left: 8px;
}

.frame-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--fg-3);
}

.frame-icon svg {
  width: 32px;
  height: 32px;
}

/* a video's whole picture, never cropped: tall ones get black bars at the sides */
.thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--media-bg);
  opacity: 0;
  transition: opacity 200ms linear;
}

/* Photos fill the card (the viewer opens out of it and shows the whole photo). */
.card.is-photo .thumb {
  object-fit: cover;
}

.thumb.on {
  opacity: 1;
}

.thumb.now {
  transition: none;
}

/* length / count, bottom right */
.badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--on-media);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.badge svg {
  width: 13px;
  height: 13px;
}

/* bottom left instead (a folder's size, HD) */
.badge.badge-left {
  right: auto;
  left: 4px;
}

/* ---------- outside lists ---------- */

.ext-cards {
  gap: 20px 10px;
}

@media (min-width: 600px) {
  .ext-cards {
    gap: 28px 16px;
  }
}

/* an ad between the cards: a row of its own (public/ads.js) */
.ad-row {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

.ad-label {
  color: var(--fg-3);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.ad-frame {
  display: block;
  max-width: 100%;
  border: 0;
}

.ext-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ext-link {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--fg);
  text-decoration: none;
}

.ext-link .frame {
  margin-bottom: 8px;
}

.ext-link:active .frame {
  opacity: 0.8;
}

@media (hover: hover) {
  .ext-link:hover .thumb {
    filter: brightness(0.92);
  }
}

.ext-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 13.5px;
  line-height: 19px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.ext-title.untitled {
  color: var(--fg-3);
  font-weight: 400;
}

.ext-meta {
  margin-top: 2px;
  color: var(--fg-2);
  font-size: 12px;
  line-height: 17px;
  overflow-wrap: anywhere;
}

.rank {
  position: absolute;
  left: 4px;
  top: 4px;
  z-index: 2;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--on-media);
  font-size: 13px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* download, over the top right of the picture */
.ext-save {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--on-media);
}

/* a bigger place to tap than the circle: out to the corner of the picture, and inward */
.ext-save::after {
  content: "";
  position: absolute;
  inset: -6px -6px -16px -16px;
}

.ext-save svg {
  width: 18px;
  height: 18px;
}

@media (hover: hover) {
  .ext-save:hover {
    background: rgba(0, 0, 0, 0.75);
  }
}

.ext-save:active {
  background: rgba(0, 0, 0, 0.85);
}

.ext-account {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  max-width: 100%;
  min-height: 28px;
  margin: 4px 0 0 -4px;
  padding: 2px 8px 2px 4px;
  border-radius: 999px;
  color: var(--fg-2);
  font-size: 12px;
  font-weight: 600;
}

@media (hover: hover) {
  .ext-account:hover {
    background: var(--hover);
  }
}

.ext-account:active {
  background: var(--press);
}

.ext-account-id {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  flex: none;
  display: block;
  width: 20px;
  height: 20px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--fill-2);
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

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

.account-title .avatar {
  width: 28px;
  height: 28px;
}

.sk-text {
  height: 14px;
  margin-top: 8px;
}

.sk-text.short {
  width: 60%;
  margin-top: 6px;
}

.feed-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 0 8px;
  color: var(--fg-2);
}

.feed-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.feed-error svg {
  width: 28px;
  height: 28px;
  color: var(--fg-3);
}

.feed-error p {
  margin: 0;
}

/* an ad blocker is on: this instead of the list */
.blocked {
  padding-top: 48px;
  line-height: 1.7;
}

.blocked .blocked-title {
  color: var(--fg);
  font-size: 17px;
  font-weight: 700;
}

.blocked .blocked-hint {
  color: var(--fg-3);
  font-size: 13px;
}

.sentinel {
  height: 1px;
}

/* リンクから保存 */

/* save sheet */
.save-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  margin: -6px 0 14px;
  color: var(--fg-2);
  font-size: 13.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  color: var(--fg-2);
}

.save-state svg {
  flex: none;
}

.save-state .grow {
  flex: 1;
}

.save-state.error {
  color: var(--danger);
}

.save-state .btn {
  color: var(--fg);
}

.save-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(50dvh, 420px);
  margin: 0 -2px;
  padding: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.save-opt {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 8px 14px 8px 12px;
  border-radius: var(--r-m);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--fg);
  text-decoration: none;
}

@media (hover: hover) {
  .save-opt:hover {
    background: var(--hover);
  }
}

.save-opt:active {
  background: var(--press);
}

.save-opt[aria-disabled="true"] {
  opacity: 0.45;
  pointer-events: none;
}

.save-quota {
  margin: 0 2px 12px;
}

.save-opt svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--fg-2);
}

.save-opt .grow {
  flex: 1;
  min-width: 0;
}

.save-label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.save-note {
  display: block;
  color: var(--fg-2);
  font-size: 12.5px;
  line-height: 1.5;
}

.save-size {
  flex: none;
  color: var(--fg-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.save-sheet .sheet-actions {
  margin-top: 12px;
}

/* more downloads for an ad: the button, then the count down over the ad */
.bonus {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 14px;
}

.bonus:empty {
  display: none;
}

.bonus-count {
  margin: 0;
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* the video watched for more downloads (public/vast.js): as large as the sheet lets it, sound off at first */
.vast {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.vast-video {
  display: block;
  width: 100%;
  max-height: min(60dvh, 480px);
  border-radius: 8px;
  background: #000;
  object-fit: contain;
}

.vast-sound {
  position: absolute;
  right: 8px;
  bottom: 8px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* the side ad (public/ads.js): a frame its tag lays the slider out in, cut down to the slider; under the sheets */
.side-ad {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: calc(var(--z-sheet) - 1);
  width: min(420px, 100vw);
  height: min(420px, 60vh);
  border: 0;
  background: transparent;
  color-scheme: normal;
  clip-path: inset(100%);
}

/* the ad under the choices (public/ads.js): kept apart from them, so it is not mistaken for one */
.ad-save {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* with the ad the sheet can be taller than a small phone */
.save-sheet {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}

/* ---------- sheet / dialog ---------- */

.sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-sheet);
  background: rgba(0, 0, 0, 0.45);
  animation: fade 150ms linear;
}

/* focused on open (keys, screen readers): no ring around the sheet */
.sheet:focus {
  outline: none;
}

.sheet {
  position: fixed;
  z-index: calc(var(--z-sheet) + 1);
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 calc(20px + var(--sar)) calc(20px + var(--sab)) calc(20px + var(--sal));
  border-radius: 12px 12px 0 0;
  background: var(--pop);
  box-shadow: var(--shadow-pop);
  animation: sheet-in 220ms var(--ease);
}

.sheet-handle {
  width: 32px;
  height: 4px;
  margin: 8px auto 14px;
  border-radius: 2px;
  background: var(--fill-2);
}

@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}

@media (min-width: 720px) {
  .sheet {
    top: 50%;
    bottom: auto;
    max-width: 420px;
    padding: 20px 24px 24px;
    border-radius: 12px;
    transform: translateY(-50%);
    animation: fade 150ms linear;
  }
  .sheet-handle {
    display: none;
  }
}

.sheet h2 {
  margin: 0 0 12px;
  font-size: 18px;
  line-height: 26px;
  font-weight: 700;
}

.sheet-note {
  margin: 14px 0;
  color: var(--fg-2);
  font-size: 13.5px;
  line-height: 1.7;
}

.sheet-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- this app ---------- */

#app {
  min-height: 100dvh;
}

.sheet-scrim,
.sheet {
  /* the sheets live outside #app */
  --z-sheet: 60;
}

.sheet h3.save-head {
  margin: 16px 0 8px;
  font-size: 13px;
  color: var(--fg-2);
  font-weight: 600;
}

/* a save option: the whole row downloads in the browser; the button at its end saves on the PC */
.save-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.save-row .save-opt {
  flex: 1;
  min-width: 0;
}

.save-pc {
  flex: none;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  width: 64px;
  border-radius: var(--r-m);
  background: var(--fill);
  color: var(--fg);
  font-size: 11px;
  font-weight: 600;
}

.save-pc svg {
  width: 20px;
  height: 20px;
}

@media (hover: hover) {
  .save-pc:hover:not(:disabled) {
    background: var(--fill-2);
  }
}

.save-pc:active:not(:disabled) {
  background: var(--press);
}

.save-pc:disabled {
  color: var(--fg-3);
}

.save-hint {
  margin: 10px 2px 0;
  color: var(--fg-3);
  font-size: 12.5px;
  line-height: 1.6;
}

/* tab badge: how many are being saved */

/* saved / queue */

/* settings */

[hidden] {
  display: none !important;
}

/* swiping between the sites: vertical scrolling stays the browser's, sideways is ours */
#view {
  overflow-x: clip;
  touch-action: pan-y;
}

.chip-row {
  touch-action: pan-x pan-y;
}

.slide-r {
  animation: slide-from-right 240ms var(--ease) both;
}

.slide-l {
  animation: slide-from-left 240ms var(--ease) both;
}

@keyframes slide-from-right {
  from {
    transform: translateX(32%);
    opacity: 0;
  }
}

@keyframes slide-from-left {
  from {
    transform: translateX(-32%);
    opacity: 0;
  }
}

/* four sites fit a narrow phone */
.site-tab {
  font-size: 14px;
  letter-spacing: -0.02em;
}

.site-tab {
  flex: 1 1 auto;
  padding: 0 6px;
}

/* no bottom bar: the page has no room to keep for it */
:root {
  --tabbar-h: 0px;
}

.site-tab {
  padding: 0 4px;
}

/* gofile pictures: a smooth, light blur (a little larger, so the blurred edge falls outside the frame) */
:root {
  --blur: clamp(1.2px, 0.33vw, 2px);
}

.thumb.soft {
  filter: blur(var(--blur)) !important;
  transform: scale(1.03);
}

/* the mail mark at the end of the site tabs */

/* gofile pictures are mostly tall: a square frame, filled */
.frame.square {
  aspect-ratio: 1 / 1;
}

.frame.square .thumb {
  object-fit: cover;
}

/* the takedown notice under the site tabs: small print that scrolls away with the page */
.notice {
  margin: 0 0 18px;
  color: var(--fg-3);
  font-size: 11.5px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

/* the page's heading, small, above the note: it says what the list is (search engines read it too) */
.intro-title {
  margin: 0 0 2px;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 700;
}

.intro .notice {
  margin-bottom: 6px;
}

/* 使い方・よくある質問: folded under the note */
.guide {
  margin: 0 0 18px;
  color: var(--fg-2);
  font-size: 12.5px;
  line-height: 1.75;
}

.guide summary {
  display: inline-block;
  font-size: 11.5px;
  list-style: none;
}

.guide summary::-webkit-details-marker {
  display: none;
}

.guide summary::after {
  content: " ▾";
}

.guide[open] summary::after {
  content: " ▴";
}

.guide h2 {
  margin: 12px 0 4px;
  color: var(--fg);
  font-size: 13.5px;
  font-weight: 700;
}

.guide h3 {
  margin: 10px 0 2px;
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 600;
}

.guide ol {
  margin: 0;
  padding-left: 1.4em;
}

.guide p {
  margin: 0;
}

/* 「お問い合わせ」 in the notice: opens the inquiry form (a little more room to tap than the text) */
.notice-link {
  display: inline;
  margin: -6px 0;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.notice-link:active {
  opacity: 0.6;
}

/* 問い合わせ */
.inq-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inq-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--fg-2);
  font-size: 12.5px;
  font-weight: 600;
}

.inq-field {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-m);
  background: var(--fill);
  color: var(--fg);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  outline: none;
}

.inq-field:focus-visible {
  box-shadow: inset 0 0 0 2px var(--fg-3);
}

.inq-text {
  resize: vertical;
  line-height: 1.6;
}

.inq-note {
  min-height: 0;
  color: var(--fg-2);
  font-size: 13px;
}

.inq-note:empty {
  display: none;
}

.inq-note.error {
  color: var(--danger);
}

.inq-actions {
  display: flex;
  justify-content: flex-end;
}

.inq-form .save-hint {
  margin: 0 2px;
}

.inq-form .save-hint a {
  color: var(--fg);
}

.inq-sheet {
  max-height: 92dvh;
  overflow-y: auto;
}

/* the links at the end of the note under the site tabs */
.notice-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  margin-top: 4px;
}

a.notice-link {
  text-decoration: none;
}

/* ---------- このサイトについて・利用規約・削除依頼・プライバシー ---------- */

.about-page {
  max-width: 760px;
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.about-age {
  margin: 4px 0 14px;
  padding: 10px 12px;
  border-radius: var(--r-m);
  background: var(--note-bg);
  color: var(--note-fg);
  font-size: 13px;
  line-height: 1.6;
}

/* the contents: the chips of the lists, without their own side padding (the page has it) */
.about-page .about-toc {
  margin: 0 0 8px;
  padding: 0 0 6px;
}

.about-section {
  padding: 22px 0 6px;
  border-top: 1px solid var(--line);
  /* opened at a section: its heading stays out from under the bar */
  scroll-margin-top: calc(var(--bar-h) + var(--sat) + 8px);
}

.about-toc + .about-section {
  border-top: 0;
}

.about-section h2 {
  margin: 0 0 10px;
  color: var(--fg);
  font-size: 18px;
  line-height: 1.5;
  font-weight: 700;
}

.about-section h3 {
  margin: 18px 0 4px;
  color: var(--fg);
  font-size: 14.5px;
  line-height: 1.5;
  font-weight: 600;
}

.about-section p {
  margin: 0 0 10px;
}

.about-section ul {
  margin: 0 0 10px;
  padding-left: 1.3em;
}

.about-section li + li {
  margin-top: 4px;
}

.about-section a {
  color: var(--link);
}

.about-article h3 {
  margin-top: 16px;
}

.about-updated {
  margin: 22px 0 0;
  color: var(--fg-3);
  font-size: 12px;
}

/* 各サイト → mostdl（通すだけ）→ あなたの端末 */
.relay {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin: 14px 0 16px;
}

.relay-node {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 12px 8px;
  border-radius: var(--r-m);
  background: var(--fill);
  text-align: center;
}

.relay-node.mine {
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.relay-label {
  color: var(--fg);
  font-size: 13.5px;
  line-height: 1.4;
  font-weight: 700;
}

.relay-sub {
  color: var(--fg-3);
  font-size: 11.5px;
  line-height: 1.4;
}

.relay-node.mine .relay-sub {
  color: var(--accent);
  font-weight: 600;
}

.relay-arrow {
  align-self: center;
  color: var(--fg-3);
  font-size: 16px;
}

/* a phone: top to bottom */
@media (max-width: 520px) {
  .relay {
    flex-direction: column;
  }

  .relay-arrow {
    transform: rotate(90deg);
    line-height: 1;
  }
}
