
:root{
  --hh-blue:#1d4ed8;
  --hh-text:#111827;
  --hh-muted:#6b7280;
  --hh-border:rgba(0,0,0,.12);
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:#ffffff;
  color:var(--hh-text);
  color-scheme: light;
}

/* layout shell */
.hh-shell{max-width:1100px;margin:20px auto;padding:0 16px}

.hh-topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 16px;
  border:1px solid var(--hh-border);
  border-radius:16px;
  background:#ffffff;
}

.hh-brand{display:flex;gap:10px;align-items:center}

.hh-mark{
  width:38px;height:38px;border-radius:12px;
  background:linear-gradient(135deg,#1d4ed8,#60a5fa);
  display:grid;place-items:center;
  font-weight:900;color:#fff;
}

.hh-title{font-weight:900;font-size:16px}
.hh-sub{color:var(--hh-muted);font-size:13px;margin-top:2px}

.hh-topbar-right{display:flex;gap:10px;align-items:center}

.hh-pill{
  border:1px solid var(--hh-border);
  border-radius:999px;
  padding:6px 10px;
  background:#f3f4f6;
  font-size:13px;
}

.hh-main{margin-top:16px}

.hh-card{
  background:#ffffff;
  border:1px solid var(--hh-border);
  border-radius:16px;
  padding:16px;
  margin:14px 0;
}

.hh-card-title{
  font-size:18px;
  font-weight:900;
  margin-bottom:14px;
}

/* grids */

.hh-grid{
  display:grid;
  gap:14px;
}

.hh-grid--top{
  grid-template-columns:220px 260px 1fr;
}

.hh-grid--topic{
  grid-template-columns:
    200px
    260px
    110px
    110px
    150px
    1fr;
}

.hh-grid--counts{
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
  margin-top:18px;
  padding-top:14px;
  border-top:1px dashed var(--hh-border);
}

.hh-counts-title{
  grid-column:1/-1;
  font-weight:900;
  color:var(--hh-muted);
}

/* fields */

.hh-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.hh-label{
  font-size:13px;
  color:var(--hh-muted);
  font-weight:700;
}

.hh-hint{
  font-size:12px;
  color:var(--hh-muted);
}

input,select,textarea{
  border:1px solid var(--hh-border);
  border-radius:10px;
  padding:10px 12px;
  font-size:14px;
  background:#ffffff;
  color:#111;
}

textarea{
  min-height:90px;
}

/* buttons */

.hh-actions{
  display:flex;
  gap:12px;
  margin-top:18px;
  margin-bottom:10px;
}

.hh-btn{
  background:linear-gradient(135deg,#1d4ed8,#3b82f6);
  color:#fff;
  border:none;
  border-radius:12px;
  padding:12px 18px;
  font-weight:800;
  cursor:pointer;
}

.hh-btn--ghost{
  background:#e5e7eb;
  color:#111;
}

.hh-timer{
  margin-left:auto;
  display:flex;
  gap:6px;
  align-items:center;
  border:1px solid var(--hh-border);
  border-radius:999px;
  padding:6px 10px;
  background:#f3f4f6;
}

.hh-timer-label{
  font-size:13px;
  color:var(--hh-muted);
}

.hh-timer-value{
  font-weight:900;
}

/* quiz blocks */

.hh-q{
  border:1px solid var(--hh-border);
  border-radius:14px;
  padding:14px;
  margin:12px 0;
  background:#f9fafb;
}

.hh-qhead{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:8px;
}

.hh-qnum{font-weight:900}

.hh-qtype{
  font-size:12px;
  border:1px solid var(--hh-border);
  border-radius:999px;
  padding:2px 8px;
  color:var(--hh-muted);
}

.hh-qmeta{
  margin-left:auto;
  font-size:13px;
  color:var(--hh-muted);
}

.hh-stem{line-height:1.6}

.hh-opts{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:10px;
}

.hh-opt{
  display:flex;
  gap:8px;
  align-items:flex-start;
}

.hh-tfset{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:10px;
}

.hh-matchrow{
  display:flex;
  gap:10px;
  align-items:center;
}

.hh-fill{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:10px;
}

.hh-submit-row{
  display:flex;
  gap:12px;
  margin-top:18px;
}

.hh-footer{
  text-align:center;
  color:var(--hh-muted);
  font-size:13px;
  margin-top:30px;
}


/* Header alignment */
.hh-header{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:16px;
  margin-bottom:18px;
}

.hh-header-title{
  font-size:28px;
  font-weight:900;
}

.hh-header-right{
  display:flex;
  gap:12px;
}

.hh-pill{
  padding:6px 12px;
  border-radius:10px;
  font-weight:700;
}

/* Question spacing */
.hh-q{
  margin-bottom:22px;
}

.hh-stem{
  margin-bottom:12px;
}

.hh-opt{
  margin:6px 0;
}

.hh-tfrow{
  margin:6px 0;
}

/* Results spacing */
.hh-results-box{
  margin-bottom:18px;
}

.hh-kv{
  padding:8px 0;
}

.hh-note{
  margin-top:16px;
}

/* ===== Top tool header ===== */
.hh-tool-header{
  display:flex !important;
  justify-content:space-between !important;
  align-items:center !important;
  gap:16px !important;
  margin:12px 0 18px !important;
  width:100% !important;
}
.hh-tool-header-title{
  flex:1 1 auto;
}
.hh-tool-header-title > *{
  margin:0 !important;
  font-size:28px !important;
  font-weight:900 !important;
  line-height:1.2 !important;
}
.hh-tool-header-right{
  display:flex !important;
  align-items:center !important;
  gap:12px !important;
  flex:0 0 auto !important;
}

/* status colors requested */
#hq-bank-status.hh-bank-loading,
.hh-pill.hh-bank-loading{
  background:#ffffff !important;
  color:#666666 !important;
  border:1px solid #d1d5db !important;
}
#hq-bank-status.hh-bank-ok,
.hh-pill.hh-bank-ok{
  background:#d6006e !important;
  color:#ffffff !important;
  border:1px solid #d6006e !important;
}
#hq-bank-status.hh-bank-error,
.hh-pill.hh-bank-error{
  background:#3c0070 !important;
  color:#ffffff !important;
  border:1px solid #3c0070 !important;
}
#hq-bank-status{
  display:inline-flex !important;
  align-items:center !important;
  min-height:34px !important;
  padding:6px 12px !important;
  border-radius:999px !important;
  font-size:13px !important;
  font-weight:700 !important;
  white-space:nowrap !important;
}
#hq-export{
  color:var(--hh-blue) !important;
  font-weight:700 !important;
  text-decoration:none !important;
  white-space:nowrap !important;
}

/* ===== Quiz head ===== */
.hh-quiz-head{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  gap:12px !important;
  align-items:start !important;
  margin-bottom:14px !important;
}
#hq-quiz-title,
.hh-quiz-title{
  display:block !important;
  margin:0 !important;
  font-size:24px !important;
  font-weight:900 !important;
  line-height:1.25 !important;
}
#hq-quiz-sub,
.hh-quiz-sub{
  display:block !important;
  margin-top:4px !important;
  color:var(--hh-muted) !important;
  line-height:1.45 !important;
  white-space:normal !important;
}
#hq-quiz-meta,
.hh-quiz-meta{
  display:block !important;
  color:var(--hh-muted) !important;
  font-size:13px !important;
  line-height:1.45 !important;
  text-align:right !important;
  white-space:normal !important;
}

/* ===== Question header and body ===== */
.hh-q{
  overflow:hidden !important;
}
.hh-qhead{
  display:grid !important;
  grid-template-columns:auto auto minmax(0,1fr) !important;
  gap:10px !important;
  align-items:start !important;
  margin-bottom:10px !important;
}
.hh-qnum{ line-height:1.3 !important; }
.hh-qtype{ line-height:1.2 !important; }
.hh-qmeta{
  margin-left:0 !important;
  justify-self:end !important;
  max-width:100% !important;
  text-align:right !important;
  line-height:1.4 !important;
  white-space:normal !important;
  word-break:break-word !important;
}
.hh-stem{
  margin:2px 0 12px !important;
  line-height:1.55 !important;
  white-space:normal !important;
  word-break:break-word !important;
}
.hh-opts{
  gap:10px !important;
}
.hh-opt{
  display:flex !important;
  align-items:flex-start !important;
  gap:10px !important;
  margin:0 !important;
  line-height:1.55 !important;
}
.hh-opt span{
  display:block !important;
  line-height:1.55 !important;
}

/* ===== TF multi fixed ===== */
.hh-tfset{
  display:flex !important;
  flex-direction:column !important;
  gap:12px !important;
  margin-top:10px !important;
}
.hh-tfrow{
  display:grid !important;
  grid-template-columns:24px minmax(0,1fr) auto !important;
  gap:12px !important;
  align-items:start !important;
  margin:0 !important;
}
.hh-tflabel{
  width:auto !important;
  min-width:24px !important;
  font-weight:800 !important;
  line-height:1.55 !important;
}
.hh-tfstmt{
  display:block !important;
  line-height:1.55 !important;
  white-space:normal !important;
  word-break:break-word !important;
}
.hh-tfchoices{
  display:flex !important;
  gap:14px !important;
  align-items:center !important;
  flex-wrap:nowrap !important;
  white-space:nowrap !important;
}
.hh-tfchoices label{
  display:inline-flex !important;
  align-items:center !important;
  gap:6px !important;
  margin:0 !important;
}

/* ===== Matching / fill / short ===== */
.hh-matchrow{
  display:grid !important;
  grid-template-columns:28px minmax(0,1fr) auto !important;
  gap:10px !important;
  align-items:start !important;
}
.hh-fill{
  gap:14px !important;
}
.hh-blank{
  display:flex !important;
  flex-direction:column !important;
  gap:6px !important;
}
.hh-short{
  width:min(420px,100%) !important;
  margin-top:10px !important;
}
.hh-short input,
.hh-short textarea{
  width:100% !important;
}

/* ===== Review and submit ===== */
.hh-review{
  margin-top:14px !important;
  padding-top:10px !important;
  border-top:1px dashed var(--hh-border) !important;
  line-height:1.55 !important;
}
.hh-submit-row{
  display:flex !important;
  align-items:center !important;
  gap:16px !important;
  flex-wrap:wrap !important;
  margin-top:22px !important;
  margin-bottom:8px !important;
}
.hh-note,
.hh-submit-row .hh-hint{
  line-height:1.55 !important;
  white-space:normal !important;
}

/* ===== Results ===== */
.hh-results-head{
  display:flex !important;
  justify-content:space-between !important;
  align-items:flex-start !important;
  gap:16px !important;
  flex-wrap:wrap !important;
  margin-bottom:14px !important;
}
.hh-results-grid{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(280px,1fr)) !important;
  gap:18px !important;
  margin-top:12px !important;
}
.hh-results-box{
  margin-bottom:0 !important;
}
#hq-breakdown-type,
#hq-breakdown-module{
  display:flex !important;
  flex-direction:column !important;
  gap:0 !important;
}
.hh-kv{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  gap:12px !important;
  align-items:start !important;
  padding:8px 0 !important;
  border-bottom:1px dashed var(--hh-border) !important;
}
.hh-kv-key{
  line-height:1.45 !important;
  white-space:normal !important;
  word-break:break-word !important;
}
.hh-kv-val{
  text-align:right !important;
  white-space:nowrap !important;
  line-height:1.45 !important;
}
.hh-kv-n{
  color:var(--hh-muted) !important;
}
.hh-results-box-title{
  margin-bottom:10px !important;
}
.hh-footer{
  line-height:1.5 !important;
}

/* mobile */
@media (max-width: 900px){
  .hh-tool-header{
    flex-direction:column !important;
    align-items:flex-start !important;
  }
  .hh-tool-header-right{
    width:100% !important;
    justify-content:flex-start !important;
    flex-wrap:wrap !important;
  }
  .hh-quiz-head{
    grid-template-columns:1fr !important;
  }
  #hq-quiz-meta,
  .hh-qmeta{
    text-align:left !important;
    justify-self:start !important;
  }
  .hh-qhead{
    grid-template-columns:auto auto 1fr !important;
  }
  .hh-tfrow{
    grid-template-columns:24px 1fr !important;
  }
  .hh-tfchoices{
    grid-column:2 !important;
    margin-left:0 !important;
  }
  .hh-results-grid{
    grid-template-columns:1fr !important;
  }
}

