/* V19 - hard mobile containment for Groups page + Smart Quran training */
html, body { max-width: 100%; }

@media (max-width: 780px) {
  html, body { overflow-x: hidden !important; }
  .dashboard-shell, .dashboard-main, .dashboard-content, .management-page,
  .management-columns, .management-columns > *, .group-create-form, .group-registry,
  .module-header, .panel { min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important; }

  .management-columns {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    overflow: hidden !important;
  }
  .management-columns > * { width: 100% !important; }
  .group-create-form, .group-registry { overflow: hidden !important; }
  .group-create-form label, .group-create-form select, .group-create-form input,
  .schedule-picker-block, .days-picker, .time-select-field { width: 100% !important; min-width: 0 !important; max-width: 100% !important; }
  .form-pair, .schedule-picker-block { display: grid !important; grid-template-columns: minmax(0,1fr) !important; }
  .day-choice-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0,1fr)) !important; width: 100% !important; }
  .group-registry article {
    display: grid !important;
    grid-template-columns: 56px minmax(0,1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }
  .group-registry article > div { min-width: 0 !important; overflow-wrap: anywhere !important; }
  .group-registry article > em { grid-column: 2 !important; justify-self: start !important; }

  /* Keep mobile bottom/navigation rail inside the physical viewport. */
  .sidebar {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    left: 0 !important;
    right: 0 !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain;
  }
  .sidebar nav { min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important; }
  .sidebar nav button { flex: 0 0 auto; }
}

.smart-v19-hidden-generic { display: none !important; }
.smart-training-v19 { display: grid; gap: 16px; width: 100%; min-width: 0; }
.smart-v19-header {
  background: linear-gradient(120deg,#40594a,#2b4034);
  color: #fff; border-radius: 18px; padding: 24px 28px;
  display: flex; justify-content: space-between; align-items: center; gap: 18px;
}
.smart-v19-header span { color: #e8b852; font-size: 11px; font-weight: 900; }
.smart-v19-header h2 { margin: 4px 0 7px; font-size: 25px; }
.smart-v19-header p { color: #d4ded7; margin: 0; line-height: 1.8; font-size: 11px; max-width: 760px; }
.smart-v19-privacy { min-width: 150px; padding: 12px; border: 1px solid #ffffff26; background:#ffffff12; border-radius:14px; display:grid; gap:4px; text-align:center; }
.smart-v19-privacy b { font-size: 14px; }
.smart-v19-privacy small { font-size: 9px; color:#dbe4de; }
.smart-v19-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; min-width: 0; }
.smart-v19-controls,.smart-v19-mic-panel,.smart-v19-result { padding: 20px !important; min-width:0; }
.smart-v19-title { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.smart-v19-title > small { width:34px; height:34px; border-radius:10px; display:grid; place-items:center; background:#f1e5ca; color:#8a621a; font-weight:900; font-size:14px; }
.smart-v19-title > div { display:grid; gap:2px; }
.smart-v19-title b { font-size:14px; color:#2d4337; }
.smart-v19-title span { color:#7d857f; font-size:9px; }
.smart-v19-controls label { display:grid; gap:6px; color:#657268; font-size:9px; font-weight:900; margin-bottom:10px; }
.smart-v19-controls select { width:100%; min-width:0; height:44px; border:1px solid #ddd6ca; border-radius:10px; background:#fff; color:#293d33; padding:0 12px; font-weight:800; }
.smart-v19-verse { min-height:112px; background:#fbf7ee; border:1px solid #eadfc9; border-radius:14px; display:flex; flex-direction:column; justify-content:center; padding:18px; font-size:21px; line-height:2.05; text-align:center; color:#233e31; margin-top:12px; font-family:"Traditional Arabic","Amiri","Noto Naskh Arabic",serif; }
.smart-v19-verse small { font-family:inherit; font-size:12px; color:#756e62; }
.smart-v19-primary,.smart-v19-stop,.smart-v19-secondary { border:0; border-radius:11px; padding:12px 16px; font-weight:900; cursor:pointer; }
.smart-v19-primary { background:#315341; color:#fff; width:100%; }
.smart-v19-stop { background:#9b4e49; color:#fff; width:100%; }
.smart-v19-secondary { background:#f1e8d6; color:#6f531e; }
.smart-v19-secondary:disabled { opacity:.55; cursor:not-allowed; }
.smart-v19-orb { width:118px; height:118px; margin:18px auto; position:relative; display:grid; place-items:center; border-radius:50%; background:#eef4ef; border:1px solid #d7e3da; }
.smart-v19-orb span { font-size:38px; z-index:2; }
.smart-v19-orb i { position:absolute; inset:10px; border:2px solid #6f9a7c; border-radius:50%; opacity:0; }
.smart-v19-orb.listening { background:#e4f2e8; }
.smart-v19-orb.listening i { animation:smartPulse 1.5s infinite; }
.smart-v19-orb.listening i:nth-child(3){animation-delay:.3s}.smart-v19-orb.listening i:nth-child(4){animation-delay:.6s}
@keyframes smartPulse { 0%{transform:scale(.7);opacity:.7}100%{transform:scale(1.55);opacity:0} }
.smart-v19-status { text-align:center; color:#55705e; font-weight:900; font-size:10px; }
.smart-v19-heard { background:#f7f5ef; border-radius:12px; padding:12px; margin-top:12px; }
.smart-v19-heard small { color:#8a877e; font-size:8px; }
.smart-v19-heard p { margin:5px 0 0; min-height:24px; color:#34483c; line-height:1.7; font-size:11px; }
.smart-v19-browser-note { display:block; color:#8a877e; line-height:1.7; margin-top:10px; font-size:8px; }
.smart-v19-score-wrap { display:flex; align-items:center; gap:16px; }
.smart-v19-score { min-width:92px; height:92px; border-radius:20px; display:grid; place-items:center; align-content:center; background:#eef5ef; border:1px solid #d8e5da; }
.smart-v19-score strong { font-size:28px; color:#315341; }
.smart-v19-score span { font-size:8px; color:#728078; }
.smart-v19-score-wrap h3 { margin:0 0 5px; font-size:18px; color:#2d4337; }
.smart-v19-score-wrap p { margin:0; color:#6d756f; font-size:10px; }
.smart-v19-word-check { margin-top:16px; line-height:2.25; font-size:17px; direction:rtl; }
.smart-v19-word-check span { display:inline-block; margin:2px 1px; padding:2px 6px; border-radius:8px; }
.smart-v19-word-check span.ok { background:#e7f3e9; color:#2d6941; }
.smart-v19-word-check span.miss { background:#f7e9e6; color:#9b4a42; text-decoration:underline dotted; }
.smart-v19-extra { margin-top:12px; padding:10px; background:#fff5df; border-radius:10px; color:#7b5a19; display:flex; gap:8px; flex-wrap:wrap; font-size:9px; }
.smart-v19-legend { display:flex; gap:15px; margin:12px 0; font-size:9px; }.smart-v19-legend .ok{color:#2d6941}.smart-v19-legend .miss{color:#9b4a42}
#smart-v19-toast { position:fixed; left:50%; bottom:28px; transform:translate(-50%,20px); background:#243d31; color:#fff; padding:11px 16px; border-radius:11px; font-size:11px; font-weight:800; opacity:0; pointer-events:none; z-index:99999; transition:.2s; box-shadow:0 10px 30px #0003; }
#smart-v19-toast.show { opacity:1; transform:translate(-50%,0); }

@media (max-width: 780px) {
  .smart-training-v19 { gap:12px; }
  .smart-v19-header { padding:17px; align-items:flex-start; flex-direction:column; }
  .smart-v19-header h2 { font-size:21px; }
  .smart-v19-header p { font-size:10px; }
  .smart-v19-privacy { width:100%; min-width:0; text-align:right; }
  .smart-v19-grid { grid-template-columns:minmax(0,1fr); gap:12px; }
  .smart-v19-controls,.smart-v19-mic-panel,.smart-v19-result { padding:14px !important; width:100%; min-width:0; box-sizing:border-box; }
  .smart-v19-verse { font-size:19px; padding:14px; min-height:95px; }
  .smart-v19-score-wrap { align-items:flex-start; }
  .smart-v19-score { min-width:78px; height:78px; }
  .smart-v19-score strong { font-size:23px; }
  .smart-v19-word-check { font-size:16px; }
}

/* V20 — admin cleanup controls */
.group-registry article{position:relative;gap:10px}
.group-delete-v20,.delete-finished-v20{border:1px solid #d7a7a1;background:#fff7f6;color:#a23d35;border-radius:10px;padding:8px 11px;font-weight:900;font-family:inherit;cursor:pointer;white-space:nowrap}
.group-delete-v20:hover,.delete-finished-v20:hover{background:#fdebea}
.group-delete-v20:disabled,.delete-finished-v20:disabled{opacity:.5;cursor:wait}
.join-v20-head-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
@media(max-width:780px){
  .group-registry article{grid-template-columns:62px minmax(0,1fr)!important;align-items:start!important}
  .group-registry article>em,.group-registry article>.group-delete-v20{grid-column:2}
  .group-delete-v20{width:max-content;max-width:100%}
  .join-v20-head-actions{width:100%;justify-content:space-between}
  .delete-finished-v20{font-size:12px;padding:7px 9px}
}
