:root {
  --bg: #fafafa;
  --card: #ffffff;
  --ink: #262626;
  --mute: #737373;
  --line: #dbdbdb;
  --accent: #00843d;
  --accent-press: #006531;
  --void: #fafafa;
  --rose: #00843d;
  --rose-soft: #8fce9a;
  --tile-void: #e7eee6;
  --pick-veil: rgba(0, 132, 61, 0.28);
  --hp-track: rgba(200, 230, 196, 0.55);
  --hp-hi: #9ccc65;
  --hp-lo: #005c28;
  --ring-1: #ffe566;
  --ring-2: #ffc20e;
  --ring-3: #8bc34a;
  --ring-4: #00843d;
  --ring-5: #005c28;
  --chip-grad: linear-gradient(120deg, var(--ring-2) 0%, var(--ring-3) 48%, var(--ring-4) 100%);
  --ring-conic-210: conic-gradient(
    from 210deg,
    var(--ring-1) 0deg,
    var(--ring-2) 70deg,
    var(--ring-3) 140deg,
    var(--ring-4) 210deg,
    var(--ring-5) 280deg,
    var(--ring-1) 360deg
  );
  --ring-conic-0: conic-gradient(
    from 0deg,
    var(--ring-1) 0deg,
    var(--ring-2) 70deg,
    var(--ring-3) 140deg,
    var(--ring-4) 210deg,
    var(--ring-5) 280deg,
    var(--ring-1) 360deg
  );
  --sheet-find-min: min(72dvh, calc(var(--vvh, 100vh) - 12px));
  --sheet-find-max: min(86dvh, calc(var(--vvh, 100vh) - 12px));
  --sheet-find-min-wide: min(32dvh, calc(var(--vvh, 100vh) - 48px));
  --sheet-find-max-wide: min(80dvh, calc(var(--vvh, 100vh) - 48px));
  --sheet-action-min-wide: min(32dvh, calc(var(--vvh, 100vh) - 48px));
  --sheet-action-width: min(520px, 100%);
  --apply-ring: 5px;
}
* {
  box-sizing: border-box;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
img, svg { -webkit-user-drag: none; }
input, textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}
html, body {
  width: 100%;
  margin: 0;
  min-height: 100%;
  overflow-x: clip;
  touch-action: pan-x pan-y;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC",
    "Microsoft JhengHei", sans-serif;
}
.blobs {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.blobs[hidden] {
  display: none !important;
}
.blobs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: 0.42;
  animation: blob-float 22s ease-in-out infinite;
}
.blobs span:nth-child(1) { width: 58vw; height: 58vw; left: -18vw; top: -12vh; background: var(--ring-2); }
.blobs span:nth-child(2) { width: 52vw; height: 52vw; right: -16vw; top: 8vh; background: var(--ring-3); animation-delay: -7s; }
.blobs span:nth-child(3) { width: 48vw; height: 48vw; left: 12vw; bottom: -18vh; background: var(--ring-4); animation-delay: -13s; }
.blobs span:nth-child(4) { width: 40vw; height: 40vw; right: 6vw; bottom: 4vh; background: var(--ring-5); animation-delay: -3s; }
@keyframes blob-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, 8%) scale(1.08); }
}
.hall {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px 48px;
}
.hall.with-feed {
  min-height: auto;
  justify-content: flex-start;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(8px + env(safe-area-inset-bottom, 0px));
}
.home-head {
  position: relative;
  width: min(720px, 100%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.home-head[hidden] {
  display: none !important;
}
.stage-bg {
  position: absolute;
  left: 50%;
  top: 0;
  width: 100vw;
  height: 280px;
  transform: translateX(-50%);
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}
.stage-bg[hidden] {
  display: none !important;
}
.hall.is-invite, .hall.is-booting {
  min-height: 100vh;
  min-height: 100dvh;
}
.hall.is-booting {
  justify-content: center;
}
.hall.is-invite {
  --gate-key: 75px;
  --gate-gap-x: 27px;
  --gate-gap-y: 16px;
  justify-content: flex-start;
  padding: 0;
  overflow: hidden;
}
@media (max-height: 700px) {
  .hall.is-invite {
    --gate-key: 64px;
    --gate-gap-x: 22px;
    --gate-gap-y: 12px;
  }
  .hall.is-invite .profile {
    padding-top: calc(env(safe-area-inset-top, 0px) + 6dvh);
  }
  .hall.is-invite .gate-pad {
    margin-top: 3.5dvh;
  }
  .hall.is-invite .gate-key {
    font-size: 28px;
  }
}
.hall.is-invite .home-head,
.hall.is-invite .local-cabs,
.hall.is-invite #album,
.hall.is-invite .tag-board,
.hall.is-invite .stage-bg,
.hall.is-booting .home-head,
.hall.is-booting .local-cabs,
.hall.is-booting .tag-board,
.hall.is-booting .stage-bg,
.hall.is-booting #feed {
  display: none !important;
}
.profile { text-align: center; }
.subway-y {
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
}
.hall.is-invite .profile {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: calc(env(safe-area-inset-top, 0px) + 14dvh);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
}
.hall.is-invite .subway-y {
  width: 48px;
  height: 48px;
  margin: 0 auto 4px;
}
.hall.is-invite h1.brand {
  font-size: 22px;
}
.hall.is-invite .status {
  margin: 0;
  min-height: 0;
}
.hall.is-invite .status:empty {
  display: none;
}
.subway-y svg { width: 100%; height: 100%; display: block; }
h1.brand {
  margin: 0;
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--rose);
}
.hall.with-feed:not(.is-invite):not(.is-booting) h1.brand { display: none !important; }
.hall.with-feed:not(.is-invite):not(.is-booting) .subway-y { display: none !important; }
.status { margin: 22px 0 0; min-height: 1.5em; font-size: 15px; color: var(--mute); }
.hall.with-feed.is-booting .status {
  font-size: clamp(18px, 5.4vw, 22px);
  font-weight: 600;
  color: var(--ink);
}
html.need-gate #invite-wait { display: none !important; }
html.gate-ok #invite-panel { display: none !important; }
.invite-panel { width: min(420px, 92vw); margin: 0 auto; text-align: center; }
.invite-hey { margin: 6px 0 0; font-size: clamp(17px, 4.6vw, 22px); font-weight: 600; }
.hall.is-invite .invite-hey { margin-top: 6px; }
.invite-safari[hidden] { display: none !important; }
.invite-safari {
  margin: 20px 0 0;
  font-size: 16px;
  color: var(--mute);
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
button.invite-go {
  margin: 28px auto 0;
  width: min(280px, 100%);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 14px 18px;
}
button.invite-go:active { background: var(--accent-press); }
.apple-row { display: flex; align-items: center; gap: 10px; }
.apple-row input,
.apple-row textarea {
  flex: 1;
  min-width: 0;
  margin: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  line-height: normal;
  -webkit-appearance: none;
  appearance: none;
  box-shadow: none;
  outline: none;
  background-clip: padding-box;
}
.apple-row input {
  height: 44px;
}
.apple-row textarea {
  min-height: 88px;
  height: auto;
  padding: 10px 14px;
  resize: none;
  line-height: 1.4;
}
button.apple-next {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  color: var(--accent);
}
button.apple-next svg { width: 36px; height: 36px; display: block; }
button.apple-next circle { fill: currentColor; }
button.apple-next path { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; }
.gate-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  min-height: 13px;
}
.gate-dots[hidden] {
  display: none !important;
}
.gate-dots span {
  width: 10px;
  height: 10px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: transparent;
}
.gate-dots span.is-on {
  background: var(--ink);
}
.gate-dots.is-bad {
  animation: gate-shake 0.4s ease;
}
@keyframes gate-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-7px); }
  80% { transform: translateX(7px); }
}
.gate-pad {
  display: grid;
  grid-template-columns: repeat(3, var(--gate-key, 75px));
  gap: var(--gate-gap-y, 16px) var(--gate-gap-x, 27px);
  width: calc(3 * var(--gate-key, 75px) + 2 * var(--gate-gap-x, 27px));
  margin: 5.5dvh auto 0;
  justify-items: center;
}
.gate-pad[hidden] {
  display: none !important;
}
.gate-pad.is-off {
  pointer-events: none;
  opacity: 0.38;
}
.gate-key {
  width: var(--gate-key, 75px);
  height: var(--gate-key, 75px);
  border-radius: 50%;
  background: rgba(38, 38, 38, 0.08);
  color: var(--ink);
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
}
.gate-key:active {
  background: rgba(38, 38, 38, 0.18);
}
.gate-del {
  font-size: 20px;
  background: transparent;
}
.gate-skip {
  width: var(--gate-key, 75px);
  height: var(--gate-key, 75px);
}
.invite-wait { margin-top: 28px; color: var(--accent); }
.thinking-five {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  height: 22px;
  margin: 0 0 14px;
}
.thinking-five span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rose);
  animation: think-five 1.2s ease-in-out infinite;
}
.thinking-five span:nth-child(2) { animation-delay: 0.12s; }
.thinking-five span:nth-child(3) { animation-delay: 0.24s; }
.thinking-five span:nth-child(4) { animation-delay: 0.36s; }
.thinking-five span:nth-child(5) { animation-delay: 0.48s; }
.thinking-five[hidden] {
  display: none !important;
}
@keyframes think-five {
  0%, 80%, 100% { opacity: 0.22; transform: scale(0.72); }
  40% { opacity: 1; transform: scale(1); }
}
.invite-wait-bar { height: 18px; width: 100%; color: var(--accent); }
.cab-hud {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 0 auto 8px;
}
.cab-wrap { width: min(148px, 42vw); position: relative; overflow: visible; perspective: 720px; }
.cab-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: visible;
  background: transparent;
}
.cab-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--rose-soft);
}
.cab-cover.is-run .cab-ring {
  box-shadow: none;
  background: var(--ring-conic-210);
  animation: ins-spin 2.8s linear infinite;
}
@keyframes ins-spin {
  to { transform: rotate(360deg); }
}
.cab-face {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--bg);
  overflow: hidden;
  z-index: 1;
  isolation: isolate;
}
.home-head,
.cab-hud,
.tag-board,
.feed,
.profile {
  position: relative;
  z-index: 1;
}
.cab-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.cab-foil {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background-image:
    repeating-linear-gradient(
      calc(118deg + var(--foil-a, 0deg)),
      rgba(255, 255, 255, 0) 0 7%,
      rgba(255, 255, 255, 0.55) 10%,
      rgba(255, 255, 255, 0) 13%
    ),
    repeating-linear-gradient(
      calc(-22deg + var(--foil-a, 0deg)),
      var(--ring-1) 0%,
      var(--ring-2) 16%,
      var(--ring-3) 32%,
      var(--ring-4) 48%,
      var(--ring-5) 64%,
      var(--ring-1) 80%
    );
  background-size: 240% 240%, 320% 320%;
  background-position: 10% 40%, 80% 20%;
  mix-blend-mode: color-dodge;
  will-change: background-position;
}
.cab-foil::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    120% 90% at var(--foil-hx, 50%) var(--foil-hy, 32%),
    rgba(255, 255, 255, 0.5) 0%,
    rgba(255, 255, 255, 0) 46%
  );
  mix-blend-mode: screen;
}
.cab-cover.is-holo .cab-foil {
  opacity: 0.68;
  animation: cab-foil 16s linear infinite;
}
@keyframes cab-foil {
  from { background-position: 10% 40%, 80% 20%; }
  to { background-position: 130% 70%, 70% 130%; }
}
@media (prefers-reduced-motion: reduce) {
  .cab-cover.is-holo .cab-foil {
    animation: none;
    transform: none;
    opacity: 0.52;
  }
}
.cab-mask {
  position: absolute;
  inset: 4px;
  z-index: 2;
  border-radius: 50%;
}
.ins-icon {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  flex: 0 0 40px;
  overflow: hidden;
  line-height: 0;
  -webkit-appearance: none;
  appearance: none;
}
.ins-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px #c8c8c8;
  pointer-events: none;
}
.ins-icon.is-live .ins-ring,
.ins-icon.is-run .ins-ring,
.photo-rail .ins-icon .ins-ring {
  box-shadow: none;
  background: var(--ring-conic-210);
}
.ins-icon.is-run .ins-ring,
.settings-entry.is-host .ins-icon .ins-ring {
  animation: ins-spin 2.4s linear infinite;
}
.settings-entry.is-host .ins-icon .ins-ring {
  box-shadow: none;
  background: var(--ring-conic-210);
}
.ins-icon.is-run,
.settings-entry.is-run {
  pointer-events: none;
  cursor: default;
}
.ins-face {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  overflow: hidden;
}
.ins-icon svg {
  width: 16px;
  height: 16px;
  display: block;
  color: #1c1c1e;
}
.ins-icon[hidden] {
  display: none !important;
}
.album-settings {
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 8;
  flex: 0 0 34px;
}
.album-settings[hidden],
.settings-menu[hidden] {
  display: none !important;
}
.settings-catch {
  position: fixed;
  inset: 0;
  z-index: 100039;
  background: transparent;
}
.settings-catch[hidden] {
  display: none !important;
}
html.settings-open #feed {
  pointer-events: none;
}
.album-settings .settings-toggle {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.22));
}
.album-settings .settings-toggle svg {
  width: 16px;
  height: 16px;
}
.settings-menu {
  position: fixed;
  z-index: 100040;
  width: 220px;
  padding: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}
button.settings-entry {
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 12px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  color: #1c1c1e;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}
button.settings-entry:active {
  background: #f2f2f7;
}
.settings-entry .ins-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  pointer-events: none;
}
.settings-entry .ins-icon svg {
  width: 14px;
  height: 14px;
}
.ask-skip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 4px;
  min-height: 44px;
  font-size: 16px;
  font-weight: 600;
  color: #1c1c1e;
}
.ask-skip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.ask-sw {
  width: 51px;
  height: 31px;
  border-radius: 999px;
  background: rgba(120, 120, 128, 0.36);
  position: relative;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.ask-sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease;
}
.ask-skip input:checked + .ask-sw {
  background: #34c759;
}
.ask-skip input:checked + .ask-sw::after {
  transform: translateX(20px);
}
.reader-name { margin: 8px 0 0; font-weight: 600; }
.hall.has-backdrop .reader-name.is-on-dark {
  color: #fff;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.75),
    0 0 12px rgba(0, 0, 0, 0.45);
}
.hall.has-backdrop .reader-name.is-on-light {
  color: var(--ink);
  text-shadow:
    0 0 6px rgba(255, 255, 255, 0.95),
    0 1px 2px rgba(255, 255, 255, 0.8),
    0 0 12px rgba(255, 255, 255, 0.7);
}
.tag-board { width: 100%; margin: 4px auto 0; text-align: left; }
html.has-rail .tag-board {
  padding-right: calc(64px + env(safe-area-inset-right, 0px));
}
html.has-rail .feed {
  padding-right: 0;
}
.mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}
.mode-btn {
  margin: 0;
  width: auto;
  font-family: Unbounded, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
}
.mode-btn.is-on {
  color: #fff;
  box-shadow: none;
  background: var(--chip-grad);
}
.photo-rail {
  position: fixed;
  right: max(8px, env(safe-area-inset-right, 0px));
  top: 50%;
  transform: translateY(-50%);
  z-index: 100010;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}
.photo-rail[hidden] {
  display: none !important;
}
.photo-rail .ins-icon {
  pointer-events: auto;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.18));
}
.photo-rail .ins-icon.is-off .ins-ring {
  box-shadow: inset 0 0 0 1.5px #c8c8c8;
  background: #fff;
}
.photo-rail .ins-icon.is-off {
  opacity: 0.46;
}
.nav-back {
  margin: 0;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.18));
}
.feed {
  width: min(720px, 100%);
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 2px;
  background: var(--bg);
}
.tile {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  background: var(--tile-void);
  overflow: hidden;
  border-radius: 0;
  color: transparent;
  /* 多選也維持 manipulation。改 none 時 iOS 會長押變 pointercancel，再當成輕點把同一本取消。 */
  touch-action: manipulation;
}
.tile.tile-film {
  aspect-ratio: 800 / 538;
}
.tile-heart {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: var(--rose);
  filter: drop-shadow(0 1px 1.2px rgba(0, 0, 0, 0.33));
}
.tile-heart svg {
  width: 22px;
  height: 22px;
  display: block;
  overflow: visible;
  fill: currentColor;
  stroke: #fff;
  stroke-width: 3.2;
  stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke fill;
}
.rail-heart.is-on {
  color: var(--rose);
}
.rail-heart.is-on .ins-face svg,
.rail-heart.is-on .ins-face path {
  fill: currentColor;
  stroke: none;
}
.tile.is-ghost {
  opacity: 0.22;
}
.tile.is-drop {
  box-shadow: inset 0 0 0 3px var(--rose);
}
.tile.is-pinned:not(.is-run) .tile-shield {
  box-shadow: inset 0 0 0 3px var(--rose);
}
.tile.is-run {
  isolation: isolate;
  padding: var(--apply-ring);
}
.tile.is-run::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: 200vw;
  height: 200vw;
  border-radius: 0;
  background: var(--ring-conic-0);
  animation: tag-apply-spin 2.4s linear infinite;
  pointer-events: none;
}
.tile.is-run::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: var(--apply-ring);
  background: var(--tile-void);
  pointer-events: none;
}
.tile.is-run img {
  position: relative;
  z-index: 2;
}
.tile.is-run .tile-shield {
  inset: var(--apply-ring);
}
.tile.is-job.is-run .tile-shield {
  box-shadow: none;
}
.tile.is-run .tile-job-hud {
  left: var(--apply-ring);
  right: var(--apply-ring);
  bottom: var(--apply-ring);
}
.tile.is-run .job-ctrl {
  right: calc(6px + var(--apply-ring));
  bottom: calc(6px + var(--apply-ring));
}
.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.12s ease;
  pointer-events: none;
}
.tile img.is-on { opacity: 1; }
.tile img.is-ready { transition: none; }
.tile-shield {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: rgba(255, 255, 255, 0.01);
  -webkit-touch-callout: none !important;
}
.tile-ep,
.tile-pct {
  position: absolute;
  z-index: 2;
  background: #000;
  color: #fff;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
  letter-spacing: 0.02em;
}
.tile-ep {
  left: 6px;
  bottom: 6px;
  min-width: 1.35em;
  padding: 3px 7px;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}
.tile-pct {
  right: 6px;
  bottom: 6px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
}
.tile-ep[hidden],
.tile-pct[hidden] {
  display: none !important;
}
.tile.is-pick::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--pick-veil);
  z-index: 1;
  pointer-events: none;
}
.tile.is-pick::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  z-index: 2;
  background: var(--accent) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round' d='M6.5 12.5l3.2 3.3 8-8.4'/></svg>") center / 16px 16px no-repeat;
  box-shadow: 0 0 0 2px #fff;
  pointer-events: none;
}
.home-install {
  position: fixed;
  inset: 0;
  z-index: 100020;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 24px 20px calc(28px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(
    to top,
    var(--bg) 0%,
    var(--bg) 22%,
    rgba(250, 250, 250, 0.92) 33%,
    rgba(250, 250, 250, 0.35) 48%,
    rgba(250, 250, 250, 0) 66%
  );
  text-align: center;
}
.home-install[hidden], [hidden] { display: none !important; }
.home-install p { margin: 0 0 8px; font-size: clamp(18px, 5.4vw, 22px); font-weight: 600; color: var(--ink); }
@media (max-width: 560px) and (pointer: coarse) {
  .feed.is-film {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
@media (max-width: 560px) {
  .ins-icon {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
  .album-settings {
    right: 8px;
    bottom: 6px;
  }
  .album-settings .settings-toggle {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
  }
  .photo-rail .ins-icon {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
  html.has-rail .tag-board {
    padding-right: 0;
  }
  .mode-bar {
    flex-wrap: nowrap;
  }
  .mode-btn { font-size: 10px; padding: 7px 12px; }
}
@media (min-width: 600px) and (pointer: coarse) {
  html.has-rail .tag-board {
    padding-right: calc(88px + env(safe-area-inset-right, 0px));
  }
  .photo-rail {
    gap: 18px;
  }
  .photo-rail .ins-icon {
    width: 64px;
    height: 64px;
    flex-basis: 64px;
  }
  .photo-rail .ins-face {
    inset: 4px;
  }
  .photo-rail .ins-icon svg {
    width: 25px;
    height: 25px;
  }
  .album-settings .settings-toggle {
    width: 39px;
    height: 39px;
    flex-basis: 39px;
  }
  .album-settings .settings-toggle svg {
    width: 18px;
    height: 18px;
  }
  .tile-heart svg {
    width: 32px;
    height: 32px;
  }
}
.batch-tag-mask {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 20px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  touch-action: none;
  overscroll-behavior: none;
}
.batch-tag-mask[hidden] {
  display: none !important;
}
.batch-tag-sheet {
  width: var(--sheet-action-width);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.26);
  -webkit-overflow-scrolling: touch;
}
#jobsBody {
  padding: 4px 2px 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}
#jobsBody p { margin: 0 0 10px; }
#jobsBody p:last-child { margin-bottom: 0; }
.batch-tag-sheet.is-wait {
  text-align: center;
}
.wait-pct {
  margin: 8px 0 4px;
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.batch-tag-sheet.is-wait .thinking-five {
  margin: 12px 0 4px;
}
button.tag-apply {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  height: 52px;
  margin: 0 0 12px;
  padding: var(--apply-ring);
  border: 0;
  border-radius: 999px;
  background-color: var(--rose);
  background-image: var(--ring-conic-210);
  overflow: hidden;
  cursor: pointer;
  color: #fff;
}
button.tag-apply[hidden] {
  display: none !important;
}
button.tag-apply::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 50%;
  width: 200vw;
  height: 200vw;
  border-radius: 0;
  background: var(--ring-conic-0);
  animation: tag-apply-spin 2.4s linear infinite;
  pointer-events: none;
}
@keyframes tag-apply-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.tag-apply-face {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.tag-apply-face svg {
  width: 18px;
  height: 18px;
  display: block;
  stroke: #fff;
}
.batch-tag-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.batch-tag-head p { margin: 0; font-size: 16px; font-weight: 700; }
button.batch-tag-close {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: #f2f2f7;
  color: transparent;
  font-size: 0;
  line-height: 0;
  -webkit-appearance: none;
  appearance: none;
}
button.batch-tag-close::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 12px 1.5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 1.5px 12px no-repeat;
  transform: translate(-50%, -50%) rotate(45deg);
  pointer-events: none;
}
.book-actions button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 600px) {
  .batch-tag-mask { align-items: center; padding: 24px 20px; }
  .batch-tag-sheet:not(.list-tag-sheet) {
    min-height: var(--sheet-action-min-wide);
    display: flex;
    flex-direction: column;
  }
  .batch-tag-sheet:not(.list-tag-sheet) .tag-apply {
    margin-top: auto;
  }
}
.err { color: var(--accent); min-height: 1.2em; }
label { display: block; margin: 18px 0 8px; color: var(--mute); text-align: left; }
@media (min-width: 768px) {
  .home-head, .cab-hud, .tag-board, .feed { width: min(720px, 100%); }
  .album-settings {
    right: 12px;
    bottom: 10px;
  }
}
.tag-modal-open,
.tag-modal-open body {
  overflow: hidden;
  height: 100%;
  touch-action: none;
  overscroll-behavior: none;
}
.tile.is-job .tile-shield {
  box-shadow: inset 0 0 0 3px var(--rose);
}
.host-lines {
  width: 100%;
  min-height: 120px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font: inherit;
  resize: vertical;
}
.batch-tag-sheet .apple-row {
  margin: 0 0 16px;
}
.batch-tag-sheet .tag-apply {
  margin-top: 8px;
}
.kb-up .blobs {
  display: none;
}
.kb-up .photo-rail {
  display: none !important;
}
.kb-up .hall.is-invite {
  justify-content: flex-start;
  min-height: 0;
  height: calc(100vh - var(--kb, 0px));
  max-height: calc(100vh - var(--kb, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-top: calc(8px + env(safe-area-inset-top, 0px));
  padding-bottom: 8px;
}
.kb-up .hall.is-invite .subway-y {
  display: none;
}
.kb-up .batch-tag-mask {
  top: var(--vv-top, 0px);
  right: 0;
  bottom: auto;
  left: 0;
  height: var(--vvh, 100vh);
  padding: 8px 12px;
}
.kb-up .batch-tag-sheet {
  max-height: calc(100% - 16px);
}
.hp-label {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  min-height: 22px;
}
.hp-label[hidden] {
  display: none !important;
}
.hp-text {
  flex: 0 0 auto;
  white-space: nowrap;
}
.hp-alt {
  position: relative;
  display: inline-grid;
  min-width: 2.4em;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.hp-alt[hidden] {
  display: none !important;
}
.hp-think {
  height: 14px;
  margin: 0;
  gap: 5px;
}
.hp-think span {
  width: 6px;
  height: 6px;
}
.tile-job-hud .hp-label {
  flex-wrap: wrap;
  row-gap: 4px;
}
.tile-job-hud .hp-think {
  flex: 1 1 100%;
  justify-content: flex-start;
  order: 3;
}
.hp.is-run .hp-fill {
  background-image:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.4) 48%,
      rgba(255, 255, 255, 0) 100%
    ),
    linear-gradient(180deg, var(--hp-hi) 0%, var(--rose) 62%, var(--hp-lo) 100%);
  background-size: 220% 100%, 100% 100%;
  animation: hp-sheen 1.1s linear infinite;
}
@keyframes hp-sheen {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}
.hp-meter {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hp-meter[hidden] {
  display: none !important;
}
.hp-track {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 8px;
  border-radius: 999px;
  background: var(--hp-track);
  overflow: hidden;
}
.hp-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--hp-hi) 0%, var(--rose) 62%, var(--hp-lo) 100%);
  transition: width 0.45s ease;
}
.tile-job-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 10px 8px 40px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
  pointer-events: none;
}
.tile-job-hud.is-done {
  pointer-events: auto;
  padding-bottom: 8px;
}
.tile-job-hud button.tag-apply {
  pointer-events: auto;
  margin: 0;
}
.tile .job-ctrl {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 5;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.28));
}
@media (prefers-reduced-motion: reduce) {
  .thinking-five span, .blobs span, .cab-cover.is-run .cab-ring,
  .cab-cover.is-holo .cab-foil, .ins-icon.is-run .ins-ring, button.tag-apply::before,
  .tile.is-run::before, .hp.is-run .hp-fill { animation: none; }
}
html.is-reading,
html.is-reading body {
  overflow: hidden;
  height: 100%;
  height: var(--vvh, 100dvh);
  overscroll-behavior: none;
}
#reader-layer {
  position: fixed;
  inset: 0;
  z-index: 300000;
  background: #f2f2f7;
  overscroll-behavior: none;
  touch-action: none;
}
#reader-layer[hidden] {
  display: none !important;
}
#reader-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  pointer-events: none;
  background: #f2f2f7;
}
#reader-layer.is-live {
  touch-action: auto;
}
#reader-layer.is-live #reader-frame {
  opacity: 1;
  pointer-events: auto;
}
#reader-bridge {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 72px 16px 32px;
  background: #f2f2f7;
  pointer-events: none;
}
#reader-bridge-cover {
  position: static;
  width: calc((min(720px, 100%) - 4px) / 3);
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center;
  flex: 0 0 auto;
  background: var(--tile-void);
}
#reader-bridge-cover[hidden] {
  display: none !important;
}
#reader-hint {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}
#reader-hint[hidden] {
  display: none !important;
}
#reader-hint .thinking-five {
  margin: 0;
  height: 28px;
  gap: 12px;
}
#reader-hint .thinking-five span {
  width: 14px;
  height: 14px;
  background: var(--rose);
}
#reader-hint .read-wait {
  margin: 0;
  color: #1c1c1e;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
#reader-layer #reader-back {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  left: max(16px, calc(env(safe-area-inset-left, 0px) + 12px));
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}
#reader-layer.is-live #reader-bridge,
#reader-layer.is-live #reader-back {
  opacity: 0;
  pointer-events: none;
}

/* 排列＝講故事／MyMoney 消息列殼。不要改沒編號的格子原件。 */
.feed.news-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(720px, calc(100% - 32px));
  margin: 8px auto 48px;
  background: transparent;
}
.feed.news-list .news-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 14px 12px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.feed.news-list .news-row:active { background: #f6f6f6; }
.feed.news-list .row-face {
  display: flex;
  align-items: center;
  gap: 10px;
}
.feed.news-list .news-row strong {
  display: block;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  height: 1.35em;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
}
.feed.news-list .news-row strong.is-run {
  display: flex;
  align-items: center;
}
.feed.news-list .news-row strong span {
  display: inline-block;
  flex: 0 0 auto;
  white-space: nowrap;
}
.feed.news-list .news-row strong.is-run span {
  padding-right: 2.5em;
  animation: news-marquee var(--marquee-s, 10s) linear infinite;
}
@keyframes news-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .feed.news-list .news-row strong.is-run span {
    animation: none;
  }
}
.feed.news-list .row-ops {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.feed.news-list .row-ops span {
  color: var(--mute);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.feed.news-list .row-ops .ins-icon.is-loved {
  color: var(--rose);
}
.feed.news-list .row-ops .ins-icon.is-loved .ins-face svg {
  fill: currentColor;
}
