* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background: #f4f6f3;
  color: #1d2b1f;
  line-height: 1.8;
}
.topbar {
  background: #1e5631;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.topbar-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand { font-size: 20px; font-weight: 700; }
.student-box { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.container { max-width: 860px; margin: 0 auto; padding: 16px; }

.btn {
  font-family: inherit;
  border: 1px solid #1e5631;
  background: #fff;
  color: #1e5631;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: #e8f2ea; }
.btn.primary { background: #1e5631; color: #fff; }
.btn.primary:hover { background: #17452a; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }

.gate { padding: 40px 16px; }
.gate-card {
  max-width: 420px; margin: 0 auto; background: #fff; border-radius: 14px;
  padding: 24px; box-shadow: 0 4px 18px rgba(0,0,0,.08);
  display: flex; flex-direction: column; gap: 12px;
}
.gate-card h1 { margin: 0; font-size: 24px; }
.gate-card input {
  font-family: inherit; font-size: 17px; padding: 10px;
  border: 1px solid #bbb; border-radius: 8px; width: 100%;
}
.error { color: #b3261e; min-height: 1.2em; font-size: 14px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab {
  font-family: inherit; font-size: 16px; padding: 10px 18px; border-radius: 10px;
  border: 1px solid #1e5631; background: #fff; color: #1e5631; cursor: pointer;
}
.tab.active { background: #1e5631; color: #fff; font-weight: 700; }

.card {
  background: #fff; border-radius: 14px; padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.06); margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 23px; }
.card h3 { margin: 0 0 8px; font-size: 19px; }
.card h4 { margin: 14px 0 6px; font-size: 17px; color: #1e5631; }
.total-label { color: #4b5b4e; font-size: 15px; margin-bottom: 6px; }

.badge {
  display: inline-block; background: #fdf3d8; border: 1px solid #d9b83c;
  color: #6b5510; border-radius: 20px; padding: 1px 12px; font-size: 13px;
  margin-inline-start: 8px; vertical-align: middle;
}
.matn-text { font-size: 18px; line-height: 2.1; text-align: justify; }

.board {
  background: #14532d; color: #eafff1; border: 6px solid #8a5a2b;
  border-radius: 10px; padding: 18px 22px; margin-bottom: 16px;
}
.board h3 { margin: 0 0 10px; color: #ffe9a8; font-size: 19px; }
.board .panel { margin-bottom: 12px; }
.board .panel:last-child { margin-bottom: 0; }
.board .panel-h { color: #ffe9a8; font-weight: 700; }
.board ul { margin: 4px 0; padding-inline-start: 20px; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.fcard {
  background: #eef6ef; border: 1px solid #bcd6c0; border-radius: 12px;
  padding: 14px; cursor: pointer; min-height: 90px; font-size: 15px;
}
.fcard .side-label { font-size: 12px; color: #1e5631; font-weight: 700; display: block; margin-bottom: 4px; }
.fcard.flipped { background: #fdf3d8; border-color: #d9b83c; }

.ward { border-top: 2px solid #e3ece4; padding-top: 14px; margin-top: 14px; }
.ward:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.ward-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.ward-title { font-size: 19px; font-weight: 700; }
.ward-meta { color: #4b5b4e; font-size: 14px; }

.player { background: #f0f4f0; border-radius: 12px; padding: 12px; margin: 10px 0; }
.player .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.player button {
  font-family: inherit; border: 1px solid #1e5631; background: #fff; color: #1e5631;
  border-radius: 8px; padding: 6px 12px; font-size: 14px; cursor: pointer;
}
.player button.main { background: #1e5631; color: #fff; min-width: 74px; }
.player select { font-family: inherit; padding: 6px; border-radius: 8px; border: 1px solid #bbb; }
.player input[type="range"] { flex: 1; min-width: 140px; }
.player .time { font-size: 13px; color: #4b5b4e; direction: ltr; unicode-bidi: embed; }
.no-audio {
  background: #fdf3d8; border: 1px dashed #d9b83c; border-radius: 12px;
  padding: 12px; margin: 10px 0; text-align: center; color: #6b5510;
}

.summary-list { margin: 6px 0; padding-inline-start: 22px; }
.summary-list li { margin-bottom: 6px; text-align: justify; }

textarea {
  font-family: inherit; width: 100%; border: 1px solid #bbb; border-radius: 8px;
  padding: 10px; font-size: 16px; line-height: 1.7; resize: vertical;
}
.benefit-list { margin: 8px 0; padding-inline-start: 22px; }
.benefit-list li { margin-bottom: 4px; }
.inline-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.saved-note { color: #1e5631; font-size: 13px; min-height: 1.2em; }

.timer-display { font-size: 26px; font-weight: 700; direction: ltr; unicode-bidi: embed; }
.timer-row { display: flex; align-items: center; gap: 12px; margin: 6px 0; }

.quiz-q { margin-bottom: 14px; }
.quiz-q .q-text { font-weight: 700; margin-bottom: 6px; }
.quiz-opt { display: block; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.quiz-opt:hover { background: #f0f4f0; }
.quiz-opt input { margin-inline-end: 8px; }
.quiz-result { font-weight: 700; margin-top: 8px; }
.quiz-result.good { color: #1e5631; }
.quiz-result.bad { color: #b3261e; }
.opt-correct { background: #dff2e2 !important; }
.opt-wrong { background: #fbe3e1 !important; }

.tatmim { display: flex; flex-direction: column; gap: 6px; }
.tatmim label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.tatmim input[type="text"] {
  font-family: inherit; padding: 6px 10px; border: 1px solid #bbb;
  border-radius: 8px; flex: 1; font-size: 15px;
}

.report-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.report-controls input[type="date"] { font-family: inherit; padding: 6px; border: 1px solid #bbb; border-radius: 8px; }
.totals { color: #4b5b4e; }
.report-ward { border-top: 1px solid #e3ece4; padding: 8px 0; }
.report-ward-title { font-weight: 700; color: #1e5631; }
.at { color: #8a978c; font-size: 12px; }

@media (max-width: 560px) {
  .brand { font-size: 17px; }
  .card { padding: 14px; }
  .matn-text { font-size: 16px; }
}
