/* host/settings.css — trang Cài đặt (host/views/settings.js) và trang Pro (host/views/pro.js).
   Dùng token --h-* của .home-shell (host/home.css). */

.st-page { max-width: 980px; }
.st-head { margin-bottom: 20px; }
.st-head h1 { margin: 0 0 4px; font-size: 26px; color: var(--h-text); }
.st-head p { margin: 0; color: var(--h-text-muted); font-size: 14px; }

.st-form { display: flex; flex-direction: column; gap: 18px; }
.st-card {
  background: var(--h-surface);
  border: 1px solid var(--h-border);
  border-radius: var(--h-radius);
  padding: 20px;
  box-shadow: var(--h-shadow);
}
.st-card h2 { margin: 0 0 4px; font-size: 17px; color: var(--h-text); }
.st-card-desc { margin: 0 0 16px; color: var(--h-text-muted); font-size: 13.5px; line-height: 1.5; }

.st-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; max-width: 520px; }
.st-field > label, .st-label { font-weight: 600; font-size: 14px; color: var(--h-text); }
.st-field .modal-input { background: #fff; }
.st-field input[readonly] { background: var(--h-bg); color: var(--h-text-muted); cursor: default; }
.st-hint { color: var(--h-text-muted); font-size: 12.5px; line-height: 1.4; }
.st-page input:focus-visible, .st-page button:focus-visible, .st-page a:focus-visible,
.st-page select:focus-visible { outline: 3px solid #8db4ff; outline-offset: 2px; }

.st-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.st-chip { position: relative; display: inline-flex; cursor: pointer; }
.st-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.st-chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--h-border); border-radius: 999px; background: #fff;
  font-size: 14px; font-weight: 600; color: var(--h-text-muted);
}
.st-chip input:checked + span { background: var(--h-indigo-weak); border-color: var(--h-indigo); color: var(--h-indigo-dark); }
.st-chip input:focus-visible + span { outline: 3px solid #8db4ff; outline-offset: 2px; }

.st-fieldset { border: 0; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.st-fieldset legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 8px; }
.st-radio {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--h-border); border-radius: var(--h-radius-sm); background: #fff;
}
.st-radio:has(input:checked) { border-color: var(--h-indigo); background: var(--h-indigo-weak); }
.st-radio:has(input:focus-visible) { outline: 3px solid #8db4ff; outline-offset: 2px; }
.st-radio input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--h-indigo); flex: 0 0 auto; }
.st-radio span { display: flex; flex-direction: column; gap: 2px; }
.st-radio small, .st-row-text small { color: var(--h-text-muted); font-size: 12.5px; }

.st-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 0; border-top: 1px solid var(--h-border); cursor: pointer; min-height: 56px;
}
.st-row-text { display: flex; flex-direction: column; gap: 2px; }
.st-switch { position: relative; flex: 0 0 auto; width: 46px; height: 26px; }
.st-switch-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.st-switch-track { position: absolute; inset: 0; border-radius: 999px; background: #cbd2e0; transition: background .15s; pointer-events: none; }
.st-switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .3); transition: transform .15s;
}
.st-switch-input:checked + .st-switch-track { background: var(--h-indigo); }
.st-switch-input:checked + .st-switch-track::after { transform: translateX(20px); }
.st-switch-input:focus-visible + .st-switch-track { outline: 3px solid #8db4ff; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .st-switch-track, .st-switch-track::after { transition: none; } }

.st-actions { margin-top: 4px; }

/* Thanh lưu dính đáy */
.st-savebar {
  position: sticky; bottom: 0; z-index: 5; margin: 6px -4px 0; padding: 12px 16px;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px);
  border: 1px solid var(--h-border); border-radius: var(--h-radius); box-shadow: 0 -4px 18px rgba(16, 24, 40, .08);
}
.st-savebar-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.st-savebar-status { margin-right: auto; font-size: 13.5px; color: var(--h-text-muted); }
.st-savebar-status[data-state="dirty"] { color: #9a5b00; font-weight: 600; }
.st-savebar-status[data-state="clean"]::before { content: "\2713 "; color: var(--h-green); }
.st-savebar .btn[disabled] { opacity: .55; cursor: not-allowed; }
.st-error { margin: 0 0 10px; padding: 10px 12px; border-radius: var(--h-radius-sm); background: #fff0f0; color: #9c2020; font-size: 13.5px; }
.st-state { padding: 20px; border-radius: var(--h-radius); background: var(--h-surface); border: 1px solid var(--h-border); }
.st-state--error { background: #fff0f0; border-color: #f2c4c4; color: #9c2020; }
.st-state p { margin: 0 0 10px; }

/* Thẻ "Xác minh giáo viên" (host/views/teacher-verify.js) */
.tv-card { margin-top: 18px; scroll-margin-top: 16px; }
.tv-card:focus { outline: none; }
.tv-card:focus-visible { outline: 3px solid #8db4ff; outline-offset: 2px; }
.tv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tv-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.tv-badge--ok { background: var(--h-green-weak); color: #11653a; }
.tv-badge--warn { background: var(--h-amber-weak); color: #7a4b00; }
.tv-badge--bad { background: #fff0f0; color: #9c2020; }
.tv-body p { margin: 0 0 8px; line-height: 1.5; }
.tv-headline { font-weight: 700; color: var(--h-text); }
.tv-summary { color: var(--h-text); font-size: 14px; }
.tv-sub { font-weight: 600; margin-top: 14px !important; }
.tv-limited { margin: 0 0 8px; padding-left: 20px; font-size: 13.5px; color: var(--h-text-muted); line-height: 1.6; }
.tv-paths { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tv-path { display: flex; gap: 10px; padding: 12px 14px; border: 1px solid var(--h-border); border-radius: var(--h-radius-sm); background: #fff; }
.tv-path--ok { border-color: #9ad9b0; background: var(--h-green-weak); }
.tv-path--blocked { opacity: .75; }
.tv-path-mark { flex: 0 0 22px; font-weight: 700; color: var(--h-text-muted); text-align: center; }
.tv-path--ok .tv-path-mark { color: var(--h-green); }
.tv-path-text { min-width: 0; }
.tv-path-text p { font-size: 13.5px; color: var(--h-text-muted); }
.tv-path-text .tv-path-progress { color: var(--h-text); font-weight: 600; }
.tv-meter { max-width: 320px; margin: 4px 0 8px; }
.tv-contact { display: inline-flex; text-decoration: none; margin-top: 2px; }
.tv-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.tv-msg:empty, .tv-vouch-msg:empty { display: none; }
.tv-msg, .tv-vouch-msg { margin-top: 10px !important; font-size: 13.5px; font-weight: 600; }
.tv-vouch-msg[data-tone="bad"] { color: #9c2020; }
.tv-vouch { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--h-border); }
.tv-vouch h3 { margin: 0 0 4px; font-size: 15px; }
.tv-vouch .st-field { margin: 10px 0 8px; }
.tv-loading { display: flex; align-items: center; gap: 10px; color: var(--h-text-muted); }
.tv-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--h-border); border-top-color: var(--h-indigo); animation: tv-spin .8s linear infinite; }
@keyframes tv-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tv-spinner { animation: none; } }
.tv-error { padding: 12px 14px; border-radius: var(--h-radius-sm); background: #fff0f0; color: #9c2020; }
.tv-error p { margin: 0 0 8px; }

/* Trang Pro */
.pr-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.pr-side { display: flex; flex-direction: column; gap: 18px; }
.pr-table-wrap { overflow-x: auto; }
.pr-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pr-table th, .pr-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--h-border); vertical-align: top; }
.pr-table thead th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--h-text-muted); }
.pr-table tbody th { font-weight: 600; color: var(--h-text); }
.pr-col-pro { background: var(--h-indigo-weak); color: var(--h-indigo-dark); font-weight: 600; }
.pr-usage p { margin: 0 0 8px; }
.pr-meter { height: 10px; border-radius: 999px; background: #e5e7eb; overflow: hidden; margin: 6px 0 10px; }
.pr-meter-fill { height: 100%; background: var(--h-indigo); border-radius: 999px; }
.pr-meter-fill.is-full { background: #dc2626; }
.pr-usage-pct { color: var(--h-text-muted); }
.pr-cta { text-decoration: none; width: 100%; box-sizing: border-box; }
.pr-nocharge { margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--h-text); }

@media (max-width: 960px) {
  .pr-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .st-page { padding: 18px 14px 40px; }
  .st-savebar { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); }
  .st-savebar-row .btn { flex: 1 1 auto; }
  /* Bảng so sánh xếp dọc: mỗi tính năng là một thẻ */
  .pr-table thead { position: absolute; left: -9999px; }
  .pr-table, .pr-table tbody, .pr-table tr, .pr-table th, .pr-table td { display: block; width: 100%; }
  .pr-table tr { padding: 10px 0; border-bottom: 1px solid var(--h-border); }
  .pr-table th, .pr-table td { border: 0; padding: 4px 4px; }
  .pr-table td::before { content: attr(data-label) ": "; font-weight: 600; color: var(--h-text-muted); }
}
/* PB-H91 */
.pr-usage-line.is-near strong{color:#b45309}.pr-usage-line.is-full strong{color:#b91c1c}

.st-usage-line{margin:4px 0}.st-usage-line.is-near strong{color:#b45309}.st-usage-line.is-full strong{color:#b91c1c}
