/* MyStyle — пользовательский стиль из cookies */
html.pl-theme-mystyle,
body.pl-theme-mystyle {
  --ms-bg: #0b0b0f;
  --ms-card: #16161d;
  --ms-accent: #ff6a00;
  --ms-text: #f2f2f5;
  --ms-muted: #9a9aa8;
  --ms-top: 56px;
  background: var(--ms-bg) !important;
  color: var(--ms-text) !important;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif !important;
  margin: 0 !important;
}
html.pl-theme-mystyle .site-header,
html.pl-theme-mystyle header.site-header,
html.pl-theme-mystyle .main-header,
html.pl-theme-mystyle #site-footer,
html.pl-theme-mystyle .app-bottom-nav { display: none !important; }

.ms-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10050;
  height: var(--ms-top);
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px;
  background: rgba(0,0,0,.88);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}
.ms-brand {
  font-weight: 900; font-size: 16px; color: var(--ms-accent);
  text-decoration: none; letter-spacing: .03em;
}
.ms-nav { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
.ms-nav a {
  color: var(--ms-muted); text-decoration: none; font-size: 12px; font-weight: 700;
  padding: 8px 10px; border-radius: 8px; white-space: nowrap;
}
.ms-nav a.on, .ms-nav a:hover { color: #fff; background: rgba(255,255,255,.06); }
.ms-btn {
  border: 0; border-radius: 10px; padding: 8px 12px; cursor: pointer;
  font-weight: 800; font-size: 12px;
  background: var(--ms-accent); color: #111;
}
.ms-btn-ghost {
  background: rgba(255,255,255,.08); color: #fff;
}

html.pl-theme-mystyle body {
  padding-top: calc(var(--ms-top) + 12px) !important;
  padding-bottom: 40px !important;
}

.ms-wrap { max-width: 1100px; margin: 0 auto; padding: 8px 14px 48px; }
.ms-row { margin-bottom: 22px; }
.ms-row-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
}
.ms-row-h h2 { margin: 0; font-size: 18px; font-weight: 800; color: #fff; }
.ms-row-h a { color: var(--ms-accent); text-decoration: none; font-size: 13px; }
.ms-rail {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.ms-card {
  flex: 0 0 auto; width: 150px; text-decoration: none; color: #fff;
  scroll-snap-align: start;
}
.ms-card-thumb {
  aspect-ratio: 2/3; border-radius: 10px; overflow: hidden;
  background: var(--ms-card); position: relative;
}
.ms-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ms-card-thumb .ph {
  width: 100%; height: 100%; display: grid; place-items: center; font-size: 28px;
  background: linear-gradient(160deg, #1a1a22, #2a2a35);
}
.ms-live {
  position: absolute; top: 8px; left: 8px;
  background: #e50914; color: #fff; font-size: 10px; font-weight: 800;
  padding: 2px 6px; border-radius: 4px;
}
.ms-card-t {
  margin-top: 8px; font-size: 12px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ms-card-m { font-size: 11px; color: var(--ms-muted); margin-top: 2px; }

/* Editor modal */
.ms-editor-bg {
  position: fixed; inset: 0; z-index: 200000;
  background: rgba(0,0,0,.72); display: none;
  align-items: flex-start; justify-content: center;
  padding: 8vh 12px; box-sizing: border-box;
  overflow-y: auto;
}
.ms-editor-bg.open { display: flex; }
.ms-editor {
  width: min(520px, 100%);
  background: #14141a;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 18px 16px 20px;
  color: #eee;
}
.ms-editor h3 { margin: 0 0 14px; font-size: 18px; }
.ms-field { margin-bottom: 12px; }
.ms-field label {
  display: block; font-size: 12px; color: #999; margin-bottom: 4px; font-weight: 600;
}
.ms-field input[type="text"],
.ms-field input[type="color"],
.ms-field select {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: #0c0c10; color: #fff; font-size: 14px;
}
.ms-field input[type="color"] { height: 42px; padding: 4px; }
.ms-checks { display: flex; flex-direction: column; gap: 8px; }
.ms-checks label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #ddd; cursor: pointer;
}
.ms-editor-actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px;
}
.ms-hint { font-size: 12px; color: #777; margin-top: 10px; line-height: 1.4; }

html.pl-theme-mystyle .container,
html.pl-theme-mystyle main {
  max-width: 1100px; margin: 0 auto; padding: 8px 14px 40px;
}
html.pl-theme-mystyle a { color: var(--ms-accent); }

.ms-field textarea {
  width: 100%; box-sizing: border-box;
  padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: #0c0c10; color: #d4f0d4;
  font-size: 12px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  line-height: 1.45; resize: vertical; min-height: 120px;
}
.ms-editor { max-height: none; }
.ms-editor-bg { align-items: flex-start; }
