.ht_sm_container{ 
  font-family: system-ui, sans-serif; 
/*  background: #f5f6f8; */

}   
.ht_sm_two-col { 
    display: grid; 
/*    grid-template-columns: 1fr 1fr; */
     grid-template-columns: 0.45fr 0.55fr;
/*    gap: 18px; */
    box-sizing: border-box;
/*    overflow: hidden;*/
    position: relative;
    border-radius: 8px;
    border: 1px solid rgb(233, 236, 239);
    background-color: #fff; 
}
/*.ht_sm_two-col {
    min-height: 500px;
}

.ht_sm_panel {
    min-height: 450px; 
}*/
    .ht_sm_panel { 
/*        overflow: hidden; */
        position: relative;
         display: flex;
  flex-direction: column;
  height: 100%; 

  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
    }
    .ht_sm_panel > div:last-child {
  flex: 1;
  display: flex;
  flex-direction: column;
}
    .ht_sm_editor-wrap {
  /*    flex: 1;              
      display: flex;
      flex-direction: column;*/
        flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;      /* CRITICAL */
  overflow: hidden; 
    }
    #ht_sm_editor {
/*  flex: 0 1 auto;
  display: block;*/
    flex: 1 1 auto;
  min-height: 0;      /* allow it to shrink inside flex parents */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}
.ql-editor {
  min-height: 165px; /* starting height */
  height: auto;      /* grow with content */
  overflow-y: visible; /* no scrollbar while growing */
  padding: 10px;
  box-sizing: border-box;
   white-space: pre-wrap;
  word-break: break-word;        /* break long words if needed */
  overflow-wrap: anywhere;       /* nice modern fallback */
  hyphens: auto;
}
.ql-editor *{
  font-size: 15px;
  line-height: 22px;
}

    .ht_sm_panel_last{
      border-left: 1px solid rgb(233, 236, 239);
    }
    .ht_sm_head { 
       border-bottom: 1px solid rgb(233, 236, 239);
      padding:9px 14px;
      gap: 5px;
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      justify-content: flex-start;
      align-items: center;
  }
  .ht_sm_panel_last .ht_sm_head{
        display: flex;
    align-content: space-between;
    min-height: 56px;
    align-items: center;
  }
  .ht_sm_head .ht_sm_title{
        font-weight: bold;
    font-size: 16px;
    height: 100%;
    line-height: 37px;
  }

/* toolbar */
    .ht_sm_toolbar { 
      display: flex; 
      gap: 8px; 
      flex-wrap: wrap; 
    }
    .ht_sm_toolbar_devider{
          flex-shrink: 0;
      width: 1px;
      height: 36px;
      background: #e9ecef;
      margin: 0 .3rem;
    }
    .ht_sm_tool-btn { border: 1px solid #e5e7eb; border-radius: 10px; padding: 6px 10px; cursor: pointer; background: #fff; position: relative; }
    .ht_sm_tool-btn:active,
    .ht_sm_tool-btn:focus{
      border: 1px solid #e5e7eb;
    }
    .ht_sm_ool-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ht_sm_tool-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
}

.ht_sm_tool-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

    #ht_sm_editor { 
/*    flex: 1;*/
    min-height: 170px;
    border: none;
    overflow-y: auto; 
  }

/*    */
.ht_sm_panel-copy-btn{
    padding: 15px 50px;
     display: flex;
       margin-top: auto;  /* pushes button to bottom */
  align-self: flex-end; /* align right if you want */
     cursor: pointer;
}
.ht_sm_box-copy-btn{
      padding: 10px 50px;
    display: block;
    width: 100%;
}
.ht_sm_panel-copy-btn,
.ht_sm_box-copy-btn{
      background: #f0f3f5;
  
   
    align-items: center;
    margin: auto;
    margin-bottom: 12px;
    gap: 8px;
     color: #000;
     font-weight: 600;
    font-size: 16px;
}
.ht_sm_panel-copy-btn span,
.ht_sm_box-copy-btn span{
  color: #000;
}


 /* Device toggle */
    .ht_sm_device-toggle { 
      display: flex; 
      background: #F0F3F5; 
          gap: 0;
    display: flex;
    padding: 5px;
    border-radius: 8px;
    margin-left: auto;

    }
    .ht_sm_device-btn {  
      padding: 6px 10px; 
      cursor: pointer; 
      border-radius: 6px; 
    }
    .ht_sm_device-btn.active { 
      background: #fff; 
      color: #000; 
    }



   /* .emoji-pop { position: absolute; top: calc(100% + 8px); left: 10px; z-index: 999; display: none; }
    .emoji-pop.open { display: block; }*/
/*    .ht_sm_sort-list { display: none; position: absolute; top: calc(100% + 6px); left: 0; background: #fff; border: 1px solid #ddd; border-radius: 6px; z-index: 20; }*/
/*    .ht_sm_sort-list.open { display: block; }*/
    .ht_sm_sort-item { padding: 6px 10px; cursor: pointer; }
    .ht_sm_sort-item:hover { background: #f8fafc; }

    
    .ht_sm_profile { display: flex; gap: 12px; margin-bottom: 8px; }
    .ht_sm_avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
    .ht_sm_meta { font-size: 14px; }
    .ht_sm_meta .ht_sm_name { font-weight: 600; }
    .ht_sm_meta .ht_sm_tag { color: #555; font-size: 13px; }
    .ht_sm_meta .ht_sm_time span{ color: #555; font-size: 12px; }

    .ht_sm_post-text *{ 
        font-size: 15px; 
        line-height: 1.4; 
        /*white-space: pre-wrap; */

      }
      .ht_sm_post-text p{
        margin-bottom: 0px;
      }
      .ht_sm_post-text *{
          white-space: pre-wrap;
        word-wrap: break-word;
        overflow-wrap: anywhere;
      }
    .ht_sm_line { display: block; }
    .ht_sm_line.blank { min-height: 1em; }
    .ht_sm_line-with-more { 
      display: flex; 
      align-items: baseline; 
      justify-content: space-between; 
      gap: 8px; 
      width: 100%;
    }
  /*  .ht_sm_line-text { flex: 1 1 auto; white-space: pre-wrap; }
    .ht_sm_more-right { white-space: nowrap; color: #666; font-weight: 500; }*/
    .ht_sm_line-text {
    flex: 1;
    white-space: pre-wrap;
    margin-right: 10px;
        color: #232323;
}

.ht_sm_more-right {
    white-space: nowrap;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
}

    .ht_sm_separator { border-top: 1px solid #ddd; margin: 8px 0; }
    .ht_sm_extra { color: #444; font-size: 14px; }

   

    /* Action Buttons */
    .ht_sm_actions { display: flex; justify-content: space-around; border-top: 1px solid #ddd; margin-top: 15px; padding-top: 4px; }
    .ht_sm_action-btn { flex: 1; text-align: center; padding: 8px; cursor: pointer; color: #555; font-size: 14px; border-radius: 6px; }
    .ht_sm_action-btn:hover { background: #f0f2f5; }
    .ht_sm_action-btn i { margin-right: 6px; }

    /* Reactions */
    .ht_sm_reactions { display: flex; justify-content: space-between; font-size: 14px; color: #555; margin-top: 20px; }
    .ht_sm_left-reactions { display: flex; align-items: center; gap: 6px; }
    .ht_sm_left-reactions span{
      color: #555;
    }
    .ht_sm_left-reactions i { color: #0a66c2; }
    .ht_sm_right-reactions { color: #777; }

    /* Preview */
    /* Preview */
    .ht_sm_preview-wrap { 
      padding: 14px;
          background: #fff;
    border-radius: 8px;
    border: 1px solid #e6e6e6;
     transition: all 0.3s ease; 
    }
    .ht_sm_preview-container{
      background: #F7F5EE;
      padding: 15px 30px;
    }
    .ht_sm_panel.ht_sm_panel_last{
      background: #fff;
    }
    .ht_sm_preview-mobile { 
      max-width: 400px; 
      margin: auto; border: 1px solid #e6e6e6; 
      border-radius: 8px; 
          min-width: 390px;
    }
    .ht_sm_preview-mobile .ht_sm_action-btn{
          padding: 8px 4px;
        cursor: pointer;
        color: #555;
        font-size: 13px;
        border-radius: 6px;
    }
/*    */
/* Three preview boxes */
 .ht_sm_three-boxes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 30px;
  }
  .ht_sm_box {
    border: 1px solid #e6e6e6;
    border-radius: 6px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
  }
  .ht_sm_box strong {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
  }
  .ht_sm_box-content {
      flex: 1;
    padding: 0.5rem;
    min-height: 80px;
    border: 1px solid #e6e6e6;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
    background: #fff;
    border-radius: 8px;
  }

.ht_sm_copy-btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  background: #f8f9fa;
}
.ht_sm_copy-btn:hover {
  background: #eaeaea;
}

/* .styled-box {
    font-family: Inter, 'Noto Sans Math', 'Cambria Math',
                 'Segoe UI Symbol', 'Apple Symbols', 'DejaVu Sans', sans-serif;
  }
  */
.ht_sm_copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  padding: 6px 10px;
  cursor: pointer;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

.ht_sm_copy-btn i { margin-left: 0; }

.ht_sm_copied-text {
  margin-left: auto;
  color: green;
  font-weight: 600;
  font-size: 0.9em;
  transition: opacity 0.3s;
}

/* Bold (serif math font) */
/*#boldBox {
  font-family: 'Cambria Math', 'Noto Serif Math', 'STIX Two Math',
               'Times New Roman', serif;
}*/

/* Bold Sans (sans math font) */
/*#boldSansBox {
  font-family: 'Noto Sans Math', 'Segoe UI Symbol', 'DejaVu Sans',
               'Arial Unicode MS', sans-serif;
}*/
#ht_sm_btnSort {
    position: relative;
    display: inline-block;
}

.ht_sm_sort-list {
    position: absolute;
    top: 110%;
    right: -100px; /* Changed from left:0 to right:0 */
    background: #fff;
    border: 1px solid #ccc;
    display: none;
    z-index: 1000; /* Increased z-index */
    min-width: 140px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ht_sm_sort-list.open { 
    display: block; 
}
.ht_sm_sort-item { padding: 5px 10px; cursor: pointer; }
.ht_sm_sort-item:hover { background: #eee; }


.ht_sm_preview-wrap.preview-mobile {
  width: 375px;
  margin: 0 auto;
  border: 1px solid #ddd;
  border-radius: 10px;
}

  @media screen and (max-width:992px){
    .ht_sm_three-boxes{
      grid-template-columns: repeat(2, 1fr);
    }



    @media screen and (max-width:767px){
      .ht_sm_two-col {
    grid-template-columns: 1fr;
    }
    .ht_sm_three-boxes{
      grid-template-columns: 1fr;
    }
    .ht_sm_panel_last{
      border-top: 1px solid rgb(233, 236, 239);
    }


  }



