/* Cấu hình kiểu đánh (#/cau-hinh) — sizes and colours from research/ui/tts-dom.json "setting-desktop"
   (the site's newer look: system font, 912px centred column, rounded cards, green switches).
   (The Cú pháp tin nhắn page is a public page now: js/view-cu-phap.js, css/cu-phap.css.)
   Shell, buttons, forms, tables, tabs, modals and toasts are in ../styles.css (see UI-GUIDE.md). */

/* ---------------------------------------------------------- Cấu hình kiểu đánh */
.view-cau-hinh { font-family: var(--font-sans); color: var(--tts-ink); }
.setting-page { max-width: 912px; margin: 0 auto; padding-top: 16px; }
.setting-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.setting-head-text { min-width: 0; }
.setting-head h1 { margin: 0 0 4px; font-size: 22px; line-height: 29px; font-weight: 750; color: var(--tts-navy); }
.setting-head p { margin: 0; font-size: 13px; line-height: 22px; color: var(--tts-muted); }
.setting-count {
  display: inline-block; margin-left: 4px; padding: 2px 9px; border-radius: 999px; background: #edf4fa;
  color: var(--tts-navy); font-size: 12px; line-height: 18px; font-weight: 600; white-space: nowrap; vertical-align: top;
}
.setting-save.btn { flex: none; height: 42px; gap: 8px; padding: 8px 18px; border-radius: 10px; font-size: 14px; line-height: 21px; font-weight: 650; }
.setting-save.btn .ic { font-size: 14px; width: 12px; }

.setting-note {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 15px; padding: 12px 16px;
  background: #f1f7fc; border: .8px solid #d9e6f2; border-radius: 12px; color: #34506e; font-size: 13px;
}
.setting-note-icon { flex: none; display: inline-flex; padding-top: 3px; color: var(--tts-blue); font-size: 16px; }
.setting-note-body { min-width: 0; }
.setting-note-title { display: block; font-size: 13px; line-height: 21px; font-weight: 700; color: var(--tts-navy); }
.setting-note ul { margin: 2px 0 0; padding: 0; list-style: none; }
.setting-note li { line-height: 22px; }
.setting-note li + li { margin-top: 2px; }
.setting-note li strong { font-weight: 700; }
.setting-note code {
  display: inline-block; padding: 1px 6px; border-radius: 5px; background: #fff; color: var(--tts-navy);
  font-family: var(--mono); font-size: 12px; line-height: 14px; word-break: normal;
}

.setting-list {
  margin: 0; padding: 0; list-style: none; overflow: hidden;
  background: #fff; border: .8px solid var(--tts-line); border-radius: 12px; color: var(--tts-ink); font-size: 14px;
}
.setting-list-head, .setting-row { display: grid; grid-template-columns: 1.1fr 1.6fr .9fr; gap: 16px; align-items: center; padding: 12px 18px; }
.setting-list-head { background: #f6f8fb; color: var(--tts-muted); font-size: 12px; line-height: 18px; font-weight: 700; text-transform: uppercase; }
.setting-row { border-top: .8px solid #edf0f4; }
.setting-type { display: flex; align-items: center; gap: 12px; min-width: 0; margin: 0; cursor: pointer; }
.setting-switch { position: relative; flex: none; width: 42px; height: 24px; }
.setting-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.setting-switch-track {
  position: absolute; inset: 0; border-radius: 999px; background: #cbd2dc; transition: background-color .18s;
}
.setting-switch-track::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .18s;
}
.setting-switch input:checked + .setting-switch-track { background: #1f9d55; }
.setting-switch input:checked + .setting-switch-track::after { transform: translateX(18px); }
.setting-switch input:focus-visible + .setting-switch-track { box-shadow: 0 0 0 3px rgba(31, 157, 85, .25); }
.setting-type-name { display: flex; flex-direction: column; min-width: 0; font-size: 14px; line-height: 19px; font-weight: 650; color: var(--tts-ink); }
.setting-type-name small { font-size: 12px; line-height: 16px; font-weight: 500; color: #1f9d55; }
.setting-row.is-off .setting-type-name small { color: #8a94a6; }
.setting-cell { display: block; min-width: 0; margin: 0; }
.setting-mlabel { display: none; }
.setting-input {
  display: block; width: 100%; height: 40px; padding: 8px 12px; border: .8px solid var(--tts-line); border-radius: 8px;
  background: #fff; color: var(--tts-ink); font: inherit; font-size: 14px; line-height: 21px; outline: 0;
  transition: border-color .15s, box-shadow .15s;
}
.setting-input::placeholder { color: #a3adbb; opacity: 1; }
.setting-input:focus { border-color: #8db8e6; box-shadow: 0 0 0 3px rgba(20, 109, 177, .12); }
.setting-input.is-invalid { border-color: var(--danger); }


@media (max-width: 991.98px) {
  .setting-page { padding-top: 4px; }
}
@media (max-width: 767.98px) {
  .setting-head { flex-direction: column; align-items: stretch; }
  .setting-save.btn { align-self: flex-start; }
  .setting-list-head { display: none; }
  .setting-row { grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 12px 14px; }
  .setting-row .setting-type { grid-column: 1 / -1; }
  .setting-row:first-of-type, .setting-list-head + .setting-row { border-top: 0; }
  .setting-mlabel { display: block; margin-bottom: 4px; font-size: 11px; line-height: 15px; font-weight: 700; color: var(--tts-muted); text-transform: uppercase; }
  .setting-note { padding: 12px; }
}
