/* Member Portal — dashboard layout (uses app.css shell) */
.login-card { max-width: 460px; margin: 6vh auto 0; text-align: center; padding: 22px; }
.login-card form { text-align: left; margin-top: 14px; }
.login-hero { font-size: 46px; line-height: 1.3; }
.key-input { text-transform: uppercase; letter-spacing: 0.04em; text-align: center; font-size: 1.05rem; }
.form-error { color: #ffb3c0; background: rgba(255, 77, 109, 0.1); border: 1px solid rgba(255, 77, 109, 0.4); border-radius: 10px; padding: 8px 12px; margin: 12px 0 0; font-size: 0.9rem; }
.login-card .btn.lg { margin-top: 14px; }
.small-note { font-size: 0.82rem; margin: 12px 0 0; }
.small { font-size: 0.8rem; }
.loading-box { text-align: center; display: grid; justify-items: center; gap: 10px; }

/* ---------- top bar extras ---------- */
.tt-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--ap-line-2); color: var(--ap-muted); max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-badge.live { color: #fff; background: rgba(255, 77, 109, 0.18); border-color: rgba(255, 77, 109, 0.6); }
.tt-badge.ok { color: #9ff0cc; border-color: rgba(47, 214, 140, 0.4); }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 4px; border-radius: 999px; background: var(--ap-panel); border: 1px solid var(--ap-line-2); max-width: 220px; }
.uc-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: var(--ap-gold-ink); background: linear-gradient(135deg, var(--ap-gold-2), var(--ap-gold)); flex: 0 0 auto; }
.uc-text { display: flex; flex-direction: column; line-height: 1.6; min-width: 0; }
.uc-text strong { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-text small { font-size: 0.68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) {
  .user-chip, .tt-badge { display: none; }
}

/* ---------- page head ---------- */
.hello { font-size: 1.35rem; }
.gold-text { color: var(--ap-gold-2); }
.license { font-size: 0.8rem; color: var(--ap-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.license code { color: var(--ap-text); }
.link-btn { appearance: none; background: none; border: 0; cursor: pointer; font-size: 0.9rem; padding: 0 2px; opacity: 0.8; }
.link-btn:hover { opacity: 1; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .head-actions { width: 100%; }
  .head-actions > * { flex: 1 1 auto; }
  .head-actions .btn, .head-actions .dropdown .btn { width: 100%; font-size: 0.86rem; padding: 8px 10px; }
}

/* ---------- stat cards ---------- */
.pcard { flex-direction: column; gap: 8px; align-items: stretch; padding: 14px 16px; }
.pc-title { font-size: 0.86rem; font-weight: 700; color: var(--ap-text); }
.pc-title.row { display: flex; }
.pc-line { margin: 0; font-size: 0.84rem; line-height: 1.6; }

.ring-row { display: flex; align-items: center; gap: 14px; }
.ring { width: 84px; height: 84px; flex: 0 0 auto; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--ap-line); stroke-width: 7; }
.ring-fg { fill: none; stroke: url(#ringGrad); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 213.63; stroke-dashoffset: 213.63; transition: stroke-dashoffset 0.6s ease; }
.ring-text { transform: rotate(90deg); transform-origin: 40px 40px; fill: var(--ap-gold-2); font-size: 15px; font-weight: 800; font-family: var(--font); }
.ring-info { display: flex; flex-direction: column; line-height: 1.6; min-width: 0; }
.big-gold { font-size: 1.5rem; font-weight: 800; color: var(--ap-gold-2); line-height: 1.6; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.tiles div { background: var(--ap-bg); border: 1px solid var(--ap-line-2); border-radius: 10px; text-align: center; padding: 4px 2px; line-height: 1.6; }
.tiles b { display: block; font-size: 1.15rem; font-weight: 800; }
.tiles small { font-size: 0.66rem; }

.live-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.live-line strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tag-mini { font-size: 0.7rem; font-weight: 700; padding: 0 8px; border-radius: 999px; border: 1px solid var(--ap-line-2); color: var(--ap-muted); white-space: nowrap; margin-left: auto; }
.tag-mini.live { color: #fff; background: linear-gradient(135deg, #ff4d6d, #d6224a); border-color: transparent; }
.tag-mini.ok { color: #9ff0cc; border-color: rgba(47, 214, 140, 0.4); }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; font-size: 0.8rem; color: var(--ap-muted); }
.mini-stats b { color: var(--ap-text); }

.input-prefix.sm span { padding: 0 9px; }
.input-prefix.sm input { padding: 7px 10px; }
.toggles-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0; }
#quick-form .row { gap: 6px; }

@media (max-width: 520px) {
  .ring-row { flex-direction: column; align-items: flex-start; }
  .ring-info small { display: none; }
  .ring-info .muted { font-size: 0.74rem; }
  .ring-row { gap: 10px; }
  .big-gold { font-size: 1.15rem; }
  .tiles b { font-size: 0.95rem; }
  .mini-stats { grid-template-columns: repeat(2, 1fr); }
  .pcard { padding: 12px; }
}

/* ---------- themes panel ---------- */
.themes-panel { padding: 16px; }
.tp-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tp-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.count-pill { font-size: 0.74rem; font-weight: 600; padding: 0 10px; border-radius: 999px; border: 1px solid var(--ap-line-2); color: var(--ap-muted); }
.tp-search { flex: 0 1 340px; min-width: 200px; }
.tp-search input { width: 100%; }
#cat-pills { margin-bottom: 12px; }
@media (max-width: 600px) {
  .tp-search { flex: 1 1 100%; }
  #cat-pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
}

.theme-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .theme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .theme-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

.tcard { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--ap-panel-2); border: 1px solid var(--ap-line); transition: transform 0.15s, border-color 0.15s; min-width: 0; }
.tcard:hover { transform: translateY(-2px); border-color: var(--ap-line-2); }
.tcard.active { border-color: var(--ap-gold); box-shadow: 0 0 0 1px rgba(245, 185, 66, 0.35), 0 8px 24px rgba(245, 185, 66, 0.12); }
.tc-banner {
  position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden;
  background:
    radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--accent, #f5b942) 60%, transparent) 0%, transparent 62%),
    repeating-conic-gradient(from 0deg at 50% 55%, rgba(255, 255, 255, 0.07) 0 7deg, transparent 7deg 16deg),
    linear-gradient(160deg, color-mix(in srgb, var(--accent, #7c4dff) 35%, #1a1230), #120c24);
}
.tc-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tc-emoji { font-size: 2.6rem; line-height: 1; filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.45)); position: relative; }
.tc-badge { position: absolute; top: 8px; left: 8px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; padding: 1px 8px; border-radius: 6px; color: #fff; background: #ff4d6d; }
.tc-badge.NEW { background: #20b37a; }
.tc-badge.PRO { background: linear-gradient(135deg, var(--ap-gold-2), var(--ap-gold)); color: var(--ap-gold-ink); }
.tc-badge.GAME { background: var(--ap-purple); }
.tc-play { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 0.78rem; cursor: pointer; }
.tc-play:hover { background: rgba(0, 0, 0, 0.8); }
.tc-num { position: absolute; right: 9px; bottom: 6px; font-size: 0.7rem; font-weight: 800; color: rgba(255, 255, 255, 0.55); }
.tc-active { position: absolute; left: 8px; bottom: 7px; font-size: 0.68rem; font-weight: 800; padding: 0 8px; border-radius: 999px; color: var(--ap-gold-ink); background: var(--ap-gold-2); }
.tc-body { padding: 10px 11px 0; display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.tc-title { font-weight: 800; font-size: 0.98rem; line-height: 1.65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 0.72rem; color: var(--ap-muted); min-width: 0; }
.tc-meta span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-cat { flex: 0 0 auto; padding: 0 8px; border-radius: 6px; border: 1px solid rgba(245, 185, 66, 0.45); color: var(--ap-gold-2); font-weight: 700; }
.tc-desc { font-size: 0.76rem; color: var(--ap-muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.tc-actions { display: flex; gap: 6px; padding: 10px 11px 11px; }
.tc-actions .btn { font-size: 0.8rem; padding: 6px 8px; }
.tc-actions .open { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .tc-emoji { font-size: 2rem; }
  .tc-title { font-size: 0.88rem; }
  .tc-desc { display: none; }
  .hide-sm { display: none; }
  .tc-actions .btn { font-size: 0.74rem; padding: 6px; }
}
.theme-empty { padding: 26px; text-align: center; border: 1px dashed var(--ap-line-2); border-radius: 14px; color: var(--ap-muted); grid-column: 1 / -1; }

/* ---------- modals ---------- */
.pv-banner { border-radius: 12px; margin-bottom: 12px; }
.test-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 560px) { .test-grid { grid-template-columns: repeat(2, 1fr); } }
.guide-steps { margin: 0; padding-left: 22px; }
.guide-steps li { margin-bottom: 14px; }
.guide-steps li::marker { color: var(--ap-gold); font-weight: 800; }
.guide-steps p { color: var(--ap-muted); margin: 2px 0 0; font-size: 0.9rem; }
.adv-toggles { border: 1px solid var(--ap-line); border-radius: 12px; padding: 4px 12px; background: var(--ap-bg); }
.adv-toggles .switch + .switch { border-top: 1px solid var(--ap-line); }
.switch input:checked { background: var(--ap-gold); }

/* ---------- BGM panel ---------- */
.bgm-panel { padding: 16px; margin-bottom: 14px; }
.bp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.bp-head h2 { margin: 0; font-size: 1.1rem; }
.bp-head .tag-mini { margin-left: 0; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.bp-head .tag-mini.ok { color: #9ff0cc; }
.bp-toggle { margin-left: auto !important; font-weight: 700; }
.bp-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr; gap: 14px; align-items: start; }
.bp-grid .field { margin: 0; }
.bp-grid input[type=file] { color: var(--ap-muted); min-width: 0; font-size: 0.82rem; }
.row.nowrap { flex-wrap: nowrap; gap: 6px; }
.row.nowrap select { min-width: 0; }
#bgm-preview.playing { background: linear-gradient(135deg, var(--ap-gold-2), var(--ap-gold)); color: var(--ap-gold-ink); }
@media (max-width: 900px) { .bp-grid { grid-template-columns: 1fr; } }

/* ---------- v15: tier pill ---------- */
.tier-pill { display: inline-flex; align-items: center; font-size: 0.72rem; font-weight: 800; line-height: 1.7; padding: 0 9px; border-radius: 999px; border: 1px solid var(--ap-line-2); color: var(--ap-muted); white-space: nowrap; }
.tier-pill.pro { color: var(--ap-gold-ink); border-color: transparent; background: linear-gradient(135deg, var(--ap-gold-2), var(--ap-gold)); }
.tier-pill.admin { color: #fff; border-color: transparent; background: linear-gradient(135deg, var(--ap-purple-2), var(--ap-purple)); }
.user-chip .tier-pill { margin-left: 2px; }

/* ---------- v15: PRO-locked theme cards ---------- */
.tcard.locked .tc-banner > :not(.tc-lock):not(.tc-badge):not(.tc-num) { opacity: 0.45; }
.tc-lock { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 2px; background: rgba(10, 6, 22, 0.45); }
.tc-lock-icon { font-size: 1.7rem; line-height: 1.3; }
.tc-lock b { font-size: 0.74rem; letter-spacing: 0.08em; padding: 0 10px; border-radius: 999px; color: var(--ap-gold-ink); background: linear-gradient(135deg, var(--ap-gold-2), var(--ap-gold)); line-height: 1.7; }
.tcard.locked .tc-title { color: var(--ap-muted); }
.tc-actions .upgrade { flex: 1 1 auto; width: 100%; color: var(--ap-gold-2); border-color: rgba(245, 185, 66, 0.55); background: rgba(245, 185, 66, 0.08); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upgrade-box .tc-banner { border-radius: 12px; margin-bottom: 10px; }
.upgrade-box p { line-height: 1.75; margin: 6px 0; }

/* ---------- v15: Live Customizer ---------- */
.cz-panel { padding: 16px; margin-bottom: 14px; }
.cz-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cz-head h2 { margin: 0; font-size: 1.1rem; line-height: 1.6; min-width: 0; }
.cz-head .tag-mini { margin-left: 0; }
.cz-head .tag-mini.busy { color: var(--ap-gold-2); border-color: rgba(245, 185, 66, 0.45); }
.cz-head .tag-mini.bad { color: #ffb3c0; border-color: rgba(255, 77, 109, 0.5); }
.cz-reset { margin-left: auto; }
.cz-intro { margin: 6px 0 12px; line-height: 1.7; }
.cz-grid { display: grid; grid-template-columns: minmax(200px, 270px) minmax(0, 1fr); gap: 18px; align-items: start; }
.cz-preview-col { min-width: 0; }
.cz-preview {
  position: relative; width: 100%; aspect-ratio: 9 / 16; overflow: hidden; isolation: isolate; border-radius: 14px;
  border: 1px solid var(--ap-line-2); background: #000; --u: 2.6px; touch-action: none; user-select: none; -webkit-user-select: none;
}
.czp-root { position: absolute; inset: 0; overflow: hidden; }
.czp-theme {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 30% at 50% 38%, color-mix(in srgb, var(--accent, #7c4dff) 55%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--accent, #7c4dff) 30%, #120c24) 0%, #120c24 70%, #07040f 100%);
}
.czp-title { position: absolute; top: calc(var(--u) * 4); left: calc(var(--u) * 5); right: calc(var(--u) * 12); text-align: center; font-weight: 800; font-size: calc(var(--u) * 6); line-height: 1.6; color: #fff; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.czp-chat { position: absolute; left: calc(var(--u) * 4); top: calc(var(--u) * 100); display: flex; flex-direction: column; gap: calc(var(--u) * 1.4); }
.czp-chat span { font-size: calc(var(--u) * 3.3); line-height: 1.7; padding: 0 calc(var(--u) * 2.4); border-radius: calc(var(--u) * 2.4); background: rgba(0, 0, 0, 0.5); color: #fff; white-space: nowrap; }
.czp-safe { position: absolute; z-index: 6; pointer-events: none; background: repeating-linear-gradient(135deg, rgba(255, 77, 109, 0.22) 0 6px, rgba(255, 77, 109, 0.08) 6px 12px); }
.czp-safe-b { left: 0; right: 0; bottom: 0; height: 28%; border-top: 1px dashed rgba(255, 140, 160, 0.8); display: grid; place-items: center; }
.czp-safe-b span { font-size: 0.68rem; line-height: 1.6; color: #ffd0d9; background: rgba(0, 0, 0, 0.55); padding: 2px 8px; border-radius: 999px; text-align: center; max-width: 90%; }
.czp-safe-r { top: 0; right: 0; width: 10%; height: 72%; border-left: 1px dashed rgba(255, 140, 160, 0.8); }
.czp-edit { position: absolute; inset: 0; z-index: 7; }
.czp-st { position: absolute; cursor: grab; touch-action: none; border-radius: 6px; outline: 1px dashed transparent; }
.czp-st img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; display: block; }
.czp-st.sel, .czp-st:hover { outline-color: rgba(255, 215, 122, 0.9); }
.czp-st:active { cursor: grabbing; }
.czp-missing { display: grid; place-items: center; width: 100%; height: 100%; color: #fff; background: rgba(0, 0, 0, 0.4); }
.czp-handle { position: absolute; right: -7px; bottom: -7px; width: 18px; height: 18px; border-radius: 50%; background: var(--ap-gold-2); border: 2px solid #1a1230; cursor: nwse-resize; opacity: 0; }
.czp-x { position: absolute; right: -8px; top: -8px; width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0; font-size: 11px; line-height: 20px; color: #fff; background: #ff4d6d; cursor: pointer; opacity: 0; }
.czp-st.sel .czp-handle, .czp-st.sel .czp-x, .czp-st:hover .czp-handle, .czp-st:hover .czp-x { opacity: 1; }
.cz-tip { text-align: center; margin-top: 8px; line-height: 1.7; }

.cz-controls { display: grid; gap: 12px; min-width: 0; }
.cz-block { background: var(--ap-bg); border: 1px solid var(--ap-line); border-radius: 12px; padding: 12px; min-width: 0; }
.cz-label { font-weight: 800; font-size: 0.9rem; line-height: 1.7; margin-bottom: 8px; }
.seg { display: flex; gap: 4px; padding: 3px; border-radius: 11px; background: var(--ap-panel); border: 1px solid var(--ap-line); margin-bottom: 10px; }
.seg button { flex: 1 1 0; min-width: 0; appearance: none; border: 0; background: none; color: var(--ap-muted); font: inherit; font-size: 0.84rem; line-height: 1.6; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--ap-panel-3); color: var(--ap-text); font-weight: 700; }
.cz-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; margin-bottom: 10px; }
.cz-thumb { position: relative; aspect-ratio: 9 / 16; border-radius: 9px; overflow: hidden; border: 2px solid var(--ap-line-2); }
.cz-thumb.on { border-color: var(--ap-gold); }
.cz-thumb-pick { appearance: none; border: 0; padding: 0; width: 100%; height: 100%; cursor: pointer; background: #000; display: block; }
.cz-thumb-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cz-del { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; padding: 0; font-size: 12px; line-height: 24px; background: rgba(0, 0, 0, 0.65); cursor: pointer; }
.cz-empty { grid-column: 1 / -1; font-size: 0.8rem; color: var(--ap-muted); line-height: 1.7; }
.cz-upload { cursor: pointer; display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; max-width: 100%; line-height: 1.6; }
.cz-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.cz-sw { position: relative; width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); cursor: pointer; padding: 0; display: grid; place-items: center; font-size: 15px; overflow: hidden; }
.cz-sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--ap-gold); }
.cz-sw-custom { background: conic-gradient(#ff4d6d, #f5b942, #2fd68c, #5aa9f2, #7c4dff, #ff4d6d); }
.cz-sw-custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; border: 0; padding: 0; }
.cz-sliders { display: grid; gap: 8px; }
.cz-range { display: grid; gap: 2px; font-size: 0.84rem; line-height: 1.7; min-width: 0; }
.cz-range input { width: 100%; accent-color: var(--ap-gold); }
.cz-range.sm { font-size: 0.76rem; flex: 1 1 auto; }
.cz-placed { display: grid; gap: 6px; margin-bottom: 10px; }
.cz-placed:empty { display: none; }
.cz-placed-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--ap-line); background: var(--ap-panel); min-width: 0; }
.cz-placed-row.sel { border-color: var(--ap-gold); }
.cz-placed-row img { width: 34px; height: 34px; object-fit: contain; flex: 0 0 auto; }
.cz-st-lib { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; margin-bottom: 10px; }
.cz-st-tile { position: relative; }
.cz-st-add { appearance: none; width: 100%; aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--ap-line-2); background: var(--ap-panel); padding: 6px; cursor: pointer; display: block; }
.cz-st-add:hover { border-color: var(--ap-gold); }
.cz-st-add img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cz-st-tile .cz-del { width: 20px; height: 20px; line-height: 20px; font-size: 10px; top: -4px; right: -4px; }
@media (max-width: 760px) {
  .cz-grid { grid-template-columns: 1fr; }
  .cz-preview-col { max-width: 250px; width: 100%; margin: 0 auto; }
  .cz-reset { margin-left: 0; }
  .czp-handle { width: 22px; height: 22px; right: -9px; bottom: -9px; opacity: 1; }
  .czp-st .czp-x { opacity: 1; }
}

/* ---------- v15: no horizontal overflow on phones ---------- */
html, body.app { max-width: 100%; overflow-x: hidden; }
#view-dash, .panel, .stats4, .stat { min-width: 0; max-width: 100%; }
.file-pick { min-width: 0; justify-content: flex-start; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.file-pick span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Burmese Neural TTS voice picker ---------- */
.tts-voice-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.tts-voice-row select { flex: 1 1 200px; min-width: 0; }
.tts-voice small { display: block; margin-top: 6px; line-height: 1.7; }

/* v4 YouTube audio-only BGM input (inside the BGM panel) */
.yt-box { margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--ap-line-2); border-radius: 12px; background: rgba(255, 0, 51, 0.04); line-height: 1.7; }
.yt-label { display: block; font-weight: 700; margin-bottom: 6px; line-height: 1.7; }
.yt-input-row { gap: 8px; }
.yt-input-row input { min-width: 0; line-height: 1.6; }
.yt-input-row .btn { white-space: nowrap; }
.yt-preview { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.yt-preview img { width: 112px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #000; flex: none; }
.yt-meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; line-height: 1.65; font-size: 0.86rem; }
.yt-meta code { font-size: 0.86rem; color: var(--ap-gold-2); }
.yt-meta input { line-height: 1.6; }
.yt-msg { display: block; margin-top: 8px; font-size: 0.8rem; color: var(--ap-muted); line-height: 1.7; }
.yt-msg.bad { color: #ffb3c0; }
.yt-hidden-host { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.yt-hidden-frame { width: 240px; height: 240px; border: 0; }
@media (max-width: 560px) {
  .yt-input-row { flex-wrap: wrap; }
  .yt-input-row .btn { width: 100%; }
}

/* 🔮 မဟာဘုတ် Auto ဗေဒင် (inside ⚙️ အသေးစိတ်) */
.mb-box { margin-top: 16px; padding: 12px 14px 14px; border: 1px solid rgba(255, 200, 90, 0.45); border-radius: 12px; background: rgba(120, 30, 40, 0.12); line-height: 1.65; }
.mb-box legend { padding: 0 8px; font-weight: 800; color: var(--ap-gold-2, #ffd166); line-height: 1.65; }
.mb-note { margin: 0 0 10px; font-size: 0.85rem; line-height: 1.7; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mb-note.ok { color: #9be7b0; }
.mb-manual { margin-top: 12px; padding-top: 10px; border-top: 1px dashed rgba(255, 200, 90, 0.35); }
.mb-manual-h { font-weight: 800; margin-bottom: 6px; line-height: 1.65; }
.mb-btns { gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.mb-out { margin-top: 8px; line-height: 1.7; }
.mb-out p { margin: 4px 0; line-height: 1.7; }
.mb-who .mb-fua { color: #ffd166; }
.mb-err { color: #ffb3c0; }
.mb-ok { color: #9be7b0; font-size: 0.85rem; }
.mb-chart { display: flex; flex-direction: column; gap: 6px; margin: 8px auto; max-width: 300px; }
.mb-row { display: flex; justify-content: center; gap: 6px; }
.mb-cell { flex: 0 0 31%; text-align: center; padding: 4px 0; border-radius: 8px; border: 1px solid rgba(255, 200, 90, 0.5); background: rgba(60, 14, 26, 0.6); line-height: 1.6; }
.mb-cell small { display: block; font-size: 0.75rem; color: #ffdf9a; }
.mb-cell b { font-size: 1.15rem; }
.mb-cell.birth { background: linear-gradient(180deg, #fff0a8, #ffc845 55%, #d98a1e); color: #3a1205; border-color: #fff4c4; }
.mb-cell.birth small { color: #5a2306; }
.mb-days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.mb-day { text-align: center; padding: 4px 2px; border-radius: 8px; border: 1px solid rgba(255, 200, 90, 0.4); background: rgba(60, 14, 26, 0.6); line-height: 1.6; }
.mb-day b { display: block; font-size: 0.8rem; }
.mb-day small { display: block; font-size: 0.72rem; color: #ffdf9a; }
.mb-day.r-friend small, .mb-day.r-spouse small { color: #a8f5c0; }
.mb-day.r-world small, .mb-day.r-enemy small { color: #ffb3a8; }
.mb-day.cur { background: linear-gradient(180deg, #fff0a8, #ffc845 55%, #d98a1e); color: #3a1205; border-color: #fff4c4; }
.mb-day.cur small { color: #5a2306; }
.mb-day.tgt { border-color: #9fe0ff; }
