﻿button#showPrevBtn {
  float: none;
  display: inline;
  margin: auto;
}

#showPrevBtn {
  float: none;
  display: inline;
}

#pdfPreview #userInfo > #form-btn {
  text-align: center !important;
}
.outcomeText {
  display: block;
}

@media (max-width: 1130px) {
  #level1_explorer {
    /* width: 80%; */
  }

  div#breadcrums span.breadLabel {
    margin: 0px 2px;
  }
}

@media (max-width: 850px) {
  .startScreen h1 {
    font-size: 15px;
  }
  .TG_bg {
    /* bottom: 230px; */
  }
}

@media (max-width: 500px) {
  .tgMainTitle {
    font-size: 16px;
  }
  .TG_bg {
    width: 100%;
    /* background-size: 100%; */
  }

  h1#topTitle {
    font-size: 30px;
  }

  h1#topTitle + h2 {
    font-size: 26px;
  }

  input#startBtn {
    margin-top: 207px;
    margin-left: 95px;
    width: auto;
  }
  #userInfo input[type="text"] {
    width: 190px;
    margin-left: 26px;
  }
  #userInfo {
    height: 406px;
  }
  input[type="submit"],
  button {
    margin-bottom: 19px;
  }

  input[type="checkbox"],
  input[type="radio"] {
    margin-left: 12px;
  }
}

@media (max-width: 850px) {
  .startScreen {
    width: 100%;
  }

  .startScreen h1 {
    font-size: 20px;
  }
  #userInfo {
    height: 369px;
  }
}

@media (max-width: 800px) {
  body {
    overflow: auto;
  }
  div#explorer {
    width: 100%;
  }
  #collectionList {
    width: 100%;
    margin-left: 0px;
    height: 100%;
    padding: 0px;
  }

  #level1_explorer {
    width: 100%;
    clear: both;
    float: none;
  }

  .level1-header {
    width: auto;
  }

  div#wrapper-button {
    /* width: auto; */
  }

  #sidePanel-auto {
    width: 100% !important;
    overflow: auto !important;
  }

  #auto-page1,
  #auto-page2 {
    width: 100% !important;
  }

  #breadcrums > span {
    display: none;
  }

  #breadcrums > span:last-child {
    display: inline;
  }

  #stats > div {
    display: block;
    float: none;
    width: 100%;
    margin-bottom: 10px;
  }

  #addTest {
    margin-right: 5px;
    clear: both;
  }

  #stats {
    height: auto;
    text-align: right;
  }

  span.quesSec {
    text-align: left;
    width: auto;
  }

  div#explorer {
    clear: both;
  }

  .quesSecNo {
    background: transparent;
    padding: 0px;
    border: none;
  }

  div#pdfPreview {
    clear: both;
  }

  #toolbars {
    height: auto;
  }

  .mx-tools {
    position: relative;
    width: 100%;
    float: none;
    margin: 5px 0px 0px 0px;
    right: 0px;
    left: 0px;
    background: rgba(255, 255, 255, 0.42);
    top: 0px;
    padding: 5px 0px;
    text-align: left;
  }

  #pdfPreview .options {
    width: 100%;
  }

  #pdfPreview label.numbering {
    left: 3px;
  }

  #pdfPreview .question-parent {
    padding: 5.75px 10px 8px 5px;
  }

  .marksDiv {
    position: absolute;
    left: auto;
    top: auto;
    background: transparent;
    bottom: 0px;
    height: 46px;
    right: 9px;
    z-index: 1;
  }
  #pdfPreview #userInfo > div {
    float: none !important;
    position: static !important;
    display: block;
    width: 100% !important;
    text-align: left !important;
  }

  div#userInfo {
    position: relative;
  }
  .TG_bg {
    /* position: relative; */
    bottom: 290px;
    /* margin: auto; */
    margin-left: -180px;
  }
  .CiE-txt.tgTitle {
    font-size: 18px;
  }
}
@media (max-width: 640px) {
  .level1-header {
    width: 100% !important;
    text-align: center;
  }

  .auto-tabs-section {
    /* width: 100% !important; */
    /* float: none !important; */
    /* text-align: center !important; */
  }
  div#wrapper-button {
    float: left;
    line-height: 30px;
    width: 100%;
    text-align: left;
  }
  div#topHeader {
    height: 35%;
  }
  /*#previewHTML td {
	width: 49%;
	font-size: 16px;
	
}*/
  #userInfo label {
    margin-left: 1px;
  }
  .main {
    width: 40% !important;
  }
}

@media screen and (max-width: 460px) {
  .auto-tabs-section {
    width: 100%;
    clear: both;
    float: none !important;
    text-align: center !important;
    height: 100% !important;
  }
  .auto-topsection {
    display: none !important;
  }
  .auto-tabs-wrapper button {
    display: inline-block;
  }
  .book_name {
    float: none !important;
    text-align: center;
    margin: auto;
    width: 100% !important;
  }

  .top_checkbox {
    width: 100% !important;
  }

  .toolbars_preview {
    padding: 0 !important;
  }
}

@media (max-width: 1920px) {
  #pdfPreview #userInfo > div:nth-child(7) {
    left: 270px;
    bottom: 94px;
    right: auto;
    text-align: left;
  }
  #pdfPreview #userInfo > div:nth-child(3) {
    width: 50%;
  }
  #logoUpdateParent {
    top: -160px;
    left: -9px;
  }
  #pdfPreview #userInfo > div:nth-child(6) {
    left: 915px;
    top: -1px;
  }

  #pdfPreview #userInfo > div:nth-child(2) {
    margin-top: 62px;
    margin-left: -80px;
  }

  #logoUpdateParent input {
    margin-left: 0px;
  }
  #userInfo label {
    margin-left: 17px;
    /*.fileChooseBlocker {
		width: 504px;
		left: 140px;
		height: 62px;
}*/
  }
  .fileChooseBlocker {
    top: 0px;
    left: 139px;
  }
  #pdfPreview #userInfo > div:nth-child(3) {
    position: relative;
    top: -53px;
  }
  #pdfPreview #userInfo > div:nth-child(5) {
    top: 116px;
    left: 268px;
  }
  .level1-header {
    /* width: 44%; */
  }
  #wrapper-button {
    /* width: 54%; */
  }
}
/*@media (max-width: 1280px) {
#pdfPreview #userInfo > div:nth-child(7) {
	right: 18%;
	
}
#logoUpdateParent input{
	margin-left: 18px;
}
}*/
@media (max-width: 800px) {
  #pdfPreview #userInfo > div:nth-child(7) {
    right: 2%;
    bottom: 106px;
  }
  #userInfo input[type="text"] {
    width: 211px;
  }
  #breadcrums {
    height: 35px;
  }
  .quesSecNo {
    float: right;
  }
  #breadcrums > span.breadLabel {
    margin: 0px 2px;
  }
  .fileChooseBlocker {
    width: 341px;
    top: 180px;
    left: 551px;
    height: 50px;
  }
}

@media (max-width: 1500px) {
  #logoUpdateParent input {
    margin-left: 18px;
  }
  #pdfPreview #userInfo > div:nth-child(5) {
    top: 116px;
    left: 138px;
  }
  #pdfPreview #userInfo > div:nth-child(6) {
    top: 3px;
    left: 653px;
  }
  #logoUpdateParent {
    top: -167px;
  }
  #pdfPreview #userInfo > div:nth-child(7) {
    bottom: 87px;
    left: 137px;
  }
  #pdfPreview #userInfo > div:nth-child(2) {
    width: 31%;
    margin-top: 63px;
    margin-left: -13px;
  }
  .fileChooseBlocker {
    top: 4px;
    left: 168px;
    z-index: 999;
  }
  .level1-header {
    /* margin-left: 142px; */

    /* width: 30%; */
  }
  #wrapper-button {
    /* width: 52%; */
  }
}
@media screen and (max-width: 1040px) {
  #toolbars {
    height: auto;
  }

  #toolbars .auto_level-buttons {
    height: 100%;
  }
  .auto_level-buttons button {
    margin: 5px auto;
  }

  .toolbarsHead {
    width: 40% !important;
  }
}

@media screen and (max-width: 1024px) {
  .main {
    width: 25%;
  }

  .folder_name {
    font-size: 16px;
  }
}

@media (max-width: 980px) {
  #pdfPreview #userInfo > div:nth-child(7) {
    right: 18%;
    left: 46px;
    bottom: 200px;
  }
  #logoUpdateParent {
    top: -149px;
    width: 48%;
  }
  #pdfPreview #userInfo > div:nth-child(5) {
    left: 50px;
    top: 149px;
  }
  #pdfPreview #userInfo > div:nth-child(2) {
    margin-top: 61px;
    width: 44%;
    margin-left: -10px;
  }
  #pdfPreview #userInfo > div:nth-child(6) {
    top: -3px;
    left: 477px;
  }
  pdfPreview #userInfo > div:nth-child(3) {
    width: 51%;
  }
  .fileChooseBlocker {
    top: 2px;
    /*left: 634px;*/
  }
  .level1-header {
    /* width: 30%; */
  }
  h1.tgTitle {
    /* padding: 0; */
    /* font-size: 22px; */
  }
  #wrapper-button {
    width: 40% !important;
  }
  .manual-filter-container {
    /*
		position: relative !important;
		right: 0 !important;
		bottom: 0 !important;
		padding-bottom: 10px !important;
		*/
  }

  #topHeader {
    height: auto !important;
  }

  #topHeader .auto-topsection {
    width: auto !important;
  }
}

@media (max-width: 1000px) {
  .quesSecNo {
    padding: 5px 0px;
  }

  #explorer .info_btn {
    padding: 5px;
    margin: 0px 4px;
  }

  .book_name .tgTitle {
    font-size: 20px;
  }

  #level1 .book_name {
    width: 38%;
  }

  #level2 .finalise_btns .info_btn,
  #auto-level-2 .finalise_btns .info_btn {
    font-size: 12px;
    padding: 5px 10px;
  }

  #auto-level-2 #pdfPreview #userInfo input,
  #level2 #pdfPreview #userInfo input {
    width: auto;
  }

  #auto-level-2 #pdfPreview #userInfo label,
  #level2 #pdfPreview #userInfo label {
    width: 70px;
  }
}

@media screen and (max-width: 850px) {
  .toolbars_preview {
    float: none;
  }
}

@media (min-width: 800px) {
  #logoUpdateParent input {
    margin-left: 0px;
  }
  #pdfPreview #userInfo > div:nth-child(2) {
    margin-top: 11px;
  }
}

@media (min-width: 768px) {
  #pdfPreview #userInfo > div:nth-child(2) {
    margin-top: 11px;
  }
}

@media screen and (max-width: 600px) {
  .auto-top-bar .cntiner .pull-right,
  .auto-top-bar .cntiner .pull-left {
    float: none !important;
    margin: 5px auto;
  }

  .activityDetails {
    margin: 20px auto;
  }

  table.auto-seelctquestions th {
    font-size: 14px;
  }

  input[type="checkbox"],
  input[type="radio"] {
    font-size: 14px !important;
  }

  #auto-testpaper-details {
    font-size: 14px;
  }
  label.ml100 {
    margin: 0;
  }
}

@media (max-width: 360px) {
  #userInfo {
    height: 458px;
  }
  #userInfo input[type="text"] {
    width: 200px;
  }
  .fileChooseBlocker {
    left: 156px;
    top: 341px;
  }
  #pdfPreview #userInfo > div:nth-child(2) {
    margin-top: 29px;
  }

  .marksPreview {
    margin-left: 30px;
    margin-top: 19px;
  }

  .level1-header {
    /* margin-left: 83px; */
    width: 53%;
  }
  /*.marksDiv {
		bottom: -16px;
		right: -18px;
	}
	.marksInput {
		margin-right: 22px;
	}*/

  /*#userInfo label {
    margin-left: 5px;
}*/
}
/*@media (min-width: 1920px) {	
	#logoUpdateParent input {
		margin-left: 0px;
	}
	
}*/

@media (max-width: 760px) {
  #userInfo table,
  #userInfo tbody,
  #userInfo tr,
  #userInfo td {
    display: block;
    width: 100%;
    padding: 0px;
    margin: 0px;
  }

  #userInfo tr,
  #userInfo tbody,
  #userInfo table {
    clear: both;
  }

  #userInfo table > tbody > tr > td td {
    width: auto;
    float: left;
    line-height: 31px;
  }

  #userInfo table > tbody > tr > td {
    width: 100%;
  }

  div#userInfo {
    height: auto;
    padding-bottom: 20px;
    padding-right: 10px;
  }

  #userInfo table > tbody > tr > td td label {
    width: auto;
    margin: 0px;
    margin-right: 10px;
    width: 120px !important;
    display: block;
  }

  div#sContainIn {
    clear: both;
  }

  div#userInfo > table {
    padding: 20px;
  }

  #previewHTML .image,
  .image {
    width: auto !important;
  }

  #userInfo input[type="text"] {
    margin: 0px !important;
    float: right;
  }

  #userInfo > div {
    clear: both;
    margin-bottom: 28px;
  }

  #level1_explorer div#topHeader {
    height: auto;
  }

  #level1_explorer div#wrapper-button {
    float: none;
  }

  #level1_explorer .level1-header {
    float: none;
  }

  #toolbars {
    position: static !important;
    display: block;
    margin: 0px 5px !important;
  }

  #toolbars {
    height: auto !important;
    /* padding: 21px 0px; */
  }

  #topHeader .auto-tabs-section {
    width: 100%;
    height: auto;
    padding: 0;
    margin: 10px auto;
  }

  #topHeader .auto-tabs-wrapper button {
    display: inline-block;
  }
  div#wrapper-button {
    width: 100% !important;
    float: none;
    text-align: left;
  }

  .totalQues {
    display: block !important;
  }
}
@media (min-width: 800px) {
  #pdfPreview #userInfo > div:nth-child(2) {
    margin-top: 11px;
  }
}
@media (min-width: 320px) {
  #pdfPreview #userInfo > div:nth-child(2) {
    margin-top: 11px;
  }
}
@media (min-width: 980px) {
  #pdfPreview #userInfo > div:nth-child(2) {
    margin-top: 61px;
  }
}

@media (max-width: 768px) {
  #pdfPreview #userInfo > div:nth-child(2) {
    margin-left: 0px !important;
  }

  #pdfPreview #userInfo > div:nth-child(9) {
    width: 100%;
    text-align: center;
    float: none;
  }

  button#showPrevBtn {
    float: none;
    margin: auto;
    display: inline;
  }
}

@media (max-width: 600px) {
  #replaceQuestion > div {
    width: 100%;
    margin: 0px;
    height: 100%;
    overflow: auto;
    position: fixed;
    top: 0px;
    left: 0px;
    z-index: 99999;
  }

  #replaceList .question-title {
    width: 100%;
    float: none;
  }

  #replaceList img {
    width: 100%;
    max-width: 100%;
  }

  #replaceQuestion {
    z-index: 99;
  }

  #replaceList > .question-parent > input[type="checkbox"] {
    margin-bottom: 10px;
    margin-left: 0px;
  }
  .TG_bg {
    /* margin-left: -4px; */
    /* margin-top: 10px; */
    bottom: 30%;
    /* margin-left: -100px; */
  }
}

@media (min-width: 768px) {
  #pdfPreview #userInfo > div:nth-child(1) {
    width: 30%;
    text-align: left;
    margin-left: 20%;
  }

  #pdfPreview #userInfo > div:nth-child(3) {
    width: 30%;
    text-align: left;
    margin-left: 20%;
  }

  #pdfPreview #userInfo > div:nth-child(5) {
    width: 30%;
    text-align: left;
    margin-left: 20%;
    float: left;
    left: 0px;
    top: -49px !important;
    left: 50% !important;
  }

  #pdfPreview #userInfo > div:nth-child(7) {
    width: 30%;
    left: 0px;
    margin-left: 20%;
    text-align: left;
  }

  #userInfo label {
    display: inline-block;
    margin: 0px;
    width: 50px;
  }

  #userInfo input[type="text"] {
    margin-left: 0px !important;
  }

  #pdfPreview #userInfo > div:nth-child(2) {
    width: 50%;
    margin-left: 0px;
    text-align: left;
    padding-top: 11px;
  }

  #pdfPreview #userInfo > div:nth-child(4) {
    width: 50%;
    text-align: left;
  }

  #pdfPreview #userInfo > div:nth-child(6) {
    left: 50%;
    width: 50%;
    text-align: left;
  }

  div#logoUpdateParent {
    width: 50% !important;
    left: 50%;
    text-align: left;
    margin: 0px;
    position: absolute;
    top: 6%;
    z-index: 999999999999999999999;
  }

  #pdfPreview #userInfo > div:nth-child(9) {
    clear: both;
    width: 100%;
    text-align: center;
    margin-top: 30px;
    /* margin-left: -70px; */
  }
}
@media (max-width: 768px) {
  #logoUpdateParent input {
    z-index: 0000;
    position: relative;
  }
}

@media (min-width: 768px) and (max-width: 1467px) {
  #pdfPreview #userInfo > #form-shcool,
  #pdfPreview #userInfo > #form-subject,
  #pdfPreview #userInfo > #form-name,
  #pdfPreview #userInfo > #form-roll,
  #pdfPreview #userInfo > #form-set,
  #pdfPreview #userInfo > #form-time,
  #pdfPreview #userInfo > #form-class,
  #pdfPreview #userInfo > #logoUpdateParent,
  #pdfPreview #userInfo > #form-btn {
    width: 50% !important;
    float: left !important;
    margin: 10px 0px !important;
    top: 0px;
    left: 0px;
    position: static !important;
  }

  #pdfPreview #userInfo > #form-name,
  #pdfPreview #userInfo > #form-set,
  #pdfPreview #userInfo > #form-class {
    clear: both;
  }

  #pdfPreview #userInfo > #form-btn {
    width: 92% !important;
    margin-top: 20px !important;
  }
  #userInfo label {
    margin-left: 30px;
  }

  #pdfPreview #userInfo > #logoUpdateParent {
    position: relative !important;
    top: -163px;
  }

  #pdfPreview #userInfo > #form-subject,
  #pdfPreview #userInfo > #form-roll,
  #pdfPreview #userInfo > #form-time {
    position: relative !important;
    top: 54px;
  }
}

@media (max-width: 1467px) {
  /*.fileChooseBlocker {
		left: 67%;
	}*/
}

@media (max-width: 768px) {
  .fileChooseBlocker {
    top: 0px;
    left: 187px;
  }
}

@media screen and (max-width: 950px) {
  .toolbars_preview {
    margin-left: 0;
    /* width: 40%; */
  }

  .book_name {
    width: auto;
  }
  .auto-topsection {
    width: auto;
    /* text-align: center !important; */
  }
}

@media screen and (max-width: 760px) {
  .auto_level-buttons {
    width: 100%;
    height: auto !important;
  }

  .auto_level-buttons button {
    display: inline-block;
  }
}

@media screen and (max-width: 650px) {
  .toolbars_preview {
    width: 96%;
    clear: both;
    padding: 10px;
    margin: 0;
  }

  .top_checkbox {
    float: none;
    text-align: center;
    margin: auto;
    width: 40%;
    display: inline-block;
  }

  .finalise_btns {
    margin: 0;
    float: right;
  }
}

@media screen and (max-width: 540px) {
  .level3-navigation {
    height: auto;
  }

  .level3_buttons {
    width: 100%;
  }
}

@media screen and (max-width: 1140px) {
  #topHeader {
    /* height: 24%; */
  }
}
@media screen and (max-width: 675px) {
  #topHeader {
    /* height: 32%; */
  }
}

@media screen and (max-width: 530px) {
  #topHeader {
    /* height: 40% !important; */
  }
}

@media screen and (max-width: 480px) {
  #topHeader {
    /* height: 45% !important; */
  }
}
@media screen and (max-width: 440px) {
  #topHeader {
    /* height: 60% !important; */
  }
}

/* ============================
   MOBILE START SCREEN FIX
   ============================ */
@media screen and (max-width: 600px) {
  /* Center the start screen wrapper */
  .startScreenWrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
  }

  /* Make start screen fit mobile width */
  .startScreen {
    width: 100% !important;
    max-width: 100%;
    background-size: contain;
    background-position: center top;
    background-repeat: no-repeat;
    margin: 0 auto;
    padding: 0;
  }

  /* Scale down the main logo for mobile */
  .main-logo {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 10;
  }

  .main-logo img {
    width: 80px;
  }

  /* Fix the Start button positioning */
  .TG_bg {
    margin-top: 85%;
    margin-left: 0 !important;
    bottom: auto !important;
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* Ensure Start button is properly sized */
  .TG_bg .sm_button {
    margin: 0 auto;
    font-size: 16px;
    min-width: 110px;
    padding: 8px 15px;
  }

  /* Hide the main title if it appears */
  .tgMainTitle {
    font-size: 14px;
    margin-top: 15%;
  }
}

/* ============================
   MOBILE AUTO MODE HEADER FIX
   ============================ */
@media screen and (max-width: 600px) {
  /* Make publication logo smaller on mobile (auto mode default) */
  .publication_logo {
    width: 130px !important;
    height: auto;
    position: relative;
    top: auto;
    left: auto;
    margin: 5px;
  }

  /* MANUAL MODE (Level 1) - Publication logo bigger to avoid blur */
  #topHeader .publication_logo {
    width: 100px !important;
    height: auto;
    position: static !important;
    margin: 5px auto;
    display: block;
    order: 2;
  }

  /* Auto mode top header - wrap items properly */
  .auto-toptitle {
    flex-wrap: wrap;
    min-height: auto !important;
    padding: 5px;
  }

  /* Book name - full width, centered, smaller font */
  .auto-toptitle .book_name {
    width: auto !important;
    float: none !important;
    text-align: center;
    flex: 1;
    min-width: 0;
  }

  /* tgTitle - only target inside #topHeader for manual mode */
  #topHeader h1.tgTitle {
    font-size: 16px !important;
    padding: 6px 20px !important;
    margin: 0 auto !important;
    display: inline-block;
  }

  /* Auto tabs section (home + info buttons) */
  .auto-toptitle .auto-tabs-section {
    width: auto !important;
    float: none !important;
    height: auto !important;
    padding: 5px;
    display: flex;
    align-items: center;
  }

  .auto-tabs-wrapper {
    display: flex;
    gap: 5px;
  }

  .auto-tabs-wrapper button {
    display: inline-block !important;
    width: 32px;
    height: 32px;
    font-size: 18px;
    margin: 2px;
  }

  /* Auto level buttons (home, info, back on right side) */
  .auto_level-buttons {
    width: auto !important;
    height: auto !important;
    padding: 5px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
  }

  .auto_level-buttons button {
    width: 32px;
    height: 32px;
    font-size: 18px;
    margin: 2px !important;
  }

  /* Auto-topsection - hide on mobile (empty div) */
  .auto-topsection {
    display: none !important;
  }

  /* ===== MANUAL MODE LEVEL 1 HEADER ===== */
  #topHeader {
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
  }

  #topHeader .level1-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-wrap: nowrap;
    min-height: auto;
    padding: 10px;
    overflow: visible !important;
  }

  /* 1. Home + Info buttons - TOP RIGHT */
  #topHeader .auto-tabs-section {
    order: 1;
    width: 100% !important;
    height: auto !important;
    display: flex !important;
    justify-content: flex-end;
    padding: 0 5px;
    margin-bottom: 5px;
    overflow: visible !important;
    position: relative;
    z-index: 10;
  }

  #topHeader .auto-tabs-wrapper {
    display: flex !important;
    gap: 8px;
    overflow: visible !important;
  }

  #topHeader .auto-tabs-wrapper button {
    width: 35px !important;
    height: 35px !important;
    min-width: 35px;
    font-size: 20px;
    border-radius: 50%;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* 2. Logo - CENTERED */
  /* (already set above with order: 2) */

  /* 3. Book Name Tab - CENTERED */
  #topHeader .book_name {
    order: 3;
    width: 100% !important;
    text-align: center;
    float: none !important;
    margin: 5px 0;
    min-width: auto !important;
  }

  /* 4. Question Counts - BELOW */
  #topHeader #wrapper-button {
    order: 4;
    width: 100% !important;
    float: none !important;
    text-align: center;
    padding: 5px 0;
  }

  #topHeader #wrapper-button .totalQues {
    display: block !important;
    margin-bottom: 5px;
    font-size: 14px;
  }

  #topHeader #wrapper-button p {
    font-size: 13px !important;
    margin: 0;
  }

  /* Toolbars (level 2 & 3 headers) */
  #toolbars,
  .level3-navigation {
    flex-wrap: wrap;
    height: auto !important;
    min-height: auto !important;
  }

  /* Toolbars preview section */
  .toolbars_preview {
    width: 100% !important;
    margin-left: 0 !important;
  }

  .finalise_btns {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
  }

  .finalise_btns .info_btn {
    font-size: 11px;
    padding: 5px 8px;
  }

  /* Level 3 buttons */
  .level3_buttons {
    width: 100% !important;
    text-align: center;
  }

  .level3_buttons .info_btn {
    font-size: 12px;
    padding: 6px 10px;
    margin: 3px;
  }

  /* Side panel + content go full width */
  #sidePanel-auto {
    width: 100% !important;
    float: none !important;
    height: auto !important;
  }

  #auto-page1,
  #auto-page2 {
    width: 100% !important;
    float: none !important;
  }

  /* Main page full width */
  #mainPage {
    width: 100% !important;
  }

  #activityArea {
    width: 100% !important;
  }

  /* Instructions area - clean up */
  .instructions-area .alert {
    font-size: 14px;
    padding: 10px;
  }

  /* Chapter list - fix padding for mobile */
  #chapterList {
    padding-left: 40px;
    font-size: 13px;
  }

  /* Table of contents title */
  h3.navTitle {
    min-width: auto;
    font-size: 16px;
  }
}

/* ============================
   MOBILE SELECT QUESTIONS FIX
   ============================ */
@media screen and (max-width: 600px) {
  /* Duration / Max Marks top bar */
  .auto-top-bar {
    height: auto !important;
    padding: 10px !important;
  }

  .auto-top-bar .cntiner {
    max-width: 100%;
  }

  .auto-top-bar .cntiner .pull-left,
  .auto-top-bar .cntiner .pull-right {
    float: none !important;
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
  }

  /* Question selection table - make it scrollable */
  .activityDetails {
    padding: 10px 5px !important;
    overflow-x: auto;
  }

  table.auto-seelctquestions {
    font-size: 13px !important;
    max-width: 100%;
    width: 100%;
    table-layout: auto;
  }

  table.auto-seelctquestions th {
    font-size: 12px !important;
    padding: 5px 3px;
    /* word-break: break-word; */
  }

  table.auto-seelctquestions td {
    font-size: 13px;
    padding: 4px 3px;
    word-break: break-word;
  }

  /* Dropdowns inside the table */
  table.auto-seelctquestions select {
    width: 50px !important;
    font-size: 12px;
    padding: 3px;
  }

  /* Marks per question input */
  table.auto-seelctquestions .marksper {
    width: 40px !important;
    font-size: 12px;
    padding: 3px;
  }

  /* Checkbox labels in select questions */
  .activityDetails label.checkbox {
    font-size: 14px;
  }

  /* Worksheet selection section */
  .worksheet-selection {
    padding-left: 10px;
  }

  #selection-worksheet label {
    font-size: 14px;
  }

  .ml100 {
    margin-left: 30px !important;
  }

  /* Bottom total and submit */
  .bottom-total-ls {
    max-width: 100%;
    padding-right: 10px;
    font-size: 14px;
  }

  .activity-submit-wrap {
    text-align: center;
    padding: 10px 0;
  }

  /* Select Questions heading */
  .instructions-area h3 {
    font-size: 16px;
  }

  /* Filter area (objectives, difficulty) */
  #filter-area {
    padding: 10px;
  }

  #auto-filter-difficulty,
  #auto-filter-outcome {
    width: 100% !important;
    float: none !important;
    margin: 10px 0 !important;
  }

  /* Test generator type modal */
  .tg-type-container {
    width: 90% !important;
    max-width: 350px;
    height: auto !important;
    padding: 20px;
    /* Reset the negative margin centering that cuts off on mobile */
    margin-left: 0 !important;
    margin-top: 0 !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%);
  }

  /* Insert new question modal */
  .insertNewQuestion-container {
    width: 95% !important;
    margin: 10px auto;
  }

  .form-group label {
    width: auto;
    display: block;
    margin-bottom: 5px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    width: 100% !important;
    box-sizing: border-box;
  }
}

/* ============================
   MOBILE TEST PREVIEW FIX
   ============================ */
@media screen and (max-width: 600px) {
  /* Toolbars header - Row wrap layout */
  #toolbars {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center;
    padding: 8px !important;
    position: relative;
    height: auto !important;
    min-height: auto !important;
    overflow: hidden !important;
    z-index: 100;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* 1. Logo - TOP LEFT */
  #toolbars > .publication_logo {
    order: 1;
    position: static !important;
    width: 80px !important;
    height: auto;
    margin: 0 !important;
    flex-shrink: 0;
  }

  /* Navigation Buttons (Home, Info, Back) - TOP RIGHT */
  #toolbars > .auto_level-buttons {
    order: 2;
    margin-left: auto !important;
    width: auto !important;
    height: auto !important;
    display: flex !important;
    gap: 5px;
    padding: 0 !important;
  }

  #toolbars > .auto_level-buttons button {
    margin: 0 2px;
    font-size: 14px;
    width: 28px;
    height: 28px;
  }

  /* Book Name - FULL WIDTH ROW BELOW */
  #toolbars > .book_name {
    order: 3;
    width: 100% !important;
    text-align: left;
    margin: 0 !important;
    float: none !important;
    min-width: auto !important;
  }

  #toolbars .book_name h1.tgTitle,
  #toolbars h1.tgTitle {
    font-size: 12px !important;
    padding: 4px 10px !important;
    margin: 0 !important;
    border-radius: 0 0 8px 8px;
    line-height: normal;
    display: inline-block;
    width: auto;
  }

  #toolbars .book_name h3 {
    font-size: 12px;
    margin: 3px 0 0 0;
    font-weight: normal;
    color: #fff;
  }

  /* Preview Tools - FULL WIDTH ROW */
  #toolbars > .toolbars_preview {
    order: 4;
    width: 100% !important;
    max-width: 100%;
    margin: 5px 0 !important;
    padding: 0 !important;
    float: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    clear: both !important;
    box-sizing: border-box;
  }

  /* Action Buttons - LEFT ALIGNED */
  .finalise_btns {
    order: 1 !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 5px;
    margin: 0 0 8px 0 !important;
    width: 100% !important;
    max-width: 100%;
    float: none !important;
    box-sizing: border-box;
  }

  .finalise_btns .info_btn {
    margin: 0;
    font-size: 10px;
    padding: 5px 8px;
    white-space: normal;
    background-color: #fefad4;
    color: #163488;
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    box-sizing: border-box;
    text-align: center;
  }

  /* Checkboxes - LEFT ALIGNED BELOW BUTTONS */
  .top_checkbox {
    order: 2 !important;
    width: 100% !important;
    text-align: left;
    margin: 0 !important;
    padding: 3px 0;
    /* display: flex !important; */
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    gap: 12px;
    float: none !important;
    color: #fff;
  }

  .top_checkbox li {
    width: auto !important;
    display: flex !important;
    align-items: center;
    margin-bottom: 3px;
    font-size: 12px;
    list-style: none;
  }

  .top_checkbox input {
    margin-top: 0;
    margin-right: 4px;
  }

  /* Hide empty auto-topsection */
  #toolbars > .auto-topsection {
    display: none !important;
  }

  /* User Info Form (Student Details) */
  #userInfo {
    height: auto !important;
    padding: 15px;
    display: flex;
    flex-direction: column;
  }

  #userInfo > div {
    width: 100% !important;
    float: none !important;
    margin: 5px 0 !important;
    padding: 0 !important;
    position: static !important;
    text-align: left !important;
    height: auto !important;
  }

  #userInfo label {
    display: block;
    width: 100%;
    margin-bottom: 5px;
  }

  #userInfo input[type="text"] {
    width: 100% !important;
    margin: 0 !important;
    box-sizing: border-box;
  }

  /* Logo upload section fix */
  #logoUpdateParent {
    position: static !important;
    width: 100% !important;
    margin: 10px 0 !important;
    text-align: center !important;
  }

  /* PDF Preview Content Area */
  #pdfPreview {
    height: auto !important;
    overflow: visible !important;
    padding: 10px 5px;
  }

  /* Question items in preview */
  #pdfPreview .question-parent {
    padding: 10px 10px 10px 40px !important; /* Left padding for numbering */
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
  }

  /* Question section headings (e.g. "C. निम्नलिखित शब्दों के...") */
  .main_Div h3 {
    font-size: 14px !important;
    padding: 10px 0 !important;
    line-height: 1.4;
  }

  /* Question type headings (e.g. "Multiple choice questions") */
  #pdfPreview h2,
  .main_Head {
    font-size: 16px !important;
  }

  /* Outcome text */
  .outcomeText {
    font-size: 12px !important;
  }

  .numbering {
    left: 5px !important;
    top: 10px !important;
    font-size: 14px;
  }

  /* Marks Display - fix absolute positioning */
  .marksDiv {
    position: static !important;
    float: right;
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    margin-top: 5px;
  }

  .marksInput {
    width: 40px !important;
  }

  /* Answers section in preview */
  .question-answer {
    width: 100% !important;
    margin-top: 5px;
  }

  /* Question images */
  .question-parent img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Options layout */
  .options {
    width: 100% !important;
  }

  /* Hide or adjust file chooser blocker */
  .fileChooseBlocker {
    display: none !important;
  }
  #level2 .finalise_btns .info_btn, #auto-level-2 .finalise_btns .info_btn {
        font-size: 7px;
        padding: 5px 10px;
    }
  #toolbars .toolbars_preview .finalise_btns {
        position: absolute;
        top: 12%;
        left: 29%;
    }
}

