.msh-wrap {
  --msh-bg: #100d1c;
  --msh-bg-soft: #181329;
  --msh-panel: rgba(255,255,255,0.05);
  --msh-panel-2: rgba(255,255,255,0.08);
  --msh-border: rgba(185, 160, 255, 0.22);
  --msh-border-strong: rgba(201, 178, 255, 0.40);
  --msh-ink: #f3eeff;
  --msh-muted: #c1b6df;
  --msh-primary: #9f7aea;
  --msh-primary-2: #c084fc;
  --msh-accent: #60a5fa;
  --msh-pink: #f472b6;
  --msh-gold: #f6c85f;
  --msh-success: #86efac;
  --msh-danger: #fda4af;
  color: var(--msh-ink);
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  line-height: 1.7;
  border-radius: 34px;
  background:
    radial-gradient(circle at 8% 8%, rgba(159,122,234,.22), transparent 30%),
    radial-gradient(circle at 94% 16%, rgba(96,165,250,.14), transparent 28%),
    radial-gradient(circle at 50% 110%, rgba(244,114,182,.10), transparent 30%),
    linear-gradient(180deg, #130f24 0%, #0d0b18 100%);
  border: 1px solid rgba(201,178,255,.16);
  box-shadow: 0 24px 90px rgba(0,0,0,.30);
  overflow: hidden;
}

.msh-wrap.msh-wrap-fullscreen {
  width: 100vw;
  max-width: none;
  min-height: 100vh;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
}

.msh-wrap * { box-sizing: border-box; }
.msh-wrap h1,
.msh-wrap h2,
.msh-wrap h3,
.msh-wrap h4,
.msh-wrap h5,
.msh-wrap h6,
.msh-wrap p,
.msh-wrap li,
.msh-wrap label,
.msh-wrap span,
.msh-wrap small,
.msh-wrap strong,
.msh-wrap summary,
.msh-wrap td,
.msh-wrap th {
  color: inherit;
}
.msh-wrap .msh-card,
.msh-wrap .msh-copy-box,
.msh-wrap .msh-login-box,
.msh-wrap .msh-sidebar,
.msh-wrap .msh-hero-card,
.msh-wrap .msh-stream-card,
.msh-wrap .msh-avatar-card,
.msh-wrap .msh-stats > div,
.msh-wrap .msh-mini-summary {
  color: var(--msh-ink);
}
.msh-wrap a { color: #ddd6fe; }
.msh-page-head {
  padding: 28px 26px;
  border: 1px solid var(--msh-border);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(192,132,252,.18), transparent 26%),
    radial-gradient(circle at bottom left, rgba(96,165,250,.13), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  box-shadow: 0 18px 60px rgba(0,0,0,.24);
  margin: 20px 0;
  backdrop-filter: blur(8px);
}
.msh-kicker {
  color: #e9d5ff;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}
.msh-page-head h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.2;
}
.msh-page-head p { margin: 0; color: var(--msh-muted); }
.msh-dashboard-shell {
  display: grid;
  grid-template-columns: 310px minmax(0,1fr);
  gap: 22px;
  align-items: start;
}
.msh-sidebar {
  position: sticky;
  top: 20px;
  background:
    radial-gradient(circle at bottom left, rgba(96,165,250,.12), transparent 22%),
    radial-gradient(circle at top right, rgba(192,132,252,.18), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid var(--msh-border);
  border-radius: 30px;
  padding: 22px;
  box-shadow: 0 20px 70px rgba(0,0,0,.28);
  backdrop-filter: blur(10px);
}
.msh-sidebar-brand {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: .02em;
}
.msh-avatar-card,
.msh-stream-card,
.msh-card,
.msh-copy-box,
.msh-login-box,
.msh-hero-card,
.msh-stats > div,
.msh-mini-summary,
.msh-video-item {
  background: var(--msh-panel);
  border: 1px solid var(--msh-border);
  box-shadow: 0 14px 40px rgba(0,0,0,.18);
  backdrop-filter: blur(8px);
}
.msh-avatar-card {
  border-radius: 24px;
  padding: 18px;
  text-align: center;
}
.msh-avatar-frame {
  width: 140px;
  height: 140px;
  margin: 0 auto 12px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, var(--msh-primary), var(--msh-accent));
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
}
.msh-avatar-image,
.msh-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.msh-avatar-image { object-fit: cover; background: #0c0a14; }
.msh-avatar-fallback {
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.05));
  color: #fff;
  font-size: 54px;
  font-weight: 900;
}
.msh-avatar-card strong { display: block; font-size: 22px; margin-bottom: 4px; }
.msh-avatar-card small { color: var(--msh-muted); font-weight: 700; }
.msh-stream-card {
  margin-top: 16px;
  border-radius: 22px;
  padding: 14px 16px;
}
.msh-stream-card span {
  display: block;
  margin-bottom: 8px;
  color: #f5d0fe;
  font-weight: 800;
}
.msh-stream-card a,
.msh-stream-card p {
  display: block;
  margin: 0;
  color: var(--msh-ink);
  word-break: break-all;
  text-decoration: none;
}
.msh-stream-card a:hover { text-decoration: underline; }
.msh-sidebar-nav { display: grid; gap: 10px; margin: 18px 0; }
.msh-side-tab,
.msh-tab {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255,255,255,.02);
  color: var(--msh-ink);
  cursor: pointer;
  font-weight: 800;
  font-size: 16px;
  transition: .2s ease;
}
.msh-side-tab:hover,
.msh-tab:hover {
  transform: translateY(-1px);
  border-color: var(--msh-border-strong);
  background: rgba(255,255,255,.05);
}
.msh-side-tab.is-active,
.msh-tab.is-active {
  background: linear-gradient(135deg, rgba(159,122,234,.52), rgba(96,165,250,.28));
  border-color: rgba(216,180,254,.48);
  box-shadow: 0 10px 26px rgba(129, 84, 255, .18);
}
.msh-sidebar-footer { margin-top: 20px; }
.msh-dashboard-main { min-width: 0; }
.msh-hero-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border-radius: 28px;
  padding: 26px 28px;
  margin-bottom: 16px;
  background:
    radial-gradient(circle at right top, rgba(250, 204, 21, .12), transparent 20%),
    radial-gradient(circle at left bottom, rgba(167, 139, 250, .16), transparent 28%),
    linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
}
.msh-hero-card h3 { margin: 0 0 8px; font-size: clamp(24px, 3.2vw, 38px); line-height: 1.2; }
.msh-hero-card p { margin: 0; color: var(--msh-muted); }
.msh-hero-badge {
  min-width: 180px;
  text-align: center;
  border-radius: 22px;
  padding: 16px;
  background: rgba(14, 12, 27, .68);
  border: 1px solid var(--msh-border);
  color: #e9d5ff;
}
.msh-hero-badge strong { display: block; font-size: 34px; color: #fff; margin-top: 6px; }
.msh-user-bar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  background: linear-gradient(135deg, rgba(159,122,234,.26), rgba(96,165,250,.16));
  color:#fff;
  border: 1px solid var(--msh-border);
  border-radius:20px;
  padding:14px 18px;
  margin:16px 0;
}
.msh-user-bar span { display:block; font-size:12px; color:#ddd6fe; }
.msh-user-bar strong { display:block; font-size:17px; }
.msh-user-bar small { display:block; color:var(--msh-muted); font-weight:700; margin-top:4px; }
.msh-alert {
  border-radius: 18px;
  padding: 14px 16px;
  margin: 14px 0;
  border: 1px solid var(--msh-border);
  background: rgba(255,255,255,.04);
}
.msh-alert-success { background: rgba(34,197,94,.10); border-color: rgba(134,239,172,.34); color:#dcfce7; }
.msh-alert-error { background: rgba(244,114,182,.10); border-color: rgba(253,164,175,.32); color:#ffe4e6; }
.msh-alert-note { background: rgba(96,165,250,.08); border-color: rgba(125,211,252,.22); color:#e0e7ff; }
.msh-card, .msh-copy-box, .msh-login-box {
  border-radius: 24px;
  padding: 20px;
}
.msh-card h4, .msh-copy-box h4, .msh-card h3, .msh-copy-box h3 { margin-top: 0; }
.msh-login-box { max-width: 620px; margin: 28px auto; }
.msh-login-box input[type=text], .msh-login-box input[type=password] { width:100%; }
.msh-panel { display:none; }
.msh-panel.is-active { display:block; }
.msh-section-head {
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:16px;
  margin: 10px 0 16px;
}
.msh-section-head h3 { margin:0 0 4px; font-size:30px; line-height:1.2; }
.msh-section-head p { margin:0; color:var(--msh-muted); }
.msh-month-form { display:flex; gap:8px; align-items:center; white-space:nowrap; }
.msh-stats {
  display:grid;
  grid-template-columns:repeat(5, minmax(0,1fr));
  gap:12px;
  margin:12px 0;
}
.msh-stats > div {
  border-radius: 20px;
  padding: 16px;
}
.msh-stats span { color:var(--msh-muted); display:block; font-size:12px; font-weight:700; }
.msh-stats strong { font-size:28px; display:block; line-height:1.25; }
.msh-stats small { color:var(--msh-muted); display:block; }
.msh-mini-summary {
  border-radius: 16px;
  padding: 12px 14px;
  margin: 12px 0;
}
.msh-grid-2 { display:grid; grid-template-columns:minmax(0,1.3fr) minmax(280px,.7fr); gap:16px; align-items:start; }
.msh-form-row, .msh-conditional, .msh-video-controls {
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:12px;
  margin:12px 0;
}
.msh-conditional { grid-template-columns:repeat(2, minmax(0,1fr)); }
.msh-settings-grid { display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,.8fr); gap:16px; align-items:start; }
.msh-note-card .msh-alert { margin: 0; }
.msh-help { margin: 6px 0 14px; color: var(--msh-muted); font-size: 13px; }
.msh-wrap label { display:block; font-weight:700; margin-bottom: 10px; }
.msh-wrap input, .msh-wrap select, .msh-wrap textarea {
  width:100%;
  border:1px solid rgba(255,255,255,.12);
  border-radius:14px;
  padding:10px 12px;
  font:inherit;
  color: var(--msh-ink);
  background: rgba(8, 7, 18, .72);
}
.msh-wrap input::placeholder, .msh-wrap textarea::placeholder { color: #9086b0; }
.msh-wrap textarea { resize:vertical; }
.msh-wrap button, .msh-wrap .msh-primary, .msh-download-link, .msh-logout-button {
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:11px 16px;
  background: rgba(255,255,255,.05);
  color: var(--msh-ink);
  cursor:pointer;
  text-decoration:none;
  display:inline-block;
  font-weight:800;
}
.msh-wrap .msh-primary {
  background: linear-gradient(135deg, var(--msh-primary), var(--msh-accent));
  border-color: transparent;
  color:#fff;
}
.msh-logout-button {
  width: 100%;
  text-align: center;
  background: rgba(255,255,255,.03);
}
.msh-danger-link {
  color: #fecdd3;
  border:none !important;
  background:transparent !important;
  padding:0 !important;
}
.msh-table-card { margin-top:16px; }
.msh-table-scroll { overflow:auto; }
.msh-table {
  width:100%;
  border-collapse:collapse;
  min-width:840px;
  border-radius: 18px;
  overflow: hidden;
}
.msh-table th, .msh-table td {
  border-bottom:1px solid rgba(255,255,255,.08);
  padding:12px 10px;
  text-align:left;
  vertical-align:top;
}
.msh-table th { background: rgba(255,255,255,.06); }
.msh-copier { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:16px; margin-bottom:16px; }
.msh-copy-box textarea { margin:10px 0; }
.msh-copy-status { min-height:1.4em; color:var(--msh-muted); font-size:13px; }
.msh-edit-details summary { cursor:pointer; font-weight:800; font-size:18px; }
.msh-repeater { border-top:1px solid rgba(255,255,255,.08); padding-top:14px; margin-top:14px; }
.msh-repeater-item { display:flex; gap:8px; align-items:flex-start; margin:8px 0; }
.msh-repeater-item textarea, .msh-repeater-item input { flex:1; }
.msh-remove-row { color: var(--msh-danger); }
.msh-video-maker label { margin-bottom:10px; }
.msh-video-actions { display:flex; gap:10px; flex-wrap:wrap; margin:12px 0; }
.msh-video-preview-list { display:grid; grid-template-columns:repeat(auto-fill, minmax(160px, 1fr)); gap:10px; margin:12px 0; }
.msh-video-item { border-radius:16px; padding:8px; }
.msh-video-item img { width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:10px; background:#111; }
.msh-video-item p { margin:6px 0 0; color:var(--msh-muted); font-size:12px; word-break:break-all; }
.msh-video-progress { display:flex; align-items:center; gap:10px; margin:12px 0; }
.msh-video-progress progress { width:240px; max-width:100%; }
.msh-video-result video { width:100%; max-height:520px; background:#000; border-radius:14px; }
.msh-download-link { margin-top:10px; }
.msh-inline-form{margin:0}
@media (max-width: 1100px) {
  .msh-dashboard-shell { grid-template-columns: 1fr; }
  .msh-sidebar { position: static; }
}
@media (max-width: 900px) {
  .msh-section-head, .msh-user-bar, .msh-hero-card { align-items:stretch; flex-direction:column; }
  .msh-stats { grid-template-columns:repeat(2, minmax(0,1fr)); }
  .msh-grid-2, .msh-copier, .msh-form-row, .msh-conditional, .msh-video-controls, .msh-settings-grid { grid-template-columns:1fr; }
  .msh-sidebar-brand { font-size: 24px; }
}

.msh-login-shell {
  display: grid;
  grid-template-columns: 310px minmax(0,1fr);
  gap: 22px;
  align-items: start;
}
.msh-sidebar-guest { min-height: 100%; }
.msh-avatar-card-guest strong { font-size: 24px; }
.msh-guest-feature-list {
  margin: 0;
  padding-left: 1.1em;
  color: var(--msh-ink);
}
.msh-guest-feature-list li { margin: 0 0 6px; }
.msh-hero-card-login { margin-bottom: 18px; }
.msh-login-box-upgraded {
  max-width: none;
  margin: 0 0 16px;
}
.msh-login-grid {
  grid-template-columns: repeat(2, minmax(0,1fr));
  margin-bottom: 16px;
}
.msh-guest-notice-card .msh-alert { margin: 0; }
@media (max-width: 1100px) {
  .msh-login-shell { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .msh-login-grid { grid-template-columns: 1fr; }
}

/* v0.3.2: prevent white theme backgrounds from making the dark UI unreadable. */
.entry-content > .msh-wrap,
.wp-block-post-content > .msh-wrap,
.page-content > .msh-wrap {
  margin-top: 18px;
  margin-bottom: 18px;
}
.msh-wrap select option {
  background: #130f24;
  color: #f3eeff;
}
@media (max-width: 900px) {
  .msh-wrap {
    padding: 16px;
    border-radius: 24px;
  }
}

/* v0.4.0 login screen refinements */
.msh-guest-feature-card {
  margin-top: 0;
}
.msh-login-box-upgraded {
  max-width: none;
  margin: 0 0 16px;
}
.msh-login-box-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}
.msh-login-box-head h3 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1.2;
}
.msh-login-box-head p {
  margin: 0;
  color: var(--msh-muted);
}
.msh-login-submit {
  min-width: 180px;
  text-align: center;
}
@media (max-width: 900px) {
  .msh-wrap.msh-wrap-fullscreen {
    width: 100%;
    min-height: 100vh;
    margin-left: 0;
    margin-right: 0;
  }
  .msh-login-box-head {
    flex-direction: column;
  }
}

/* v0.5.0 dashboard refinements */
.msh-avatar-upload-form {
  margin: 0;
}
.msh-avatar-upload-label {
  display: inline-block;
  cursor: pointer;
  margin: 0;
}
.msh-avatar-file-input {
  position: absolute;
  width: 1px !important;
  height: 1px !important;
  opacity: 0;
  pointer-events: none;
}
.msh-avatar-edit-hint {
  display: inline-block;
  margin: 8px auto 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: var(--msh-muted);
  font-size: 12px;
  font-weight: 800;
}
.msh-avatar-upload-label:hover .msh-avatar-frame {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.msh-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
  margin: 14px 0;
}
.msh-chart-card {
  background: var(--msh-panel);
  border: 1px solid var(--msh-border);
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 14px 40px rgba(0,0,0,.18);
}
.msh-chart-card h4 {
  margin: 0 0 10px;
}
.msh-line-chart {
  width: 100%;
  height: auto;
  display: block;
}
.msh-line-chart line {
  stroke: rgba(255,255,255,.18);
  stroke-width: 1;
}
.msh-line-chart polyline {
  fill: none;
  stroke: #c084fc;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.msh-line-chart circle {
  fill: #f3eeff;
  stroke: #9f7aea;
  stroke-width: 3;
}
.msh-line-chart text {
  fill: #c1b6df;
  font-size: 18px;
}
.msh-record-form [data-msh-show-for] {
  transition: opacity .2s ease;
}
@media (max-width: 1100px) {
  .msh-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* v0.5.1 */
.msh-avatar-file-input {
  display: none !important;
}
.msh-avatar-frame {
  display: block;
}
.msh-stats {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.msh-video-merge {
  margin-top: 18px;
}
.msh-video-file-placeholder {
  aspect-ratio: 16/9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.06);
  color: var(--msh-muted);
  font-weight: 900;
  letter-spacing: .12em;
}

/* v0.5.3 multi record rows */
.msh-record-listener-block {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid var(--msh-border);
  border-radius: 18px;
  background: rgba(255,255,255,.03);
}
.msh-record-listener-block h4 {
  margin: 0 0 10px;
}
.msh-record-listener-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 10px 0;
}
.msh-record-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.msh-wrap .msh-secondary {
  background: rgba(255,255,255,.06);
  color: var(--msh-ink);
}
@media (max-width: 900px) {
  .msh-record-listener-row {
    grid-template-columns: 1fr;
  }
}

/* v0.5.4: extend the dashboard's original purple/dark background to the whole fixed page/theme area. */
html.msh-helper-fullscreen-page,
body.msh-helper-fullscreen-page,
body.msh-helper-fullscreen-page.custom-background {
  background-color: #100d1c !important;
  background-image:
    radial-gradient(circle at 8% 8%, rgba(159,122,234,.22), transparent 30%),
    radial-gradient(circle at 94% 16%, rgba(96,165,250,.14), transparent 28%),
    radial-gradient(circle at 50% 110%, rgba(244,114,182,.10), transparent 30%),
    linear-gradient(180deg, #130f24 0%, #0d0b18 100%) !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  min-height: 100% !important;
}

body.msh-helper-fullscreen-page #page,
body.msh-helper-fullscreen-page .site,
body.msh-helper-fullscreen-page .site-content,
body.msh-helper-fullscreen-page .content-area,
body.msh-helper-fullscreen-page .site-main,
body.msh-helper-fullscreen-page .inside-article,
body.msh-helper-fullscreen-page .entry-content,
body.msh-helper-fullscreen-page .grid-container,
body.msh-helper-fullscreen-page .container,
body.msh-helper-fullscreen-page .separate-containers .inside-article,
body.msh-helper-fullscreen-page .wp-block-post-content,
body.msh-helper-fullscreen-page .page-content {
  background: transparent !important;
}

body.msh-helper-fullscreen-page .site-content,
body.msh-helper-fullscreen-page .inside-article,
body.msh-helper-fullscreen-page .entry-content,
body.msh-helper-fullscreen-page .wp-block-post-content,
body.msh-helper-fullscreen-page .page-content {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body.msh-helper-fullscreen-page .entry-content > .msh-wrap.msh-wrap-fullscreen,
body.msh-helper-fullscreen-page .wp-block-post-content > .msh-wrap.msh-wrap-fullscreen,
body.msh-helper-fullscreen-page .page-content > .msh-wrap.msh-wrap-fullscreen {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

body.msh-helper-fullscreen-page .msh-wrap.msh-wrap-fullscreen {
  min-height: 100vh;
}

/* Modern-browser fallback before JS adds the helper class. */
body:has(.msh-wrap.msh-wrap-fullscreen) {
  background-color: #100d1c !important;
  background-image:
    radial-gradient(circle at 8% 8%, rgba(159,122,234,.22), transparent 30%),
    radial-gradient(circle at 94% 16%, rgba(96,165,250,.14), transparent 28%),
    radial-gradient(circle at 50% 110%, rgba(244,114,182,.10), transparent 30%),
    linear-gradient(180deg, #130f24 0%, #0d0b18 100%) !important;
  background-attachment: fixed !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
}
