/* KURU — dark manga reader */
:root {
  --bg: #000;
  --surface: #1c1c1e;
  --surface-2: #2a2a2d;
  --surface-3: #3a3a3d;
  --line: rgba(255, 255, 255, 0.08);
  --fg: 255 255 255;               /* overlay ink: white on dark themes, black on light */
  --glass: rgba(38, 38, 42, 0.5);   /* tab bar */
  --btn-glass: rgba(36, 36, 38, 0.82);
  --float: rgba(44, 44, 47, 0.95);  /* popovers, toasts */
  --sheet: #1c1c1e;
  --blob: #0b0b0d;                  /* tab bar bubble */
  --head-glass: rgba(0, 0, 0, 0.72);
  --text: #fff;
  --text-2: #d6d6d9;
  --muted: #8e8e93;
  --teal: #46b3a6;
  --teal-2: #5fd0c2;
  --teal-dim: rgba(70, 179, 166, 0.16);
  --read: #86d39b;
  --read-dim: #5fae75;
  --read-bg: rgba(110, 200, 140, 0.075);
  --red: #e5323f;
  --font-ui: "Gill Sans", "Gill Sans MT", "Gill Sans Nova", Optima, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-head: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-t: max(env(safe-area-inset-top, 0px), var(--native-safe-t, 0px));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--native-safe-b, 0px));
  --tabbar-h: 66px;
  --gap: 0px; /* iOS home-screen bug: fixed layout stops short of the bottom edge; filled in by JS */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
/* iOS home-screen apps: without this, iOS sizes the page one status-bar shorter than the screen */
html { min-height: calc(100% + env(safe-area-inset-top, 0px)); }
body {
  font-family: var(--font-ui);
  font-size: 16px;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  user-select: none;
  -webkit-user-select: none;
}
input, textarea { user-select: text; -webkit-user-select: text; }
input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { -webkit-user-drag: none; -webkit-touch-callout: none; }
a, .card, .cover, .reader { -webkit-touch-callout: none; }
.card.pressing .cover { transform: scale(0.95); transition: transform 0.45s var(--ease-out); }
.hidden { display: none !important; }
svg.i { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- app layers ---------- */
#app { position: fixed; inset: 0; overflow: hidden; }
.view {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 40px);
}
.view.tab-view { z-index: 1; }
.view.stack-view { z-index: 10; box-shadow: -18px 0 40px rgba(0, 0, 0, 0.55); will-change: transform; }
.view.inactive { visibility: hidden; pointer-events: none; }
.stack-view.enter { animation: slideIn 0.42s var(--ease-out) both; }
.stack-view.leave { animation: slideOut 0.32s cubic-bezier(0.4, 0, 1, 1) both; pointer-events: none; }
.stack-view.under { transform: translateX(-28%); transition: transform 0.42s var(--ease-out); filter: brightness(0.6); }
.tab-view.fade-in { animation: tabIn 0.28s var(--ease-out) both; }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes slideOut { from { transform: none; } to { transform: translateX(100%); } }
@keyframes tabIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeOnly { from { opacity: 0; } to { opacity: 1; } }

/* ---------- headers ---------- */
.large-title {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 40px;
  letter-spacing: -0.5px;
  margin: 0;
  padding: calc(var(--safe-t) + 54px) 28px 18px;
}
.mini-header {
  position: sticky; top: 0; z-index: 20;
  height: calc(var(--safe-t) + 56px);
  padding-top: var(--safe-t);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 19px;
  background: rgba(18, 18, 20, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border-bottom: 0.5px solid var(--line);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  margin-bottom: calc(-1 * (var(--safe-t) + 56px));
}
.mini-header.show { opacity: 1; pointer-events: auto; }

.section { margin: 6px 0 30px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 14px 0 14px; margin-bottom: 14px;
}
.section-title { font-family: var(--font-ui); font-weight: 700; font-size: 22px; letter-spacing: 0.2px; }
.see-all { color: var(--teal); font-size: 19px; display: inline-flex; gap: 6px; align-items: center; }
.see-all:active { opacity: 0.6; }
.section-sub { color: var(--muted); font-size: 13px; margin-left: 8px; font-style: italic; }

/* ---------- cards ---------- */
.hrow {
  display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden;
  padding: 0 14px; scroll-snap-type: x proximity; scrollbar-width: none;
}
.hrow::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.hrow .card { flex: 0 0 calc((100vw - 14px * 2 - 14px * 2) / 3.12); scroll-snap-align: start; max-width: 190px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 14px; padding: 0 14px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }

.card { display: block; min-width: 0; position: relative; }
.card:active .cover { transform: scale(0.965); }
.cover {
  position: relative; width: 100%; aspect-ratio: 0.71; border-radius: 4px; overflow: hidden;
  background: linear-gradient(135deg, #1a1a1c, #26262a);
  transition: transform 0.18s var(--ease-out);
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.35s; }
.cover img.loaded { opacity: 1; }
.cover .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; padding: 8px; }
.card .t { margin-top: 8px; font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.card .c { margin-top: 4px; font-size: 15px; color: var(--teal); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .a { margin-top: 3px; font-size: 14.5px; color: var(--muted); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-src {
  position: absolute; top: 5px; left: 5px; z-index: 2;
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px; font-family: var(--font-head);
  padding: 2px 5px; border-radius: 5px;
  background: rgba(0, 0, 0, 0.62); color: #fff;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.badge-new {
  position: absolute; top: 5px; right: 5px; z-index: 2;
  font-size: 10px; font-weight: 800; font-family: var(--font-head);
  padding: 2px 6px; border-radius: 9px; background: var(--red); color: #fff;
}
.card .check {
  position: absolute; top: 6px; right: 6px; z-index: 3; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0, 0, 0, 0.35); display: grid; place-items: center;
  transition: transform 0.2s var(--ease-spring), background 0.2s;
}
.card.selected .check { background: var(--teal); border-color: var(--teal); transform: scale(1.08); }
.card.selected .cover { outline: 3px solid var(--teal); outline-offset: -3px; }

.skeleton .cover { animation: pulse 1.3s ease-in-out infinite; }
.skeleton .t, .skeleton .c { height: 12px; border-radius: 4px; background: #1d1d20; animation: pulse 1.3s ease-in-out infinite; }
.skeleton .t { width: 85%; margin-top: 10px; }
.skeleton .c { width: 50%; }
@keyframes pulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.empty { color: var(--muted); text-align: center; padding: 50px 30px; font-size: 16px; line-height: 1.5; }
.empty b { color: var(--text); display: block; font-size: 19px; margin-bottom: 6px; }
.err-box { margin: 10px 14px; padding: 14px 16px; border-radius: 12px; background: #2a1517; color: #ffb4b9; font-size: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.err-box button { color: var(--text); background: rgb(var(--fg) / 0.12); border-radius: 8px; padding: 6px 12px; font-size: 14px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgb(var(--fg) / 0.15); border-top-color: var(--teal); animation: spin 0.8s linear infinite; margin: 24px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.load-more { height: 60px; display: grid; place-items: center; }

/* ---------- buttons, chips, inputs ---------- */
.pill-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 18px;
  background: var(--surface); border-radius: 12px; font-size: 18px;
  transition: transform 0.15s, background 0.15s;
}
.pill-btn:active { transform: scale(0.96); background: var(--surface-2); }
.circle-btn {
  width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center;
  background: var(--btn-glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: inset 0 0.5px 0 rgb(var(--fg) / 0.18), 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s var(--ease-spring);
}
.circle-btn:active { transform: scale(0.88); }
.circle-btn svg.i { width: 24px; height: 24px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px; scrollbar-width: none; }
.chip {
  flex: 0 0 auto; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--surface);
  font-size: 15px; display: inline-flex; align-items: center; gap: 6px; color: var(--text-2);
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.chip:active { transform: scale(0.95); }
.chip.on { background: var(--teal); color: #031512; font-weight: 600; }
.chip .n { font-size: 12px; opacity: 0.7; }

.search-box {
  margin: 0 28px; height: 58px; border-radius: 29px; background: var(--surface);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
}
.search-box svg.i { color: var(--text-2); width: 24px; height: 24px; flex: none; }
.search-box input {
  flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--text);
  font-family: var(--font-head); font-size: 20px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box .clear { color: var(--muted); display: none; }
.search-box.has-text .clear { display: block; }
.toolbar { display: flex; justify-content: flex-end; gap: 14px; padding: 18px 28px 22px; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 14px; color: var(--muted); margin: 0 0 6px 4px; }
.field input, .select {
  width: 100%; height: 52px; border-radius: 14px; border: 1px solid transparent; outline: none;
  background: var(--surface); color: var(--text); padding: 0 16px; font-size: 17px; font-family: var(--font-head);
  transition: border-color 0.2s;
}
.field input:focus { border-color: var(--teal); }
.primary-btn {
  width: 100%; height: 54px; border-radius: 16px; background: var(--teal); color: #03201c;
  font-weight: 700; font-size: 18px; font-family: var(--font-head); transition: transform 0.15s, opacity 0.2s;
}
.primary-btn:active { transform: scale(0.97); }
.primary-btn[disabled] { opacity: 0.5; }
.ghost-btn { width: 100%; height: 50px; border-radius: 14px; background: var(--surface); color: var(--text); font-size: 17px; }
.danger { color: #ff6b74 !important; }

/* ---------- tab bar (liquid glass) ---------- */
.tabbar {
  position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 10px);
  width: min(calc(100% - 52px), 560px); height: var(--tabbar-h);
  border-radius: 33px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(26px) saturate(190%) brightness(1.05);
  backdrop-filter: blur(26px) saturate(190%) brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgb(var(--fg) / 0.22),
    inset 0 -1px 0 rgb(var(--fg) / 0.05),
    inset 0 0 0 0.5px rgb(var(--fg) / 0.12),
    0 10px 34px rgba(0, 0, 0, 0.55);
  transition: transform 0.45s var(--ease-out), opacity 0.3s;
}
.tabbar.away { transform: translate(-50%, 150%); opacity: 0; pointer-events: none; }
.tabbar .goo-layer { position: absolute; inset: 0; filter: url(#goo); pointer-events: none; }
.tabbar .blob, .tabbar .drop {
  position: absolute; top: 6px; height: calc(100% - 12px); border-radius: 27px;
  background: var(--blob);
}
.tabbar .drop { border-radius: 50%; top: 50%; }
.tabbar .lens {
  position: absolute; top: 6px; height: calc(100% - 12px); border-radius: 27px; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 0%, rgb(var(--fg) / 0.12), rgb(var(--fg) / 0) 60%);
  box-shadow: inset 0 1px 0.5px rgb(var(--fg) / 0.28), inset 0 -1px 1px rgb(var(--fg) / 0.06), inset 0 0 12px rgba(70, 179, 166, 0.10);
}
.tabbar .items { position: absolute; top: 0; bottom: 0; left: 6px; right: 6px; display: flex; }
.tab {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-family: var(--font-head); font-weight: 800; font-size: 13px; color: var(--text); white-space: nowrap; letter-spacing: -0.1px;
  position: relative; transition: color 0.25s;
}
.tab .ico { position: relative; width: 30px; height: 30px; display: grid; place-items: center; transition: transform 0.35s var(--ease-spring); }
.tab .ico svg.i { width: 28px; height: 28px; stroke-width: 2.2; }
.tab .ico svg.fill { fill: currentColor; stroke: none; }
.tab.active { color: var(--teal-2); }
.tab.active .lbl { font-weight: 600; }
.tab.splash .ico { animation: splash 0.55s var(--ease-spring); }
@keyframes splash { 0% { transform: scale(1); } 30% { transform: scale(0.72, 0.8) translateY(2px); } 65% { transform: scale(1.18, 1.1) translateY(-3px); } 100% { transform: scale(1); } }
.tab .ripple { position: absolute; left: 50%; top: 42%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 2px solid var(--teal-2); opacity: 0; pointer-events: none; }
.tab.splash .ripple { animation: ripple 0.6s var(--ease-out); }
@keyframes ripple { 0% { opacity: 0.7; transform: scale(0.4); } 100% { opacity: 0; transform: scale(5.5); } }
.tab .tbadge {
  position: absolute; top: -9px; left: 16px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: var(--red); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center;
  box-shadow: 0 0 0 2px rgba(20, 20, 22, 0.9);
}
.tab .avatar-mini { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; border: 1.5px solid currentColor; }

/* ---------- popover + sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, 0); transition: background 0.25s; }
.scrim.show { background: rgba(0, 0, 0, 0.45); }
.popover {
  position: fixed; z-index: 201; min-width: 240px; max-width: calc(100vw - 24px);
  background: var(--float);
  -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  border-radius: 22px; padding: 14px 0; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transform-origin: var(--ox, top right);
  animation: popIn 0.32s var(--ease-spring) both;
}
.popover.out { animation: popOut 0.18s ease-in both; }
@keyframes popIn { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes popOut { to { opacity: 0; transform: scale(0.85); } }
.popover h4 { margin: 4px 0 10px; text-align: center; font-family: var(--font-head); font-size: 20px; font-weight: 800; }
.popover .opt { display: flex; align-items: center; gap: 16px; width: 100%; padding: 13px 26px; font-size: 18px; text-align: left; }
.popover .opt:active { background: rgb(var(--fg) / 0.06); }
.popover .opt.on { color: var(--teal-2); }
.popover .opt .tick { margin-left: auto; opacity: 0; }
.popover .opt.on .tick { opacity: 1; }
.popover hr { border: 0; border-top: 0.5px solid var(--line); margin: 8px 0; }
.popover .toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 26px; font-size: 16px; color: var(--text-2); }

.sheet {
  position: fixed; z-index: 201; left: 0; right: 0; bottom: 0; max-height: 88vh;
  background: var(--sheet); border-radius: 26px 26px 0 0;
  padding-bottom: var(--safe-b);
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform 0.42s var(--ease-out);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}
.sheet.show { transform: none; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 8px auto 2px; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px 14px; }
.sheet-head h3 { flex: 1; text-align: center; margin: 0; font-family: var(--font-head); font-size: 24px; font-weight: 800; }
.sheet-head .sq { width: 64px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; }
.sheet-head .sq.on { background: var(--teal-dim); color: var(--teal-2); }
.sheet .chip { background: var(--surface-2); }
.sheet .chip.on { background: var(--teal); }
.sheet .group { background: var(--surface-2); }
.sheet-body { overflow-y: auto; padding: 0 14px 20px; -webkit-overflow-scrolling: touch; }

/* ---------- chapter rows ---------- */
.ch-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--surface-2); border-radius: 8px; padding: 12px 14px 12px 20px; margin-bottom: 8px;
  transition: transform 0.12s, background 0.2s;
  position: relative;
}
.ch-row:active { transform: scale(0.985); }
.ch-row .main { flex: 1; min-width: 0; }
.ch-row .l { font-size: 19px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-row .l small { color: var(--muted); font-size: 15px; }
.ch-row .m { margin-top: 4px; font-size: 15px; color: var(--muted); font-style: italic; display: flex; justify-content: space-between; gap: 10px; }
.ch-row .m .g { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.ch-row.read { background: var(--read-bg); }
.ch-row.read .l, .ch-row.read .l small { color: var(--read); }
.ch-row.read .m { color: var(--read-dim); }
.ch-row.current { box-shadow: inset 3px 0 0 var(--teal); }
.ch-row.current .l { color: var(--teal-2); }
.ch-row .mark {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; color: var(--muted);
  border: 1.5px solid var(--surface-3); transition: all 0.2s var(--ease-spring);
}
.ch-row.read .mark { background: var(--read); border-color: var(--read); color: #062010; }
.ch-row .mark svg.i { width: 18px; height: 18px; stroke-width: 3; }
.ch-row .ext { color: var(--muted); font-size: 12px; display: inline-flex; gap: 4px; align-items: center; }
.ch-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ch-grid button { height: 46px; border-radius: 8px; background: var(--surface-2); font-size: 16px; }
.ch-grid button.read { color: var(--read); background: var(--read-bg); }
.ch-grid button.current { background: var(--teal); color: #032; font-weight: 700; }

.pager { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 10px 0 6px; }
.pager button { min-width: 36px; height: 38px; border-radius: 10px; background: var(--surface); font-size: 16px; padding: 0 8px; transition: transform 0.15s; }
.pager button:active { transform: scale(0.92); }
.pager button.on { background: var(--teal); color: #032; font-weight: 700; }
.pager button[disabled] { opacity: 0.35; }
.pager .dots { color: var(--muted); padding: 0 2px; }
.pager-jump { display: flex; justify-content: center; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; padding: 8px; }
.pager-jump input { width: 70px; height: 34px; border-radius: 8px; border: 0; background: var(--surface); color: var(--text); text-align: center; font-size: 15px; }

/* ---------- manga detail ---------- */
.manga-page { position: relative; isolation: isolate; }
.manga-page > .backdrop {
  position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: calc(var(--safe-t) + 520px);
  overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 0.2s ease;
}
.manga-page > .backdrop.on { opacity: 1; }
.manga-page > .backdrop::before {
  content: ''; position: absolute; inset: -40px; background: inherit; background-size: cover; background-position: center 30%;
  filter: blur(var(--banner-blur, 8px)) saturate(1.2) brightness(var(--banner-bright, 0.62)); transform: scale(1.08);
}
.manga-page > .backdrop::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.05) 35%, var(--bg) 96%);
}
.manga-page > .backdrop { background-size: 0 0; }
.detail-top {
  position: sticky; top: 0; z-index: 30; display: flex; justify-content: space-between; align-items: flex-start;
  padding: calc(var(--safe-t) + 12px) 28px 0; height: 0; overflow: visible; box-sizing: content-box;
}
.detail-top .circle-btn { margin-top: 0; }
.detail-top .fav.on { color: var(--teal-2); }
.detail-top .fav.on svg.i { fill: var(--teal-2); }
.detail-top .right { display: flex; gap: 12px; }
.detail-top .bell.on { color: var(--teal-2); }
.detail-top .bell.on svg.i { fill: var(--teal-2); }
.detail-top .bell.muted { color: #8e8e93; }
.detail-top .fav.pop { animation: heartPop 0.5s var(--ease-spring); }
@keyframes heartPop { 0% { transform: scale(1); } 35% { transform: scale(0.7); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
.detail-title {
  font-family: var(--font-head); font-weight: 800; font-size: 40px; letter-spacing: -0.4px;
  margin: 0; padding: calc(var(--safe-t) + 88px) 28px 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.detail-hero { display: flex; gap: 16px; padding: 0 14px; }
.detail-hero .cover { width: 37%; flex: none; border-radius: 6px; }
.detail-hero .info { flex: 1; min-width: 0; }
.detail-hero .full { font-family: var(--font-head); font-weight: 800; font-size: 20px; line-height: 1.22; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 6px 0 14px; }
.detail-hero .kv { font-size: 18px; margin: 0 0 12px; color: var(--text-2); }
.detail-hero .kv b { font-family: var(--font-head); color: var(--text); font-weight: 700; }
.detail-hero .kv span { color: var(--text-2); }
.h2 { font-family: var(--font-ui); font-weight: 700; font-size: 22px; padding: 28px 14px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.h2 .count { color: var(--muted); font-weight: 400; font-size: 17px; }
.suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 14px; }
.suggest button { height: 82px; border-radius: 41px; background: var(--surface); font-size: 18px; line-height: 1.35; transition: transform 0.15s, background 0.2s; }
.suggest button:active { transform: scale(0.96); background: var(--surface-2); }
.suggest button small { display: block; font-size: 13px; color: var(--muted); }
.suggest button.resume { background: rgba(110, 200, 140, 0.16); color: var(--read); box-shadow: inset 0 0 0 1.5px rgba(134, 211, 155, 0.55); font-weight: 600; }
.suggest button.resume small { color: var(--read-dim); font-weight: 400; }
.suggest button.resume:active { background: rgba(110, 200, 140, 0.26); }
.tag-row { display: flex; gap: 14px; overflow-x: auto; padding: 0 14px; scrollbar-width: none; }
.tag-row::-webkit-scrollbar { display: none; }
.tag {
  flex: 0 0 auto; min-width: 140px; height: 82px; padding: 0 22px; border-radius: 6px; background: var(--surface);
  display: grid; place-items: center; font-size: 18px; transition: transform 0.15s, background 0.2s;
}
.tag:active { transform: scale(0.96); background: var(--surface-2); }
.desc { padding: 0 14px; font-size: 16.5px; line-height: 1.45; color: var(--text-2); white-space: pre-line; user-select: text; -webkit-user-select: text; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.more-link { color: var(--teal); padding: 6px 14px; font-size: 16px; }
.chapter-tools { display: flex; gap: 8px; }
.chapter-tools button { width: 40px; height: 40px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; }
.chapters-wrap { padding: 0 14px; }
.credit { color: var(--muted); font-size: 13px; padding: 14px; text-align: center; font-style: italic; }

/* ---------- genres ---------- */
.genre-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 0 14px; }
.genre-tile {
  height: 82px; border-radius: 6px; background: var(--surface); display: grid; place-items: center;
  font-size: 19px; text-align: center; padding: 0 8px; transition: transform 0.15s, background 0.2s;
}
.genre-tile:active { transform: scale(0.96); background: var(--surface-2); }
.group-title { color: var(--muted); font-size: 14px; text-transform: uppercase; letter-spacing: 1.2px; padding: 22px 16px 10px; font-family: var(--font-head); font-weight: 600; }

/* ---------- favorites ---------- */
.fav-top { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 12px) 14px 0; }
.sync-pill {
  height: 50px; min-width: 112px; border-radius: 25px; background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 18px; padding: 0 16px; transition: opacity 0.3s, width 0.3s;
}
.sync-pill .mini-spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px dotted var(--text-2); animation: spin 1.4s linear infinite; }
.fav-search { flex: 1; height: 42px; border-radius: 21px; background: var(--surface); display: flex; align-items: center; padding: 0 16px; }
.fav-search input { width: 100%; background: none; border: 0; outline: 0; color: var(--text); font-size: 17px; font-family: var(--font-head); }
.fav-search input::placeholder { color: var(--muted); }
.edit-btn { height: 50px; padding: 0 22px; border-radius: 25px; background: var(--surface); font-size: 20px; font-family: var(--font-head); }
.edit-btn.on { background: var(--teal); color: #032; font-weight: 700; }
.fav-title { padding-top: 34px !important; }
.sort-row { display: flex; justify-content: space-between; align-items: center; padding: 0 14px 16px; }
.sort-row b { font-size: 22px; }
.sort-row button { display: flex; align-items: center; gap: 8px; font-size: 19px; }
.edit-bar {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--safe-b) + var(--tabbar-h) + 22px);
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: all 0.3s var(--ease-spring);
  display: flex; gap: 10px;
}
.edit-bar.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.edit-bar button { height: 46px; padding: 0 20px; border-radius: 23px; background: var(--float); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); font-size: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }
.edit-bar .del { background: var(--red); }

/* ---------- list page ---------- */
.list-head {
  position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 12px;
  padding: calc(var(--safe-t) + 10px) 14px 10px;
  background: var(--head-glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.list-head .ttl { flex: 1; min-width: 0; font-family: var(--font-head); font-weight: 800; font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-head .ttl small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- reader ---------- */
.reader { position: fixed; inset: 0; z-index: 100; background: #000; overflow: hidden; animation: tabIn 0.25s both; }
.reader .scroller { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.reader .scroller.paged {
  overflow-x: auto; overflow-y: hidden; display: flex; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.reader .scroller.paged::-webkit-scrollbar { display: none; }
.reader .scroller.paged.rtl { direction: rtl; }
.reader .pg { position: relative; width: 100%; display: block; background: #0a0a0a; }
.reader .scroller.cont .pg, .reader .scroller.cont .chapter-end { width: var(--pw, 100%); margin-left: auto; margin-right: auto; }
.reader .scroller.cont .pg.wait { min-height: calc(140vw * var(--pwf, 1)); }
.reader .scroller.cont.gap .pg { margin-bottom: 10px; }
.reader .pg img { width: 100%; height: auto; display: block; }
.reader .pg.wait { min-height: 140vw; display: grid; place-items: center; }
.reader .pg.wait::after { content: attr(data-n); color: #333; font-size: 40px; font-family: var(--font-head); font-weight: 800; }
.reader .scroller.paged .pg { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; display: grid; place-items: center; background: #000; overflow: hidden; min-height: 0; }
.reader .scroller.paged .pg img { width: var(--pw, 100%); height: 100%; object-fit: contain; }
.reader .pg .retry { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 15px; }
.reader .pg .retry button { margin-top: 10px; padding: 10px 18px; border-radius: 10px; background: var(--surface); color: #fff; }
.reader .head-note { color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }
.chapter-end {
  min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 40px 28px 140px; text-align: center;
}
.scroller.paged .chapter-end { flex: 0 0 100%; height: 100%; min-height: 0; scroll-snap-align: center; direction: ltr; }
.chapter-end .done { color: var(--muted); font-size: 15px; }
.chapter-end .big { font-family: var(--font-head); font-weight: 800; font-size: 26px; }
.chapter-end .primary-btn { max-width: 340px; }
.chapter-end .ghost-btn { max-width: 340px; }

.r-top, .r-bottom { position: fixed; left: 0; right: 0; z-index: 110; transition: transform 0.35s var(--ease-out), opacity 0.25s; }
.r-top {
  top: 0; padding: calc(var(--safe-t) + 10px) 14px 14px; display: flex; align-items: center; gap: 12px;
  /* light, see-through shade: the page shows through under the camera / status-bar area */
  background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.35) 65%, rgba(0, 0, 0, 0));
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.r-top .mid { flex: 1; min-width: 0; text-align: center; }
.r-top .mt { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.r-top .mt span { display: inline-block; padding: 0 12px; }
.r-top .mt.marquee span { animation: marquee 14s linear infinite; }
@keyframes marquee { 0%, 12% { transform: translateX(0); } 88%, 100% { transform: translateX(var(--mq, -50%)); } }
.r-top .mc { font-size: 17px; color: #e5e5ea; margin-top: 4px; }
.r-bottom { bottom: calc(var(--safe-b) + 14px); padding: 0 14px; }
.r-slider { display: flex; align-items: center; gap: 10px; margin: 0 6px 12px; padding: 8px 14px; border-radius: 20px; background: rgba(30, 30, 32, 0.78); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); font-size: 13px; color: var(--muted); }
.r-slider input { flex: 1; accent-color: var(--teal); }
.r-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.r-bar .circle-btn { width: 64px; height: 64px; }
.r-bar .circle-btn svg.i { width: 30px; height: 30px; }
.r-bar .circle-btn[disabled] { opacity: 0.35; }
.r-bar .pgc { width: 64px; height: 64px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 17px; line-height: 1.05; background: var(--btn-glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.r-bar .pgc i { font-style: normal; color: #8e8e93; font-size: 12px; letter-spacing: -1px; }
.reader.ui-hidden .r-top { transform: translateY(-110%); opacity: 0; pointer-events: none; }
.reader.ui-hidden .r-bottom { transform: translateY(130%); opacity: 0; pointer-events: none; }
.r-progress { position: fixed; left: 0; top: 0; height: 2px; background: var(--teal); z-index: 105; transition: width 0.2s; opacity: 0.85; }
.reader:not(.ui-hidden) .r-progress { opacity: 0; }
.reader .loading-center { position: absolute; inset: 0; display: grid; place-items: center; }

/* ---------- toast ---------- */
#toasts { position: fixed; z-index: 400; top: calc(var(--safe-t) + 12px); left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  max-width: calc(100vw - 40px); padding: 12px 18px; border-radius: 22px; font-size: 15px;
  background: var(--float); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); animation: toastIn 0.4s var(--ease-spring) both;
}
.toast.out { animation: toastOut 0.25s ease-in both; }
.toast.has-action { pointer-events: auto; display: flex; align-items: center; gap: 14px; }
.toast-btn { flex: none; padding: 7px 14px; border-radius: 14px; background: var(--teal); color: #032; font-weight: 700; font-size: 14px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-20px) scale(0.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-14px); } }

/* ---------- profile ---------- */
.profile-card { margin: 0 14px; padding: 26px 18px 22px; border-radius: 22px; background: var(--surface); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.avatar-big { width: 112px; height: 112px; border-radius: 50%; position: relative; background: linear-gradient(135deg, #2b6f68, #173836); display: grid; place-items: center; font-size: 44px; font-weight: 800; font-family: var(--font-head); overflow: hidden; }
.avatar-big img { width: 100%; height: 100%; object-fit: cover; }
.avatar-wrap { position: relative; }
.avatar-wrap .cam { position: absolute; right: 0; bottom: 2px; width: 36px; height: 36px; border-radius: 50%; background: var(--teal); color: #032; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--surface); }
.avatar-wrap .cam svg.i { width: 18px; height: 18px; }
.pname { font-family: var(--font-head); font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.pname button { color: var(--muted); }
.puser { color: var(--muted); font-size: 15px; }
.sync-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-top: 4px; }
.sync-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--read); }
.sync-row .dot.busy { background: #f6c34a; animation: pulse 1s infinite; }
.sync-row .dot.err { background: var(--red); }
.sync-row button { color: var(--teal); font-size: 14px; }
.group { margin: 22px 14px 0; border-radius: 16px; background: var(--surface); overflow: hidden; }
.group-label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin: 26px 30px -14px; font-family: var(--font-head); font-weight: 600; }
.row { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 10px 16px; border-bottom: 0.5px solid var(--line); width: 100%; text-align: left; font-size: 17px; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .grow small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.row .val { color: var(--muted); font-size: 16px; display: flex; align-items: center; gap: 4px; }
.row:active:not(.static) { background: rgb(var(--fg) / 0.04); }
.switch { position: relative; width: 52px; height: 32px; border-radius: 16px; background: var(--surface-3); transition: background 0.25s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%; background: #fff; transition: transform 0.3s var(--ease-spring); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.switch.on { background: var(--teal); }
.switch.on::after { transform: translateX(20px); }
.seg { display: flex; background: var(--surface); border-radius: 12px; padding: 3px; margin: 0 14px 18px; position: relative; }
.seg button { flex: 1; height: 38px; border-radius: 9px; font-size: 16px; position: relative; z-index: 1; transition: color 0.2s; }
.seg button.on { color: var(--text); font-weight: 600; }
.seg .seg-ind { position: absolute; top: 3px; bottom: 3px; border-radius: 9px; background: var(--surface-3); transition: left 0.35s var(--ease-spring), width 0.35s var(--ease-spring); }
.auth { padding: 0 28px; }
.auth .logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0 0 26px; }
.auth .logo img { width: 92px; height: 92px; border-radius: 22px; box-shadow: 0 10px 30px rgba(70, 179, 166, 0.25); }
.auth .logo p { color: var(--muted); text-align: center; margin: 0; font-size: 15px; line-height: 1.45; }
.auth .err { color: #ff8a92; font-size: 14px; min-height: 20px; margin: -4px 4px 10px; }
.about { color: var(--muted); font-size: 13px; text-align: center; padding: 28px 30px; line-height: 1.6; }

/* ---------- avatar editor ---------- */
.editor { position: fixed; inset: 0; z-index: 300; background: #000; display: flex; flex-direction: column; animation: tabIn 0.25s both; }
.editor-top { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-t) + 14px) 20px 10px; font-size: 18px; }
.editor-top b { font-family: var(--font-head); font-size: 19px; }
.editor-top .save { color: var(--teal-2); font-weight: 700; }
.editor-stage { flex: 1; position: relative; overflow: hidden; touch-action: none; }
.editor-stage img { position: absolute; left: 50%; top: 50%; transform-origin: 0 0; max-width: none; will-change: transform; }
.editor-mask { position: absolute; inset: 0; pointer-events: none; }
.editor-ring { position: absolute; left: 50%; top: 50%; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 4000px rgba(0, 0, 0, 0.62); transform: translate(-50%, -50%); }
.editor-tools { padding: 16px 24px calc(var(--safe-b) + 24px); display: flex; flex-direction: column; gap: 16px; }
.zoom-row { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.zoom-row input { flex: 1; accent-color: var(--teal); height: 30px; }
.editor-tools .btns { display: flex; gap: 10px; }
.editor-tools .btns button { flex: 1; height: 46px; border-radius: 12px; background: var(--surface); font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; }

/* ---------- misc ---------- */
.edge-shadow { position: fixed; top: 0; bottom: 0; left: 0; width: 24px; z-index: 90; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- desktop / large screens ---------- */
@media (min-width: 900px) {
  .view > div { max-width: 1280px; margin: 0 auto; }
  .hrow .card { flex-basis: 170px; }
  .detail-hero .cover { width: 240px; }
  .detail-hero .full { font-size: 26px; }
  .suggest, .tag-row, .chapters-wrap, .desc { max-width: 900px; }
  .genre-grid { grid-template-columns: repeat(4, 1fr); }
  .r-bottom { max-width: 620px; margin: 0 auto; }
  .r-top { padding-left: 24px; padding-right: 24px; }
  .search-box { max-width: 720px; }
  .profile-card, .group, .auth, .seg { max-width: 640px; }
  .profile-card, .group { margin-left: auto; margin-right: auto; }
  .group-label { max-width: 640px; margin-left: auto; margin-right: auto; padding-left: 16px; }
  .auth, .seg { margin-left: auto; margin-right: auto; }
  .chapter-end { min-height: 50vh; }
}
@media (hover: hover) and (pointer: fine) {
  .card:hover .cover { transform: scale(1.03); }
  .card:hover .t { color: var(--teal-2); }
  .ch-row:hover { background: var(--surface-3); }
  .ch-row.read:hover { background: rgba(110, 200, 140, 0.14); }
  .genre-tile:hover, .tag:hover, .suggest button:hover, .pill-btn:hover, .chip:hover { background: var(--surface-2); }
  .chip.on:hover { background: var(--teal-2); }
  .tab:hover .ico { transform: translateY(-2px); }
  .view, .sheet-body, .reader .scroller.cont { scrollbar-width: thin; scrollbar-color: #3a3a3d transparent; }
  .hrow { scrollbar-width: thin; scrollbar-color: #3a3a3d transparent; padding-bottom: 6px; }
  .hrow::-webkit-scrollbar { display: block; height: 6px; }
  .hrow::-webkit-scrollbar-thumb { background: #3a3a3d; border-radius: 3px; }
  ::-webkit-scrollbar { width: 8px; }
  ::-webkit-scrollbar-thumb { background: #3a3a3d; border-radius: 4px; }
  ::-webkit-scrollbar-track { background: transparent; }
  button, a, .ch-row, .genre-tile { cursor: pointer; }
}

/* ---------- iOS home-screen apps: stretch fixed layers into the bottom strip iOS leaves unused ---------- */
#app, .reader, .scrim, .editor { bottom: calc(0px - var(--gap)); }
.tabbar { bottom: calc(var(--safe-b) + 10px - var(--gap)); }
.sheet { bottom: calc(0px - var(--gap)); padding-bottom: calc(var(--safe-b) + var(--gap)); }
.edit-bar { bottom: calc(var(--safe-b) + var(--tabbar-h) + 22px - var(--gap)); }
.r-bottom { bottom: calc(var(--safe-b) + 14px - var(--gap)); }

/* =====================================================================
   Themes — <html data-theme="…">; "custom" gets its colors from JS
   ===================================================================== */
html[data-theme="light"] {
  --bg: #f2f2f7; --surface: #ffffff; --surface-2: #e5e5ea; --surface-3: #d1d1d6;
  --line: rgba(0, 0, 0, 0.08); --fg: 0 0 0;
  --text: #111114; --text-2: #3c3c43; --muted: #6e6e73;
  --teal: #1f8f83; --teal-2: #13786d; --teal-dim: rgba(31, 143, 131, 0.14);
  --read: #2e9e55; --read-dim: #2b8a4b; --read-bg: rgba(46, 158, 85, 0.08);
  --glass: rgba(255, 255, 255, 0.62); --btn-glass: rgba(255, 255, 255, 0.86); --float: rgba(255, 255, 255, 0.97);
  --sheet: #ffffff; --blob: #dedee3; --head-glass: rgba(242, 242, 247, 0.82);
  color-scheme: light;
}
html[data-theme="light"] .tabbar { box-shadow: inset 0 1px 0 rgba(255,255,255,.9), inset 0 0 0 0.5px rgba(0,0,0,.08), 0 10px 30px rgba(0,0,0,.16); }
html[data-theme="light"] .manga-page > .backdrop::before { filter: blur(var(--banner-blur, 8px)) saturate(1.2) brightness(1.05); }
html[data-theme="light"] .manga-page > .backdrop::after { background: linear-gradient(to bottom, rgba(255,255,255,0.1), var(--bg) 96%); }
html[data-theme="light"] .switch::after { box-shadow: 0 2px 6px rgba(0,0,0,.25); }

html[data-theme="gray"] {
  --bg: #1b1b1f; --surface: #2a2a2f; --surface-2: #36363c; --surface-3: #46464d;
  --glass: rgba(62, 62, 68, 0.55); --btn-glass: rgba(52, 52, 58, 0.85); --float: rgba(56, 56, 62, 0.97);
  --sheet: #2a2a2f; --blob: #141417; --head-glass: rgba(27, 27, 31, 0.8);
}
html[data-theme="purple"] {
  --bg: #0f0a1a; --surface: #1c1430; --surface-2: #281d44; --surface-3: #382a5c;
  --line: rgba(200, 170, 255, 0.1); --text-2: #ddd6ee; --muted: #9a90b0;
  --teal: #a78bfa; --teal-2: #c4b5fd; --teal-dim: rgba(167, 139, 250, 0.18);
  --glass: rgba(42, 30, 70, 0.55); --btn-glass: rgba(38, 28, 62, 0.85); --float: rgba(42, 31, 68, 0.97);
  --sheet: #1c1430; --blob: #0a0712; --head-glass: rgba(15, 10, 26, 0.78);
}
html[data-theme="halloween"] {
  --bg: #0d0805; --surface: #1d130b; --surface-2: #2b1c10; --surface-3: #3d2815;
  --line: rgba(255, 160, 80, 0.1); --text-2: #eddccb; --muted: #a08a76;
  --teal: #ff7a1a; --teal-2: #ff9a45; --teal-dim: rgba(255, 122, 26, 0.16);
  --glass: rgba(48, 30, 14, 0.55); --btn-glass: rgba(40, 25, 12, 0.85); --float: rgba(48, 30, 15, 0.97);
  --sheet: #1d130b; --blob: #080503; --head-glass: rgba(13, 8, 5, 0.75);
}
html[data-theme="winter"] {
  --bg: #06101b; --surface: #0f1d2c; --surface-2: #172a3e; --surface-3: #233a52;
  --line: rgba(160, 210, 255, 0.1); --text-2: #d8e6f2; --muted: #8aa0b6;
  --teal: #7cc8ff; --teal-2: #a8dcff; --teal-dim: rgba(124, 200, 255, 0.16);
  --glass: rgba(24, 44, 66, 0.5); --btn-glass: rgba(20, 38, 58, 0.85); --float: rgba(24, 42, 62, 0.97);
  --sheet: #0f1d2c; --blob: #040a12; --head-glass: rgba(6, 16, 27, 0.75);
}
html[data-theme="galaxy"] {
  --bg: #04030b; --surface: #12101f; --surface-2: #1c1930; --surface-3: #2a2545;
  --line: rgba(180, 170, 255, 0.1); --text-2: #dcd9f2; --muted: #9590b8;
  --teal: #8b7bff; --teal-2: #b3a8ff; --teal-dim: rgba(139, 123, 255, 0.16);
  --glass: rgba(30, 26, 58, 0.5); --btn-glass: rgba(26, 22, 50, 0.85); --float: rgba(30, 26, 56, 0.97);
  --sheet: #12101f; --blob: #03020a; --head-glass: rgba(4, 3, 11, 0.72);
}
/* animated backgrounds: a canvas sits behind the pages, and pages turn see-through */
#fx { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none; display: none; }
html.anim-bg #fx { display: block; }
html.anim-bg #app { z-index: 1; }
html.anim-bg .view { background: transparent; }
/* see-through pages can't slide over each other (they'd overlap, and the slide shadow shows as a dark band): crossfade instead */
/* Animated themes: pages are see-through, so they can never be on screen together.
   The old page vanishes in the same frame the new one starts fading in. */
html.anim-bg .view { transition: opacity 0.2s ease-out, visibility 0s; }
html.anim-bg .view.stack-view { box-shadow: none; }
html.anim-bg .view.under { visibility: hidden; opacity: 0; transform: none; filter: none; transition: none; }
html.anim-bg .stack-view.enter { animation: fxIn 0.2s ease-out both; }
html.anim-bg .stack-view.leave { display: none; }
@keyframes fxIn { from { opacity: 0.25; } to { opacity: 1; } }
/* frosted glass over a moving background is re-blurred every frame — that's what made it lag.
   On animated themes the glass is solid-ish instead. */
html.anim-bg *, html.anim-bg *::before, html.anim-bg *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.anim-bg .tabbar { background: color-mix(in srgb, var(--surface) 94%, transparent); }
html.anim-bg .circle-btn { background: color-mix(in srgb, var(--surface-2) 92%, transparent); }
html.anim-bg .list-head, html.anim-bg .chat-head, html.anim-bg .composer, html.anim-bg .attach { background: color-mix(in srgb, var(--bg) 92%, transparent); }
html.anim-bg .popover, html.anim-bg .toast, html.anim-bg .edit-bar button { background: var(--surface-2); }
html.anim-bg .chat { background: color-mix(in srgb, var(--bg) 82%, transparent); }

/* theme picker */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 12px; padding: 6px 16px 18px; }
.theme-chip { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.theme-chip .sw { width: 100%; aspect-ratio: 1 / 1.25; border-radius: 16px; position: relative; overflow: hidden; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgb(var(--fg) / 0.1); }
.theme-chip.on .sw { border-color: var(--teal); }
.theme-chip .sw i { position: absolute; left: 10%; right: 10%; height: 14%; border-radius: 6px; }
.theme-chip .sw i:nth-child(1) { top: 12%; } .theme-chip .sw i:nth-child(2) { top: 32%; right: 35%; } .theme-chip .sw i:nth-child(3) { bottom: 10%; left: 25%; right: 25%; height: 12%; border-radius: 99px; }
.theme-chip .sw .em { position: absolute; right: 8px; top: 6px; font-size: 18px; }
.color-row { display: flex; align-items: center; gap: 14px; padding: 10px 18px; }
.color-row label { flex: 1; font-size: 16px; }
.color-row input[type=color] { width: 52px; height: 36px; border: 0; border-radius: 10px; background: none; padding: 0; }

/* profile background */
.profile-bg { position: absolute; z-index: -1; left: 0; right: 0; top: 0; pointer-events: none; background-size: cover; background-position: center; }
.profile-bg.banner { height: calc(var(--safe-t) + 330px); }
.profile-bg.banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,var(--dim, .25)), var(--bg) 98%); }
.profile-bg.full { position: sticky; top: 0; height: 100vh; margin-bottom: -100vh; }
.profile-bg.full::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,var(--dim, .45)); }
.profile-page { position: relative; isolation: isolate; }
.profile-page.has-full .group, .profile-page.has-full .profile-card { background: color-mix(in srgb, var(--surface) 82%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.vol-row { border-bottom: 0 !important; }
.vol-slider { padding: 0 20px 14px 58px; }
.vol-slider input, .sheet input[type=range] { width: 100%; accent-color: var(--teal); }
.seg-mini { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.seg-mini button { padding: 6px 10px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.seg-mini button.on { background: var(--teal); color: #fff; }

.blur-preview { height: 140px; border-radius: 16px; overflow: hidden; position: relative; background-size: cover; background-position: center; }
.blur-preview::before { content: ''; position: absolute; inset: -30px; background: inherit; background-size: cover; filter: blur(var(--b, 8px)) brightness(0.8); }

/* =====================================================================
   Friends & clubs
   ===================================================================== */
.home-head { position: relative; }
.head-btn { position: absolute; right: 22px; bottom: 26px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); }
.head-btn.hidden { display: none; }
.head-btn svg.i { width: 24px; height: 24px; }
.head-badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.head-badge.hidden { display: none; }

.av { position: relative; flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--surface-3); color: #fff; font-weight: 800; font-family: var(--font-head); box-shadow: 0 0 0 2px var(--c, var(--teal)); }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av svg.i { width: 55%; height: 55%; }

.social { padding-bottom: 20px; }
.social .spinner { margin-top: 40px; }
.code-card { margin: 14px 14px 6px; padding: 16px 18px; border-radius: 18px; background: linear-gradient(135deg, var(--teal-dim), var(--surface)); display: flex; align-items: center; gap: 12px; }
.code-card > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.code-card small { color: var(--muted); font-size: 13px; }
.code-card b { font-family: var(--font-head); font-size: 26px; letter-spacing: 1.5px; color: var(--teal-2); }
.code-card span { color: var(--text-2); font-size: 14px; }
.search-box.small { margin: 0 14px 8px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--surface); }
.search-box.small input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font-size: 17px; outline: none; }
.group.results:empty { display: none; }
.row.person { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.row.person .grow small { display: block; }
.mini { flex: none; height: 32px; padding: 0 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); font-size: 14px; font-weight: 600; }
.mini.yes { background: var(--teal); color: #fff; }
.mini[disabled] { opacity: 0.55; }
.group-label.with-btn { display: flex; align-items: center; justify-content: space-between; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--teal-2); font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0; }
.link-btn svg.i { width: 16px; height: 16px; }
.link-btn.danger { color: var(--red); margin-top: 12px; }
.hint { padding: 4px 22px 14px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.club-ico { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--teal-dim); color: var(--teal-2); }
.text-in { height: 48px; border-radius: 12px; border: 1px solid var(--surface-3); background: var(--surface-2); color: var(--text); font-size: 17px; padding: 0 14px; outline: none; }
.text-in:focus { border-color: var(--teal); }

.member-strip { display: flex; gap: 14px; overflow-x: auto; padding: 16px 16px 6px; scrollbar-width: none; }
.member-strip::-webkit-scrollbar { display: none; }
.member { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; text-decoration: none; color: var(--text-2); font-size: 12px; }
.member span:last-child { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member.invited { opacity: 0.5; }
.member.add .av { background: var(--surface-2); color: var(--teal-2); box-shadow: inset 0 0 0 1.5px var(--surface-3); }

.club-manga { display: flex; gap: 14px; margin: 0 14px 12px; padding: 12px; border-radius: 16px; background: var(--surface); text-decoration: none; color: inherit; }
.club-manga .cover { width: 74px; flex: none; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.club-manga .cover img { width: 100%; height: 100%; object-fit: cover; }
.club-manga .info { flex: 1; min-width: 0; }
.club-manga .t { font-family: var(--font-head); font-weight: 800; font-size: 17px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.club-manga .s { color: var(--muted); font-size: 13px; margin: 3px 0 8px; }
.prog { display: flex; flex-wrap: wrap; gap: 6px; }
.prog .none { color: var(--muted); font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 4px; border-radius: 15px; background: color-mix(in srgb, var(--c) 18%, var(--surface-2)); color: var(--text); font-size: 13px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.chip b { font-weight: 700; }
.chip small { color: var(--text-2); }

.club-strip { margin: 4px 14px 14px; padding: 12px 12px 10px; border-radius: 16px; background: var(--surface); }
.club-strip .lbl { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin: 0 2px 8px; }
.club-strip .lbl svg.i { width: 16px; height: 16px; }
.club-strip .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-marks { display: inline-flex; margin-left: 8px; vertical-align: middle; }
.ch-marks .av { margin-left: -5px; box-shadow: 0 0 0 2px var(--c), 0 0 0 3.5px var(--bg); font-size: 10px; }
.ch-marks .av:first-child { margin-left: 0; }
.social .group-label { margin: 24px 30px 8px; }
.social .group { margin-top: 0; }
.social .group.results { margin-bottom: 8px; }
.club-manga .cover:empty::after { content: '📖'; display: grid; place-items: center; height: 100%; font-size: 26px; opacity: 0.5; }

/* ---------- presence ---------- */
.av-wrap { position: relative; display: inline-flex; flex: none; }
.av-wrap .st-dot { position: absolute; right: 0; bottom: 0; width: 28%; height: 28%; min-width: 10px; min-height: 10px; border-radius: 50%; background: #3ad06b; box-shadow: 0 0 0 2.5px var(--surface); }
.av-wrap.st-idle .st-dot { background: #f4b63f; }
.av-wrap.st-idle .st-dot::after { content: ''; position: absolute; left: -10%; top: -10%; width: 70%; height: 70%; border-radius: 50%; background: var(--surface); }
.av-wrap.st-offline .av { filter: grayscale(0.6) brightness(0.8); }
.row.person.reading .grow small { color: #3ad06b; }
.pstatus { margin-top: 6px; font-size: 14px; color: var(--muted); }
.pstatus.st-online { color: #3ad06b; }
.pstatus.st-idle { color: #f4b63f; }
.msg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; height: 44px; padding: 0 22px; text-decoration: none; }
.st-emoji { width: 24px; text-align: center; font-size: 15px; }
.unread { flex: none; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--red); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.head-btn.online::after { content: ''; position: absolute; left: 2px; bottom: 2px; width: 12px; height: 12px; border-radius: 50%; background: #3ad06b; box-shadow: 0 0 0 2.5px var(--bg); }
.circle-btn.priv.on { color: #f4b63f; }

/* ---------- share sheet ---------- */
.share-preview { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface-2); margin-bottom: 12px; }
.share-preview img, .share-preview .ph { width: 46px; height: 64px; border-radius: 6px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--surface-3); }
.share-preview b { display: block; font-size: 16px; }
.share-preview small { color: var(--muted); }
.share-preview + .text-in { width: 100%; }
.share-other { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.share-other .pill-btn { flex: 1; justify-content: center; font-size: 16px; }

/* ---------- chat ---------- */
.chat { position: fixed; inset: 0; bottom: var(--kb, 0px); z-index: 100; background: var(--bg); display: flex; flex-direction: column; animation: fadeOnly 0.2s both; }
html.anim-bg .chat { background: color-mix(in srgb, var(--bg) 88%, transparent); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: calc(var(--safe-t) + 8px) 12px 10px; background: var(--head-glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-bottom: 0.5px solid var(--line); }
.chat-head .circle-btn { width: 42px; height: 42px; flex: none; }
.chat-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-title b { font-family: var(--font-head); font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-title small { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .st-online + .chat-title small, .chat-head span:has(.st-online) + .chat-title small { color: #3ad06b; }
.chat-list { flex: 1; overflow-y: auto; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.chat-empty { margin: auto; color: var(--muted); font-size: 16px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 100%; }
.msg.mine { align-items: flex-end; }
.msg .who { font-size: 12px; font-weight: 700; margin: 4px 0 2px 38px; }
.mrow { display: flex; align-items: flex-end; gap: 8px; max-width: 82%; }
.msg.mine .mrow { max-width: 82%; }
.bubble { padding: 9px 13px; border-radius: 18px; background: var(--surface-2); color: var(--text); font-size: 16px; line-height: 1.35; white-space: pre-wrap; word-break: break-word; border-bottom-left-radius: 6px; }
.msg.mine .bubble { background: var(--teal); color: #fff; border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
.bubble.big-emoji { background: none !important; font-size: 40px; padding: 0 2px; line-height: 1.1; }
.bubble.pic { padding: 3px; overflow: hidden; }
.chat-img { display: block; max-width: min(260px, 64vw); max-height: 360px; border-radius: 15px; object-fit: cover; background: var(--surface-3); cursor: zoom-in; }
.bubble.share { padding: 4px; width: min(270px, 68vw); }
.bubble.share .cap { padding: 7px 9px 5px; }
.share-card { display: block; text-decoration: none; color: inherit; border-radius: 14px; overflow: hidden; background: rgb(var(--fg) / 0.06); }
.msg.mine .share-card { background: rgba(0, 0, 0, 0.18); color: #fff; }
.page-shot { height: 220px; overflow: hidden; background: #000; }
.page-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-meta { display: flex; align-items: center; gap: 10px; padding: 9px 10px 4px; }
.sc-cover { width: 34px; height: 48px; border-radius: 5px; object-fit: cover; flex: none; }
.sc-meta b { display: block; font-size: 15px; line-height: 1.2; }
.sc-meta small { opacity: 0.75; font-size: 13px; }
.sc-open { display: block; padding: 4px 10px 10px; font-size: 13px; font-weight: 700; color: var(--teal-2); }
.msg.mine .sc-open { color: #fff; }
.msg .when { font-size: 11px; color: var(--muted); margin: 2px 6px 4px 42px; opacity: 0; transition: opacity 0.2s; }
.msg.mine .when { margin-right: 4px; }
.msg:last-child .when, .msg:hover .when { opacity: 1; }
.msg .seen { font-size: 11px; color: var(--muted); margin: 0 4px 2px; }
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px calc(var(--safe-b) + 8px); background: var(--head-glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-top: 0.5px solid var(--line); }
.composer textarea { flex: 1; min-width: 0; resize: none; max-height: 140px; min-height: 42px; padding: 10px 14px; border-radius: 21px; border: 0; background: var(--surface-2); color: var(--text); font: inherit; font-size: 16px; line-height: 1.35; outline: none; }
.cbtn { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); font-size: 22px; }
.cbtn svg.i { width: 24px; height: 24px; }
.cbtn.send { background: var(--teal); color: #fff; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 4px 10px 10px; }
.emoji-grid button { font-size: 24px; height: 40px; border-radius: 10px; }
.emoji-grid button:active { background: rgb(var(--fg) / 0.1); }
.img-viewer { position: fixed; inset: 0; z-index: 400; background: rgba(0, 0, 0, 0.92); display: grid; place-items: center; animation: tabIn 0.2s both; }
.img-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* full-screen pages (reader, chat) stacked on each other: only the top one shows */
.reader.inactive, .chat.inactive { visibility: hidden; pointer-events: none; }
/* chat v2: ticks, info, swipe-for-time, manga picker, attachment */
.msg .when { display: flex; align-items: center; gap: 4px; }
.msg .tick { font-size: 11px; letter-spacing: -2px; color: var(--muted); }
.msg .tick.seen { color: var(--teal-2); }
.msg.mine:not(:last-child) .when { opacity: 0; }
.msg .info { font-size: 12px; color: var(--muted); margin: 0 8px 4px 42px; }
.msg.mine .info { margin-left: 0; }
.mrow { position: relative; }
.side-time { position: absolute; top: 50%; right: -66px; transform: translateY(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; width: 58px; }
.chat-list { overflow-x: hidden; }
.chat-list .msg { transform: translateX(var(--sx, 0px)); transition: transform 0.25s var(--ease-out); }
.chat-list.swiping .msg { transition: none; }
.msg.mine .mrow { margin-right: 0; }
.msg:not(.mine) .side-time { right: auto; left: calc(100% + 8px); }
.attach:empty { display: none; }
.attach { padding: 6px 10px 0; background: var(--head-glass); }
.att-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--teal-dim); }
.att-chip img, .att-chip > span { width: 34px; height: 48px; border-radius: 5px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--surface-3); }
.att-chip div { flex: 1; min-width: 0; }
.att-chip b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-chip small { color: var(--muted); font-size: 12px; }
.att-chip .x { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.pick-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.pick-head { color: var(--muted); font-size: 13px; padding: 4px 4px 2px; }
.pick { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; background: var(--surface-2); text-align: left; color: var(--text); }
.pick img, .pick .ph { width: 40px; height: 56px; border-radius: 6px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--surface-3); }
.pick div { flex: 1; min-width: 0; }
.pick b { display: block; font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick small { color: var(--muted); font-size: 12px; }
.pick .src { flex: none; font-size: 11px; font-weight: 700; padding: 3px 6px; border-radius: 6px; background: var(--teal-dim); color: var(--teal-2); }
.head-online { position: absolute; left: -4px; bottom: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: #3ad06b; color: #04210f; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2.5px var(--bg); }
.head-online.hidden { display: none; }
.act-cover { width: 30px; height: 42px; border-radius: 5px; object-fit: cover; flex: none; }
.side-time { opacity: 0; transition: opacity 0.2s; }
.chat-list.swiping .side-time { opacity: 1; }

/* sheets (share, manga picker…) sit above the keyboard */
.sheet { bottom: calc(var(--kb, 0px) - var(--gap)); max-height: calc(100vh - var(--kb, 0px) - var(--safe-t) - 16px); transition: transform 0.42s var(--ease-out), bottom 0.18s ease-out; }

/* manga page: one title, shown in full */
.detail-title { white-space: normal; overflow: visible; text-overflow: clip; font-size: 30px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; padding-bottom: 18px; }

/* desktop: friends / clubs pages in one centered column */
@media (min-width: 900px) {
  .social { max-width: 680px; margin: 0 auto !important; }
  .social .group, .social .group-label, .social .profile-card { max-width: none; margin-left: 14px; margin-right: 14px; }
  .social .group-label { padding-left: 16px; }
  .social .search-box.small { max-width: none; }
  .chat-list, .composer, .attach { padding-left: max(12px, calc(50% - 380px)); padding-right: max(12px, calc(50% - 380px)); }
  .chat-head { padding-left: max(12px, calc(50% - 400px)); padding-right: max(12px, calc(50% - 400px)); }
}
.reader.under, .chat.under { visibility: hidden; }
.circle-btn.spin svg { animation: spin 0.6s linear infinite; }

/* Friends screen v3: compact status, color-coded sections */
.status-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px 2px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 12px; border-radius: 17px; background: var(--surface); color: var(--text); font-size: 15px; font-weight: 600; }
.status-chip svg.i { width: 16px; height: 16px; color: var(--muted); }
.status-chip span { font-size: 12px; }
.online-n { color: var(--muted); font-size: 14px; }
.sec { --sc: var(--teal); margin-top: 16px; }
.sec-friends { --sc: #3ad06b; }
.sec-messages { --sc: #4aa8ff; }
.sec-clubs { --sc: #ffb23f; }
.sec-req { --sc: #ff5a6e; }
.sec-top { display: flex; align-items: center; justify-content: space-between; margin: 0 16px 8px; }
.sec-head { display: inline-flex; align-items: center; gap: 8px; color: var(--sc); font-family: var(--font-head); font-weight: 700; font-size: 14px; letter-spacing: 0.6px; text-transform: uppercase; padding: 4px 2px; }
.sec-head svg.i { width: 18px; height: 18px; }
.sec-head .sec-chev svg.i { width: 15px; height: 15px; opacity: 0.7; }
.sec .group { margin: 0 14px; border-left: 3px solid var(--sc); background: color-mix(in srgb, var(--sc) 7%, var(--surface)); }
.sec .group.sent { margin-top: 8px; opacity: 0.8; }
.sec .hint { padding-left: 22px; }
.sec-clubs .club-ico, .sec-messages .club-ico { background: color-mix(in srgb, var(--sc) 18%, transparent); color: var(--sc); }
.sec .link-btn { color: var(--sc); }
@media (min-width: 900px) { .social .sec .group { margin-left: 14px; margin-right: 14px; } }
.sheet .code-card b { font-size: 22px; }
.sheet .text-in { width: 100%; box-sizing: border-box; }
.sub-label { margin: 6px 22px 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.sec .group + .sub-label { margin-top: 12px; }
.sec .group.sent { opacity: 1; margin-top: 0; }
.status-row .online-n { flex: 1; }
.pending-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 600; }
.pending-chip svg.i { width: 16px; height: 16px; }
.pending-chip b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-3); color: var(--text); font-size: 12px; display: grid; place-items: center; }
.pending-chip.hot { color: #ff7a8a; }
.pending-chip.hot b { background: var(--red); color: #fff; }
.pending-box { padding: 0 16px 20px; }
.pending-box .sub-label { margin: 8px 6px 6px; }
.pending-box .group { margin: 0; }
.sheet .pending-box { padding: 0; }
.sheet .pending-box.solo { padding: 0 16px 22px; }
/* MangaDex import */
.imp-help { font-size: 14px; line-height: 1.45; color: var(--text-2); background: var(--surface-2); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; }
.imp-help a { color: var(--teal-2); }
.imp-help span { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.imp-label { font-size: 13px; color: var(--muted); margin: 6px 4px 0; }
.imp-err { color: #ff7a8a; font-size: 14px; min-height: 4px; }
.imp-group { margin-bottom: 14px; }
.imp-ghead { display: flex; justify-content: space-between; align-items: center; margin: 6px 4px 8px; }
.imp-ghead small { color: var(--muted); }
.imp-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px; margin-bottom: 6px; border-radius: 12px; background: var(--surface-2); text-align: left; color: var(--text); opacity: 0.55; }
.imp-row.on, .imp-row.have { opacity: 1; }
.imp-row img, .imp-row .ph { width: 38px; height: 54px; border-radius: 6px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--surface-3); }
.imp-row .t { flex: 1; min-width: 0; font-size: 15px; line-height: 1.25; }
.imp-row .ck { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; border: 1.5px solid var(--surface-3); color: transparent; }
.imp-row .ck svg.i { width: 16px; height: 16px; }
.imp-row.on .ck { background: var(--teal); border-color: var(--teal); color: #fff; }
.imp-row.have .ck { border: 0; color: var(--red); }
.imp-row.have .ck svg.i { fill: currentColor; }
.imp-foot { position: sticky; bottom: 0; padding: 10px 0 4px; background: var(--sheet); }
.imp-foot .primary-btn { width: 100%; }

/* ---------- library lists (Favorites tabs + list button on manga pages) ---------- */
.lib-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.lib-tabs::-webkit-scrollbar { display: none; }
.lib-tab { flex: none; display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 18px; background: var(--surface-2); color: var(--text-2); font-size: 15px; white-space: nowrap; transition: background 0.2s, color 0.2s; }
.lib-tab i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.lib-tab b { font-weight: 600; font-size: 13px; color: var(--muted); }
.lib-tab.on { background: var(--text); color: var(--bg); }
.lib-tab.on b { color: var(--bg); opacity: 0.7; }
.list-dot { position: absolute; top: 7px; left: 7px; width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55); }
.list-row { padding: 2px 16px 6px; display: flex; }
.list-pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 19px; background: var(--surface-2); color: var(--text); font-size: 15.5px; }
.list-pill i { width: 9px; height: 9px; border-radius: 50%; }
.list-pill svg.i { width: 18px; height: 18px; opacity: 0.75; }
.list-pill.add { color: var(--teal); }
.edit-bar .move:disabled, .edit-bar .del:disabled { opacity: 0.5; }
html.anim-bg .lib-tab:not(.on), html.anim-bg .list-pill { background: color-mix(in srgb, var(--surface-2) 92%, transparent); }
.popover .opt.tinted { color: var(--opt-c); font-weight: 600; }
.popover .opt.tinted svg.i { color: var(--opt-c); stroke: var(--opt-c); }
.cover img.instant { transition: none; }

/* ---------- unfolded Fold / tablet (phone app): the tab bar becomes a dock on the right ---------- */
html.side-dock { --dock-w: 84px; --dock-r: calc(max(env(safe-area-inset-right, 0px), var(--native-safe-r, 0px)) + 12px); }
html.side-dock .tabbar {
  left: auto; bottom: auto; top: 50%; right: var(--dock-r);
  transform: translateY(-50%);
  width: var(--dock-w); height: min(calc(100% - 60px), 480px); border-radius: 42px;
}
html.side-dock .tabbar.away { transform: translate(160%, -50%); }
html.side-dock .tabbar .items { top: 6px; bottom: 6px; left: 0; right: 0; flex-direction: column; }
html.side-dock .tabbar .blob, html.side-dock .tabbar .lens { left: 6px; width: calc(100% - 12px); border-radius: 36px; }
html.side-dock .tabbar .drop { top: auto; left: 50%; }
html.side-dock .tab { flex-direction: column; }
html.side-dock .view { padding-bottom: calc(var(--safe-b) + 30px); padding-right: calc(var(--dock-w) + var(--dock-r) + 8px); }
html.side-dock .edit-bar { bottom: calc(var(--safe-b) + 22px); }

/* ---------- profile top (gear) + settings ---------- */
.profile-top { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--safe-t, 0px) + 14px) 16px 10px; min-height: 52px; }
.profile-top .large-title { padding: 0 !important; margin: 0; }
.gear-btn svg.i { transition: transform 0.6s var(--ease-spring); }
.gear-btn:active svg.i { transform: rotate(90deg); }
.decor-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--surface-2); color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.decor-btn svg.i { width: 15px; height: 15px; color: #f4b63f; }
.cat-list .row.cat { gap: 14px; }
.cat-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--cc) 20%, transparent); color: var(--cc); }
.cat-ico svg.i { width: 20px; height: 20px; margin: 0 !important; }
.update-group { margin-top: 26px; }
.update-row.busy svg.i:first-child { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scope-box { padding: 4px 16px 14px; }
.scope-seg { display: flex; gap: 6px; }
.scope-seg button { flex: 1; height: 34px; border-radius: 17px; background: var(--surface-2); color: var(--text-2); font-size: 13px; font-weight: 600; }
.scope-seg button.on { background: var(--teal); color: #041a17; }
.scope-note { margin-top: 8px; color: var(--muted); font-size: 12.5px; text-align: center; }
.hint-small { color: var(--muted); font-size: 12.5px; padding: 8px 30px; line-height: 1.5; }

/* ---------- avatar decorations ---------- */
.decor { position: relative; display: inline-grid; place-items: center; flex: none; border-radius: 50%; isolation: isolate; }
.decor > .av, .decor > .avatar-big { box-shadow: none; }
.decor::before {
  content: ''; position: absolute; z-index: 1; pointer-events: none; border-radius: 50%;
  inset: calc(var(--ds) * -0.075); padding: calc(var(--ds) * 0.06 + 1px);
  background: var(--dg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  filter: drop-shadow(0 0 calc(var(--ds) * 0.06) var(--glow));
}
.decor.spin::before { animation: decSpin 5s linear infinite; }
@keyframes decSpin { to { transform: rotate(360deg); } }
.decor.stars::after { content: '✦  ·  ✧'; position: absolute; z-index: 2; left: -8%; bottom: -10%; color: #fff; font-size: calc(var(--ds) * 0.16); letter-spacing: 1px; text-shadow: 0 0 6px #b483ff; pointer-events: none; }
.decor .dec-em { position: absolute; z-index: 2; right: -14%; top: -16%; font-size: calc(var(--ds) * 0.3); line-height: 1; transform: rotate(14deg); filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); pointer-events: none; }
.decor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 14px 8px; padding: 10px 16px 12px; }
.decor-chip { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 4px 8px; border-radius: 16px; font-size: 13px; color: var(--text-2); }
.decor-chip.on { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--text); outline: 2px solid var(--teal); }
.decor-custom { margin: 0 16px 8px; }
.decor-custom:empty { display: none; }
@media (prefers-reduced-motion: reduce) { .decor.spin::before { animation: none; } }

/* ---------- more themes ---------- */
html[data-theme="nebula"] {
  --bg: #03020a; --surface: #120e22; --surface-2: #1a1530; --surface-3: #2a2148;
  --line: rgba(255, 170, 230, 0.1); --text-2: #eadcf2; --muted: #a294b8;
  --teal: #ff8ad8; --teal-2: #ffb3e6; --teal-dim: rgba(255, 138, 216, 0.16);
  --glass: rgba(34, 24, 60, 0.5); --btn-glass: rgba(28, 20, 50, 0.85); --float: rgba(32, 24, 56, 0.97);
  --sheet: #120e22; --blob: #020108; --head-glass: rgba(3, 2, 10, 0.72);
}
html[data-theme="aurora"] {
  --bg: #020c10; --surface: #0b1c21; --surface-2: #11262c; --surface-3: #1b363e;
  --line: rgba(120, 255, 200, 0.1); --text-2: #d6f2ea; --muted: #86a8a0;
  --teal: #4ff0b0; --teal-2: #8af7cd; --teal-dim: rgba(79, 240, 176, 0.16);
  --glass: rgba(18, 44, 50, 0.5); --btn-glass: rgba(14, 36, 42, 0.85); --float: rgba(18, 42, 48, 0.97);
  --sheet: #0b1c21; --blob: #01080b; --head-glass: rgba(2, 12, 16, 0.72);
}
html[data-theme="sakura"] {
  --bg: #140a12; --surface: #22131e; --surface-2: #2e1a28; --surface-3: #422538;
  --line: rgba(255, 170, 205, 0.1); --text-2: #f2dde8; --muted: #b394a6;
  --teal: #ff8fb8; --teal-2: #ffb6d0; --teal-dim: rgba(255, 143, 184, 0.16);
  --glass: rgba(56, 30, 48, 0.5); --btn-glass: rgba(46, 25, 40, 0.85); --float: rgba(52, 29, 45, 0.97);
  --sheet: #22131e; --blob: #0c050a; --head-glass: rgba(20, 10, 18, 0.74);
}
html[data-theme="tokyo"] {
  --bg: #07060f; --surface: #141224; --surface-2: #1b1830; --surface-3: #2a2548;
  --line: rgba(255, 80, 170, 0.12); --text-2: #e4def5; --muted: #9a92b8;
  --teal: #ff4fa3; --teal-2: #ff86c0; --teal-dim: rgba(255, 79, 163, 0.16);
  --glass: rgba(30, 26, 56, 0.5); --btn-glass: rgba(26, 22, 48, 0.85); --float: rgba(30, 26, 54, 0.97);
  --sheet: #141224; --blob: #040309; --head-glass: rgba(7, 6, 15, 0.72);
}
html[data-theme="ocean"] {
  --bg: #020d17; --surface: #0a1c2b; --surface-2: #0f2638; --surface-3: #18364e;
  --line: rgba(80, 200, 255, 0.1); --text-2: #d4e8f4; --muted: #84a2b8;
  --teal: #35c6ff; --teal-2: #7ad8ff; --teal-dim: rgba(53, 198, 255, 0.16);
  --glass: rgba(16, 42, 62, 0.5); --btn-glass: rgba(12, 34, 52, 0.85); --float: rgba(16, 40, 58, 0.97);
  --sheet: #0a1c2b; --blob: #010810; --head-glass: rgba(2, 13, 23, 0.72);
}
html[data-theme="midnight"] {
  --bg: #070b18; --surface: #111830; --surface-2: #18213a; --surface-3: #243052;
  --line: rgba(120, 160, 255, 0.1); --text-2: #d8def2; --muted: #8b95b4;
  --teal: #6c9cff; --teal-2: #9dbcff; --teal-dim: rgba(108, 156, 255, 0.16);
  --glass: rgba(28, 38, 70, 0.55); --btn-glass: rgba(22, 30, 58, 0.85); --float: rgba(26, 36, 66, 0.97);
  --sheet: #111830; --blob: #04060e; --head-glass: rgba(7, 11, 24, 0.78);
}
html[data-theme="matcha"] {
  --bg: #0a120c; --surface: #131f16; --surface-2: #1b2a1e; --surface-3: #283c2c;
  --line: rgba(150, 220, 140, 0.1); --text-2: #dcebd8; --muted: #8fa38b;
  --teal: #8fd18a; --teal-2: #b4e3b0; --teal-dim: rgba(143, 209, 138, 0.16);
  --glass: rgba(30, 48, 34, 0.55); --btn-glass: rgba(24, 40, 28, 0.85); --float: rgba(28, 44, 32, 0.97);
  --sheet: #131f16; --blob: #050a06; --head-glass: rgba(10, 18, 12, 0.78);
}

/* ---------- search without a title / genre search ---------- */
.search-top { height: calc(var(--safe-t) + 22px); }
.genre-search { display: flex; align-items: center; gap: 10px; margin: -4px 14px 14px; height: 46px; padding: 0 14px; border-radius: 14px; background: var(--surface); }
.genre-search .gs-ico svg.i { width: 20px; height: 20px; color: var(--muted); }
.genre-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 16px; }
.genre-tile small { display: block; margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--muted); }
.chip.all-chip.on { background: linear-gradient(135deg, var(--teal), color-mix(in srgb, var(--teal) 55%, #b483ff)); }
.genre-tile { align-content: center; }

/* Friends & Messages: no colored edge for the whole list — each person gets green only while online */
.sec-friends .group, .sec-messages .group { border-left: 0; background: var(--surface); }
.sec .group .row.person { box-shadow: inset 3px 0 0 transparent; transition: box-shadow 0.3s, background 0.3s; }
.sec .group .row.ps-online { box-shadow: inset 3px 0 0 #3ad06b; background: color-mix(in srgb, #3ad06b 7%, transparent); }
.sec .group .row.ps-idle { box-shadow: inset 3px 0 0 #f4b63f; }
.fav-refresh { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); }
.fav-refresh svg.i { width: 20px; height: 20px; }
.fav-refresh.spin svg.i { animation: spin 0.9s linear infinite; }

/* manga page title: never spills under the cover — smaller for long names, tap to show it all */
.detail-title { padding-bottom: 0 !important; margin-bottom: 18px; line-height: 1.16; overflow-wrap: anywhere; cursor: pointer; }
.detail-title.t-m { font-size: 27px; }
.detail-title.t-l { font-size: 23px; }
.detail-title.t-xl { font-size: 20px; -webkit-line-clamp: 4; }
.detail-title.open { -webkit-line-clamp: unset; display: block; overflow: visible; }
.fav-gap { height: 14px; }
/* keyboard open on iPhone: keep the chat (and its header with name + picture) inside the visible area */
.chat { top: var(--vvt, 0px); }
.chat-head { flex: none; }

/* ---------- chat: mixed Persian/English text, reactions, official chat ---------- */
.bubble, .bubble .cap, .chat .composer textarea { unicode-bidi: plaintext; text-align: start; }
.chat-row small, .chat-title small { unicode-bidi: plaintext; }
.msg { position: relative; }
.reacts { display: flex; flex-wrap: wrap; gap: 4px; margin: -4px 0 2px 36px; position: relative; z-index: 1; }
.msg.mine .reacts { margin: -4px 4px 2px 0; justify-content: flex-end; }
.react { display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--surface-2); border: 1.5px solid var(--bg); font-size: 15px; line-height: 1; }
.react small { font-size: 12px; color: var(--text-2); font-weight: 600; }
.react.mine { background: color-mix(in srgb, var(--teal) 28%, var(--surface-2)); }
.react-bar { display: flex; align-items: center; gap: 2px; padding: 5px 6px; border-radius: 24px; background: var(--float); box-shadow: 0 8px 26px rgba(0,0,0,.45); margin-bottom: 6px; animation: popIn 0.25s var(--ease-spring) both; transform-origin: bottom left; z-index: 3; }
.msg.mine .react-bar { transform-origin: bottom right; align-self: flex-end; }
.react-bar button { width: 40px; height: 40px; border-radius: 50%; font-size: 24px; display: grid; place-items: center; transition: transform 0.15s; }
.react-bar button:active { transform: scale(1.3); }
.react-bar button.on { background: color-mix(in srgb, var(--teal) 30%, transparent); }
.react-bar .plus svg.i { width: 22px; height: 22px; color: var(--text-2); }
.react-in { width: 120px; height: 40px; border: 0; outline: 0; border-radius: 20px; padding: 0 14px; background: var(--surface-2); color: var(--text); font-size: 22px; text-align: center; }
.team-av { flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, var(--teal), #6b3df5); color: #fff; box-shadow: 0 0 0 2px color-mix(in srgb, var(--teal) 40%, transparent); }
.team-av svg.i { width: 56%; height: 56%; }
.chat-row.official { background: color-mix(in srgb, var(--teal) 9%, transparent); }
.ro-note { flex: none; text-align: center; color: var(--muted); font-size: 13px; padding: 12px 16px calc(var(--safe-b) + 12px); border-top: 0.5px solid var(--line); }
.composer.hidden { display: none; }
.club-ico { overflow: hidden; }
.club-ico img { width: 100%; height: 100%; object-fit: cover; }
.chat-head .club-ico, .chat-head .team-av { width: 38px; height: 38px; border-radius: 50%; }
.chat-row .club-ico { border-radius: 50%; }
.when-sm { color: var(--muted); font-size: 12px; margin-left: 6px; white-space: nowrap; }

/* Messages screen: friends behind the 👥 button */
.friends-btn { position: relative; }
.fb-on { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #3ad06b; color: #04210f; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.fb-on.hidden { display: none; }
button.online-n { background: none; color: var(--muted); font-size: 14px; text-align: left; padding: 0; }
.friends-box { padding: 0 0 24px; }
.friends-box .group { margin: 0 14px 14px; }
.sec-friends-list .row.person { box-shadow: inset 3px 0 0 transparent; }
.sec-friends-list .row.ps-online { box-shadow: inset 3px 0 0 #3ad06b; background: color-mix(in srgb, #3ad06b 7%, transparent); }
.sec-friends-list .row.ps-idle { box-shadow: inset 3px 0 0 #f4b63f; }

/* club page card + edit */
.club-card { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 14px 4px; padding: 20px 16px; border-radius: 22px; background: var(--surface); }
.club-card .club-pic { width: 84px; height: 84px; border-radius: 26px; cursor: pointer; }
.club-card .club-pic svg.i { width: 40px; height: 40px; }
.club-name { font-family: var(--font-head); font-weight: 800; font-size: 22px; text-align: center; }
.club-actions { display: flex; gap: 10px; }
.pill-btn.primary { background: var(--teal); color: #041a17; }
.club-edit { display: grid; gap: 14px; padding: 6px 18px 26px; justify-items: center; }
.club-edit .club-ico { border-radius: 28px; }
.club-edit .club-ico svg.i { width: 44px; height: 44px; }
.club-edit-btns { display: flex; gap: 10px; }
.club-edit .text-in, .club-edit .primary-btn { width: 100%; }
/* "Online · Reading One Piece Ch. 12" in green (idle in amber) */
.row.person.ps-online small { color: #3ad06b; }
.row.person.ps-idle small { color: #f4b63f; }

/* ---------- Admin Console ---------- */
.admin-tabs { display: flex; gap: 8px; margin: 8px 14px 4px; padding: 4px; border-radius: 16px; background: var(--surface); }
.admin-tabs button { flex: 1; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--text-2); font-weight: 600; font-size: 15px; }
.admin-tabs button svg.i { width: 19px; height: 19px; }
.admin-tabs button.on { background: var(--teal); color: #041a17; }
.admin-box { margin: 0 14px; padding: 14px; border-radius: 18px; background: var(--surface); display: grid; gap: 12px; }
.admin-box + .admin-box { margin-top: 12px; }
.admin-target { justify-content: stretch; }
.admin-target button { flex: 1; height: 36px; font-weight: 600; }
.admin-who { display: flex; gap: 8px; }
.admin-who .text-in { flex: 1; }
.admin-text { min-height: 120px; resize: vertical; font-family: inherit; line-height: 1.4; padding-top: 10px; }
.admin-add { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-attach { display: grid; gap: 8px; }
.admin-attach:empty { display: none; }
.att-img { position: relative; border-radius: 14px; overflow: hidden; max-height: 240px; }
.att-img img { width: 100%; max-height: 240px; object-fit: cover; display: block; }
.att-img .x, .admin-attach .att-chip .x { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.admin-attach .att-chip { position: relative; }
.admin-preview { border-radius: 16px; background: var(--surface-2); padding: 12px; display: grid; gap: 10px; }
.ap-head { display: flex; align-items: center; gap: 10px; }
.ap-head small { display: block; color: var(--muted); font-size: 12px; }
.ap-img { width: 100%; max-height: 200px; object-fit: cover; border-radius: 10px; }
.ap-text { white-space: pre-wrap; unicode-bidi: plaintext; color: var(--text-2); font-size: 15px; }
.admin-search { grid-template-columns: 1fr auto; align-items: center; }
.admin-count { color: var(--muted); font-size: 13px; padding: 12px 22px 8px; }
.admin-users { margin: 0 14px 30px; }
.admin-user { text-align: left; }
.au-name { font-style: normal; color: var(--muted); font-size: 13px; }
.au-stats { opacity: 0.75; }
.admin-box .primary-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.admin-box .primary-btn svg.i { width: 20px; height: 20px; }
.admin-box .pill-btn { background: var(--surface-2); }

/* ---------- performance: long lists only draw what's on screen ---------- */
.grid > .card { content-visibility: auto; contain-intrinsic-size: auto 250px; }
.ch-row { content-visibility: auto; contain-intrinsic-size: auto 66px; }
.admin-users .row, .sec .group .row { content-visibility: auto; contain-intrinsic-size: auto 64px; }
#fx { contain: strict; }
/* screens you're not looking at are skipped entirely by the browser (their scroll spot is kept) */
.view.inactive { content-visibility: hidden; }
.email-why { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 4px 6px 10px; }
.email-why b { font-family: var(--font-head); font-size: 20px; }
.email-why p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.ew-ico { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--teal) 20%, transparent); color: var(--teal); }
.ew-ico svg.i { width: 26px; height: 26px; }

/* ---------- Persian (right-to-left) ---------- */
html[dir="rtl"] body { font-family: var(--font-ui), Vazirmatn, Tahoma, "Segoe UI", sans-serif; }
html[dir="rtl"] .head-btn { right: auto; left: 22px; }
/* arrows point the other way */
html[dir="rtl"] .row .val svg.i:last-child, html[dir="rtl"] .row > svg.i:last-child,
html[dir="rtl"] .list-head > .circle-btn:first-child svg.i, html[dir="rtl"] .chat-head > .circle-btn:first-child svg.i,
html[dir="rtl"] .detail-top > .circle-btn:first-child svg.i { transform: scaleX(-1); }
html[dir="rtl"] .group-label { text-align: right; }
html[dir="rtl"] .large-title, html[dir="rtl"] .detail-title { letter-spacing: 0; }
/* manga names, chat and people's names keep their own direction */
html[dir="rtl"] .card .t, html[dir="rtl"] .detail-title, html[dir="rtl"] .bubble { unicode-bidi: plaintext; }

/* ---------- the bell on Home + notifications ---------- */
.head-btn.bell-btn { right: 76px; }
html[dir="rtl"] .head-btn.bell-btn { right: auto; left: 76px; }
.head-btn.hidden { display: none; }
.notes-list { margin: 0 14px 30px; }
.row.note { align-items: center; gap: 12px; }
.row.note.unseen { background: color-mix(in srgb, var(--teal) 9%, transparent); }
.row.note .grow > span { display: block; font-weight: 600; }
.row.note small { display: block; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.note-time { color: var(--teal-2) !important; font-size: 12px !important; margin-top: 2px; }
.note-ico { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.note-ico.like { color: #ff5a6e; } .note-ico.like svg.i { fill: #ff5a6e; }
.note-ico.reply { color: #4aa8ff; }
.note-cover { width: 42px; height: 58px; object-fit: cover; border-radius: 6px; flex: none; }

/* ---------- comments ---------- */
.comments { margin-top: 10px; padding-bottom: 20px; }
.comments .h2 .count { color: var(--muted); font-weight: 500; font-size: 17px; }
.composer-c { margin: 0 14px 12px; padding: 10px 12px; border-radius: 18px; background: var(--surface); display: grid; gap: 8px; }
.composer-c.is-reply { margin: 8px 0 4px 44px; background: var(--surface-2); }
.c-compose-top { display: flex; }
.c-who { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 4px; border-radius: 16px; background: var(--surface-2); font-size: 13.5px; font-weight: 600; color: var(--text); }
.composer-c.is-reply .c-who { background: var(--surface-3); }
.c-who small { color: var(--teal-2); font-weight: 500; font-size: 12px; }
.c-compose { display: flex; align-items: flex-end; gap: 6px; }
.c-compose textarea { flex: 1; min-width: 0; min-height: 38px; max-height: 160px; resize: none; border: 0; outline: 0; border-radius: 19px; padding: 9px 14px; background: var(--bg); color: var(--text); font: inherit; font-size: 15.5px; line-height: 1.35; unicode-bidi: plaintext; }
.c-tool { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.c-tool svg.i { width: 22px; height: 22px; }
.c-tool.gif { font-weight: 800; font-size: 12px; letter-spacing: 0.5px; border: 1.5px solid currentColor; width: 34px; height: 26px; border-radius: 7px; margin-bottom: 6px; }
.c-post { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: #041a17; }
.c-post svg.i { width: 18px; height: 18px; }
.c-post:disabled { opacity: 0.5; }
.c-att:empty { display: none; }
.c-att-img { position: relative; display: inline-block; }
.c-att-img img { max-width: 160px; max-height: 160px; border-radius: 12px; display: block; }
.c-att-img .x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; display: grid; place-items: center; }
.c-att-img .x svg.i { width: 15px; height: 15px; }
.c-list { padding: 0 14px; display: grid; gap: 4px; }
.c-item { padding: 8px 0; }
.c-item.flash { animation: cFlash 1.8s ease-out; border-radius: 14px; }
@keyframes cFlash { 0%, 40% { background: color-mix(in srgb, var(--teal) 18%, transparent); } 100% { background: transparent; } }
.c-row { display: flex; gap: 10px; align-items: flex-start; }
.c-main { flex: 1; min-width: 0; }
.c-name { font-weight: 700; font-size: 14px; color: var(--text); }
.c-text { margin-top: 2px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; unicode-bidi: plaintext; color: var(--text-2); }
.c-img { display: block; margin-top: 6px; max-width: min(260px, 100%); max-height: 320px; border-radius: 12px; object-fit: cover; background: var(--surface-2); cursor: zoom-in; }
.c-deleted { color: var(--muted); font-size: 14px; }
.c-acts { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.c-time { color: var(--muted); font-size: 12.5px; }
.c-act { color: var(--muted); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.c-like svg.i { width: 16px; height: 16px; }
.c-like.on { color: #ff5a6e; }
.c-like.on svg.i { fill: #ff5a6e; }
.c-del { color: #ff6b74; }
.c-replies-btn { margin-top: 6px; color: var(--teal-2); font-size: 13px; font-weight: 600; }
.c-replies-btn.hidden { display: none; }
.c-replies { margin-left: 44px; }
html[dir="rtl"] .c-replies, html[dir="rtl"] .composer-c.is-reply { margin-left: 0; margin-right: 44px; }
.c-item.reply { padding: 6px 0; }
.anon-av { flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #3a3a44, #22222a); color: #c9c9d4; font-weight: 800; font-size: 15px; }
.c-more.hidden { display: none; }
.c-more { margin: 8px 14px 0; width: calc(100% - 28px); }
.gif-grid { columns: 2; column-gap: 8px; margin-top: 12px; min-height: 120px; }
.gif-grid .gif { display: block; width: 100%; margin-bottom: 8px; border-radius: 10px; overflow: hidden; background: var(--surface-2); break-inside: avoid; }
.gif-grid .gif img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gif-grid .hint, .gif-grid .spinner { column-span: all; }
.gif-credit { color: var(--muted); font-size: 11px; text-align: center; margin-top: 6px; }
/* emoji picker */
.emoji-tabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 12px 8px; scrollbar-width: none; }
.emoji-tabs::-webkit-scrollbar { display: none; }
.emoji-tabs button { flex: none; width: 40px; height: 36px; border-radius: 10px; font-size: 20px; }
.emoji-tabs button:active { background: var(--surface-2); }
.emoji-body { max-height: 52vh; overflow-y: auto; padding: 0 10px 24px; overscroll-behavior: contain; }
.emoji-cat { color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 10px 6px 6px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
.emoji-grid button { height: 44px; font-size: 27px; border-radius: 10px; line-height: 1; }
.emoji-grid button:active { background: var(--surface-2); transform: scale(1.15); }

/* ---------- voice messages + typing ---------- */
.composer .cbtn.hidden { display: none; }
.cbtn.mic { color: var(--teal-2); }
.bubble.voice { padding: 8px 12px 8px 8px; min-width: 210px; }
.voice-msg { display: flex; align-items: center; gap: 10px; }
.vplay { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--teal); color: #041a17; }
.msg.mine .vplay { background: #fff; color: #0b2b27; }
.vplay svg.i { width: 18px; height: 18px; }
.vmid { flex: 1; min-width: 0; display: grid; gap: 3px; }
.vwave { height: 28px; display: flex; align-items: center; gap: 2px; cursor: pointer; direction: ltr; }
.vwave i { flex: 1; min-width: 2px; max-width: 4px; border-radius: 2px; background: currentColor; opacity: 0.35; transition: opacity 0.15s; }
.vwave i.on { opacity: 1; }
.vmeta { display: flex; align-items: center; gap: 8px; }
.vspeed { border: 0; padding: 1px 7px; border-radius: 8px; font-size: 11.5px; font-weight: 700; background: rgb(var(--fg) / 0.15); color: inherit; }
.vtime { font-size: 12px; font-variant-numeric: tabular-nums; opacity: 0.85; }
.rec-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 10px calc(var(--safe-b) + 8px); border-top: 0.5px solid var(--line); background: var(--bg); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff3b4a; animation: recPulse 1s ease-in-out infinite; }
@keyframes recPulse { 50% { opacity: 0.25; transform: scale(0.8); } }
.rec-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.rec-hint { flex: 1; color: var(--muted); font-size: 14px; }
.composer.hidden { display: none; }
.typing { flex: none; display: flex; align-items: center; gap: 8px; padding: 2px 16px 6px; color: var(--muted); font-size: 13px; }
.typing.hidden { display: none; }
.typing .dots { display: inline-flex; gap: 3px; }
.typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--teal-2); animation: tdot 1.2s infinite ease-in-out; }
.typing .dots i:nth-child(2) { animation-delay: 0.15s; } .typing .dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes tdot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }
.chat-title small.is-typing { color: var(--teal-2) !important; }

.popover { max-height: min(78vh, 640px); overflow-y: auto; overscroll-behavior: contain; }
.chapter-end { box-sizing: border-box; max-width: 100%; }
.chapter-end .r-comments { box-sizing: border-box; width: 100%; min-width: 0; max-width: 720px; margin: 22px auto 0; text-align: start; padding: 0 0 calc(var(--safe-b, 0px) + 40px); font-size: 16px; }
.r-comments .comments, .r-comments .composer-c, .r-comments .c-compose { box-sizing: border-box; max-width: 100%; min-width: 0; }
.r-comments .comments .h2 { padding-left: 0; padding-right: 0; font-size: 22px; }
.r-comments .c-list { padding: 0; }
.scroller.paged .chapter-end { overflow-y: auto; }

/* ---------- voice message playing in the background (bar at the top, like Telegram) ---------- */
html.vp-on { --safe-t: calc(max(env(safe-area-inset-top, 0px), var(--native-safe-t, 0px)) + 46px); }
.vp-bar { position: fixed; z-index: 150; left: 0; right: 0; top: max(env(safe-area-inset-top, 0px), var(--native-safe-t, 0px)); height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 8px 0 10px; background: var(--head-glass, rgba(20,20,22,.9)); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-bottom: 0.5px solid var(--line); transform: translateY(-120%); transition: transform 0.22s; }
.vp-bar.show { transform: none; }
.vpb-play { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--teal); color: #041a17; }
.vpb-play .i { width: 16px; height: 16px; }
.vpb-info { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); text-align: start; display: flex; flex-direction: column; line-height: 1.2; padding: 0; }
.vpb-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.vpb-info small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.vpb-speed { flex: none; border: 0; border-radius: 9px; padding: 4px 9px; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--text); min-width: 44px; }
.vpb-x { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; background: none; color: var(--text-2); display: grid; place-items: center; }
.vpb-x .i { width: 18px; height: 18px; }
.vpb-line { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--teal); transition: width 0.25s linear; }
.r-comments .composer-c { margin: 0 0 12px; }
.c-compose textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- help & feedback ---------- */
.fb-note { font-size: 13px; line-height: 1.5; color: var(--muted); padding: 2px 4px 12px; }
.fb-kinds { margin-bottom: 10px; }
.fb-text { width: 100%; box-sizing: border-box; min-height: 110px; resize: vertical; border: 0; border-radius: 14px; padding: 12px 14px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; line-height: 1.45; }
.fb-label { font-size: 12.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin: 14px 4px 6px; }
.fb-pics { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-pic { position: relative; width: 82px; height: 82px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.fb-pic img { width: 100%; height: 100%; object-fit: cover; }
.fb-pic button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0,0,0,.65); color: #fff; }
.fb-pic button .i { width: 14px; height: 14px; }
.fb-add { display: inline-flex; align-items: center; gap: 8px; border: 1.5px dashed var(--line-2, rgba(255,255,255,.18)); background: none; color: var(--text-2); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.fb-add .i { width: 20px; height: 20px; }
.fb-voice { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.fb-voice audio { flex: 1; min-width: 0; height: 40px; }
.fb-recdot { width: 12px; height: 12px; border-radius: 50%; background: #ff3b4e; animation: tdot 1s infinite; }
.fb-rectime { font-variant-numeric: tabular-nums; font-weight: 600; flex: 1; }
.fb-logrow { margin-top: 14px; }
.fb-send { width: 100%; justify-content: center; margin: 14px 0 6px; display: flex; align-items: center; gap: 8px; }
.admin-tabs button { position: relative; }
.fb-badge { position: absolute; top: 2px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff3b4e; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.fb-filter { margin: 4px 0 12px; }
.fb-list { display: grid; gap: 12px; padding-bottom: 30px; }
.fb-card { background: var(--surface); border-radius: 16px; padding: 12px 14px; display: grid; gap: 10px; border: 1px solid transparent; }
.fb-card.new { border-color: var(--teal); }
.fb-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fb-who { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: var(--text); text-align: start; padding: 0; min-width: 0; }
.fb-who span { display: flex; flex-direction: column; min-width: 0; }
.fb-who small { color: var(--muted); font-size: 12px; }
.fb-kind { flex: none; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 10px; background: var(--surface-2); }
.fb-kind.k-bug { background: rgba(255,90,100,.18); color: #ff8a92; }
.fb-kind.k-idea { background: rgba(244,182,63,.18); color: #f4c46a; }
.fb-kind.k-feedback { background: rgba(74,168,255,.18); color: #8cc6ff; }
.fb-body { white-space: pre-wrap; line-height: 1.5; font-size: 15px; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.fb-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-thumbs img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; display: block; }
.fb-audio { width: 100%; height: 40px; }
.fb-meta { font-size: 12px; color: var(--muted); }
.fb-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-acts .ghost-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; font-size: 13px; text-decoration: none; width: auto; flex: 0 0 auto; margin: 0; height: auto; min-height: 34px; }
.fb-acts .ghost-btn .i { width: 16px; height: 16px; }
.fb-acts .ghost-btn.danger { color: #ff7a82; }
.fb-log { white-space: pre-wrap; word-break: break-all; font: 11.5px/1.45 ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: 12px; border-radius: 12px; max-height: 70vh; overflow: auto; margin: 0; }
.admin-page .fb-filter, .admin-page .fb-list { margin-left: 14px; margin-right: 14px; }
.fb-kinds { justify-content: flex-start; }

/* ---------- scores ---------- */
.stars { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.stars .st-row { position: relative; display: inline-block; line-height: 1; letter-spacing: 1px; font-size: 16px; }
.stars .st-bg { color: rgb(var(--fg) / 0.18); }
.stars .st-fg { position: absolute; left: 0; top: 0; overflow: hidden; white-space: nowrap; color: #ffc53d; }
.stars b { font-size: 14px; font-weight: 700; color: var(--text); }
.stars.sm .st-row { font-size: 11.5px; letter-spacing: 0.5px; }
.stars.sm b { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.card-stars { min-height: 16px; margin-top: 2px; }
.card-stars.empty { min-height: 0; }
.rate-wrap { margin: 6px 0 4px; }
.rate-box { margin: 0 14px; background: var(--surface); border-radius: 18px; padding: 14px; display: grid; gap: 12px; }
.rate-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rate-col { background: var(--surface-2); border-radius: 14px; padding: 12px; display: grid; gap: 4px; justify-items: start; min-width: 0; }
.rate-col.site .st-fg { color: #8cc6ff; }
.rate-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rate-big { font-size: 30px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.rate-big small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.rate-big.none { color: var(--muted); }
.rate-col .stars b { display: none; }
.rate-none, .rate-n { font-size: 12.5px; color: var(--muted); }
.rate-mine { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; direction: ltr; }
.rate-mine button { height: 36px; border: 0; border-radius: 10px; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 14px; padding: 0; font-variant-numeric: tabular-nums; }
.rate-mine button.low { background: rgba(255, 197, 61, 0.22); }
.rate-mine button.on { background: #ffc53d; color: #1d1600; }
.rate-hint { font-size: 12.5px; color: var(--muted); text-align: center; }
.deck-group { padding: 12px; display: grid; gap: 10px; }
.deck-make { width: 100%; justify-content: center; }
.deck-key { display: grid; gap: 6px; }
.deck-key small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.deck-k { display: flex; gap: 8px; align-items: center; }
.deck-k code { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 12.5px/1.4 ui-monospace, Menlo, Consolas, monospace; background: var(--surface-2); padding: 10px; border-radius: 10px; user-select: all; }

/* ---------- get the app (website only) ---------- */
.dl-bar { display: flex; align-items: center; gap: 12px; width: calc(100% - 28px); margin: 0 14px 14px; padding: 12px 14px; border: 0; border-radius: 16px; text-align: start; color: var(--text); background: linear-gradient(120deg, var(--teal-dim), var(--surface)); box-shadow: inset 0 0 0 1px var(--teal-dim); }
.dl-bar-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--teal); color: #041a17; }
.dl-bar-ico .i { width: 22px; height: 22px; }
.dl-bar-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dl-bar-t b { font-size: 15px; }
.dl-bar-t small { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-bar-go { flex: none; font-weight: 700; font-size: 13.5px; color: var(--teal); }
.dl-block { background: var(--surface); border-radius: 18px; padding: 14px; margin-bottom: 12px; display: grid; gap: 10px; }
.dl-head { display: flex; align-items: center; gap: 12px; }
.dl-head > div { display: flex; flex-direction: column; min-width: 0; }
.dl-head b { font-size: 17px; }
.dl-head small { color: var(--muted); font-size: 12.5px; }
.dl-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.dl-ico .i { width: 24px; height: 24px; }
.dl-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; text-decoration: none; }
.dl-btn.disabled { opacity: 0.5; pointer-events: none; }
.dl-info { color: var(--muted); font-size: 12px; text-align: center; margin-top: -4px; }
.dl-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.dl-steps b { color: var(--text); }
.dl-inline { display: inline-grid; vertical-align: -4px; width: 22px; height: 22px; place-items: center; border-radius: 6px; background: var(--surface-2); color: #0a84ff; }
.dl-inline .i { width: 16px; height: 16px; }
.dl-warn { background: rgba(244,182,63,.15); color: #f4c46a; border-radius: 10px; padding: 9px 12px; font-size: 13.5px; }
.dl-key { justify-self: start; }
.deck-dl { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
