@font-face { font-family: "jf-openhuninn"; src: url("/fonts/huninn.woff") format("woff"); font-display: swap; }

:root {
  --bg: #fff6fa; --dot: #ffdcea; --surface: #ffffff; --surface-2: #fff4f9; --sunken: #fdf0f6;
  --line: #f4dbe7; --line-2: #ecd0de;
  --ink: #4a2f5c; --ink-2: #634a73; --muted: #87719a; --faint: #b7a6c4;
  --pink: #ff5fa2; --pink-hover: #ef4790; --pink-soft: #ffe6f1; --pink-ink: #c2337a;
  --lav: #8f6bff; --lav-soft: #efe9ff; --lav-ink: #5b3fd0;
  --mint: #2fbf8a; --mint-soft: #e2f8ef; --mint-ink: #187a57;
  --red: #f0506a; --red-soft: #ffe8ec; --red-ink: #c22846;
  --amber-soft: #fff3dc; --amber-ink: #9a5b00; --amber: #ffb547;
  --radius: 16px; --radius-sm: 12px;
  --shadow: 0 2px 4px rgba(74, 47, 92, .04), 0 8px 24px color-mix(in srgb, var(--pink) 8%, transparent);
  --shadow-lift: 0 4px 8px rgba(74, 47, 92, .06), 0 16px 32px color-mix(in srgb, var(--pink) 16%, transparent);
  --font: "jf-openhuninn", "Zen Maru Gothic", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scrollbar-color: #f2c6da transparent; }
body { margin: 0; min-height: 100vh; color: var(--ink); font: 15px/1.6 var(--font); font-synthesis: none; caret-color: var(--pink);
  background: radial-gradient(var(--dot) 1.2px, transparent 1.6px) 0 0 / 22px 22px, var(--bg); }
::selection { background: #ffc4dd; color: var(--ink); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: #f2c6da; border: 3px solid transparent; border-radius: 8px; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
a { color: var(--pink-ink); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #ffb3d4; outline-offset: 2px; }

/* ---------- header ---------- */
.topbar { position: sticky; top: 0; z-index: 5; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px); border-bottom: 2px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 22px; letter-spacing: .02em; }
.brand small { font-size: 14px; padding: 2px 10px; border-radius: 999px; background: var(--pink-soft); color: var(--pink-ink); }
.logo { width: 40px; height: 40px; flex: none; display: block; }
.logo.lg { width: 96px; height: 96px; margin: 0 auto 8px; }
.account { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--pink-soft); flex: none; display: inline-block; box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--line); }

/* ---------- page frame ---------- */
.app { max-width: 1240px; margin: 0 auto; padding: 32px 32px 128px; }
.app.with-sidebar { max-width: none; padding: 0; }
.hero { position: relative; max-width: 460px; margin: 10vh auto 0; text-align: center; background: var(--surface); border-radius: 28px; padding: 36px 32px 32px; box-shadow: var(--shadow-lift); border: 2px solid var(--line); }
.hero h1 { margin: 0 0 8px; font-size: 28px; line-height: 36px; font-weight: 400; }
.hero p { color: var(--muted); margin: 0 0 24px; }
.hero .btn { width: 100%; height: 48px; font-size: 16px; }

.page-head h1, .section-title { margin: 0; font-size: 28px; line-height: 36px; font-weight: 400; letter-spacing: .01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.page-head { padding-bottom: 24px; margin-bottom: 24px; border-bottom: 2px dashed var(--line); }
.page-head .crumb { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; color: var(--muted); font-size: 13px; text-decoration: none; padding: 2px 10px 2px 6px; border-radius: 999px; }
.page-head .crumb:hover { color: var(--pink-ink); background: var(--pink-soft); }
.page-head .crumb .icon { width: 16px; height: 16px; }
.page-title { display: flex; align-items: center; gap: 16px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 18px; border: 2px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 14px; cursor: var(--cursor-point, pointer); text-decoration: none; white-space: nowrap; transition: background-color .18s ease, border-color .18s ease, transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s ease; }
.btn:hover { border-color: var(--pink-line); background: var(--surface-2); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary, .btn.success { background: var(--pink); border-color: var(--pink); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--pink) 32%, transparent); }
.btn.primary:hover, .btn.success:hover { background: var(--pink-hover); border-color: var(--pink-hover); }
.btn.primary:disabled:hover { background: var(--pink); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.outline-danger { color: var(--red-ink); border-color: #f6c0ca; }
.btn.outline-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: rgba(255, 255, 255, .12); }
.btn.sm { height: 32px; padding: 0 14px; font-size: 13px; }
.btn.icon { width: 34px; height: 34px; padding: 0; border-color: transparent; background: transparent; color: var(--faint); }
.btn.icon:hover { background: var(--red-soft); color: var(--red); }
.btn .icon { width: 16px; height: 16px; }

/* ---------- server picker ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.guild-card { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--line); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease, border-color .2s ease; }
.guild-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: #f6bcd6; }
.guild-card .name { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-card .go { font-size: 13px; color: var(--pink-ink); }
.guild-card.absent .guild-icon { filter: grayscale(1); opacity: .6; }
.guild-card.absent .go { color: var(--muted); }
.guild-card > div { min-width: 0; }
.guild-icon { width: 52px; height: 52px; border-radius: 18px; background: linear-gradient(135deg, var(--pink-light), #a98bff); display: grid; place-items: center; font-size: 20px; color: #fff; flex: none; object-fit: cover; box-shadow: 0 0 0 3px #fff, 0 4px 12px rgba(143, 107, 255, .25); }

/* ---------- settings layout ---------- */
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: calc(100vh - 64px); }
.layout > * { min-width: 0; }
.sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; background: rgba(255, 255, 255, .9); border-right: 2px solid var(--line); display: flex; flex-direction: column; }
.guild-head { display: flex; gap: 12px; align-items: center; padding: 18px 16px 14px; flex: none; }
.guild-head .guild-icon { width: 42px; height: 42px; border-radius: 14px; font-size: 17px; }
.guild-head > div { min-width: 0; }
.guild-head strong { display: block; font-weight: 400; font-size: 16px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guild-head span { font-size: 12px; color: var(--muted); }
.tabs { padding: 4px 12px 12px; flex: 1; }
.tab-group { margin: 18px 10px 6px; font-size: 12px; color: var(--faint); letter-spacing: .08em; }
.tab { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; height: 40px; padding: 0 12px; margin-bottom: 2px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 15px; text-align: left; cursor: var(--cursor-point, pointer); text-decoration: none; transition: background-color .15s ease; }
.tab .icon { color: var(--tile, var(--muted)); }
.tab:hover { background: var(--surface-2); }
.tab[aria-current="page"] { background: var(--pink-soft); color: var(--pink-ink); }
.tab .label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab .state { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); flex: none; box-shadow: 0 0 0 3px var(--mint-soft); }
.tab .state.off { background: transparent; box-shadow: inset 0 0 0 2px var(--faint); }
.switch-server { display: flex; align-items: center; gap: 8px; margin: 12px; height: 42px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); border: 2px solid var(--line); color: var(--ink-2); text-decoration: none; font-size: 14px; flex: none; }
.switch-server:hover { color: var(--pink-ink); border-color: #f6bcd6; }
.content { padding: 32px 40px 128px; max-width: 1080px; }
.content.wide { max-width: 1200px; }

/* ---------- cards & fields ---------- */
.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h3 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 400; color: var(--ink); }
.card > h3 + .muted, .card > h3 + p { margin: 2px 0 16px; font-size: 14px; color: var(--muted); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.card-head > div:first-child { min-width: 0; flex: 1 1 240px; }
.card-head p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.field { display: grid; gap: 8px; margin-top: 20px; }
.field > label, .field > .label { font-size: 13px; color: var(--ink-2); }
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: start; }
.row > .btn { align-self: end; margin-bottom: 4px; }
.row > .field { flex: 1 1 180px; min-width: 0; }
input[type=text], input[type=number], input[type=time], input[type=date], select, textarea { width: 100%; border: 2px solid var(--line); border-radius: var(--radius-sm); background: #fffbfd; color: var(--ink); padding: 0 14px; height: 44px; font-size: 15px; transition: border-color .15s ease, box-shadow .15s ease; }
input[type=number] { font-variant-numeric: tabular-nums; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--line-2); }
select { appearance: none; padding-right: 38px; font-size: 14px; background: #fffbfd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1.5 1.5l4.5 4.5 4.5-4.5' fill='none' stroke='%23c2337a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center; cursor: var(--cursor-point, pointer); text-overflow: ellipsis; }
select option:disabled { color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 4px var(--pink-soft); }
textarea { display: block; height: auto; min-height: 92px; padding: 10px 14px; resize: vertical; line-height: 1.6; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); line-height: 1.5; }
.vars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.var { height: 26px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--lav-soft); color: var(--lav-ink); font: 12px var(--mono); cursor: var(--cursor-point, pointer); transition: background-color .15s ease; }
.var:hover { background: #e0d5ff; }
.note { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--lav-soft); color: var(--ink-2); font-size: 13px; }
.note .icon { width: 18px; height: 18px; color: var(--lav); margin-top: 1px; }
.warn { display: flex; gap: 10px; align-items: flex-start; background: var(--amber-soft); border: 2px solid #ffe0a8; color: var(--amber-ink); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin-bottom: 16px; }
.warn .icon { color: var(--amber); width: 18px; height: 18px; margin-top: 2px; }
.empty { margin: 16px 0 0; padding: 22px; border-radius: var(--radius-sm); border: 2px dashed #f6c9dc; background: var(--surface-2); color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- switch ---------- */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: var(--cursor-point, pointer); user-select: none; font-size: 14px; color: var(--ink-2); }
.switch input { appearance: none; width: 46px; height: 28px; border-radius: 14px; background: #eadcf0; position: relative; cursor: var(--cursor-point, pointer); transition: background-color .2s ease; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(74, 47, 92, .2); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
.switch input:checked { background: var(--mint); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 3px solid #ffb3d4; outline-offset: 2px; }
.field > .switch { justify-self: start; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px 0 12px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); font-size: 13px; }
.chip .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px #fff; }
.chip button { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: var(--faint); cursor: var(--cursor-point, pointer); padding: 0; }
.chip button:hover { color: #fff; background: var(--red); }
.chip button .icon { width: 12px; height: 12px; stroke-width: 2.6; }
.chips select { width: auto; min-width: 170px; height: 32px; font-size: 13px; border-radius: 999px; border-style: dashed; border-color: var(--pink-line); color: var(--pink-ink); background-color: transparent; }
.day { padding: 0 14px 0 10px; cursor: var(--cursor-point, pointer); gap: 8px; }
.day input { accent-color: var(--pink); margin: 0; width: 16px; height: 16px; }
.day:has(input:checked) { background: var(--pink-soft); border-color: #f6bcd6; color: var(--pink-ink); }
.theme-chip { height: 38px; padding: 0 16px 0 10px; cursor: var(--cursor-point, pointer); color: var(--ink-2); }
.theme-chip .dot { width: 18px; height: 18px; background: var(--swatch); box-shadow: 0 0 0 3px var(--swatch-bg); }
.theme-chip:hover { border-color: #f6bcd6; }
.theme-chip[aria-checked="true"] { border-color: var(--pink); background: var(--pink-soft); color: var(--pink-ink); }
.card-preview { display: block; width: 100%; max-width: 640px; height: auto; margin-top: 16px; border-radius: var(--radius); background: var(--sunken); aspect-ratio: 934 / 282; box-shadow: var(--shadow); }
.card-preview.welcome { aspect-ratio: 1024 / 400; }

/* ---------- list items ---------- */
.list-item { background: var(--surface-2); border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-top: 12px; }
.list-item .field:first-child, .list-item .row:first-child .field { margin-top: 0; }
.list-item .card-head { align-items: center; }
.list-item .card-head + .row .field, .list-item .card-head + .field { margin-top: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; font-size: 12px; padding: 0 10px; border-radius: 999px; background: var(--sunken); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--faint); }
.badge.ok { background: var(--mint-soft); color: var(--mint-ink); }
.badge.ok::before { background: var(--mint); box-shadow: none; }
.actions { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 16px; }
.actions .row { gap: 8px; }

/* ---------- tables ---------- */
.board { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.board th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 400; padding: 8px 12px; border-bottom: 2px solid var(--line); }
.board td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 14px; }
.board tbody tr:hover td { background: var(--surface-2); }
.board tbody tr:last-child td { border-bottom: 0; }
.board .who { display: flex; align-items: center; gap: 10px; }
.rank-no { color: var(--muted); width: 52px; font-size: 16px; }
.rank-1 .rank-no { color: #c88a00; } .rank-2 .rank-no { color: #7d74a8; } .rank-3 .rank-no { color: #c86a3f; }
.type-tag { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; }
.type-tag.warn-t { background: var(--amber-soft); color: var(--amber-ink); } .type-tag.danger-t { background: var(--red-soft); color: var(--red-ink); }
.bar { height: 8px; background: var(--sunken); border-radius: 4px; overflow: hidden; width: 140px; max-width: 100%; margin-top: 6px; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--pink-light), var(--lav)); border-radius: 4px; }
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 16px; }

/* ---------- save bar & toast ---------- */
.savebar { position: fixed; left: calc(272px + 40px); right: 40px; bottom: 24px; max-width: 1000px; display: flex; gap: 12px; align-items: center; background: var(--ink); color: #fff; border-radius: 999px; padding: 10px 10px 10px 24px; box-shadow: 0 12px 30px rgba(74, 47, 92, .35); z-index: 10; animation: pop .35s cubic-bezier(.3, 1.4, .5, 1); }
.savebar span { flex: 1; }
.savebar .btn.ghost { color: #e8dcf0; }
@keyframes pop { from { transform: translateY(20px) scale(.96); opacity: 0; } }
.toast { position: fixed; right: 24px; top: 80px; display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 2px solid var(--line); padding: 12px 18px; border-radius: var(--radius); max-width: min(420px, calc(100% - 48px)); z-index: 20; box-shadow: var(--shadow-lift); font-size: 14px; animation: pop .3s cubic-bezier(.3, 1.4, .5, 1); }
.toast::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--mint); flex: none; margin-top: 6px; }
.toast.error::before { background: var(--red); }
.toast[hidden] { display: none; }

/* ---------- feature colour, overview ---------- */
.tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; flex: none; color: var(--tile); background: color-mix(in srgb, var(--tile) 16%, #fff); box-shadow: 0 0 0 2px #fff, 0 0 0 4px color-mix(in srgb, var(--tile) 22%, #fff); }
.tile.lg { width: 60px; height: 60px; border-radius: 18px; }
.tile.lg .icon { width: 30px; height: 30px; }

.guild-banner { position: relative; display: flex; align-items: center; gap: 20px; min-height: 148px; padding: 28px 32px; margin-bottom: 32px; border-radius: 24px; overflow: hidden; border: 2px solid #fff;
  background: radial-gradient(rgba(255, 255, 255, .55) 1.5px, transparent 2px) 0 0 / 18px 18px, linear-gradient(120deg, #ffd3e6 0%, #e4dbff 60%, #d6f1ff 100%); box-shadow: var(--shadow-lift); }
.guild-banner h1 { margin: 0; font-size: 30px; line-height: 38px; font-weight: 400; }
.guild-banner p { margin: 4px 0 0; color: var(--ink-2); }
.guild-banner > div { position: relative; z-index: 1; min-width: 0; }
.guild-icon.xl { position: relative; z-index: 1; width: 80px; height: 80px; border-radius: 26px; font-size: 32px; box-shadow: 0 0 0 4px #fff, 0 10px 24px rgba(143, 107, 255, .3); }
.group-title { display: flex; align-items: center; gap: 8px; margin: 28px 0 14px; font-size: 15px; font-weight: 400; color: var(--ink-2); }
.group-title::after { content: ""; flex: 1; height: 0; border-top: 2px dashed var(--line); }
.guild-banner + .group-title, .warn + .group-title { margin-top: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.feature { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 20px; background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1), box-shadow .2s ease, border-color .2s ease; }
.feature:hover { transform: translateY(-4px) rotate(-.4deg); border-color: color-mix(in srgb, var(--tile) 45%, #fff); box-shadow: var(--shadow-lift); }
.feature.off .tile { filter: grayscale(.9); opacity: .55; }
.feature-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.feature-top .switch { position: relative; z-index: 1; }
.feature h3 { margin: 0; font-size: 18px; line-height: 26px; font-weight: 400; }
.feature h3 a { color: var(--ink); text-decoration: none; }
.feature h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 20px; }
.feature h3 a:focus-visible { outline: none; }
.feature:has(h3 a:focus-visible) { box-shadow: 0 0 0 4px #ffb3d4; }
.feature > p { margin: 0; font-size: 14px; color: var(--muted); flex: 1; }
.feature-foot { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--line); font-size: 13px; color: var(--muted); }
.feature-foot .go { color: color-mix(in srgb, var(--tile) 75%, var(--ink)); white-space: nowrap; transition: transform .2s ease; }
.feature:hover .go { transform: translateX(3px); }

/* ---------- decorative layer: petals, greeting, helper, stickers ---------- */
.topbar, .app, .savebar, .toast { position: relative; z-index: 1; }
.topbar { position: sticky; z-index: 5; }
.savebar, .toast { position: fixed; z-index: 10; }
.toast { z-index: 20; }

.stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.stats li { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .72); font-size: 13px; color: var(--ink-2); box-shadow: 0 2px 6px color-mix(in srgb, var(--pink-ink) 8%, transparent); }
.stats b { font-weight: 400; color: var(--pink-ink); font-size: 15px; }

.sparkle { display: inline-block; width: 18px; height: 18px; margin-left: 8px; vertical-align: 4px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 1l2.6 7.4L22 11l-7.4 2.6L12 21l-2.6-7.4L2 11l7.4-2.6z' fill='%23ffd166' stroke='%234a2f5c' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; animation: twinkle 2.4s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(.8) rotate(20deg); opacity: .7; } }

.helper { display: flex; gap: 10px; align-items: flex-start; margin: 8px 12px 0; padding: 12px; border-radius: var(--radius); background: linear-gradient(135deg, #fff0f6, #f3eeff); border: 2px solid #fff; box-shadow: var(--shadow); flex: none; }
.helper .mascot { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid #fff; box-shadow: 0 0 0 2px #ffc4dd; }
.helper strong { display: block; font-weight: 400; font-size: 13px; color: var(--pink-ink); }
.helper p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.helper:not(:has(.mascot)) { padding-left: 14px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty img { width: 40px; height: 40px; opacity: .85; }
.savebar-logo { width: 30px; height: 30px; margin-left: -8px; }

.highlights { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: -8px 0 24px; padding: 0; list-style: none; }
.highlights li { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px 3px 6px; border-radius: 999px; font-size: 12.5px; color: color-mix(in srgb, var(--tile) 70%, var(--ink)); background: color-mix(in srgb, var(--tile) 12%, #fff); }
.highlights .icon { width: 15px; height: 15px; color: var(--tile); }

/* ---------- MEE6-style structure: top nav, switcher, plugin header, sub-tabs ---------- */
.topnav { display: flex; gap: 4px; margin-right: auto; margin-left: 24px; }
.topnav a { padding: 8px 16px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 15px; transition: background-color .15s ease; }
.topnav a:hover { background: var(--surface-2); }
.topnav a[aria-current="page"] { background: var(--pink-soft); color: var(--pink-ink); }

.switcher { position: relative; margin: 14px 12px 6px; flex: none; }
.switcher summary { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--radius); border: 2px solid var(--line); background: var(--surface); cursor: var(--cursor-point, pointer); list-style: none; transition: border-color .15s ease; }
.switcher summary::-webkit-details-marker { display: none; }
.switcher summary:hover, .switcher[open] summary { border-color: #f6bcd6; }
.switcher summary .guild-icon { width: 40px; height: 40px; border-radius: 14px; font-size: 16px; }
.switcher summary > div:not(.guild-icon) { min-width: 0; flex: 1; }
.switcher summary strong { display: block; font-weight: 400; font-size: 15px; line-height: 21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher summary span { font-size: 12px; color: var(--muted); }
.switcher summary > .icon { color: var(--muted); transition: transform .2s ease; }
.switcher[open] summary > .icon { transform: rotate(180deg); }
.switcher-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; display: grid; gap: 2px; max-height: 60vh; overflow-y: auto; padding: 6px; border-radius: var(--radius); background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow-lift); }
.switcher-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; color: var(--ink); text-decoration: none; font-size: 14px; }
.switcher-menu a:hover { background: var(--surface-2); }
.switcher-menu a[aria-current] { background: var(--pink-soft); color: var(--pink-ink); }
.switcher-menu a > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher-menu .guild-icon { width: 30px; height: 30px; border-radius: 10px; font-size: 13px; box-shadow: none; }
.switcher-menu .absent .guild-icon { filter: grayscale(1); opacity: .6; }
.switcher-menu small { color: var(--pink-ink); font-size: 12px; }
.switcher-menu .all { border-top: 2px dashed var(--line); border-radius: 0 0 12px 12px; margin-top: 4px; padding-top: 10px; color: var(--muted); }

.plugin-head { position: relative; margin-bottom: 20px; padding: 22px 26px; border-radius: 22px; overflow: hidden; border: 2px solid #fff; box-shadow: var(--shadow-lift);
  background: radial-gradient(rgba(255, 255, 255, .5) 1.5px, transparent 2px) 0 0 / 18px 18px, linear-gradient(120deg, color-mix(in srgb, var(--tile) 22%, #fff), color-mix(in srgb, var(--tile) 8%, #fff8fc) 70%); }
.plugin-head .crumb { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 10px; color: var(--ink-2); font-size: 13px; text-decoration: none; padding: 2px 10px 2px 6px; border-radius: 999px; background: rgba(255, 255, 255, .6); }
.plugin-head .crumb:hover { background: #fff; }
.plugin-head .crumb .icon { width: 16px; height: 16px; }
.plugin-row { display: flex; align-items: center; gap: 18px; }
.plugin-text { flex: 1; min-width: 0; }
.plugin-text h1 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 400; }
.plugin-text p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.switch.big { padding: 8px 14px 8px 10px; border-radius: 999px; background: rgba(255, 255, 255, .8); box-shadow: var(--shadow); white-space: nowrap; }
.off-note { margin: 14px 0 0; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .75); color: var(--ink-2); font-size: 13px; }
.plugin-head.off .tile { filter: grayscale(.8); opacity: .6; }

.subtabs { display: flex; gap: 6px; margin: 0 0 18px; padding: 6px; border-radius: 999px; background: rgba(255, 255, 255, .8); border: 2px solid var(--line); overflow-x: auto; scrollbar-width: none; width: fit-content; max-width: 100%; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { flex: none; padding: 7px 18px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 14px; transition: background-color .15s ease; }
.subtabs a:hover { background: var(--surface-2); }
.subtabs a[aria-current="page"] { background: var(--pink); color: #fff; box-shadow: 0 4px 10px color-mix(in srgb, var(--pink) 30%, transparent); }

.pair.flat { gap: 16px; }
.pair.flat > .field { margin-top: 16px; }
.row.tight { gap: 8px; align-items: center; }
.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; margin-bottom: 16px; }
.rule-grid > .card { margin-bottom: 0; }
.danger-zone { border-color: #f9d0d8; }

/* ---------- composer & Discord-look preview ---------- */
.compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.compose-edit { display: grid; gap: 8px; min-width: 0; }
.compose-edit > .field:first-child, .compose-edit > .row:first-child .field { margin-top: 0; }
.preview { position: sticky; top: 84px; border-radius: var(--radius); padding: 12px; background: #313338; box-shadow: var(--shadow); min-width: 0; }
.preview-label { margin: 0 0 8px; font-size: 12px; color: #b5bac1; display: flex; align-items: center; gap: 6px; }
.preview-label::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #23a55a; }
.dc { display: flex; gap: 14px; padding: 4px; color: #dbdee1; font: 15px/1.375 "gg sans", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: #fff; }
.dc-body { min-width: 0; flex: 1; }
.dc-head { display: flex; align-items: center; gap: 6px; }
.dc-name { color: #ff9cc6; font-weight: 500; }
.dc-app { padding: 0 5px; border-radius: 4px; background: #5865f2; color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; }
.dc-time { color: #949ba4; font-size: 12px; }
.dc-text { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-empty { color: #80848e; font-style: italic; }
.dc .mention { padding: 0 3px; border-radius: 4px; background: rgba(88, 101, 242, .3); color: #c9cdfb; font-weight: 500; }
.dc .link { color: #00a8fc; }
.dc code { padding: 1px 4px; border-radius: 4px; background: #2b2d31; font: 13px var(--mono); }
.dc-embed { display: flex; gap: 16px; max-width: 520px; margin-top: 6px; padding: 10px 14px 14px 12px; border-radius: 4px; background: #2b2d31; border-left: 4px solid var(--bar); }
.dc-embed-main { min-width: 0; flex: 1; display: grid; gap: 6px; }
.dc-author { font-size: 13px; font-weight: 600; color: #f2f3f5; }
.dc-title { font-weight: 700; color: #f2f3f5; }
.dc-title.link { color: #00a8fc; }
.dc-desc { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.dc-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.dc-field { flex: 1 1 100%; font-size: 14px; min-width: 0; }
.dc-field.inline { flex: 1 1 140px; }
.dc-fname { font-weight: 600; color: #f2f3f5; }
.dc-image { max-width: 100%; border-radius: 4px; margin-top: 4px; }
.dc-thumb { width: 72px; height: 72px; border-radius: 4px; object-fit: cover; flex: none; }
.dc-footer { font-size: 12px; color: #b5bac1; }
.dc-attachment { display: block; max-width: 100%; margin-top: 6px; border-radius: 8px; }

/* ---------- logs, embeds, giveaways, commands ---------- */
.event-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 16px; align-items: start; }
.event-group { display: grid; align-content: start; gap: 10px; margin: 0; padding: 14px 16px; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--surface-2); }
.event-group legend { padding: 0 8px; font-size: 13px; color: var(--pink-ink); }
.embed-card { border-top: 6px solid var(--bar); }
.embed-card > .compose { margin-top: 18px; }
.color-field { display: flex; gap: 8px; align-items: center; }
.color-field input[type=color] { width: 44px; height: 44px; padding: 3px; border: 2px solid var(--line); border-radius: 12px; background: #fff; cursor: var(--cursor-point, pointer); flex: none; }
.duration { display: flex; gap: 8px; }
.duration input { flex: 1; min-width: 0; }
.duration select { width: 96px; flex: none; }
.giveaway { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px; border-radius: var(--radius-sm); border: 2px solid var(--line); background: linear-gradient(120deg, #fff5f8, #fff); }
.giveaway.ended { background: var(--surface-2); }
.giveaway-main { display: grid; gap: 2px; min-width: 0; }
.giveaway-main strong { font-weight: 400; font-size: 16px; }
.winners { color: var(--pink-ink); font-size: 14px; }
.command-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.command-groups > .card { margin: 0; }
.command-list { display: grid; gap: 10px; margin: 12px 0 0; }
.command-list > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: baseline; }
.command-list dt { display: flex; flex-wrap: wrap; gap: 4px; }
.command-list dt code { padding: 2px 8px; border-radius: 999px; background: var(--lav-soft); color: var(--lav-ink); font: 12.5px var(--mono); white-space: nowrap; }
.command-list dd { margin: 0; font-size: 14px; color: var(--ink-2); }

/* ---------- public leaderboard ---------- */
.public-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.public-head .guild-icon { width: 68px; height: 68px; border-radius: 22px; font-size: 26px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 1180px) { .compose { grid-template-columns: minmax(0, 1fr); } .preview { position: static; } }
@media (max-width: 960px) {
  .pair { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .rule-grid { grid-template-columns: minmax(0, 1fr); }
  .topnav a { padding: 8px 10px; }
}
@media (max-width: 820px) {
  .topbar { padding: 0 16px; height: 56px; }
  .brand { font-size: 19px; }
  .logo { width: 34px; height: 34px; }
  .app { padding: 24px 16px 128px; }
  .layout { grid-template-columns: minmax(0, 1fr); min-height: 0; align-content: start; }
  .sidebar { position: static; height: auto; overflow: visible; border-right: 0; border-bottom: 2px solid var(--line); }
  .guild-head { padding: 12px 16px 6px; }
  .tabs { display: flex; gap: 6px; overflow-x: auto; padding: 6px 12px 12px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-group { display: none; }
  .tab { width: auto; flex: none; margin: 0; height: 38px; background: var(--surface-2); }
  .switch-server { display: none; }
  .content { padding: 24px 16px 128px; }
  .card { padding: 18px 16px; }
  .card-head > div:first-child { flex-basis: 160px; }
  .savebar { left: 12px; right: 12px; bottom: 12px; padding-left: 18px; }
  .board td, .board th { padding-left: 6px; padding-right: 6px; }
  .board .who .avatar { display: none; }
  .rank-no { width: 36px; }
  .account .name { display: none; }
  .topnav { margin-left: 6px; gap: 0; }
  .topnav a { padding: 6px 8px; font-size: 13px; white-space: nowrap; }
  .account .avatar { display: none; }
  .plugin-text { flex-basis: calc(100% - 80px); }
  .brand small { display: none; }
  .switcher { margin: 12px 12px 4px; }
  .plugin-head { padding: 18px; }
  .plugin-row { flex-wrap: wrap; gap: 12px; }
  .plugin-text h1 { font-size: 23px; line-height: 30px; }
  .giveaway { flex-direction: column; align-items: stretch; }
  .guild-banner { padding: 20px; gap: 14px; min-height: 120px; }
  .guild-icon.xl { width: 60px; height: 60px; border-radius: 20px; font-size: 24px; }
  .guild-banner h1 { font-size: 24px; line-height: 30px; }
  .helper { display: none; }
}

/* ==========================================================================
   櫻花夢境: the character art becomes the light source of the whole page.
   Blurred art glows behind everything; panels are frosted glass over it.
   ========================================================================== */
:root {
  --glass: rgba(255, 255, 255, .66); --glass-strong: rgba(255, 255, 255, .82); --glass-edge: rgba(255, 255, 255, .9);
  --glow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 10px 30px color-mix(in srgb, var(--pink) 12%, transparent), 0 2px 6px rgba(74, 47, 92, .05);
  --glow-lift: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 18px 40px color-mix(in srgb, var(--pink) 20%, transparent), 0 4px 10px rgba(74, 47, 92, .06);
}
html { background: #fbeef5; }
body { background: transparent; }
html::before { content: ""; position: fixed; inset: -80px; z-index: -1; pointer-events: none;
  background: url("/mascot.png") 70% 30% / cover no-repeat; filter: blur(56px) saturate(1.25); opacity: .55; }
html::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1.4px) 0 0 / 24px 24px, linear-gradient(180deg, rgba(255, 246, 250, .55), rgba(246, 240, 255, .7)); }

.topbar { background: rgba(255, 255, 255, .6); backdrop-filter: blur(18px) saturate(1.4); border-bottom: 1px solid var(--glass-edge); box-shadow: 0 1px 0 color-mix(in srgb, var(--pink) 8%, transparent); }
.sidebar { background: rgba(255, 255, 255, .5); backdrop-filter: blur(18px) saturate(1.3); border-right: 1px solid var(--glass-edge); }
.card, .feature, .guild-card, .hero, .subtabs, .switcher summary, .list-item, .event-group, .giveaway, .toast {
  background: var(--glass); backdrop-filter: blur(16px) saturate(1.35); border: 1px solid var(--glass-edge); box-shadow: var(--glow); }
.list-item, .event-group { background: rgba(255, 255, 255, .5); box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset; }
.feature:hover, .guild-card:hover { box-shadow: var(--glow-lift); border-color: #fff; }
input[type=text], input[type=number], input[type=time], input[type=date], select, textarea { background-color: rgba(255, 255, 255, .78); border: 1.5px solid color-mix(in srgb, var(--pink-line) 80%, transparent); }
input:focus, select:focus, textarea:focus { background-color: #fff; }
.switcher-menu { background: rgba(255, 255, 255, .92); backdrop-filter: blur(18px); border: 1px solid var(--glass-edge); }
.tab[aria-current="page"] { background: linear-gradient(90deg, color-mix(in srgb, var(--pink) 16%, transparent), rgba(143, 107, 255, .1)); box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset; }
.helper { background: linear-gradient(135deg, rgba(255, 240, 246, .8), rgba(243, 238, 255, .8)); border: 1px solid var(--glass-edge); }
.card h3, .feature h3 { letter-spacing: .02em; }
.group-title::after { border-top: 1px solid color-mix(in srgb, var(--pink) 25%, transparent); }

/* Overview: the character steps into the banner, Mochi speaks in a dialogue box. */
.guild-banner { display: block; position: relative; min-height: 300px; padding: 32px 36px 118px; margin-bottom: 36px; border-radius: 28px; overflow: hidden;
  border: 1px solid var(--glass-edge); box-shadow: var(--glow-lift);
  background: radial-gradient(rgba(255, 255, 255, .55) 1.4px, transparent 1.8px) 0 0 / 20px 20px, linear-gradient(115deg, rgba(255, 214, 233, .92) 0%, rgba(236, 225, 255, .85) 55%, rgba(255, 236, 246, .6) 100%); }
.banner-art { position: absolute; right: 0; top: 0; width: min(54%, 560px); height: 100%; object-fit: cover; object-position: 50% 22%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%); mask-image: linear-gradient(90deg, transparent 0%, #000 38%); pointer-events: none; }
.banner-info { position: relative; z-index: 1; display: flex; align-items: center; gap: 20px; max-width: 58%; }
.banner-info > div { min-width: 0; }
.banner-info h1 { margin: 0; font-size: 32px; line-height: 40px; font-weight: 400; text-shadow: 0 1px 0 rgba(255, 255, 255, .8); }
.guild-banner .dialogue { position: absolute; left: 24px; right: 24px; bottom: 20px; z-index: 2; max-width: 720px; padding: 18px 46px 16px 22px; border-radius: 18px;
  background: rgba(74, 47, 92, .72); backdrop-filter: blur(10px); color: #fff; border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 10px 30px rgba(74, 47, 92, .25); }
.dialogue .line { display: block; min-height: 1.7em; font-size: 15px; line-height: 1.7; color: #fff; }
.speaker { position: absolute; left: 18px; top: -15px; padding: 3px 16px; border-radius: 999px; background: linear-gradient(90deg, var(--pink-light), #b48cff); color: #fff; font-size: 14px; letter-spacing: .08em; box-shadow: 0 4px 12px color-mix(in srgb, var(--pink) 35%, transparent); }
.next { position: absolute; right: 18px; bottom: 14px; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid #ffc4dd; animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); opacity: .6; } }

/* Feature headers: the character watches faintly from the right. */
.plugin-head { border: 1px solid var(--glass-edge); box-shadow: var(--glow-lift); }
.plugin-head::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 42%; z-index: 0; pointer-events: none;
  background: url("/mascot.png") 50% 24% / cover no-repeat; opacity: .32;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); mask-image: linear-gradient(90deg, transparent, #000 70%); }
.plugin-head > * { position: relative; z-index: 1; }

/* Login: art on one side, a glass card on the other. */
.login { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; max-width: 1080px; margin: 6vh auto 0; }
.login-art { margin: 0; border-radius: 32px; overflow: hidden; aspect-ratio: 1; border: 1px solid var(--glass-edge); box-shadow: var(--glow-lift); }
.login-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.login .hero { margin: 0; max-width: none; padding: 40px 36px 36px; border-radius: 28px; }
.login .hero h1 { font-size: 34px; line-height: 42px; }

@media (max-width: 960px) {
  .banner-art { width: 62%; opacity: .55; }
  .banner-info { max-width: none; }
  .login { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 2vh; }
  .login-art { aspect-ratio: 16 / 10; }
  .login-art img { object-position: 50% 25%; }
}
@media (max-width: 820px) {
  .guild-banner { min-height: 0; padding: 22px 20px 128px; }
  .banner-info { gap: 14px; }
  .banner-info h1 { font-size: 24px; line-height: 30px; }
  .banner-art { width: 70%; opacity: .45; }
  .guild-banner .dialogue { left: 14px; right: 14px; bottom: 14px; padding: 16px 38px 14px 16px; }
  .dialogue .line { font-size: 14px; }
  .plugin-head::after { width: 50%; opacity: .22; }
  .login .hero { padding: 28px 22px; }
}
@media (prefers-reduced-motion: reduce) { .next { animation: none; } }

/* ---------- effects ---------- */
canvas.petals { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.guild-banner .dialogue { font: inherit; text-align: left; cursor: var(--cursor-point, pointer); transition: background-color .2s ease, transform .2s ease; }
.guild-banner .dialogue:hover { background: rgba(74, 47, 92, .82); }
.guild-banner .dialogue:active { transform: scale(.995); }
.banner-art { cursor: var(--cursor-point, pointer); animation: breathe 6s ease-in-out infinite; transform-origin: 60% 90%; transition: translate .4s cubic-bezier(.2, .8, .2, 1); }
@keyframes breathe { 50% { transform: scale(1.025) translateY(-4px); } }
.helper { cursor: var(--cursor-point, pointer); transition: transform .2s ease; }
.helper:hover { transform: translateY(-2px); }

.holo { position: relative; transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .25s cubic-bezier(.2, .8, .2, 1); transform-style: preserve-3d; will-change: transform; }
.holo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .3s ease; mix-blend-mode: soft-light;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .85), transparent 45%),
    linear-gradient(115deg, transparent 20%, rgba(255, 170, 220, .6) 35%, rgba(170, 220, 255, .6) 50%, rgba(255, 240, 170, .55) 65%, transparent 80%) var(--mx, 50%) var(--my, 50%) / 250% 250%; }
.holo:hover::after { opacity: 1; }
.holo-frame { display: block; max-width: 640px; margin-top: 16px; border-radius: var(--radius); }
.holo-frame .card-preview { margin-top: 0; }
.holo-frame:hover { box-shadow: var(--glow-lift); }

/* The sky follows the clock: dawn peach, daylight pink, dusk amber-violet, night indigo with stars. */
html[data-sky="dawn"]::after { background: radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1.4px) 0 0 / 24px 24px, linear-gradient(180deg, rgba(255, 228, 214, .6), rgba(255, 240, 248, .65)); }
html[data-sky="dusk"]::after { background: radial-gradient(rgba(255, 255, 255, .4) 1px, transparent 1.4px) 0 0 / 24px 24px, linear-gradient(180deg, rgba(255, 196, 170, .5), rgba(206, 170, 240, .6)); }
/* Night in the light theme is only a softer lavender dusk; the real dark look is the 夜櫻 theme. */
html[data-sky="night"]:not([data-theme=dark]) { background: #f1e8f8; }
html[data-sky="night"]:not([data-theme=dark])::after { background: radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1.4px) 0 0 / 24px 24px, linear-gradient(180deg, rgba(243, 234, 252, .6), rgba(230, 220, 248, .78)); }

::view-transition-old(root) { animation: .22s ease both fade-out; }
::view-transition-new(root) { animation: .32s cubic-bezier(.2, .8, .2, 1) both fade-in; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .banner-art { animation: none; } }

/* ==========================================================================
   Review pass: contrast, focus, touch targets, switches, and layout polish.
   ========================================================================== */
:root {
  --muted: #6e5982; --faint: #8a7799;
  --pink-btn: #d1307f; --pink-btn-hover: #b92a70; --red-btn: #c22846;
  --focus: #c2337a;
  --r-sm: 12px; --r: 18px; --r-lg: 28px;
}
/* Buttons and the active sub-tab carry white text, so they use the darker pink (4.7:1). */
.btn.primary, .btn.success { background: var(--pink-btn); border-color: var(--pink-btn); }
.btn.primary:hover, .btn.success:hover { background: var(--pink-btn-hover); border-color: var(--pink-btn-hover); }
.btn.primary:disabled:hover { background: var(--pink-btn); }
.btn.danger { background: var(--red-btn); border-color: var(--red-btn); }
.btn.armed { background: var(--red-soft); border-color: var(--red-btn); color: var(--red-ink); }
.subtabs a[aria-current="page"] { background: var(--pink-btn); }

/* A focus ring that is visible on glass (5:1). */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.switch input:focus-visible { outline-color: var(--focus); }
.feature:has(h3 a:focus-visible) { box-shadow: 0 0 0 3px var(--focus); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink-ink) 30%, transparent); }
h1[tabindex="-1"]:focus { outline: none; }

/* Switches: a visible off track, and a sakura gradient instead of Discord green. */
.switch input { background: #9a86ad; }
.switch input:checked { background: linear-gradient(90deg, var(--pink-btn), #7c5ce0); }
.switch input::after { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 4c1 2 3 2 3 4s-2 2-3 4c-1-2-3-2-3-4s2-2 3-4z' fill='%23ffc4dd'/%3E%3C/svg%3E") center / 14px no-repeat; }
.switch input:checked::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 4c1 2 3 2 3 4s-2 2-3 4c-1-2-3-2-3-4s2-2 3-4z' fill='%23ff5fa2'/%3E%3C/svg%3E"); }
.tab .state { background: var(--pink-btn); box-shadow: 0 0 0 3px var(--pink-soft); }

/* Readable small text: nothing under 13px, tinted text mixed toward ink. */
.tab-group, .guild-head span, .switcher summary span, .board th, .badge, .type-tag, .var, .preview-label, .switcher-menu small, .helper p, .highlights li, .command-list dt code { font-size: 13px; }
.feature-foot .go { color: color-mix(in srgb, var(--tile) 40%, var(--ink)); }
.highlights li { color: color-mix(in srgb, var(--tile) 40%, var(--ink)); background: var(--pink-soft); }
.speaker { background: linear-gradient(90deg, #c22f74, #6a45d6); }
.card > p.muted, .card > h3 + p { font-size: 14px; }

/* "Applies instantly" marker, used wherever a control skips the save bar. */
.instant { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--amber-soft); color: var(--amber-ink); font-size: 12px; white-space: nowrap; }
.master { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.content:has(.plugin-head.off) > .card, .content:has(.plugin-head.off) > div > .card { opacity: .72; }

/* Overview: every card shows its state in the same corner, footers stay on one line, rows keep one width. */
.feature-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.pill { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; background: var(--lav-soft); color: var(--lav-ink); font-size: 13px; }
.pill.on { background: var(--pink-soft); color: var(--pink-ink); }
.feature-foot > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layout:has(.guild-banner) .helper { display: none; }

/* Feature headers: the character looks in on purpose instead of a faint watermark. */
.plugin-head::after { width: 30%; opacity: 1; background-position: 50% 16%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%); mask-image: linear-gradient(90deg, transparent, #000 45%); }
.plugin-row { padding-right: 28%; }

/* Sidebar: the helper sits at the bottom and is a real button. */
.helper { margin-top: auto; margin-bottom: 12px; padding: 0; }
.helper-btn { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 12px; border: 0; border-radius: inherit; background: transparent; text-align: left; font: inherit; color: inherit; cursor: var(--cursor-point, pointer); }
.helper-btn > span { min-width: 0; }

/* Moderation rules read as one list rather than a ragged two-column grid. */
.rule-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }

/* Inline editors, summaries and owner notes. */
.inline-edit { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-edit input { width: 120px; height: 36px; }
.summary { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--r-sm); background: var(--lav-soft); color: var(--ink-2); font-size: 14px; }
.field-error { margin: 10px 0 0; color: var(--red-ink); font-size: 14px; }
.owner-note { margin-top: 6px; font-size: 13px; }
.owner-note summary { cursor: var(--cursor-point, pointer); color: var(--amber-ink); }
.avatar.initial { display: grid; place-items: center; background: linear-gradient(135deg, var(--pink-light), #a98bff); color: #fff; font-size: 15px; }
.theme-chip:has(input:checked) { border-color: var(--pink); background: var(--pink-soft); color: var(--pink-ink); }
.theme-chip:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.login .logo.lg { width: 56px; height: 56px; }
.motion-toggle { color: var(--muted); }

/* Night: panels stay light enough for ink text, and text on the sky itself turns light. */

/* Motion switched off by the viewer or the OS. */
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after { animation: none !important; transition: none !important; }
html[data-motion="off"] canvas.petals { display: none; }

/* Touch: 44px targets on phones and touch screens, a fade that shows tab rows scroll. */
.chip button { width: 28px; height: 28px; }
button, a, summary, label { touch-action: manipulation; }
@media (max-width: 820px), (pointer: coarse) {
  .btn.sm, .btn.icon, .topnav a, .subtabs a, .var, .plugin-head .crumb, .page-head .crumb { min-height: 44px; }
  .btn.icon { min-width: 44px; }
  .chip button { width: 32px; height: 32px; }
  .tab { height: 44px; }
}
@media (max-width: 820px) {
  .tabs, .subtabs { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); scroll-padding-inline: 16px; overscroll-behavior-x: contain; }
  .subtabs { width: auto; }
  /* Compact feature header so the first setting is visible sooner. */
  .plugin-head { padding: 14px 16px; }
  .plugin-head .crumb { margin-bottom: 6px; }
  .plugin-row { padding-right: 0; flex-wrap: nowrap; }
  .plugin-text p { display: none; }
  .plugin-text h1 { font-size: 22px; line-height: 28px; }
  .plugin-head .tile.lg { width: 44px; height: 44px; border-radius: 14px; }
  .master .instant { display: none; }
  .plugin-head::after { width: 40%; opacity: .5; }
  .motion-toggle { display: none; }
}
@media (max-width: 820px) { .account .avatar, .account .avatar.initial { display: none; } .topnav { min-width: 0; overflow-x: auto; scrollbar-width: none; } .chips select { min-width: 0; max-width: 100%; } }

/* ---------- role panels: list, then a step-by-step editor beside a faithful Discord preview ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar p { margin: 0; color: var(--muted); font-size: 14px; flex: 1 1 280px; }
textarea.short { min-height: 64px; }
.badge.warn { background: var(--amber-soft); color: var(--amber-ink); }
.badge.warn::before { background: var(--amber); box-shadow: none; }
.warn-text { color: var(--amber-ink); }

/* list */
.panel-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.panel-item { position: relative; display: grid; gap: 10px; align-content: start; padding: 18px 18px 14px 22px; border-radius: var(--r); background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--glow); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.panel-item::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--bar); }
.panel-item:hover { transform: translateY(-2px); box-shadow: var(--glow-lift); }
.panel-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.panel-item h3 { margin: 0; font-size: 18px; font-weight: 400; min-width: 0; overflow-wrap: anywhere; }
.panel-item h3 a { color: var(--ink); text-decoration: none; }
.panel-item h3 a:hover { color: var(--pink-ink); }
.panel-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.panel-meta span + span::before { content: "·"; margin-right: 14px; color: var(--faint); }
.role-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px; }
.role-chips .chip { padding: 0 12px 0 8px; height: 30px; }
.role-chips .chip.more { padding: 0 10px; color: var(--muted); }
.role-chips .emoji { font-size: 16px; line-height: 1; }
.role-chips .emoji.custom { width: 18px; height: 18px; }
.panel-item-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; border-top: 1px dashed var(--line-2); }
.panel-empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 32px 20px; }
.panel-empty h3 { margin: 6px 0 0; font-size: 20px; font-weight: 400; }
.panel-empty p { margin: 0 0 8px; color: var(--muted); max-width: 42ch; }
.panel-empty-art { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.panel-empty-art .mini { width: 132px; }
.panel-empty-art .mini span { display: block; margin-top: 46px; font-size: 13px; color: #b5bac1; }

/* tiny Discord sketches that explain each delivery style */
.mini { position: relative; height: 72px; border-radius: 10px; background: #313338; overflow: hidden; }
.mini::before { content: ""; position: absolute; left: 10px; right: 22px; top: 10px; height: 26px; border-radius: 3px; background: #2b2d31; border-left: 3px solid var(--pink); }
.mini::after { content: ""; position: absolute; left: 10px; bottom: 12px; }
.mini-reactions::after { width: 26px; height: 16px; border-radius: 6px; background: #3b3d63; box-shadow: 0 0 0 1px #5865f2, 32px 0 0 #2b2d31, 64px 0 0 #2b2d31; }
.mini-buttons::after { width: 34px; height: 16px; border-radius: 3px; background: #4e5058; box-shadow: 40px 0 0 #4e5058, 80px 0 0 #4e5058; }
.mini-select::after { right: 22px; height: 18px; border-radius: 3px; background: #1e1f22; }

/* editor */
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--pink-ink); text-decoration: none; }
.back:hover { text-decoration: underline; }
.back .icon { width: 18px; height: 18px; }
.steps { gap: 14px; }
.step { position: relative; display: grid; gap: 10px; margin: 0; }
.step:has(.emoji-pick[open]) { z-index: 20; }
.step h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 18px; font-weight: 400; }
.step-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--pink-btn); color: #fff; font-size: 14px; flex: none; }
.step > .hint { margin: 0; }
.step .field { margin-top: 0; }
.type-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.type-card { display: grid; gap: 4px; align-content: start; padding: 10px; border-radius: var(--r-sm); border: 2px solid color-mix(in srgb, var(--pink-line) 80%, transparent); background: rgba(255, 255, 255, .6); cursor: var(--cursor-point, pointer); transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.type-card .mini { margin-bottom: 6px; height: 64px; }
.type-card strong { font-weight: 400; font-size: 15px; color: var(--ink); }
.type-card span { font-size: 13px; color: var(--muted); line-height: 1.45; }
.type-card:hover { border-color: var(--pink-line); transform: translateY(-1px); }
.type-card:has(input:checked) { border-color: var(--pink-btn); background: var(--pink-soft); }
.type-card:has(input:checked) strong { color: var(--pink-ink); }
.choice-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice { display: grid; gap: 2px; align-content: start; padding: 10px 12px; border-radius: var(--r-sm); border: 2px solid color-mix(in srgb, var(--pink-line) 80%, transparent); background: rgba(255, 255, 255, .6); cursor: var(--cursor-point, pointer); transition: border-color .15s ease, background-color .15s ease; }
.choice strong { font-weight: 400; font-size: 14px; color: var(--ink); }
.choice span { font-size: 13px; color: var(--muted); line-height: 1.4; }
.choice:hover { border-color: var(--pink-line); }
.choice:has(input:checked) { border-color: var(--pink-btn); background: var(--pink-soft); }
.choice:has(input:checked) strong { color: var(--pink-ink); }
.choice:has(input:focus-visible), .type-card:has(input:focus-visible), .swatch:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch { position: relative; width: 36px; height: 36px; border-radius: 50%; background: var(--c); cursor: var(--cursor-point, pointer); box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(74, 47, 92, .15); transition: transform .15s ease; }
.swatch:hover { transform: scale(1.08); }
.swatch:has(input:checked) { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--c); }
.swatch.custom { background: conic-gradient(var(--pink), #f5a623, #2fbf8a, #3aa8f0, #8f6bff, var(--pink)); overflow: hidden; }
.swatch.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: var(--cursor-point, pointer); border: 0; padding: 0; }
.swatch.custom:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }

/* emoji → role rows */
.role-rows { display: grid; gap: 8px; }
.role-row { display: grid; grid-template-columns: 48px 16px minmax(0, 1.2fr) minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.role-rows.no-label .role-row { grid-template-columns: 48px 16px minmax(0, 1fr) 44px; }
.role-row .arrow { color: var(--faint); text-align: center; }
.role-row input[type=text] { text-align: left; }
.add-role { justify-self: start; }
.emoji-pick { position: relative; }
.emoji-pick summary { display: grid; place-items: center; width: 48px; height: 44px; border-radius: var(--r-sm); border: 2px dashed var(--pink-line); background: rgba(255, 255, 255, .7); cursor: var(--cursor-point, pointer); list-style: none; font-size: 22px; line-height: 1; }
.emoji-pick summary::-webkit-details-marker { display: none; }
.emoji-pick summary:hover, .emoji-pick[open] summary { border-color: var(--pink-btn); border-style: solid; background: var(--pink-soft); }
.emoji-pick summary .emoji.custom { width: 26px; height: 26px; }
.emoji-empty { display: grid; place-items: center; color: var(--pink-ink); }
.emoji-empty .icon { width: 18px; height: 18px; }
.emoji-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(320px, calc(100vw - 48px)); max-height: 340px; overflow-y: auto; display: grid; gap: 10px; padding: 12px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); box-shadow: var(--glow-lift); }
.emoji-group .label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; }
.emoji-grid button { display: grid; place-items: center; height: 40px; border: 0; border-radius: 10px; background: transparent; font-size: 22px; cursor: var(--cursor-point, pointer); padding: 0; }
.emoji-grid button:hover, .emoji-grid button:focus-visible { background: var(--pink-soft); }
.emoji-grid img { width: 26px; height: 26px; object-fit: contain; }
.emoji-own { display: flex; gap: 8px; }
.emoji-own input { flex: 1; min-width: 0; }

/* Discord components in the preview */
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0 54px; max-width: 420px; }
.dc-button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 4px; background: #4e5058; color: #fff; font: 500 14px/1.3 "gg sans", "Noto Sans TC", system-ui, sans-serif; }
.dc-select { display: flex; justify-content: space-between; align-items: center; max-width: 400px; margin: 8px 0 0 54px; padding: 10px 12px; border-radius: 4px; background: #1e1f22; color: #949ba4; font: 14px "gg sans", "Noto Sans TC", system-ui, sans-serif; }
.dc-select .icon { width: 18px; height: 18px; }
.dc-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0 54px; }
.dc-reaction { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: 8px; background: rgba(88, 101, 242, .15); border: 1px solid #5865f2; color: #dee0fc; font: 500 14px/1 "gg sans", system-ui, sans-serif; }
.dc-reaction .emoji { font-size: 16px; }
.dc-reaction .emoji.custom, .dc-button .emoji.custom { width: 18px; height: 18px; }
.preview .dc-empty { margin: 8px 0 0 54px; color: #80848e; font-size: 13px; }
.editor-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; }

@media (max-width: 820px) {
  .type-cards, .choice-cards { grid-template-columns: minmax(0, 1fr); }
  .type-card { grid-template-columns: 96px minmax(0, 1fr); column-gap: 12px; }
  .type-card .mini { grid-row: span 2; margin: 0; height: 56px; }
  .role-row { grid-template-columns: 48px minmax(0, 1fr) 44px; }
  .role-row .arrow { display: none; }
  .role-row > input[type=text] { grid-column: 1 / 3; }
  .role-row > .btn.icon { grid-row: 1; grid-column: 3; }
  .role-rows.no-label .role-row { grid-template-columns: 48px minmax(0, 1fr) 44px; }
  .dc-buttons, .dc-select, .dc-reactions, .preview .dc-empty { margin-left: 0; }
}

/* ---------- dropdowns: Mochi listbox in place of the browser's select popup ---------- */
select[data-dd] { display: none !important; }
.dd-trigger { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; height: 44px; padding: 0 8px 0 14px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: linear-gradient(#fffbfd, #fff6fa); color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: var(--cursor-point, pointer); box-shadow: 0 1px 0 #fff inset, 0 1px 2px rgba(74, 47, 92, .04); transition: border-color .15s ease, box-shadow .2s ease, background-color .15s ease, transform .15s ease; }
.dd-trigger:hover { border-color: var(--pink-line); box-shadow: 0 1px 0 #fff inset, 0 4px 12px color-mix(in srgb, var(--pink) 10%, transparent); }
.dd-trigger:active { transform: scale(.99); }
.dd-trigger:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink-ink) 30%, transparent); background: #fff; }
.dd-trigger[aria-expanded=true] { border-color: var(--pink); background: #fff; box-shadow: 0 0 0 4px var(--pink-soft), 0 6px 18px color-mix(in srgb, var(--pink) 14%, transparent); }
.dd-trigger:disabled { opacity: .55; cursor: not-allowed; }
.dd-trigger.placeholder .dd-text { color: var(--faint); }
.dd-trigger.picked { animation: dd-picked .45s ease; }
@keyframes dd-picked { 30% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--pink) 22%, transparent); border-color: var(--pink); } }
.dd-chevron { display: grid; place-items: center; width: 28px; height: 28px; margin-left: auto; flex: none; border-radius: 50%; background: var(--pink-soft); color: var(--pink-ink); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1), background-color .15s ease; }
.dd-chevron .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.dd-trigger:hover .dd-chevron { background: var(--pink-soft); }
.dd-trigger[aria-expanded=true] .dd-chevron { transform: rotate(180deg); background: var(--pink-btn); color: #fff; }
.dd-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--rc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc) 22%, transparent); }
.dd-hash { display: grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 7px; background: #efe9ff; color: #5b3fd0; font-size: 13px; }

.dd-pop { position: fixed; z-index: 1000; display: flex; flex-direction: column; padding: 6px; border-radius: 18px; background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3); border: 1px solid rgba(255, 255, 255, .95); box-shadow: 0 0 0 1px rgba(242, 188, 212, .55), 0 4px 10px rgba(74, 47, 92, .06), 0 22px 48px color-mix(in srgb, var(--pink) 24%, transparent); transform-origin: top center; animation: dd-in .2s cubic-bezier(.2, .9, .3, 1.15); overflow: hidden; }
.dd-pop::before { content: ""; position: absolute; top: -18px; right: -14px; width: 64px; height: 64px; background: radial-gradient(circle at 50% 50%, rgba(255, 182, 213, .5), transparent 65%); pointer-events: none; }
.dd-pop.up { transform-origin: bottom center; animation-name: dd-in-up; }
@keyframes dd-in { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
@keyframes dd-in-up { from { opacity: 0; transform: translateY(6px) scale(.96); } }
.dd-search-wrap { position: relative; display: flex; align-items: center; margin: 2px 2px 6px; flex: none; }
.dd-search-wrap .icon { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.dd-search { width: 100%; height: 40px; padding: 0 12px 0 36px; border: 0; border-radius: 12px; background: #fff1f7; color: var(--ink); font: inherit; font-size: 14px; }
.dd-search::placeholder { color: var(--faint); }
.dd-search:focus { outline: none; box-shadow: 0 0 0 2px var(--pink) inset; background: #fff; }
.dd-search::-webkit-search-cancel-button { display: none; }
.dd-list { position: relative; margin: 0; padding: 0; list-style: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #f6b8d3 transparent; }
.dd-list [role=option] { --rc: var(--pink); position: relative; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 10px 8px 14px; border-radius: 12px; color: var(--ink); font-size: 14px; cursor: var(--cursor-point, pointer); animation: dd-item .26s ease backwards; animation-delay: calc(var(--i, 0) * 14ms); transition: background-color .12s ease, color .12s ease; }
@keyframes dd-item { from { opacity: 0; transform: translateX(-4px); } }
.dd-list [role=option].placeholder { color: var(--muted); }
.dd-list [role=option].active { background: color-mix(in srgb, var(--rc) 13%, #fff); }
.dd-list [role=option][aria-selected=true] { color: var(--pink-ink); background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 16%, #fff), color-mix(in srgb, var(--rc) 6%, #fff)); }
.dd-list [role=option][aria-selected=true]::before { content: ""; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--rc); }
.dd-list [role=option][aria-disabled=true] { color: var(--faint); cursor: not-allowed; background: none; }
.dd-list [role=option][aria-disabled=true] .dd-dot { opacity: .45; }
.dd-list .dd-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.dd-check { display: grid; place-items: center; width: 22px; height: 22px; margin-left: auto; flex: none; border-radius: 50%; background: linear-gradient(135deg, #ff7eb6, var(--pink-btn)); color: #fff; box-shadow: 0 2px 6px color-mix(in srgb, var(--pink-btn) 35%, transparent); }
.dd-check .icon { width: 13px; height: 13px; stroke-width: 3; }
.dd-group { display: flex; align-items: center; gap: 8px; padding: 12px 12px 4px; font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.dd-group::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.dd-group:first-child { padding-top: 4px; }
.dd-none { margin: 0; padding: 18px 12px; text-align: center; color: var(--muted); font-size: 13px; }
html[data-motion=off] .dd-pop, html[data-motion=off] .dd-list [role=option], html[data-motion=off] .dd-trigger.picked { animation: none; }

/* phones: the list rises as a bottom sheet */
.dd-backdrop { position: fixed; inset: 0; z-index: 999; background: rgba(74, 47, 92, .28); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); animation: dd-fade .2s ease; }
@keyframes dd-fade { from { opacity: 0; } }
.dd-pop.sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 72vh; padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-radius: 24px 24px 0 0; animation: dd-rise .28s cubic-bezier(.2, .9, .3, 1); }
@keyframes dd-rise { from { transform: translateY(100%); } }
.dd-pop.sheet .dd-list { flex: 1; min-height: 0; }
.dd-pop.sheet [role=option] { min-height: 50px; font-size: 15px; }
.dd-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 4px 10px; flex: none; }
.dd-head strong { font-weight: 400; font-size: 17px; color: var(--ink); }
.dd-grip { position: absolute; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--pink-line); }
.dd-done { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--pink-soft); color: var(--pink-ink); font: inherit; font-size: 14px; cursor: var(--cursor-point, pointer); }
html[data-motion=off] .dd-pop.sheet, html[data-motion=off] .dd-backdrop { animation: none; }

.chips .dd-trigger { width: auto; min-width: 170px; height: 34px; padding-right: 4px; font-size: 13px; border-radius: 999px; border-style: dashed; border-color: var(--pink-line); color: var(--pink-ink); background: transparent; box-shadow: none; }
.chips .dd-trigger.placeholder .dd-text { color: var(--pink-ink); }
.chips .dd-chevron { width: 24px; height: 24px; }
.duration .dd-trigger { width: 110px; flex: none; }
@media (max-width: 820px) { .chips .dd-trigger { min-width: 0; max-width: 100%; } }
.dd-list [hidden], .dd-pop [hidden] { display: none !important; }

/* ---------- cursor: a pink arrow, and a star wand over anything clickable (mouse only) ---------- */
@media (pointer: fine) {
  :root { --cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E %3Cpath d='M4 3 L4 23.5 L9.3 18.8 L12.9 26.8 L16.6 25.2 L13.2 17.4 L20.3 17.1 Z' fill='%234a2f5c' stroke='%234a2f5c' stroke-width='3.4' stroke-linejoin='round'/%3E %3Cpath d='M4 3 L4 23.5 L9.3 18.8 L12.9 26.8 L16.6 25.2 L13.2 17.4 L20.3 17.1 Z' fill='%23ff6fae' stroke='%23fff' stroke-width='1.6' stroke-linejoin='round'/%3E %3Cpath d='M6.2 7.5 L6.2 15.5' stroke='%23ffd1e6' stroke-width='1.6' stroke-linecap='round'/%3E %3Cg transform='translate%2824.5 7%29'%3E%3Ccircle r='2.2' cy='-2.6' fill='%23ffc2dc'/%3E%3Ccircle r='2.2' cx='2.5' cy='-0.8' fill='%23ffc2dc'/%3E%3Ccircle r='2.2' cx='1.5' cy='2.1' fill='%23ffc2dc'/%3E%3Ccircle r='2.2' cx='-1.5' cy='2.1' fill='%23ffc2dc'/%3E%3Ccircle r='2.2' cx='-2.5' cy='-0.8' fill='%23ffc2dc'/%3E%3Ccircle r='1.2' fill='%23ff5fa2'/%3E%3C/g%3E %3C/svg%3E") 4 3, auto; --cursor-point: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E %3Cpath d='M11 11 L27 27' stroke='%23fff' stroke-width='7.4' stroke-linecap='round'/%3E %3Cpath d='M7 0.6 L8.65 4.73 L13.2 5 L9.66 7.87 L10.82 12.3 L7 9.8 L3.18 12.3 L4.34 7.87 L0.8 5 L5.35 4.73 Z' fill='%23fff' stroke='%23fff' stroke-width='3.6' stroke-linejoin='round'/%3E %3Cpath d='M11 11 L27 27' stroke='%234a2f5c' stroke-width='5.4' stroke-linecap='round'/%3E %3Cpath d='M11 11 L27 27' stroke='%23ff8cc0' stroke-width='3' stroke-linecap='round'/%3E %3Cpath d='M13 13 L25 25' stroke='%23ffe0ee' stroke-width='1' stroke-linecap='round'/%3E %3Cpath d='M7 0.6 L8.65 4.73 L13.2 5 L9.66 7.87 L10.82 12.3 L7 9.8 L3.18 12.3 L4.34 7.87 L0.8 5 L5.35 4.73 Z' fill='%23ffd447' stroke='%234a2f5c' stroke-width='1.5' stroke-linejoin='round'/%3E %3Cpath d='M5.6 5.4 L6.6 4.4' stroke='%23fff' stroke-width='1.2' stroke-linecap='round'/%3E %3Cpath d='M20 4 v4 M18 6 h4' stroke='%23ff5fa2' stroke-width='1.4' stroke-linecap='round'/%3E %3Ccircle cx='25' cy='12' r='1.2' fill='%238f6bff'/%3E %3C/svg%3E") 7 7, pointer; --cursor-text: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E %3Cpath d='M11 5.5 Q16 5.5 16 9 Q16 5.5 21 5.5 M16 9 V23 M11 26.5 Q16 26.5 16 23 Q16 26.5 21 26.5' fill='none' stroke='%23fff' stroke-width='5.2' stroke-linecap='round' stroke-linejoin='round'/%3E %3Cpath d='M11 5.5 Q16 5.5 16 9 Q16 5.5 21 5.5 M16 9 V23 M11 26.5 Q16 26.5 16 23 Q16 26.5 21 26.5' fill='none' stroke='%234a2f5c' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E %3Cpath d='M11 5.5 Q16 5.5 16 9 Q16 5.5 21 5.5 M16 9 V23 M11 26.5 Q16 26.5 16 23 Q16 26.5 21 26.5' fill='none' stroke='%23ff6fae' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E %3Cg transform='translate%2825.5 8.5%29 rotate%28-20%29'%3E%3Cellipse rx='2.4' ry='3.6' fill='%23ffc2dc' stroke='%23fff' stroke-width='1'/%3E%3Cpath d='M0 -3.4 L0 -1.6' stroke='%23ff5fa2' stroke-width='1' stroke-linecap='round'/%3E%3C/g%3E %3C/svg%3E") 16 16, text; }
  html { cursor: var(--cursor); }
  a[href], button:not(:disabled), summary, label:has(input[type=radio], input[type=checkbox], input[type=color]), [role=option]:not([aria-disabled=true]) { cursor: var(--cursor-point); }
  input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), textarea, [contenteditable] { cursor: var(--cursor-text); }
}
input, textarea { caret-color: var(--pink); }
.click-pop { position: fixed; z-index: 2000; width: 0; height: 0; pointer-events: none; }
.click-pop::before { content: ""; position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--pink) 70%, transparent); animation: click-ring .45s ease-out forwards; }
.click-pop i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--c, var(--pink-light)); animation: click-spark .5s ease-out forwards; }
@keyframes click-ring { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
@keyframes click-spark { from { transform: rotate(var(--a)) translateX(4px) scale(1); opacity: 1; } to { transform: rotate(var(--a)) translateX(20px) scale(.2); opacity: 0; } }

/* ---------- layout proportions: one content width for every page, centred in the space beside the sidebar ---------- */
.content, .content.wide { width: 100%; max-width: 1240px; margin-inline: auto; padding: 32px clamp(24px, 3vw, 48px) 128px; }
@media (max-width: 820px) { .content, .content.wide { padding: 24px 16px 128px; } }
.savebar { left: calc(272px + max(40px, (100vw - 272px - 1240px) / 2 + 40px)); right: max(40px, (100vw - 272px - 1240px) / 2 + 40px); max-width: none; }
@media (max-width: 820px) { .savebar { left: 12px; right: 12px; } }
.field:has(> .dd-trigger) { max-width: 520px; }

/* ---------- living Mochi logo ---------- */
.brand { position: relative; }
.live-logo { display: block; cursor: var(--cursor-point, pointer); }
.live-logo svg { display: block; width: 100%; height: 100%; overflow: visible; }
.live-logo g, .live-logo path, .live-logo ellipse, .live-logo circle { transform-box: fill-box; transform-origin: center; }
.live-logo .m-body { transform-origin: 50% 100%; transition: transform .3s cubic-bezier(.3, 1.5, .5, 1); }
.live-logo .m-look { transition: transform .12s ease-out; }
.live-logo .m-eyes { transition: transform .08s ease; }
.live-logo.blink .m-eyes { transform: scaleY(.12); }
.live-logo .m-cheek { opacity: .75; transition: transform .3s ease, opacity .3s ease, fill .3s ease; }
.live-logo .m-happy, .live-logo .m-shy-eyes, .live-logo .m-mouth-open, .live-logo .m-mouth-pout, .live-logo .m-hearts { opacity: 0; transition: opacity .15s ease; }
.live-logo .m-open, .live-logo .m-mouth { transition: opacity .15s ease; }
.live-logo .m-star { transition: transform .4s cubic-bezier(.3, 1.5, .5, 1); }
.live-logo.poked .m-body { animation: m-squish .4s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes m-squish { 30% { transform: scale(1.12, .86); } 60% { transform: scale(.95, 1.06); } }
/* eager: wide sparkling eyes, the star spins */
.live-logo[data-mood=eager] .m-eyes { transform: scale(1.18); }
.live-logo[data-mood=eager] .m-star { transform: rotate(72deg) scale(1.25); }
.live-logo[data-mood=eager] .m-body { transform: translateY(-1.5px); }
/* happy: ^ ^ eyes and an open smile, a little hop */
.live-logo[data-mood=happy] .m-open, .live-logo[data-mood=happy] .m-mouth { opacity: 0; }
.live-logo[data-mood=happy] .m-happy, .live-logo[data-mood=happy] .m-mouth-open { opacity: 1; }
.live-logo[data-mood=happy] .m-body { animation: m-hop .5s cubic-bezier(.3, 1.5, .5, 1); }
.live-logo[data-mood=happy] .m-star { transform: rotate(144deg) scale(1.2); }
@keyframes m-hop { 40% { transform: translateY(-5px) scale(.97, 1.04); } }
/* pout: puffed cheeks, tiny round mouth */
.live-logo[data-mood=pout] .m-mouth { opacity: 0; }
.live-logo[data-mood=pout] .m-mouth-pout { opacity: 1; }
.live-logo[data-mood=pout] .m-cheek { transform: scale(1.35); opacity: 1; fill: #ff6f9f; }
.live-logo[data-mood=pout] .m-body { transform: scale(1.06, .97); }
/* shy: > < eyes, deep blush, floating hearts */
.live-logo[data-mood=shy] .m-open { opacity: 0; }
.live-logo[data-mood=shy] .m-shy-eyes, .live-logo[data-mood=shy] .m-hearts { opacity: 1; }
.live-logo[data-mood=shy] .m-cheek { transform: scale(1.5, 1.3); opacity: 1; fill: #ff5f95; }
.live-logo[data-mood=shy] .m-hearts { animation: m-hearts 1.4s ease-in-out infinite; }
@keyframes m-hearts { 50% { transform: translateY(-3px); } }
html[data-motion=off] .live-logo *, html[data-motion=off] .live-logo { animation: none !important; transition: none !important; }

.mochi-bubble { position: absolute; z-index: 20; top: calc(100% + 10px); left: 0; width: max-content; max-width: min(260px, 70vw); padding: 10px 14px; border-radius: 16px; border-top-left-radius: 4px; background: #fff; color: var(--ink); font-size: 14px; line-height: 1.5; box-shadow: 0 0 0 1px rgba(242, 188, 212, .7), 0 12px 28px color-mix(in srgb, var(--pink) 22%, transparent); pointer-events: none; animation: bubble-in .3s cubic-bezier(.3, 1.4, .5, 1); }
.mochi-bubble.out { opacity: 0; transform: translateY(-4px); transition: opacity .3s ease, transform .3s ease; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(-6px) scale(.9); } }

/* ---------- save stamp ---------- */
.stamp { position: fixed; z-index: 1500; left: 50%; top: 42%; width: 0; height: 0; pointer-events: none; }
.stamp-inner { position: absolute; left: -78px; top: -78px; width: 156px; height: 156px; display: grid; place-items: center; align-content: center; gap: 2px; border-radius: 50%; border: 5px solid color-mix(in srgb, var(--pink-btn) 88%, transparent); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .6), inset 0 0 0 7px color-mix(in srgb, var(--pink-btn) 55%, transparent); background: radial-gradient(circle, rgba(255, 240, 247, .92), rgba(255, 228, 240, .85)); color: var(--pink-btn); transform: rotate(-12deg); animation: stamp-down 1.45s cubic-bezier(.2, .9, .3, 1) forwards; }
.stamp-inner strong { font-weight: 400; font-size: 32px; letter-spacing: .08em; line-height: 1.1; }
.stamp-top, .stamp-date { font-size: 12px; letter-spacing: .3em; opacity: .85; }
.stamp-top { padding-left: .3em; }
@keyframes stamp-down {
  0% { transform: rotate(-24deg) scale(2.3); opacity: 0; }
  22% { transform: rotate(-12deg) scale(.9); opacity: 1; }
  32% { transform: rotate(-12deg) scale(1.04); }
  42%, 72% { transform: rotate(-12deg) scale(1); opacity: 1; }
  100% { transform: rotate(-12deg) scale(1.02); opacity: 0; }
}

/* ---------- typing petals ---------- */
.type-petal { position: fixed; z-index: 1200; width: 9px; height: 12px; margin: -6px 0 0 -4px; border-radius: 80% 0 80% 0; background: var(--c); pointer-events: none; animation: type-petal .9s ease-out forwards; }
@keyframes type-petal { from { opacity: .95; transform: translate(0, 0) rotate(0) scale(.6); } 25% { transform: translate(calc(var(--dx) * .3), calc(var(--dy) * .4)) rotate(calc(var(--r) * .4)) scale(1); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(.8); } }
.sakura-glow { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse at 50% 0%, rgba(255, 143, 191, .35), transparent 60%), radial-gradient(ellipse at 50% 100%, rgba(255, 182, 213, .25), transparent 55%); animation: sakura-glow 2.6s ease forwards; }
@keyframes sakura-glow { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
canvas.petals.front { z-index: 1100; }

/* ---------- outfits ---------- */
.live-logo[data-outfit=witch] .m-star, .live-logo[data-outfit=santa] .m-star, .live-logo[data-outfit=nightcap] .m-star { opacity: 0; }
.live-logo[data-outfit=nightcap]:not([data-mood]) .m-eyes { transform: scaleY(.45); }

/* ---------- topbar toggles ---------- */
.icon-toggle { width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center; border-radius: 50%; }
.icon-toggle .icon { width: 18px; height: 18px; }
.icon-toggle[aria-pressed=true] { background: var(--pink-soft); color: var(--pink-ink); }
@media (max-width: 820px) { .account .motion-toggle { display: none; } .icon-toggle { width: 40px; height: 40px; } }

/* ---------- desktop pet ---------- */
.pet { position: fixed; left: 0; bottom: 0; z-index: 9; width: 56px; height: 56px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; will-change: transform; }
.pet.held { cursor: grabbing; z-index: 1300; }
.pet-flip { width: 100%; height: 100%; transition: transform .18s ease; }
.pet.left .pet-flip { transform: scaleX(-1); }
.pet-flip svg { filter: drop-shadow(0 4px 6px rgba(74, 47, 92, .18)); }
.pet.walking .pet-flip svg { animation: pet-walk .38s ease-in-out infinite; }
@keyframes pet-walk { 50% { transform: translateY(-4px) scale(1.03, .97); } }
.pet.held .pet-flip svg { transform: rotate(-10deg) scale(1.06, .94); }
.pet.landed .pet-flip svg { animation: pet-land .35s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes pet-land { 30% { transform: scale(1.18, .8); } 65% { transform: scale(.94, 1.06); } }
.pet.sleeping .m-eyes { transform: scaleY(.12); }
.pet.sleeping::after { content: "z Z"; position: absolute; top: -12px; right: -8px; font-size: 13px; color: var(--lav-ink, #5b3fd0); letter-spacing: .1em; animation: pet-zzz 2.4s ease-in-out infinite; }
@keyframes pet-zzz { 0% { opacity: 0; transform: translate(0, 4px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -8px); } }
.pet-bubble { position: absolute; bottom: calc(100% + 8px); left: 50%; width: max-content; max-width: 200px; padding: 8px 12px; border-radius: 14px; border-bottom-left-radius: 4px; background: #fff; color: var(--ink); font-size: 13px; box-shadow: 0 0 0 1px rgba(242, 188, 212, .7), 0 10px 24px color-mix(in srgb, var(--pink) 20%, transparent); transform: translateX(-20%); pointer-events: none; animation: bubble-in .3s cubic-bezier(.3, 1.4, .5, 1); }
html[data-motion=off] .pet *, html[data-motion=off] .pet::after { animation: none !important; }

/* ---------- loader ---------- */
.loader { display: grid; justify-items: center; gap: 14px; padding: 18vh 16px; color: var(--muted); font-size: 15px; }
.loader p { margin: 0; }
.loader-mochi { position: relative; display: grid; justify-items: center; }
.loader-mochi img { width: 72px; height: 72px; animation: loader-bounce .9s cubic-bezier(.5, 0, .5, 1) infinite; transform-origin: 50% 100%; }
.loader-shadow { width: 46px; height: 8px; margin-top: 4px; border-radius: 50%; background: color-mix(in srgb, var(--pink-btn) 18%, transparent); animation: loader-shadow .9s cubic-bezier(.5, 0, .5, 1) infinite; }
@keyframes loader-bounce { 0%, 100% { transform: translateY(0) scale(1.12, .86); } 15% { transform: translateY(-6px) scale(.94, 1.08); } 50% { transform: translateY(-34px) scale(1); } 85% { transform: translateY(-4px) scale(.96, 1.05); } }
@keyframes loader-shadow { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.55); opacity: .45; } }
html[data-motion=off] .loader-mochi img, html[data-motion=off] .loader-shadow { animation: none; }
.pet .live-logo { cursor: inherit; }
@media (max-width: 820px) { .topbar .brand { font-size: 0; gap: 0; } .topbar .account { gap: 6px; } .icon-toggle { width: 36px; height: 36px; } }
@media (max-width: 820px) { .topbar { gap: 6px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); } .topnav { gap: 0; } .topnav a { padding-inline: 8px; font-size: 13px; } }
@media (max-width: 820px) { .topbar .account { gap: 2px; } .icon-toggle { width: 32px; height: 32px; } .account .btn.sm:not(.icon-toggle) { padding-inline: 10px; } .topnav { margin-left: 2px; } }
@media (max-width: 380px) { .topnav a { padding-inline: 6px; } }

/* ---------- tooltips: a Mochi bubble in place of the browser's title box ---------- */
.tip { position: fixed; z-index: 1400; max-width: min(260px, calc(100vw - 16px)); padding: 7px 12px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.45; box-shadow: 0 8px 22px rgba(74, 47, 92, .28); pointer-events: none; animation: tip-in .16s ease-out; }
.tip::after { content: ""; position: absolute; left: var(--arrow, 50%); top: 100%; width: 10px; height: 10px; margin-left: -5px; margin-top: -5px; background: var(--ink); transform: rotate(45deg); border-radius: 2px; }
.tip.below::after { top: 0; }
@keyframes tip-in { from { opacity: 0; transform: translateY(3px) scale(.96); } }
.tip.below { animation-name: tip-in-below; }
@keyframes tip-in-below { from { opacity: 0; transform: translateY(-3px) scale(.96); } }
html[data-motion=off] .tip { animation: none; }

/* ---------- topbar: search pill and preferences ---------- */
.search-pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface-soft, rgba(255, 255, 255, .6)); color: var(--muted); font: inherit; font-size: 13px; cursor: var(--cursor-point, pointer); transition: border-color .15s ease, background-color .15s ease; }
.search-pill:hover { border-color: var(--pink-line); color: var(--ink); }
.search-pill .icon { width: 16px; height: 16px; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--kbd-bg, #fff); border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line); color: var(--muted); font: 12px/1 system-ui, sans-serif; }
@media (max-width: 1100px) { .search-pill { display: none; } }
.prefs-btn[aria-expanded=true] { background: var(--pink-soft); color: var(--pink-ink); }

.prefs-menu { position: fixed; z-index: 1200; width: 280px; display: grid; gap: 4px; padding: 12px; border-radius: 18px; background: var(--pop-bg, rgba(255, 255, 255, .97)); border: 1px solid var(--line); box-shadow: 0 4px 10px rgba(74, 47, 92, .06), 0 22px 48px color-mix(in srgb, var(--pink) 22%, transparent); animation: dd-in .18s cubic-bezier(.2, .9, .3, 1.15); transform-origin: top right; }
.pref-label { font-size: 12px; color: var(--muted); padding: 2px 4px 6px; }
.theme-pick { width: 100%; margin-bottom: 6px; }
.theme-pick label { flex: 1; text-align: center; padding: 6px 4px; font-size: 13px; }
.pref-row { display: flex; justify-content: space-between; min-height: 44px; padding: 0 4px; border-radius: 10px; }
.pref-row:hover { background: var(--pink-soft); }
.pref-wardrobe, .pref-search { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 10px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: var(--cursor-point, pointer); }
.pref-wardrobe { margin-top: 4px; background: linear-gradient(90deg, var(--pink-soft), transparent); }
.pref-wardrobe:hover, .pref-search:hover { background: var(--pink-soft); }
.pref-wardrobe .heart { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--pink-btn); color: #fff; font-size: 16px; flex: none; }
.pref-wardrobe span:nth-child(2) { display: grid; }
.pref-wardrobe small { color: var(--muted); font-size: 12px; }
.pref-wardrobe .icon { width: 16px; height: 16px; margin-left: auto; transform: rotate(-90deg); color: var(--pink-ink); }
.pref-search .icon { width: 18px; height: 18px; color: var(--muted); }
.pref-search kbd { margin-left: auto; }

/* ---------- dialogs (wardrobe, search) ---------- */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(74, 47, 92, .32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet-dialog { width: min(560px, calc(100vw - 24px)); max-height: min(86vh, 760px); padding: 0 22px 22px; border: 0; border-radius: 24px; background: var(--pop-bg, #fffafc); box-shadow: 0 30px 80px rgba(74, 47, 92, .3); overflow-y: auto; animation: dialog-in .28s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 18px 0 10px; background: inherit; }
.dialog-head h2 { margin: 0; font-size: 20px; font-weight: 400; }
.sheet-dialog h3 { margin: 18px 0 10px; font-size: 15px; font-weight: 400; color: var(--ink-2); }
.bond { display: flex; align-items: center; gap: 18px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, var(--pink-soft), var(--lav-soft, #efe9ff)); }
.wardrobe-mochi { width: 84px; height: 84px; flex: none; animation: m-float 3s ease-in-out infinite; }
@keyframes m-float { 50% { transform: translateY(-4px); } }
.bond-info { display: grid; gap: 8px; min-width: 0; flex: 1; }
.bond-level { display: flex; align-items: baseline; gap: 8px; font-size: 14px; color: var(--pink-ink); }
.bond-level .heart { font-size: 18px; }
.bond-level strong { font-weight: 400; font-size: 18px; color: var(--ink); }
.bond-bar { height: 10px; border-radius: 999px; background: rgba(255, 255, 255, .7); overflow: hidden; box-shadow: inset 0 1px 2px rgba(74, 47, 92, .1); }
.bond-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pink-light), var(--pink-btn), #8f6bff); }
.outfits { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.outfit { position: relative; display: grid; justify-items: center; gap: 4px; padding: 10px 6px 8px; border-radius: 14px; border: 2px solid var(--line); background: var(--card-soft, rgba(255, 255, 255, .7)); cursor: var(--cursor-point, pointer); transition: border-color .15s ease, transform .15s ease; }
.outfit:hover { border-color: var(--pink-line); transform: translateY(-2px); }
.outfit:has(input:checked) { border-color: var(--pink-btn); background: var(--pink-soft); }
.outfit:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.outfit-thumb { width: 52px; height: 52px; }
.outfit-name { font-size: 13px; }
.outfit.locked { cursor: not-allowed; transform: none; }
.outfit.locked .outfit-thumb { filter: grayscale(1) brightness(1.1); opacity: .45; }
.outfit.locked .outfit-name { color: var(--faint); }
.outfit-lock { position: absolute; top: 6px; right: 6px; padding: 1px 6px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11px; }
.achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.achievements li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card-soft, rgba(255, 255, 255, .7)); border: 1px solid var(--line); color: var(--faint); }
.achievements li.earned { color: var(--ink); background: linear-gradient(90deg, #fff6d6, var(--card-soft, #fff)); border-color: #ffe3a1; }
.achievements .trophy { font-size: 20px; }
.achievements li:not(.earned) .trophy { filter: grayscale(1); opacity: .6; }
.achievements span:last-child { display: grid; }
.achievements strong { font-weight: 400; font-size: 14px; }
.achievements small { font-size: 12px; color: var(--muted); }
.stats { margin: 16px 0 0; text-align: center; }

.achievement { position: fixed; z-index: 1500; top: 80px; left: 50%; display: flex; align-items: center; gap: 12px; padding: 10px 20px 10px 12px; border-radius: 999px; background: linear-gradient(90deg, #fff6d6, #fff); border: 2px solid #ffd166; color: var(--ink); box-shadow: 0 14px 34px rgba(245, 166, 35, .3); transform: translateX(-50%); animation: ach-in .5s cubic-bezier(.3, 1.4, .5, 1); }
.achievement .trophy { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #ffd166; font-size: 22px; }
.achievement span:last-child { display: grid; }
.achievement small { font-size: 12px; color: #9a5b00; }
.achievement strong { font-weight: 400; font-size: 16px; }
.achievement.out { opacity: 0; transform: translate(-50%, -10px); transition: opacity .4s ease, transform .4s ease; }
@keyframes ach-in { from { opacity: 0; transform: translate(-50%, -20px) scale(.85); } }

.search-dialog { width: min(600px, calc(100vw - 24px)); margin-top: 12vh; padding: 0; border: 0; border-radius: 22px; background: var(--pop-bg, #fffafc); box-shadow: 0 30px 80px rgba(74, 47, 92, .3); overflow: hidden; animation: dialog-in .22s cubic-bezier(.2, .9, .3, 1.1); }
.search-box { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.search-box > .icon { width: 20px; height: 20px; color: var(--pink-ink); flex: none; }
.search-input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 17px; }
.search-input:focus { outline: none; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-results { max-height: min(52vh, 420px); margin: 0; padding: 8px; list-style: none; overflow-y: auto; }
.search-results [role=option] { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: var(--cursor-point, pointer); }
.search-results [role=option].active { background: var(--pink-soft); }
.sr-main { display: grid; min-width: 0; }
.sr-main strong { font-weight: 400; font-size: 15px; }
.search-results .active .sr-main strong { color: var(--pink-ink); }
.sr-main small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-group { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--lav-soft, #efe9ff); color: var(--lav-ink, #5b3fd0); font-size: 12px; }
.search-empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.search-foot { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.search-foot kbd { margin-right: 2px; }
@media (max-width: 640px) { .search-dialog { margin-top: 8px; } .search-foot { display: none; } }

/* ---------- opening: sakura doors ---------- */
.intro { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; overflow: hidden; cursor: var(--cursor-point, pointer); transition: opacity .5s ease; }
.intro.done { opacity: 0; pointer-events: none; }
.intro-door { position: absolute; top: 0; bottom: 0; width: 50.5%; background:
  radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .55) 0 3px, transparent 4px) 0 0 / 46px 46px,
  radial-gradient(circle at 70% 60%, rgba(255, 214, 232, .9) 0 4px, transparent 5px) 0 0 / 64px 64px,
  linear-gradient(160deg, var(--pink-soft), var(--pink-light) 55%, #f49cc4);
  animation: door-open .9s cubic-bezier(.7, 0, .2, 1) 1.3s forwards; }
.intro-door.left { left: 0; box-shadow: inset -6px 0 0 rgba(255, 255, 255, .6), inset -9px 0 0 color-mix(in srgb, var(--pink-btn) 25%, transparent); }
.intro-door.right { right: 0; box-shadow: inset 6px 0 0 rgba(255, 255, 255, .6), inset 9px 0 0 color-mix(in srgb, var(--pink-btn) 25%, transparent); --to: 100%; }
.intro-door.left { --to: -100%; }
@keyframes door-open { to { transform: translateX(var(--to)); } }
.intro-center { position: relative; display: grid; justify-items: center; gap: 6px; color: #4a2f5c; text-align: center; animation: intro-pop .6s cubic-bezier(.3, 1.5, .5, 1) .15s backwards, intro-away .5s ease 1.2s forwards; }
.intro-center img { width: 112px; height: 112px; margin-bottom: 6px; filter: drop-shadow(0 10px 20px color-mix(in srgb, var(--pink-btn) 30%, transparent)); animation: loader-bounce .9s cubic-bezier(.5, 0, .5, 1) 2; }
.intro-center strong { font-weight: 400; font-size: 30px; }
.intro-center span { font-size: 16px; color: #634a73; }
.intro-center small { margin-top: 14px; font-size: 12px; color: rgba(74, 47, 92, .6); }
@keyframes intro-pop { from { opacity: 0; transform: scale(.6); } }
@keyframes intro-away { to { opacity: 0; transform: scale(1.15); } }
.search-box .search-input, .search-box .search-input:hover, .search-box .search-input:focus, .search-box .search-input:focus-visible { border: 0; box-shadow: none; background: transparent; padding: 0; height: 40px; }

/* ---------- 夜櫻: dark theme. Deep violet night, glowing petals; set by html[data-theme=dark] ---------- */
html[data-theme=dark] {
  color-scheme: dark;
  --bg: #1b1530; --dot: #3a2b55; --surface: #2a2040; --surface-2: #2f2448; --sunken: #241b38;
  --line: rgba(255, 214, 236, .12); --line-2: rgba(255, 214, 236, .2);
  --ink: #f6eeff; --ink-2: #ddd0ee; --muted: #b9a8cc; --faint: #8f7fa6;
  --pink-soft: color-mix(in srgb, var(--pink) 18%, transparent); --pink-ink: #ff9ccb; --pink-btn: #e0408f; --pink-btn-hover: #ec559c;
  --lav-soft: rgba(143, 107, 255, .2); --lav-ink: #c9b8ff;
  --mint-soft: rgba(47, 191, 138, .16); --mint-ink: #7fe0bb;
  --red-soft: rgba(240, 80, 106, .16); --red-ink: #ff8fa2;
  --amber-soft: rgba(255, 181, 71, .16); --amber-ink: #ffcf85;
  --focus: #ff9ccb;
  --glass: rgba(40, 30, 62, .72); --glass-strong: rgba(44, 33, 68, .86); --glass-edge: rgba(255, 214, 236, .1);
  --glow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 10px 30px rgba(0, 0, 0, .3), 0 0 0 1px rgba(255, 143, 191, .04);
  --glow-lift: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 18px 40px rgba(0, 0, 0, .4), 0 0 24px color-mix(in srgb, var(--pink) 14%, transparent);
  --shadow: 0 2px 4px rgba(0, 0, 0, .2), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lift: 0 4px 8px rgba(0, 0, 0, .25), 0 16px 32px rgba(0, 0, 0, .35);
  --pop-bg: #2a2040; --card-soft: rgba(255, 255, 255, .05); --kbd-bg: #3a2d55; --surface-soft: rgba(255, 255, 255, .05);
  background: #1b1530;
}
html[data-theme=dark]::before { opacity: .22; filter: blur(64px) saturate(1.1); }
html[data-theme=dark]::after { background: radial-gradient(rgba(255, 182, 213, .1) 1px, transparent 1.4px) 0 0 / 24px 24px, linear-gradient(180deg, rgba(27, 21, 48, .78), rgba(36, 24, 62, .86)); }
html[data-theme=dark] body { color: var(--ink); }
html[data-theme=dark] ::selection { background: color-mix(in srgb, var(--pink) 40%, transparent); color: #fff; }

/* chrome */
html[data-theme=dark] .topbar { background: rgba(27, 20, 44, .72); box-shadow: 0 1px 0 rgba(255, 143, 191, .08); }
html[data-theme=dark] .sidebar { background: rgba(27, 20, 44, .6); }
html[data-theme=dark] .switcher-menu { background: rgba(36, 27, 56, .96); }
html[data-theme=dark] .helper { background: linear-gradient(135deg, color-mix(in srgb, var(--pink) 14%, transparent), rgba(143, 107, 255, .14)); }
html[data-theme=dark] .tab[aria-current="page"] { background: linear-gradient(90deg, color-mix(in srgb, var(--pink) 26%, transparent), rgba(143, 107, 255, .16)); box-shadow: none; }
html[data-theme=dark] .btn.ghost:hover { background: rgba(255, 255, 255, .06); }
html[data-theme=dark] .avatar.initial, html[data-theme=dark] .guild-icon { box-shadow: 0 0 0 2px rgba(255, 255, 255, .1); }

/* panels */
html[data-theme=dark] .card, html[data-theme=dark] .feature, html[data-theme=dark] .guild-card, html[data-theme=dark] .hero, html[data-theme=dark] .subtabs,
html[data-theme=dark] .switcher summary, html[data-theme=dark] .giveaway, html[data-theme=dark] .toast, html[data-theme=dark] .panel-item { background: var(--glass); border-color: var(--glass-edge); }
html[data-theme=dark] .list-item, html[data-theme=dark] .event-group { background: rgba(255, 255, 255, .04); box-shadow: none; }
html[data-theme=dark] .feature:hover, html[data-theme=dark] .guild-card:hover { border-color: rgba(255, 143, 191, .3); }
html[data-theme=dark] .group-title, html[data-theme=dark] .page-head h1, html[data-theme=dark] .page-head p { color: var(--ink); }
html[data-theme=dark] .stats li, html[data-theme=dark] .switch.big, html[data-theme=dark] .off-note { background: rgba(27, 20, 44, .7); color: var(--ink-2); box-shadow: none; }
html[data-theme=dark] .guild-banner { background: radial-gradient(rgba(255, 182, 213, .12) 1.4px, transparent 1.8px) 0 0 / 20px 20px, linear-gradient(115deg, rgba(74, 36, 84, .95) 0%, rgba(48, 34, 86, .9) 55%, rgba(60, 30, 70, .6) 100%); }
html[data-theme=dark] .banner-info h1, html[data-theme=dark] .plugin-head h1 { text-shadow: none; color: var(--ink); }
html[data-theme=dark] .plugin-head { border-color: rgba(255, 214, 236, .14); background: radial-gradient(rgba(255, 182, 213, .1) 1.5px, transparent 2px) 0 0 / 18px 18px, linear-gradient(120deg, color-mix(in srgb, var(--tile, var(--pink)) 30%, #241a3a) 0%, #2a2040 60%, #241a3a 100%); }
html[data-theme=dark] .plugin-head p { color: var(--ink-2); }
html[data-theme=dark] .plugin-head .crumb { background: rgba(27, 20, 44, .7); color: var(--ink-2); }
html[data-theme=dark] .tile { box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
html[data-theme=dark] .subtabs a:not([aria-current]) { color: var(--ink-2); }

/* forms */
html[data-theme=dark] input[type=text], html[data-theme=dark] input[type=number], html[data-theme=dark] input[type=time], html[data-theme=dark] input[type=date],
html[data-theme=dark] select, html[data-theme=dark] textarea { background-color: rgba(255, 255, 255, .05); border-color: rgba(255, 214, 236, .16); color: var(--ink); }
html[data-theme=dark] input:focus, html[data-theme=dark] select:focus, html[data-theme=dark] textarea:focus { background-color: rgba(255, 255, 255, .08); box-shadow: 0 0 0 4px color-mix(in srgb, var(--pink) 20%, transparent); }
html[data-theme=dark] .dd-trigger { background: rgba(255, 255, 255, .05); border-color: rgba(255, 214, 236, .16); box-shadow: none; }
html[data-theme=dark] .dd-trigger:hover { border-color: rgba(255, 143, 191, .4); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
html[data-theme=dark] .dd-trigger[aria-expanded=true], html[data-theme=dark] .dd-trigger:focus-visible { background: rgba(255, 255, 255, .08); }
html[data-theme=dark] .dd-trigger:hover .dd-chevron { background: color-mix(in srgb, var(--pink) 30%, transparent); }
html[data-theme=dark] .dd-dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc) 30%, transparent); }
html[data-theme=dark] .dd-pop { background: rgba(42, 32, 64, .97); border-color: rgba(255, 214, 236, .12); box-shadow: 0 0 0 1px rgba(255, 143, 191, .12), 0 22px 48px rgba(0, 0, 0, .5); }
html[data-theme=dark] .dd-search { background: rgba(255, 255, 255, .06); }
html[data-theme=dark] .dd-search:focus { background: rgba(255, 255, 255, .09); }
html[data-theme=dark] .dd-list [role=option].active { background: color-mix(in srgb, var(--rc) 22%, #2a2040); }
html[data-theme=dark] .dd-list [role=option][aria-selected=true] { background: linear-gradient(90deg, color-mix(in srgb, var(--rc) 28%, #2a2040), color-mix(in srgb, var(--rc) 10%, #2a2040)); }
html[data-theme=dark] .type-card, html[data-theme=dark] .choice, html[data-theme=dark] .outfit, html[data-theme=dark] .emoji-pick summary { background: rgba(255, 255, 255, .04); border-color: rgba(255, 214, 236, .14); }
html[data-theme=dark] .type-card:has(input:checked), html[data-theme=dark] .choice:has(input:checked), html[data-theme=dark] .outfit:has(input:checked) { background: color-mix(in srgb, var(--pink) 16%, transparent); border-color: var(--pink-btn); }
html[data-theme=dark] .emoji-menu { background: #2a2040; border-color: rgba(255, 214, 236, .12); }
html[data-theme=dark] .segmented { background: rgba(255, 255, 255, .05); border-color: rgba(255, 214, 236, .14); }
html[data-theme=dark] .swatch { box-shadow: 0 0 0 2px #2a2040, 0 2px 6px rgba(0, 0, 0, .3); }
html[data-theme=dark] .swatch:has(input:checked) { box-shadow: 0 0 0 3px #2a2040, 0 0 0 5px var(--c); }

/* popovers and bubbles */
html[data-theme=dark] .mochi-bubble, html[data-theme=dark] .pet-bubble { background: #2f2448; color: var(--ink); box-shadow: 0 0 0 1px rgba(255, 143, 191, .25), 0 12px 28px rgba(0, 0, 0, .4); }
html[data-theme=dark] .tip, html[data-theme=dark] .tip::after { background: #f6eeff; color: #2a2040; }
html[data-theme=dark] .prefs-menu { box-shadow: 0 22px 48px rgba(0, 0, 0, .5); }
html[data-theme=dark] .bond { background: linear-gradient(135deg, color-mix(in srgb, var(--pink) 18%, transparent), rgba(143, 107, 255, .18)); }
html[data-theme=dark] .bond-bar { background: rgba(255, 255, 255, .1); }
html[data-theme=dark] .achievements li.earned { background: linear-gradient(90deg, rgba(255, 209, 102, .16), transparent); border-color: rgba(255, 209, 102, .35); }
html[data-theme=dark] .achievement { background: linear-gradient(90deg, #3d3020, #2a2040); color: var(--ink); }
html[data-theme=dark] .achievement small { color: #ffcf85; }
html[data-theme=dark] .stamp-inner { background: radial-gradient(circle, rgba(60, 30, 60, .92), rgba(42, 32, 64, .9)); color: var(--pink-light); border-color: rgba(255, 140, 192, .9); }
html[data-theme=dark] dialog::backdrop { background: rgba(10, 6, 20, .55); }
html[data-theme=dark] .pet-flip svg { filter: drop-shadow(0 0 10px rgba(255, 143, 191, .35)); }
html[data-theme=dark] .live-logo svg { filter: drop-shadow(0 0 6px rgba(255, 143, 191, .25)); }
html[data-theme=dark] .loader-shadow { background: color-mix(in srgb, var(--pink) 25%, transparent); }
html[data-theme=dark] .savebar { background: #f6eeff; color: #2a2040; }
html[data-theme=dark] .savebar .btn.ghost { color: #2a2040; }
html[data-theme=dark] :focus-visible { outline-color: var(--focus); }
html[data-theme=dark] .dd-hash { background: rgba(143, 107, 255, .25); color: #c9b8ff; }
.segmented { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: rgba(255, 255, 255, .6); border: 1.5px solid color-mix(in srgb, var(--pink-line) 80%, transparent); }
.segmented label { padding: 6px 16px; border-radius: 999px; cursor: var(--cursor-point, pointer); font-size: 14px; color: var(--ink-2); transition: background-color .15s ease, color .15s ease; }
.segmented label:hover { background: var(--pink-soft); }
.segmented label:has(input:checked) { background: var(--pink-btn); color: #fff; }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
html[data-theme=dark] .segmented { background: rgba(255, 255, 255, .05); border-color: rgba(255, 214, 236, .14); }
.prefs-menu .theme-pick { display: flex; width: 100%; } .prefs-menu .theme-pick label { flex: 1; padding: 6px 4px; text-align: center; white-space: nowrap; font-size: 13px; }

/* ---------- accent colours: the pink tokens are swapped per html[data-accent]; sakura petals and the logo stay pink ---------- */
:root { --pink-line: #f2bcd4; --pink-light: #ff8cc0; }
html[data-accent=lavender] { --pink: #9b7bff; --pink-hover: #8a66f5; --pink-soft: #efe9ff; --pink-ink: #6a4bd6; --pink-btn: #6c47d9; --pink-btn-hover: #5b38c4; --pink-line: #d4c6ff; --pink-light: #b8a2ff; --focus: #6a4bd6; }
html[data-accent=mint] { --pink: #2fbf8a; --pink-hover: #25a878; --pink-soft: #e2f8ef; --pink-ink: #17734f; --pink-btn: #17855c; --pink-btn-hover: #12704d; --pink-line: #a9e6cf; --pink-light: #6fd8b0; --focus: #17734f; }
html[data-accent=sky] { --pink: #3aa8f0; --pink-hover: #2596de; --pink-soft: #e3f3fe; --pink-ink: #1b65a0; --pink-btn: #1a73b5; --pink-btn-hover: #15619a; --pink-line: #a9d8f7; --pink-light: #7cc6f5; --focus: #1b65a0; }
html[data-accent=peach] { --pink: #ff8a5c; --pink-hover: #f5763f; --pink-soft: #fff0e8; --pink-ink: #b44a17; --pink-btn: #c4521e; --pink-btn-hover: #a84517; --pink-line: #ffc9b0; --pink-light: #ffad8a; --focus: #b44a17; }
html[data-theme=dark][data-accent=lavender] { --pink-soft: rgba(155, 123, 255, .2); --pink-ink: #c9b8ff; --pink-btn: #7d5ae8; --focus: #c9b8ff; }
html[data-theme=dark][data-accent=mint] { --pink-soft: rgba(47, 191, 138, .18); --pink-ink: #7fe0bb; --pink-btn: #1f9a6c; --focus: #7fe0bb; }
html[data-theme=dark][data-accent=sky] { --pink-soft: rgba(58, 168, 240, .18); --pink-ink: #8fd0ff; --pink-btn: #1f86cc; --focus: #8fd0ff; }
html[data-theme=dark][data-accent=peach] { --pink-soft: rgba(255, 138, 92, .18); --pink-ink: #ffb38f; --pink-btn: #d9622b; --focus: #ffb38f; }
.accent-pick { display: flex; gap: 10px; padding: 2px 4px 8px; }
.accent-pick label { position: relative; width: 32px; height: 32px; border-radius: 50%; background: var(--c); cursor: var(--cursor-point, pointer); box-shadow: 0 0 0 2px var(--pop-bg, #fff), 0 2px 6px rgba(74, 47, 92, .15); transition: transform .15s ease; }
.accent-pick label:hover { transform: scale(1.1); }
.accent-pick label:has(input:checked) { box-shadow: 0 0 0 3px var(--pop-bg, #fff), 0 0 0 5px var(--c); }
.accent-pick label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 4px; }

/* ---------- weekly report on the overview ---------- */
.report { margin-bottom: 32px; display: grid; gap: 18px; }
.report-head { display: flex; align-items: baseline; gap: 12px; }
.report-head h2 { margin: 0; font-size: 20px; font-weight: 400; }
.report-say { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 16px; background: linear-gradient(90deg, var(--pink-soft), transparent); }
.report-say img { width: 40px; height: 40px; flex: none; }
.report-say p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink); }
.report-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.report-stat { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--card-soft, rgba(255, 255, 255, .6)); border: 1px solid var(--line); }
.report-stat span { font-size: 13px; color: var(--muted); }
.report-stat strong { font-weight: 400; font-size: 26px; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.report-stat small { font-size: 12px; color: var(--muted); }
.report-stat.up small, .report-stat.up strong { color: var(--mint-ink); }
.report-stat.down small { color: var(--red-ink); }
.report-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.report-chart { margin: 0; display: grid; gap: 10px; }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; height: 170px; align-items: end; }
.bar-col { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 4px; height: 100%; }
.bar-value { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .15s ease; }
.bar-col:hover .bar-value, .bar-col.peak .bar-value { opacity: 1; }
.bar-col.peak .bar-value { color: var(--pink-ink); }
.bar { align-self: end; width: 100%; max-width: 34px; height: var(--h); border-radius: 10px 10px 4px 4px; background: color-mix(in srgb, var(--pink) 32%, transparent); transform-origin: bottom; animation: bar-grow .6s cubic-bezier(.2, .9, .3, 1.1) backwards; transition: background-color .15s ease; }
.bar-col:nth-child(2) .bar { animation-delay: .04s; } .bar-col:nth-child(3) .bar { animation-delay: .08s; } .bar-col:nth-child(4) .bar { animation-delay: .12s; }
.bar-col:nth-child(5) .bar { animation-delay: .16s; } .bar-col:nth-child(6) .bar { animation-delay: .2s; } .bar-col:nth-child(7) .bar { animation-delay: .24s; }
.bar-col:hover .bar { background: color-mix(in srgb, var(--pink) 55%, transparent); }
.bar-col.peak .bar { background: linear-gradient(180deg, var(--pink-light), var(--pink-btn)); }
@keyframes bar-grow { from { transform: scaleY(0); } }
.bar-day { font-size: 13px; color: var(--muted); }
.bar-col.peak .bar-day { color: var(--pink-ink); }
html[data-motion=off] .bar { animation: none; }
.report-top { display: grid; align-content: start; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--card-soft, rgba(255, 255, 255, .6)); border: 1px solid var(--line); }
.report-top ol { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.report-top li { display: flex; align-items: center; gap: 10px; min-width: 0; }
.report-top .medal { font-size: 20px; width: 24px; text-align: center; }
.report-top .avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; }
.top-name { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-count { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 960px) { .report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .report-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .bars { gap: 6px; height: 140px; } .report-stat strong { font-size: 22px; } }

/* ---------- weekly report page ---------- */
.report-stats.full { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.week-nav .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.week-nav .btn .icon { width: 16px; height: 16px; }
.week-nav .flip { display: inline-flex; transform: scaleX(-1); }
.week-nav [aria-disabled=true] { opacity: .4; pointer-events: none; }
.week-label { display: grid; justify-items: center; text-align: center; }
.week-label strong { font-weight: 400; font-size: 18px; }
.week-label span { font-size: 13px; color: var(--muted); }
.report-body.page { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.report-body.page > .card { margin: 0; }
.bars.tall { height: 240px; }
.report-body.page .report-top { padding: 0; border: 0; background: none; }
.report-top li { position: relative; padding: 4px 6px; border-radius: 10px; }
.report-top li::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: inherit; background: color-mix(in srgb, var(--pink) 10%, transparent); z-index: -1; }
.report-top ol { position: relative; z-index: 0; }
.report-top .medal { font-size: 18px; color: var(--muted); font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.report-table th, .report-table td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.report-table th:first-child { text-align: left; font-weight: 400; }
.report-table thead th { font-size: 13px; font-weight: 400; color: var(--muted); }
.report-table tbody tr:hover { background: color-mix(in srgb, var(--pink) 6%, transparent); }
.report-note { margin: 12px 4px 0; }
@media (max-width: 1100px) { .report-stats.full { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) { .report-body.page { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .report-stats.full { grid-template-columns: repeat(2, minmax(0, 1fr)); } .week-nav .btn { padding-inline: 10px; } }
.week-label { padding: 6px 20px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--glow); }
.report-body.page { align-items: start; }
/* Wide screens: the content grows with the window (up to 1680px) instead of floating in a fixed 1240px column. */
@media (min-width: 1700px) {
  .content, .content.wide { max-width: min(1680px, calc(100vw - 272px - 64px)); }
  .savebar { left: calc(272px + max(40px, (100vw - 272px - 1680px) / 2 + 40px)); right: max(40px, (100vw - 272px - 1680px) / 2 + 40px); }
}

/* ---------- visual-novel onboarding ---------- */
.vn { position: fixed; inset: 0; z-index: 2500; overflow: hidden; animation: dd-fade .4s ease; }
.vn.out { opacity: 0; transition: opacity .4s ease; }
.vn-scene { position: absolute; inset: 0; overflow: hidden; transition: filter .4s ease; }
.vn-scene::before { content: ""; position: absolute; inset: -60px; background: url("/mascot.png") center / cover no-repeat; filter: blur(40px) saturate(1.2) brightness(1.08); }
.vn-cg { position: absolute; inset: 0; background: url("/mascot.png") 50% 30% / auto 100% no-repeat; -webkit-mask-image: linear-gradient(90deg, transparent calc(50% - 50vh - 40px), #000 calc(50% - 50vh + 80px), #000 calc(50% + 50vh - 80px), transparent calc(50% + 50vh + 40px)); mask-image: linear-gradient(90deg, transparent calc(50% - 50vh - 40px), #000 calc(50% - 50vh + 80px), #000 calc(50% + 50vh - 80px), transparent calc(50% + 50vh + 40px)); animation: vn-kenburns 18s ease-in-out infinite alternate; transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.vn-scene::after { z-index: 1; }
.vn-scene.happy .vn-cg { animation: vn-kenburns 18s ease-in-out infinite alternate, vn-hop .5s cubic-bezier(.3, 1.5, .5, 1); }
.vn-scene::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255, 236, 246, .1) 0%, transparent 35%, rgba(54, 34, 70, .25) 62%, rgba(54, 34, 70, .7) 100%); }
.vn-scene.pout { filter: saturate(.8) brightness(.95); }
.vn-scene.serious { filter: contrast(1.05); }
@keyframes vn-kenburns { from { transform: scale(1); } to { transform: scale(1.06); } }
@keyframes vn-hop { 40% { translate: 0 -10px; } }
.vn-skip { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); z-index: 2; min-height: 40px; padding: 0 16px; border: 1px solid rgba(255, 255, 255, .6); border-radius: 999px; background: rgba(74, 47, 92, .45); color: #fff; font: inherit; font-size: 14px; cursor: var(--cursor-point, pointer); backdrop-filter: blur(8px); }
.vn-skip:hover { background: rgba(74, 47, 92, .65); }
.vn-stage { position: absolute; left: 0; right: 0; bottom: 0; display: grid; justify-items: center; gap: 18px; padding: 0 max(16px, env(safe-area-inset-left, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.vn-choices { display: grid; gap: 10px; width: min(460px, 100%); }
.vn-choice { min-height: 50px; padding: 10px 22px; border: 2px solid rgba(255, 255, 255, .9); border-radius: 16px; background: linear-gradient(90deg, rgba(255, 255, 255, .92), rgba(255, 236, 246, .92)); color: #4a2f5c; font: inherit; font-size: 16px; cursor: var(--cursor-point, pointer); box-shadow: 0 8px 22px rgba(74, 47, 92, .22); animation: vn-choice .35s cubic-bezier(.2, .9, .3, 1.2) var(--d, 0ms) backwards; transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
.vn-choice::before { content: "✿ "; color: var(--pink); }
.vn-choice:hover, .vn-choice:focus-visible { transform: translateX(6px); box-shadow: 0 10px 26px color-mix(in srgb, var(--pink) 35%, transparent); outline: none; border-color: var(--pink); }
@keyframes vn-choice { from { opacity: 0; transform: translateY(10px); } }
.vn-box { position: relative; width: min(980px, 100%); min-height: 140px; padding: 30px 30px 26px; border-radius: 22px; background: rgba(54, 34, 70, .82); color: #fff; border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 16px 40px rgba(30, 16, 44, .4); backdrop-filter: blur(12px); cursor: var(--cursor-point, pointer); }
.vn-name { position: absolute; left: 22px; top: -16px; padding: 4px 18px; border-radius: 999px; background: linear-gradient(90deg, #ff6fae, #b48cff); color: #fff; font-size: 15px; letter-spacing: .1em; box-shadow: 0 4px 12px rgba(209, 48, 127, .35); }
.vn-dots { position: absolute; right: 22px; top: 14px; display: flex; gap: 6px; }
.vn-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, .3); transition: background-color .3s ease; }
.vn-dots span.on { background: #ffc4dd; }
.vn-line { margin: 0; font-size: 18px; line-height: 1.8; min-height: 3.6em; }
.vn-next { position: absolute; right: 24px; bottom: 16px; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid #ffc4dd; animation: nudge 1.2s ease-in-out infinite; }
html[data-motion=off] .vn, html[data-motion=off] .vn * { animation: none !important; transition: none !important; }
@media (max-width: 640px) {
      .vn-line { font-size: 16px; }
  .vn-box { padding: 26px 18px 22px; min-height: 120px; }
}

@media (max-width: 640px) { .vn-cg { background-size: cover; background-position: 62% 20%; -webkit-mask-image: none; mask-image: none; } }
.vn-scene { z-index: 0; } .vn-stage { z-index: 2; } .vn-skip { z-index: 3; }
/* Wider onboarding: the art spans most of the screen (cropped from the bottom, keeping her face), with a wider dialogue. */
.vn { --cg: min(88vw, 160vh); }
.vn-cg { background-size: var(--cg) auto; background-position: 50% 26%;
  -webkit-mask-image: linear-gradient(90deg, transparent calc(50% - var(--cg) / 2), #000 calc(50% - var(--cg) / 2 + 120px), #000 calc(50% + var(--cg) / 2 - 120px), transparent calc(50% + var(--cg) / 2));
  mask-image: linear-gradient(90deg, transparent calc(50% - var(--cg) / 2), #000 calc(50% - var(--cg) / 2 + 120px), #000 calc(50% + var(--cg) / 2 - 120px), transparent calc(50% + var(--cg) / 2)); }
.vn-box { width: min(1240px, 100%); }
.vn-choices { width: min(620px, 100%); }
@media (max-width: 640px) { .vn-cg { background-size: cover; background-position: 62% 20%; -webkit-mask-image: none; mask-image: none; } }

/* ---------- review fixes ---------- */
/* Instant switches carry a ⚡ so they read differently from the ones that wait for 儲存變更; the label shows on phones too. */
.feature .instant-switch::before { content: "⚡"; margin-right: 2px; font-size: 13px; color: var(--amber-ink); }
@media (max-width: 820px) { .master .instant { display: inline-flex; } }
.toast-action { margin-left: 12px; min-height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--pink-btn); color: #fff; font: inherit; font-size: 13px; cursor: var(--cursor-point, pointer); }
.toast-action:hover { background: var(--pink-btn-hover); }
.load-failed { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--red-soft); color: var(--red-ink); font-size: 14px; }

/* Search lives in the tab strip on phones, where there is no search pill or Ctrl+K. */
.search-tab { display: none; border: 0; background: transparent; font: inherit; text-align: left; cursor: var(--cursor-point, pointer); }
@media (max-width: 820px) { .search-tab { display: flex; } }

/* Phones: a one-line save bar, a compact overview. */
.savebar .short { display: none; }
@media (max-width: 640px) {
  .savebar .long { display: none; }
  .savebar .short { display: inline; }
  .savebar { gap: 8px; padding: 8px 8px 8px 14px; }
  .savebar .savebar-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
  .savebar .btn { padding-inline: 12px; }
  .savebar-logo { display: none; }
  .feature { padding: 14px 16px; gap: 6px; }
  .feature p { display: none; }
  .feature h3 { margin: 4px 0 0; }
  .feature-grid { gap: 10px; }
  .guild-banner { min-height: 0; }
}

/* Tables scroll inside their card instead of crushing columns on phones. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) { .table-wrap > table.board { min-width: 560px; } .table-wrap th, .table-wrap td { white-space: nowrap; } }
.tab { position: relative; }

/* Role panels empty state: labels under the sketches, not over them. */
.mini-wrap { display: grid; justify-items: center; gap: 6px; width: 132px; font-size: 13px; color: var(--muted); }
.mini-wrap .mini { width: 100%; }

/* Rows whose fields have different heights line up on their inputs. */
.row:has(> .field .switch) { align-items: end; }
.row > .switch { flex: 1 1 180px; align-self: end; min-height: 44px; }

/* Server log event groups: headings inside the box. */
.event-group > legend { float: left; width: 100%; padding: 0; margin-bottom: 2px; }

/* Command list: wider name column, balanced columns without holes. */
.command-groups { display: block; columns: 2 420px; column-gap: 16px; }
.command-groups > .card { break-inside: avoid; margin: 0 0 16px; }
.command-list > div { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }

/* Weekly report: activity bars run under each name; ranks 4+ stay quiet. */
.report-top li::before { inset: auto auto 0 44px; width: calc((100% - 44px) * var(--w-frac, 0)); height: 3px; background: color-mix(in srgb, var(--pink) 45%, transparent); }
.report-top li { padding-bottom: 8px; }
.report-top .medal { font-size: 18px; }
.report-top li:nth-child(n+4) .medal { font-size: 14px; color: var(--muted); }
@media (max-width: 640px) { .report-stats.full > :last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* Short screens: the helper card would be cut off at the bottom of the sidebar. */
@media (min-width: 821px) and (max-height: 900px) { .helper { display: none; } }

/* Native controls in Mochi's style. */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=checkbox]:not([role=switch]) { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; flex: none; border: 2px solid var(--pink-line); border-radius: 6px; background: var(--surface); display: inline-grid; place-items: center; cursor: var(--cursor-point, pointer); transition: background-color .15s ease, border-color .15s ease; }
input[type=checkbox]:not([role=switch])::after { content: ""; width: 10px; height: 6px; margin-top: -2px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg) scale(0); transition: transform .15s ease; }
input[type=checkbox]:not([role=switch]):checked { background: var(--pink-btn); border-color: var(--pink-btn); }
input[type=checkbox]:not([role=switch]):checked::after { transform: rotate(-45deg) scale(1); }
input[type=checkbox]:not([role=switch]):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Dark theme: the save bar stays a calm dark strip with a pink edge instead of the brightest thing on screen. */
html[data-theme=dark] .savebar { background: #3b2a57; color: #fff; border: 1px solid color-mix(in srgb, var(--pink) 40%, transparent); }
html[data-theme=dark] .savebar .btn.ghost { color: #fff; }
.dc-image-missing { margin-top: 10px; padding: 10px 12px; border-radius: 4px; background: #1e1f22; color: #949ba4; font-size: 13px; }
/* The pet steps back while the admin types, so it never sits on a field being filled in. */
body:has(input:focus, textarea:focus) .pet { opacity: .2; pointer-events: none; transition: opacity .2s ease; }

/* The dashboard is an app, not a document: dragging or Ctrl+A shouldn't paint the whole page pink.
   Fields people type in (and copy from) stay selectable. */
body { -webkit-user-select: none; user-select: none; }
input, textarea, [contenteditable], .selectable { -webkit-user-select: text; user-select: text; }
::selection { background: color-mix(in srgb, var(--pink) 30%, transparent); }
/* Links and images can't be dragged out as a ghost "title + URL" preview. */
a, img, svg { -webkit-user-drag: none; user-drag: none; }

/* ---------- music player page: a small copy of the real player inside a Discord channel ---------- */
.mp-sketch { display: grid; gap: 12px; align-content: start; padding: 14px 16px; border-radius: var(--radius); background: #313338; color: #dbdee1; font: 14px "gg sans", "Noto Sans TC", system-ui, sans-serif; }
.mp-channel { padding-bottom: 10px; border-bottom: 1px solid #3f4147; color: #949ba4; }
.mp-msg { display: flex; gap: 10px; align-items: flex-start; }
.mp-avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; background: #5865f2; }
.mp-avatar.a { background: linear-gradient(135deg, #f0b232, #f47b67); }
.mp-avatar.b { background: linear-gradient(135deg, #23a55a, #5bc0de); }
.mp-avatar.mochi { background: url("/mascot.png") center / cover, #ffd6e8; }
.mp-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.mp-who { display: flex; align-items: center; gap: 6px; }
.mp-who b { font-weight: 600; color: #f2f3f5; }
.mp-who b.mochi { color: #ff8cc0; }
.mp-app { padding: 0 4px; border-radius: 3px; background: #5865f2; color: #fff; font-size: 10px; line-height: 15px; }
.mp-card { margin-top: 4px; padding: 8px; border-radius: 8px; background: #2b2d31; border-left: 3px solid #ff5fa2; display: grid; gap: 8px; }
.mp-banner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 6px; overflow: hidden; color: #4a2f5c;
  background: radial-gradient(rgba(255, 255, 255, .7) 1px, transparent 1.4px) 0 0 / 12px 12px, linear-gradient(115deg, #ffeaf4, #f8e8fb 60%, #ece4ff); }
.mp-text { display: grid; min-width: 0; }
.mp-text small { font-size: 8px; letter-spacing: 2px; color: #d1307f; }
.mp-text strong { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-text em { font-style: normal; font-size: 11px; color: #7a6390; }
.mp-disc { width: 52px; height: 52px; flex: none; border-radius: 50%;
  background: radial-gradient(circle, #fff6fa 0 6%, #ff9cc7 7% 30%, #fff 31% 33%, transparent 34%), repeating-radial-gradient(circle, #3a2340 0 1.5px, #24152a 1.5px 3px);
  box-shadow: 0 2px 8px rgba(74, 47, 92, .35); animation: mp-spin 6s linear infinite; }
@keyframes mp-spin { to { transform: rotate(360deg); } }
html[data-motion=off] .mp-disc { animation: none; }
.mp-row { display: flex; gap: 6px; }
.mp-btn { display: grid; place-items: center; width: 34px; height: 26px; border-radius: 4px; background: #4e5058; font-size: 12px; }
.mp-btn.primary { background: #5865f2; }
.mp-btn.danger { background: #da373c; }
.mp-caption { color: #949ba4; font-size: 12px; text-align: center; }
/* Player style choices: tiny copies of each look. */
.ps-mini { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 64px; margin-bottom: 6px; padding: 10px 12px; border-radius: 8px;
  background: radial-gradient(rgba(255, 255, 255, .7) 1px, transparent 1.4px) 0 0 / 10px 10px, linear-gradient(115deg, #ffeaf4, #f8e8fb 60%, #ece4ff); }
.ps-lines { display: grid; gap: 5px; flex: 1; }
.ps-lines i { display: block; height: 5px; border-radius: 3px; background: #ff8cc0; width: 45%; }
.ps-lines i:nth-child(2) { height: 9px; width: 80%; background: #4a2f5c; }
.ps-lines i:nth-child(3) { width: 50%; background: #b9a3c9; }
.ps-art { width: 44px; height: 44px; flex: none; }
.ps-vinyl .ps-art { border-radius: 50%; background: radial-gradient(circle, #fff6fa 0 6%, #ff9cc7 7% 30%, #fff 31% 33%, transparent 34%), repeating-radial-gradient(circle, #3a2340 0 1.5px, #24152a 1.5px 3px); }
.ps-cover .ps-art { border-radius: 9px; border: 3px solid #fff; background: linear-gradient(135deg, #ff9cc7, #b48cff); box-shadow: 0 3px 8px rgba(209, 48, 127, .25); }
.ps-hidden { justify-content: flex-start; }
html[data-theme=dark] .ps-mini { filter: brightness(.92); }
.mp-cover { width: 48px; height: 48px; flex: none; border-radius: 9px; border: 3px solid #fff; background: url("/mascot.png") center / cover, linear-gradient(135deg, #ff9cc7, #b48cff); box-shadow: 0 3px 8px rgba(74, 47, 92, .3); }
.mp-plain { display: grid; gap: 2px; padding: 4px 4px 0; }
.mp-plain strong { font-size: 15px; font-weight: 600; color: #f2f3f5; }
.mp-plain small { font-size: 12px; color: #949ba4; }

/* ---------- welcome page ---------- */
.is-off { opacity: .55; transition: opacity .2s ease; }
.is-off:focus-within, .is-off:hover { opacity: .85; }
.off-hint { margin: 12px 0 4px; padding: 8px 12px; border-radius: 10px; background: var(--amber-soft); color: var(--amber-ink); font-size: 13px; }
.card-options { display: grid; gap: 12px; margin-top: 12px; padding-top: 14px; border-top: 1px dashed var(--line-2); }
.card-style { display: grid; gap: 10px; }
.card-style > .label { font-size: 13px; color: var(--ink-2); }
.bg-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-style .hint { margin: 0; }
