:root {
    --bg:#f7f7fb; 
    --card:#ffffff; 
    --ink:#111827; 
    --muted:#6b7280;
    --accent:#6c5ce7; 
    --green:#10b981; 
    --red:#ef4444; 
    --line:#e5e7eb;
    --bg-gradient-t: linear-gradient(90deg, #0ea5e9 0%, #6366f1 100%);
}

/* Khung header mô phỏng thead trên desktop */
.lookup-header {
  display: flex;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 8px;
}
.lookup-header .col{
    padding: 0;
    font-size: 16px;
    font-weight: 700;
}
.lookup-row input, .look-up input[readonly]{
    font-size: 16px;
    background-color: #fff !important;
    font-weight: 600;
}
.phonetic{
    color: #e84949 !important;
}
.vi-mean{
    color: #06C270 !important;
}

/* Mỗi hàng dùng CSS Grid, không cần scroll ngang */
.lookup-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #fff;
  align-items: center;
}

.lookup-row .col { display: flex; flex-direction: column; padding: 0;}
.lookup-row .help-msg { display:none; color:#d9534f; font-size:12px; margin-top:4px; }
.lookup-row .is-invalid + .help-msg { display:block; }

.lookup-row .btn-wrap { display:inline-flex; align-items:center; gap:8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile: stack 1 cột, tự hiển thị nhãn từ data-label */
@media (max-width: 1199px) {
  .lookup-row, .lookup-header {
    display: block;
  }
  .lookup-header { display: none !important; }
  .lookup-row .col {
    margin-bottom: 8px;
    position: relative;
    padding-top: 18px;
  }
  .lookup-row .col::before {
    content: attr(data-label);
    position: absolute;
    top: 0;
    left: 0;
    font-size: 14px;
    color: #6b7280;
  }
  .col-play .btn, .col-dl .btn { width: 100%; }
  .lookup-row .btn-wrap{
    width: auto;
  }
  .lookup-row .col-play,
  .lookup-row .col-dl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;        /* mỗi nút chiếm 1 nửa */
    margin-right: 2%;  /* khoảng cách nhỏ */
    margin-bottom: 0;  /* bỏ margin dưới */
  }

  .lookup-row .col-play::before,
  .lookup-row .col-dl::before, .col-actions:before {
    display: none;     /* ẩn nhãn data-label */
  }
  .lookup-row input{
    margin-top: 10px !important;
  }
  .col-actions{
    padding-top: 10px !important;
  }
}

.actions-group{
  display:inline-flex;
  align-items:center;
  gap:8px;
  flex-wrap: nowrap;
  justify-content: center;
}


.page-wrap{max-width:1200px;margin:32px auto}
.table thead th{white-space:nowrap;background:#028F99;color:#fff;border-color:#028F99; font-weight:700;}
.table td,.table th{vertical-align:middle}
.cell-readonly input{background:#f1f3f5}
.phonetic{font-family:"Courier New",monospace}
@keyframes spin{to{transform:rotate(360deg)}}
.help-msg{font-size:12px;color:#dc3545;margin-top:4px;display:none}
.en-input.is-invalid{border-color:#dc3545}
.play-btn, .dl-btn{
    font-size: 15px;
}
.play-btn i, .dl-btn i{
    padding-right: 0 !important;
}
.doc-btn{
    display: flex;
    align-items: center;
    justify-content: center;
}
.g-4{
    gap:15px;
}

/*Cau*/
.tra-cau-section textarea{
    width:100%;
    min-height:84px;
    border:1px solid var(--line);
    border-radius:14px;
    padding:12px 14px;
    font-size:18px;
    line-height:1.4;
    outline:none;
    resize:vertical;
    background:#fff
}

.tra-cau-section textarea:focus{
    border-color:var(--iq-primary);
    box-shadow:0 0 0 3px rgba(108,92,231,.15)
}

.tra-cau-section textarea:disabled, .tra-cau-section textarea[readonly]{
    background-color: #fff;
}
#accentSentence, #voiceSelectVNSentence{
    width: 110px;
}
#voice, #accentSentence, #voiceSelectVNSentence{
    appearance: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 14px;
    background: #fff;
    height: 37.5px;
    width: 100%;
}

.controls{display:flex;gap:10px;align-items:center}
.speak, .download-sentence-mp3{
    cursor: pointer;
    height:37.5px;
    border-radius:8px;
    display:grid;
    place-items:center;
    border:1px solid var(--line);
    background:var(--iq-primary);
    cursor:pointer;
    box-shadow:0 8px 20px rgba(0,0,0,.05)
}
.speak:disabled{opacity:.6;cursor:not-allowed}
.speak svg{width:22px;height:22px;fill:#fff}
.speak-icon{
    display:flex;
    gap:1px;
}
.ta-vi{color:var(--green) !important;font-weight:700}
.ta-en{color:#1f2937 !important;font-size:20px;font-weight:700}
.ta-ipa{color:var(--red) !important;font-weight:700}
@media(min-width:768px){
    .tra-cau-section textarea{
        min-height: 130px;
    }
}
#lookupTable input{
    font-size: 16px;
}
@media(max-width:480px){
    .tra-cau-section textarea{
        font-size: 16px;
    }
}
@media(max-width:465px){
    .dropdown-menu-right{
        z-index: 99999;
    }
    #headerC{
        flex-wrap: wrap;
    }
    #btnSpeak{
        position: fixed;
        right:20px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 9999;
    }

    #btnSpeakVN{
        position: fixed;
        right:20px;
        top: calc(50% + 50px);
        transform: translateY(-50%);
        z-index: 9999;
    }

    #download-sentence-mp3{
        position: fixed;
        right:20px;
        top: calc(50% + 100px);
        transform: translateY(-50%);
        z-index: 9999;
    }
    .controls{
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .dh-title{
        flex-wrap:wrap-reverse;
        gap:15px;
    }
    .dh-title h4{
        font-size:18px;
    }
    .dh-title p{
        width:100%;
        text-align:right;
    }
}

#sentence-submit {
    padding: 5px 15px;
    height: 37.5px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.loading-overlay {
  position: fixed; inset: 0;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.65); z-index: 9999;
}
.loading-overlay.active { display: flex; }

.loading-box {
  width: 140px; min-height: 140px; border-radius: 16px;
  background: rgba(255,255,255,.08);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px 14px;
}

.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  animation: spin .8s linear infinite;
  margin-bottom: 12px;
}
.msg { color: #fff; font: 500 14px/1.4 sans-serif; }

@keyframes spin { to { transform: rotate(360deg); } }

.vi-container{
    position:relative;
}
#modalSugguestVi{
    position:absolute;
    right: 2px;
    top: -2px;
    color:var(--iq-primary) !important;
    background:transparent;
    border:0;
    width: 30px;
    font-size:20px;
}
#toast-notification{
    min-width:290px;
}
.col-vi{
    position: relative;
}

.modalSugguestWordVi{
    position:absolute;
    right: 2px;
    top: 0px;
    color:var(--iq-primary) !important;
    background:transparent;
    border:0;
    width: 30px;
    font-size:20px;
}


@media (max-width: 767.98px) {
  #headerC {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  #headerC .btn,
  #headerC .dropdown > button {
    width: 97%;
    margin-bottom: 0px;
  }

  #headerC .dropdown-menu {
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
  }
  .modalSugguestWordVi{
    top:28px;
  }
}
}

.example-card { background:#fff; border-radius: 14px; padding:1rem 1.25rem; box-shadow:0 4px 10px rgba(0,0,0,.05); margin-bottom:0rem; }
.example-en { font-size:1.1rem; font-weight:600; color:#111; }
.example-vi { color:#333; font-size:0.95rem; }
.badge-en { background:#e8f3ff; color:#0b63ce; }
.badge-vi { background:#fff1e6; color:#d67200; }
#modal-suggest-sentence-word .modal-content { border-radius:16px; overflow:hidden; }
#modal-suggest-sentence-word .modal-header { background:#f9fafb; border-bottom:1px solid #eee; }
#modal-suggest-sentence-word .modal-footer { background:#f9fafb; border-top:1px solid #eee; }
@media(max-width:576px){
    .example-card { padding:0.9rem; }
    .example-en { font-size:1rem; }
}

.show>.btn-light.dropdown-toggle {
    color:#000;
}
.dropdown-s button{
    height:37.5px;
}
.download-sentence-mp3{
    width:50px;
}
/*H*/
.example-card-history{
    border:1px solid #fff3f3;
    background:#fff; 
    border-radius:14px; 
    padding:1rem 1.25rem;
    box-shadow:0 2px 8px rgba(0,0,0,.05); margin-bottom:1rem;
}
.vi-mean, .phonetic{
    cursor:pointer;
}
.tra-cau-section{
    padding-bottom:55px;
}
.history-option select{
    height:45px;
    font-size:14px;
}
#modal-history1{
    z-index:1051 !important;
}
.font-ipa, .example-ipa{
    font-family: "Noto Sans", sans-serif;
    font-style:italic;
    letter-spacing: 0.02em;
}

.example-ipa { 
    color:#555; 
}


.handle {
    cursor: grab;
    color: #999;
    font-size: 20px;
    margin-right: 8px;
}
.course-desc{
    background:#fff;
    border-radius:8px;
    padding:15px 25px;
}
.course-desc h2{
    text-align:left;
    background: var(--bg-gradient-t);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.course-desc p{
    color:#000;
    font-size:16px;
}
.course-desc{
    font-size:16px;
}
.text-phonetic, .txt-12{
    font-size:12px;
}
.col-en .input-group-text{
    background:#e4e4e4 !important;
}
.action-ms{
    display:flex;
    flex-direction: column;
}
.row-action-aq{
    display:flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.action-dl{
    border-left: 1px solid #b4abab;
    padding-left: 10px;
}
#qaTabContent{
    padding-left:15px;
    padding-right:15px;
}

.qa-card {
    border: none;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    background: #ffffff;
}

.qa-tabs {
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
    background: linear-gradient(90deg, #0ea5e9 0%, #6366f1 100%);
    padding: 0.25rem;
}

.qa-tabs .nav-link {
    border: none !important;
    border-radius: 999px;
    color: #e5e7eb !important;
    font-weight: 500;
    padding: 0.55rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    font-size:15px;
}

.qa-tabs .nav-link.active {
    background: #ffffff;
    color: #0f172a !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.25);
}

.qa-tabs .nav-link:hover {
    background: rgba(15, 23, 42, 0.15);
    color: #ffffff !important;
}

.qa-tabs .nav-link.active i {
    color: #0ea5e9;
}

.topic-label {
    background: #eef2ff;
    color: #4f46e5;
    font-size: 0.73rem;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 500;
    float: right;
}
.col-en .input-group-text, 
.col-en .en-input, 
.col-en .en-input-answer {
    font-weight:700 !important;
}


.col-phon .phonetic, 
.col-vi .vi-mean,
.col-phon .phonetic-answer, 
.col-vi .vi-mean-answer{
    font-weight:400 !important;
}
.lookup-row textarea{
    font-size:16px;
}
.nav-paragraph{
    align-items:center;
    justify-content: center;
}