body{
  background:var(--bg);
  color:var(--text);
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
}

.lesson-wrap{
  max-width:720px;
  margin:0 auto;
  padding:16px 12px 60px;
}

.tg-post{
  background:var(--surface);
  box-shadow:var(--shadow);
  border-radius:16px;
  margin-bottom:18px;
  overflow:hidden;
  
}

.tg-header{
  padding:18px 18px 12px;
  font-weight:600;
  font-size:20px;
  line-height:1.3;
  border-bottom:1px solid var(--border);
  text-align:center;
}

.tg-body{
  padding:14px 18px 20px;
  line-height:1.55;
  font-size:15px;
  color:var(--text);

}


/* STEPS */

.steps-box{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin:12px 0 18px;
}

.step-row{
  display:flex;
  gap:14px;
  align-items:center;
  border:1px solid var(--border);
  background:var(--surface);
  border-radius:14px;
  padding:14px 16px;
}

.step-circle{
  min-width:28px;
  height:28px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:600;
  background:var(--surface-2);
  color:var(--text);
}

.step-row > div:last-child{
  display:flex;
  align-items:center;
  line-height:1.4;
}

/* QUOTE */


.tg-post,
.step-row,
.ingredients-box{
  box-shadow:var(--shadow);
}

.card,
.tg-post,
.step-row {
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  border: 1px solid var(--border);
}

.lessons-container {
  box-shadow: 0 4px 14px rgba(0,0,0,0.04);
  border: 1px solid var(--border);
}

.card:hover,
.tg-post:hover {
  box-shadow: 0 10px 28px rgba(0,0,0,0.08);
}
/* =========================
   GLOBAL READING MODE
========================= */



body.reading-mode .container {
  max-width: 760px;
  margin: 0 auto;
}

/* скрываем лишнее */
body.reading-mode .video-wrapper,
body.reading-mode .item-delete,
body.reading-mode .section-delete,
body.reading-mode .section-actions {
  display: none !important;
}

/* текст крупнее */
body.reading-mode .text-content,
body.reading-mode .step-text,
body.reading-mode .tg-quote {
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.9;
  text-align: center;
}

/* ингредиенты текстом */
body.reading-mode .ingredient-view-item {
  display: block;
  text-align: center;
  font-size: 24px;
  margin-bottom: 16px;
}

body.reading-mode .ingredient-dots {
  display: none;
}

body.reading-mode .tg-body {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* =========================
   🛒 STORE ADMIN DARK FIX
========================= */

.admin-page {
  background: #0f1114;
  color: #f3f4f6;
}

/* Карточки */

.admin-card {
  background: #171a1f;
  border-radius: 20px;
  padding: 22px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  border: 1px solid rgba(255,255,255,0.05);
  transition: 0.2s ease;
}

.admin-card:hover {
  border-color: rgba(124,92,255,0.4);
  box-shadow: 0 0 0 1px rgba(124,92,255,0.2);
}

/* Превью */

.admin-card__preview img,
.admin-card__preview-placeholder {
  width: 90px;
  height: 90px;
  border-radius: 18px;
  object-fit: cover;
  background: #0f1114;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

/* Информация */

.admin-card__title-row h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
}

.muted {
  font-size: 14px;
  color: #9aa0a6;
  margin-top: 4px;
}

/* Бейджи */

.lesson-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}

.lesson-badge.published {
  background: rgba(34,197,94,0.15);
  color: #22c55e;
}

.lesson-badge.draft {
  background: rgba(255,255,255,0.08);
  color: #9aa0a6;
}

/* Кнопки */

.btn.small {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 10px;
}

.btn.publish {
  background: #7c5cff;
  color: white;
}

.btn.publish:hover {
  background: #6a4ee6;
}

.btn.unpublish {
  background: rgba(255,255,255,0.08);
  color: #f87171;
}

.btn.unpublish:hover {
  background: rgba(248,113,113,0.15);
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  color: #d1d5db;
}

.btn.ghost:hover {
  border-color: #7c5cff;
  color: #ffffff;
}

/* Поиск */

.admin-search input {
  border-radius: 14px;
  padding: 10px 14px;
  min-width: 260px;
}

/* DARK THEME */

[data-theme="dark"] .admin-search input {
  background: #171a1f;
  border: 1px solid rgba(255,255,255,0.08);
  color: #ffffff;
}

/* LIGHT THEME */

[data-theme="light"] .admin-search input {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #111827;
}

/* LIGHT */

[data-theme="light"] input:focus {
  border-color: #32303b;
  box-shadow: 0 0 0 2px rgba(124,92,255,0.2);
}

/* DARK */

[data-theme="dark"] input:focus {
  border-color: #9f8cff;
  box-shadow: 0 0 0 2px rgba(159,140,255,0.25);
}

input[type="text"],
input[type="search"] {
  border-radius: 14px;
  padding: 10px 14px;
}

/* DARK */

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="search"] {
  background: #171a1f;
  border: 1px solid rgba(255,255,255,0.08);
  color: #ffffff;
}

/* LIGHT */

[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="search"] {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #111827;
}



.card {
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

[data-theme="light"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
}

.card {
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

/* WATERMARK */

.video-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.video-wrapper {
  position: relative;
}

.video-wrapper iframe {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  border: none;
  display: block;
  position: relative;
  z-index: 1;
}

.video-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}


/* =========================
   VIDEO FAKE FULLSCREEN
========================= */

.video-wrapper{
  position:relative;
  width:100%;
  aspect-ratio:9/16;
  max-height:85vh;
  margin:0 auto;
  background:black;
  overflow:hidden;
}

.video-wrapper iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:none;
}

/* watermark 

.video-wrapper .wm{
  position:absolute;
  inset:0;
  pointer-events:none;
  z-index:20;
}


.video-wrapper.fake-fullscreen{

  position:relative;

  width:auto;
  height:100vh;

  aspect-ratio:9/16;
  max-height:100vh;

  display:flex;
  align-items:center;
  justify-content:center;

}

.video-wrapper.fake-fullscreen iframe{
  width:100%;
  height:100%;
}
*/
/* fullscreen button */

.video-fs-overlay{

  position:fixed;
  inset:0;

  background:black;

  display:flex;
  align-items:center;
  justify-content:center;

  z-index:999999;

}

body.video-fs-active{
  overflow:hidden;
}

body.video-fs-active {
  touch-action: none;
}

.fs-btn {
  position: absolute !important; /* чтобы перекрыть другие правила */
  bottom: 10px !important;
  right: 18px !important;
  width: 40px !important;
  height: 40px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  z-index: 9999; /* чтобы перекрыть все слои */
  pointer-events: auto;
}

.video-wrapper.fake-fullscreen {
  position: relative;
}

.video-wrapper.fake-fullscreen .fs-btn {
  bottom: 10px;
}

body.video-fs-active .some-back-button {
  display: none !important;
}

/* Видеоконтейнер */
.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: 85vh;
  margin: 0 auto;
  background: black;
  overflow: hidden;
}

.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  position: relative;
  z-index: 1;
}

/* fake fullscreen 
.video-wrapper.fake-fullscreen {
  position: relative;
  width: auto;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-wrapper.fake-fullscreen iframe {
  width: 100%;
  height: 100%;
}


.video-fs-overlay {
  position: fixed;
  inset: 0;
  background: black;
  z-index: 999999;
}*/

/* Fullscreen button */
.fs-btn {
  position: absolute !important;
  bottom: 10px !important;
  right: 18px !important;
  width: 40px !important;
  height: 40px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  z-index: 9999;
  pointer-events: auto;
}

