/* ZemGuru modular styles 14/16. Original cascade order preserved. */
/* === Admin course constructor redesign v4 === */
.course-builder-page{
  padding: 8px 4px 30px;
}
.course-builder-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  padding: 4px 0 16px;
  border-bottom:1px solid rgba(15,23,42,.08);
  margin-bottom:16px;
}
.course-builder-header h1{
  margin:0 0 12px;
  font-size:30px;
  line-height:1.1;
  letter-spacing:-.03em;
  color:#111827;
}
.course-builder-tabs{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:22px;
}
.course-builder-tabs button{
  border:0;
  background:transparent;
  color:#667085;
  font-weight:800;
  padding: 8px 0;
  border-bottom:3px solid transparent;
  cursor:pointer;
}
.course-builder-tabs button.active{
  color:#14773a;
  border-bottom-color:#14773a;
}
.course-builder-mini-status{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:5px 10px;
  background:#eefbf2;
  color:#14773a;
  font-weight:800;
  font-size:12px;
}
.course-builder-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.course-builder-course-select{
  display:flex;
  align-items:center;
  gap:10px;
  margin: 0 0 14px;
}
.course-builder-course-select label{
  color:#667085;
  font-weight:800;
}
.course-builder-workspace{
  display:grid;
  grid-template-columns: minmax(290px, 360px) minmax(460px, 1fr) minmax(230px, 285px);
  gap:16px;
  align-items:start;
}
.course-builder-tree,
.course-builder-editor,
.course-builder-inspector .panel{
  border:1px solid rgba(15,23,42,.09);
  box-shadow:0 8px 26px rgba(15,23,42,.04);
}
.course-builder-tree{
  position:sticky;
  top:14px;
  padding:0;
  overflow:hidden;
}
.course-builder-tree-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:18px 18px 14px;
  border-bottom:1px solid rgba(15,23,42,.08);
}
.course-builder-tree-head h2,
.course-builder-editor-head h2,
.course-builder-status-card h2,
.course-builder-help-card h2{
  margin:0;
  font-size:20px;
  letter-spacing:-.02em;
}
.course-builder-tree-head p,
.course-builder-editor-head p{
  margin:4px 0 0;
  color:#667085;
  font-size:13px;
}
.course-builder-tree-search{
  display:flex;
  align-items:center;
  gap:8px;
  margin:14px;
  border:1px solid rgba(15,23,42,.1);
  border-radius:14px;
  padding:0 12px;
  background:#fbfcfb;
}
.course-builder-tree-search input{
  flex:1;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
  padding:12px 0!important;
}
.course-builder-tree-list{
  padding:0 14px 12px;
  max-height: calc(100vh - 300px);
  overflow:auto;
}
.course-builder-module{
  border-bottom:1px solid rgba(15,23,42,.07);
  padding:10px 0 12px;
}
.course-builder-module-title{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:10px;
  align-items:flex-start;
  padding:8px 0;
}
.course-builder-folder{
  color:#14773a;
  font-weight:900;
}
.course-builder-module-title b{
  display:block;
  color:#111827;
  font-size:14px;
}
.course-builder-module-title small{
  display:block;
  color:#667085;
  font-size:12px;
  margin-top:2px;
}
.course-builder-module-title em{
  font-style:normal;
  min-width:24px;
  height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:#eef2f1;
  color:#64706c;
  font-weight:900;
  font-size:12px;
}
.course-builder-lessons{
  display:grid;
  gap:8px;
  margin:6px 0;
}
.course-builder-lesson-node{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:10px;
  align-items:center;
  padding:12px 10px;
  border:1px solid rgba(15,23,42,.08);
  border-radius:12px;
  background:#fff;
  cursor:pointer;
  transition:.18s ease;
}
.course-builder-lesson-node:hover{
  border-color:rgba(20,119,58,.35);
  background:#fbfffc;
}
.course-builder-lesson-node.selected{
  border-color:rgba(20,119,58,.45);
  background:linear-gradient(90deg, rgba(32,147,69,.1), rgba(255,255,255,.92));
  box-shadow:inset 3px 0 0 #14773a;
}
.course-builder-doc-icon{
  width:28px;
  height:28px;
  border-radius:8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#f0f7f2;
  color:#14773a;
  font-weight:900;
}
.course-builder-lesson-node strong{
  display:block;
  color:#111827;
  font-size:13px;
  line-height:1.25;
}
.course-builder-lesson-node small{
  display:block;
  color:#667085;
  margin-top:3px;
  font-size:12px;
}
.course-builder-node-menu{
  border:0;
  background:transparent;
  color:#667085;
  font-size:20px;
  cursor:pointer;
}
.course-builder-add-lesson,
.course-builder-add-module{
  width:100%;
  border:1px dashed rgba(20,119,58,.35);
  background:#fbfffc;
  color:#14773a;
  border-radius:14px;
  padding:12px;
  font-weight:900;
  cursor:pointer;
}
.course-builder-add-module{
  margin:8px 14px 16px;
  width:calc(100% - 28px);
}
.course-builder-module-empty,
.course-builder-empty{
  border:1px dashed rgba(15,23,42,.12);
  border-radius:14px;
  padding:18px;
  color:#667085;
  background:#fbfcfb;
}
.course-builder-empty b,
.course-builder-empty span{
  display:block;
}
.course-builder-empty b{
  color:#111827;
  font-size:18px;
  margin-bottom:6px;
}
.course-builder-editor{
  padding:0;
  overflow:hidden;
}
.course-builder-editor-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:18px 20px 14px;
  border-bottom:1px solid rgba(15,23,42,.08);
}
.course-builder-editor-head-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.course-builder-editor-tabs{
  display:flex;
  align-items:center;
  gap:26px;
  padding:0 20px;
  border-bottom:1px solid rgba(15,23,42,.08);
  overflow:auto;
}
.course-builder-editor-tabs button{
  border:0;
  background:transparent;
  padding:14px 0 12px;
  font-weight:900;
  color:#667085;
  border-bottom:3px solid transparent;
  cursor:pointer;
  white-space:nowrap;
}
.course-builder-editor-tabs button.active{
  color:#14773a;
  border-bottom-color:#14773a;
}
.course-builder-content-editor{
  padding:18px 20px 20px;
}
.course-builder-content-note{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:12px 14px;
  border:1px solid rgba(20,119,58,.14);
  background:#f5fcf7;
  border-radius:14px;
  margin-bottom:14px;
}
.course-builder-content-note strong{
  color:#14773a;
  white-space:nowrap;
}
.course-builder-content-note span{
  color:#52605b;
}
.course-builder-save-row{
  display:flex;
  justify-content:flex-end;
  padding-top:14px;
}
.course-builder-inspector{
  position:sticky;
  top:14px;
  display:grid;
  gap:14px;
}
.course-builder-status-card,
.course-builder-help-card{
  padding:18px;
}
.course-builder-facts{
  display:grid;
  gap:13px;
  margin:14px 0 18px;
}
.course-builder-facts span{
  display:block;
  padding-bottom:12px;
  border-bottom:1px solid rgba(15,23,42,.07);
}
.course-builder-facts small{
  display:block;
  color:#667085;
  margin-bottom:5px;
  font-weight:800;
}
.course-builder-facts b{
  color:#111827;
}
.course-builder-help-card p{
  margin:10px 0;
  color:#52605b;
}
.course-builder-page .lesson-zen-editor{
  border:0;
  padding:0;
  background:transparent;
}
.course-builder-page .lesson-zen-toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:16px;
}
.course-builder-page .lesson-zen-toolbar .btn{
  border-radius:12px;
  padding:10px 14px;
}
.course-builder-page .lesson-zen-feed{
  display:grid;
  gap:12px;
}
.course-builder-page .lesson-zen-block{
  border:1px solid rgba(15,23,42,.09);
  border-radius:14px;
  background:#fff;
  padding:14px;
  box-shadow:0 6px 16px rgba(15,23,42,.035);
}
.course-builder-page .lesson-zen-block-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.course-builder-page .lesson-zen-block-type{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:900;
  color:#111827;
}
.course-builder-page .lesson-zen-block-type b{
  width:32px;
  height:32px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#eefbf2;
  color:#14773a;
  font-size:12px;
}
.course-builder-page .lesson-zen-title-input,
.course-builder-page .lesson-zen-editable{
  width:100%;
  border:1px solid rgba(15,23,42,.1);
  border-radius:12px;
  padding:12px 14px;
  background:#fbfcfb;
  min-height:44px;
  outline:none;
}
.course-builder-page .lesson-zen-editable:focus,
.course-builder-page .lesson-zen-title-input:focus{
  border-color:rgba(20,119,58,.45);
  box-shadow:0 0 0 3px rgba(20,119,58,.08);
}
.course-builder-page .lesson-zen-media-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.course-builder-page .lesson-zen-media-grid .lesson-zen-preview{
  grid-column:1/-1;
  min-height:110px;
  border:1px dashed rgba(15,23,42,.14);
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fbfcfb;
  overflow:hidden;
  color:#667085;
}
.course-builder-page .lesson-zen-preview img{
  width:100%;
  max-height:240px;
  object-fit:cover;
  display:block;
}
.course-builder-page .user-form-grid,
.course-builder-page .lesson-editor-section{
  padding:18px 20px 20px;
}
.editor-empty{
  margin:18px 20px 20px;
}
@media (max-width: 1320px){
  .course-builder-workspace{grid-template-columns:minmax(260px,330px) minmax(420px,1fr)}
  .course-builder-inspector{grid-column:1/-1; position:static; grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width: 920px){
  .course-builder-header{flex-direction:column;}
  .course-builder-workspace{grid-template-columns:1fr;}
  .course-builder-tree,.course-builder-inspector{position:static;}
  .course-builder-inspector{grid-template-columns:1fr;}
  .course-builder-page .lesson-zen-media-grid{grid-template-columns:1fr;}
}

/* Student lesson reader redesign — clean Dzen-like article layout */
.student-lesson-page {
  display: grid;
  gap: 18px;
  padding-bottom: 32px;
}

.student-lesson-breadcrumbs {
  margin: 4px 0 -4px;
}

.student-lesson-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  padding: 24px;
  border: 1px solid #dfe9e2;
  border-radius: 24px;
  background:
    radial-gradient(circle at 92% 14%, rgba(47, 111, 78, 0.14), transparent 34%),
    linear-gradient(135deg, #f8fbf7 0%, #ffffff 52%, #eef7f1 100%);
  box-shadow: 0 12px 34px rgba(16, 40, 28, 0.07);
}

.student-lesson-hero-main {
  display: grid;
  gap: 14px;
  align-content: center;
}

.student-lesson-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.student-lesson-kicker span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #e8f5ec;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.student-lesson-hero h1 {
  margin: 0;
  max-width: 900px;
  color: #141b17;
  font-size: clamp(28px, 3.1vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.student-lesson-hero p {
  max-width: 880px;
  margin: 0;
  color: #59645d;
  font-size: 16px;
  line-height: 1.7;
}

.student-lesson-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.student-lesson-progress-card {
  display: grid;
  gap: 10px;
  align-content: center;
  min-height: 190px;
  padding: 18px;
  border: 1px solid rgba(47, 111, 78, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 32px rgba(16, 40, 28, 0.07);
}

.student-lesson-progress-card span,
.student-lesson-progress-card small {
  color: #68736c;
  font-size: 13px;
  font-weight: 700;
}

.student-lesson-progress-card strong {
  color: #121915;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.student-lesson-progressbar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3ebe6;
}

.student-lesson-progressbar i {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: linear-gradient(90deg, #247441, #44a764);
}

.student-lesson-reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.student-lesson-reader {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.student-lesson-article {
  max-width: 980px;
  width: 100%;
  padding: 30px;
  border-radius: 24px;
}

.student-lesson-article .student-article-block {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
  scroll-margin-top: 90px;
}

.student-lesson-article .student-article-block:last-child {
  margin-bottom: 0;
}

.student-lesson-article .lesson-formatted-content {
  gap: 16px;
}

.student-lesson-article .lesson-formatted-content p,
.student-lesson-article .lesson-content-text p,
.student-lesson-article .lesson-content-body p {
  color: #1f2b24;
  font-size: 17px;
  line-height: 1.82;
}

.student-lesson-article .lesson-formatted-content h2,
.student-lesson-article .lesson-block-heading {
  margin-top: 4px;
  color: #111814;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.student-lesson-article .lesson-formatted-content h3 {
  color: #111814;
  font-size: 22px;
}

.student-lesson-article .lesson-article-image {
  margin: 2px 0 4px;
}

.student-lesson-article .lesson-article-image img {
  max-height: 720px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(16, 40, 28, 0.08);
}

.student-lesson-article .lesson-article-file {
  border-radius: 18px;
  background: #f8fbf9;
}

.student-lesson-article .lesson-content-warning {
  padding: 18px 20px;
  border-radius: 18px;
  background: #fff8e6;
}

.student-lesson-article .lesson-article-checklist {
  padding: 18px 20px;
  border-radius: 18px;
}

.student-lesson-video {
  max-width: 980px;
}

.student-lesson-video .lesson-article-video iframe,
.student-lesson-video .lesson-video-card {
  border-radius: 22px;
  box-shadow: 0 12px 34px rgba(16, 40, 28, 0.09);
}

.student-lesson-empty-video {
  max-width: 980px;
  padding: 16px 18px;
  border: 1px dashed #d7e3dc;
  border-radius: 18px;
  background: #f8fbf9;
}

.student-lesson-empty-video span {
  display: block;
  color: #9b5d1a;
  font-weight: 900;
}

.student-lesson-empty-video p {
  margin: 5px 0 0;
  color: #66716a;
  line-height: 1.55;
}

.student-lesson-empty-content {
  display: grid;
  gap: 8px;
  padding: 24px;
  border: 1px dashed #d7e3dc;
  border-radius: 18px;
  background: #f8fbf9;
}

.student-lesson-empty-content h2,
.student-lesson-empty-content p {
  margin: 0;
}

.student-lesson-homework-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 980px;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff8e8, #ffffff);
}

.student-lesson-homework-card span {
  color: #ad6b20;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.student-lesson-homework-card h2,
.student-lesson-homework-card p {
  margin: 0;
}

.student-lesson-homework-card div {
  display: grid;
  gap: 7px;
}

.student-lesson-bottom-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 980px;
}

.student-lesson-side {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 14px;
}

.student-lesson-side-card {
  border-radius: 20px;
}

.student-lesson-side-card h2 {
  margin: 0 0 12px;
  font-size: 19px;
}

.lesson-meta-list.clean {
  gap: 13px;
}

.lesson-meta-list.clean span {
  padding-bottom: 11px;
  border-bottom: 1px solid #eef3ef;
}

.lesson-meta-list.clean span:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.student-lesson-toc {
  display: grid;
  gap: 8px;
}

.student-lesson-toc a {
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  color: #324039;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.student-lesson-toc a:hover {
  background: #eef7f1;
  color: var(--green);
}

@media (max-width: 1180px) {
  .student-lesson-reading-layout {
    grid-template-columns: 1fr;
  }

  .student-lesson-side {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .student-lesson-hero {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .student-lesson-article {
    padding: 20px;
  }

  .student-lesson-side {
    grid-template-columns: 1fr;
  }

  .student-lesson-bottom-nav,
  .student-lesson-homework-card {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Student lesson clean reader: убрали правые блоки «О уроке» и «В уроке», контент стал шире */
.student-lesson-reading-layout-clean {
  grid-template-columns: minmax(0, 1fr);
}

.student-lesson-reader-wide {
  max-width: 1120px;
  width: 100%;
}

.student-lesson-reader-wide .student-lesson-article,
.student-lesson-reader-wide .student-lesson-video,
.student-lesson-reader-wide .student-lesson-empty-video,
.student-lesson-reader-wide .student-lesson-homework-card,
.student-lesson-reader-wide .student-lesson-bottom-nav {
  max-width: 1120px;
}

.student-lesson-reader-wide .lesson-article-image img {
  width: 100%;
  object-fit: contain;
}

/* Lesson content block rich formatting fix */
.lesson-block-format-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #f8fbf9;
}
.lesson-block-format-btn {
  appearance: none;
  border: 1px solid rgba(20, 119, 58, 0.18);
  border-radius: 10px;
  background: #fff;
  color: #173b27;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.lesson-block-format-btn:hover {
  border-color: rgba(20, 119, 58, 0.38);
  background: #eefbf2;
}
.lesson-zen-editable {
  font-size: 17px;
  line-height: 1.75;
}
.lesson-zen-editable p {
  margin: 0 0 14px;
}
.lesson-zen-editable p:last-child {
  margin-bottom: 0;
}
.lesson-zen-editable h2 {
  margin: 0 0 14px;
  font-size: 28px;
  line-height: 1.22;
  font-weight: 900;
  color: #111827;
}
.lesson-zen-editable h3 {
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 900;
  color: #16251c;
}
.lesson-zen-editable ul,
.lesson-zen-editable ol {
  margin: 0 0 14px 22px;
  padding: 0;
}
.lesson-zen-editable li {
  margin: 6px 0;
}
.lesson-zen-editable strong,
.lesson-zen-editable b {
  font-weight: 900;
}
.lesson-zen-editable em,
.lesson-zen-editable i {
  font-style: italic;
}
.course-builder-page .lesson-zen-editable {
  font-size: 17px;
  line-height: 1.75;
}
.course-builder-page .lesson-block-format-toolbar {
  margin-bottom: 10px;
}
@media (max-width: 780px) {
  .lesson-block-format-toolbar {
    gap: 5px;
  }
  .lesson-block-format-btn {
    padding: 7px 8px;
    font-size: 12px;
  }
  .lesson-zen-editable {
    font-size: 16px;
  }
}

/* Fix 2026-06-30: teacher messenger student list should not collapse to icon rail */
body[data-active="teacherDialog"] .teacher-dialog-sidebar.mentor-list-sidebar {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 280px !important;
  max-width: 380px !important;
  overflow: hidden !important;
}

body[data-active="teacherDialog"] .teacher-dialog-sidebar.mentor-list-sidebar .teacher-dialog-chats-main,
body[data-active="teacherDialog"] .teacher-dialog-sidebar.mentor-list-sidebar .teacher-dialog-chats-main-hint {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
  grid-template-columns: none !important;
}

body[data-active="teacherDialog"] .teacher-dialog-sidebar.mentor-list-sidebar .teacher-dialog-chats-pane {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
}

body[data-active="teacherDialog"] .teacher-dialog-sidebar.mentor-list-sidebar .teacher-dialog-chats-list {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

body[data-active="teacherDialog"] .teacher-dialog-sidebar.mentor-list-sidebar .teacher-dialog-chat-row {
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr) !important;
  width: 100% !important;
  min-width: 0 !important;
}

body[data-active="teacherDialog"] .teacher-dialog-sidebar.mentor-list-sidebar .teacher-dialog-chat-row-body,
body[data-active="teacherDialog"] .teacher-dialog-sidebar.mentor-list-sidebar .teacher-dialog-chat-row-top,
body[data-active="teacherDialog"] .teacher-dialog-sidebar.mentor-list-sidebar .teacher-dialog-chat-row-bottom {
  min-width: 0 !important;
}

body[data-active="teacherDialog"] .teacher-dialog-sidebar.mentor-list-sidebar .teacher-dialog-chat-row-name,
body[data-active="teacherDialog"] .teacher-dialog-sidebar.mentor-list-sidebar .teacher-dialog-chat-row-preview {
  display: block !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

/* Step 70: clean calls and recordings layout */
body[data-active="calls"] .calls-main-tabs {
  margin-bottom: 14px;
}
body[data-active="calls"] .calls-filters {
  align-items: stretch;
  margin-bottom: 18px;
}
body[data-active="calls"] .calls-filters .search {
  min-width: min(520px, 100%);
}
body[data-active="calls"] .calls-clean-panel {
  overflow: visible;
}
.calls-clean-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.call-clean-row.call-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(120px, 150px) minmax(220px, auto);
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #edf0ed;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20, 45, 35, .035);
}
.call-clean-row.call-row:last-child {
  border-bottom: 1px solid #edf0ed;
}
.call-clean-row.with-recording {
  background: linear-gradient(90deg, rgba(31, 125, 61, .055), #fff 42%);
  padding-left: 16px;
  padding-right: 16px;
}
.call-clean-icon.row-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 14px;
}
.call-clean-record .call-clean-icon {
  background: #eef6ff;
  color: #315c91;
}
.call-clean-past .call-clean-icon {
  background: #f3f5f4;
  color: #718076;
}
.call-clean-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.call-clean-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.call-clean-title strong {
  font-size: 16px;
  line-height: 1.18;
}
.call-clean-main small,
.call-clean-date small,
.small-muted {
  color: var(--muted);
  line-height: 1.25;
}
.call-clean-date {
  display: grid;
  gap: 4px;
  color: var(--ink);
}
.call-clean-date b {
  line-height: 1.15;
}
.call-clean-actions.call-row-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.call-clean-actions .btn {
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}
.call-more-menu {
  position: relative;
  display: inline-block;
}
.call-more-menu summary {
  list-style: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid #dfe7e2;
  border-radius: 11px;
  background: #fff;
  color: var(--green);
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}
.call-more-menu summary::-webkit-details-marker {
  display: none;
}
.call-more-menu[open] summary {
  border-color: rgba(31, 125, 61, .35);
  background: #f4fbf6;
}
.call-more-menu > div {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 25;
  min-width: 190px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid #dfe7e2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(14, 31, 24, .14);
}
.call-more-menu button {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  padding: 9px 10px;
  cursor: pointer;
}
.call-more-menu button:hover {
  background: #f3f7f4;
  color: var(--green);
}
.clean-calls-sidebar .quick-actions {
  display: grid;
  gap: 10px;
}
body[data-theme="dark"] .call-clean-row.call-row,
body[data-theme="dark"] .call-more-menu summary,
body[data-theme="dark"] .call-more-menu > div {
  background: var(--panel);
  border-color: var(--line);
}
body[data-theme="dark"] .call-clean-row.with-recording {
  background: linear-gradient(90deg, rgba(51, 180, 103, .10), var(--panel) 48%);
}
body[data-theme="dark"] .call-more-menu button:hover {
  background: rgba(255,255,255,.06);
}
@media (max-width: 1320px) {
  .call-clean-row.call-row {
    grid-template-columns: 44px minmax(0, 1fr) minmax(120px, auto);
  }
  .call-clean-actions.call-row-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
@media (max-width: 720px) {
  .call-clean-row.call-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .call-clean-date,
  .call-clean-actions.call-row-actions {
    grid-column: 2 / -1;
  }
  .call-clean-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .call-more-menu,
  .call-more-menu summary {
    width: 100%;
  }
}

/* Messenger unread badges: меню и верхняя панель */
.messenger-top-icon {
  font-size: 21px;
}

.top-icon span,
.messenger-top-icon span {
  min-width: 18px;
  width: auto;
  padding: 0 5px;
  border-radius: 999px;
  background: #f04d4d;
  color: #fff;
  font-weight: 800;
  line-height: 18px;
}

/* Step 2026-06-30: Email/VK connection panels in all profiles */
.profile-channel-note {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px dashed rgba(31, 132, 76, 0.28);
  border-radius: 10px;
  background: rgba(31, 132, 76, 0.06);
  color: var(--muted);
  line-height: 1.45;
}

.profile-channel-note strong {
  color: var(--text);
}

.integration-panel,
.email-panel {
  padding: 22px;
}

.integration-panel .section-title,
.email-panel .section-title {
  align-items: flex-start;
}

.integration-connected,
.email-connected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfb;
}

.integration-connected > div:first-child,
.email-connected > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.integration-connected b,
.email-connected b {
  overflow-wrap: anywhere;
}

.integration-connected span,
.email-connected span {
  color: var(--muted);
  line-height: 1.45;
}

.integration-connected.muted-state,
.email-connected.muted-state {
  background: #f8faf8;
  border-style: dashed;
}

.email-panel .security-note,
.vk-panel .security-note {
  margin-top: 12px;
}

body[data-theme="dark"] .profile-channel-note {
  background: rgba(91, 196, 130, 0.08);
  border-color: rgba(120, 220, 157, 0.22);
}

body[data-theme="dark"] .profile-channel-note strong {
  color: var(--text);
}

body[data-theme="dark"] .integration-connected,
body[data-theme="dark"] .email-connected {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
}

@media (max-width: 720px) {
  .integration-connected,
  .email-connected {
    align-items: stretch;
    flex-direction: column;
  }

  .integration-connected .btn-row,
  .email-connected .btn-row {
    width: 100%;
  }

  .integration-connected .btn,
  .email-connected .btn {
    width: 100%;
  }
}

