/* Design token trich xuat tu site goc — dung nguyen gia tri. */
:root {
  --ink: #14110f;
  --paper: #f7f4ee;
  --line: #d9d2c4;
  --accent: #c8501e;
  --teal: #0f6e63;
  --muted: #7a7166;
  --ok: #2f7d4f;
  --err: #b23b2e;
  --blue: #2a5db0;
  --shadow: 0 1px 0 rgba(0, 0, 0, .04), 0 8px 24px rgba(20, 17, 15, .06);
  --radius-panel: 14px;
  --radius-btn: 10px;
  --radius-tab: 12px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.55;
  /* Mobile-first: chan tran mach cua moi khoi con, tranh scroll ngang o 375px. */
  overflow-x: hidden;
}

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.1; }
h1 { font-size: 32px; margin: .2em 0 .3em; }
h2 { font-size: 24px; margin-top: 1.6em; }
h3 { font-size: 18px; margin-bottom: .2em; }

a { color: var(--blue); }

.wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

/* --- header --- */
.top { border-bottom: 1px solid var(--line); padding-bottom: 18px; margin-bottom: 22px; }
.kicker {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.top .sub { color: var(--muted); margin: 0; max-width: 62ch; }

/* --- tab chinh --- */
.maintabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.mtab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: var(--radius-tab);
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.mtab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* --- panel --- */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow);
  padding: 20px;
}
.panel + .panel { margin-top: 16px; }

.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
input[type="url"], input[type="text"], textarea, select {
  width: 100%;
  font: inherit;
  color: inherit;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  background: var(--paper);
}
textarea { min-height: 120px; resize: vertical; }

/* Focus ring phai nhin thay ro tren ca nen giay lan nen trang. */
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* --- nut --- */
.btn {
  font: inherit;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: var(--radius-btn);
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.pillrow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.pill[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }

/* --- wizard --- */
.steps { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.step {
  font-size: 14px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  padding-bottom: 4px;
}
.step[aria-current="step"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

/* --- ket qua & trang thai --- */
.out {
  white-space: pre-wrap;
  overflow-wrap: anywhere;   /* transcript la mot doan rat dai, khong duoc day trang rong ra */
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-btn);
  padding: 14px;
  margin-top: 12px;
  max-height: 460px;
  overflow-y: auto;
}
.out:empty { display: none; }

.note { color: var(--muted); font-size: 14px; }
.err { color: var(--err); font-weight: 600; }
.warn { color: var(--accent); }
.ok { color: var(--ok); font-weight: 600; }

.spin {
  display: inline-block;
  width: 14px; height: 14px;
  margin-right: 8px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 3s; }
}

.hidden { display: none !important; }

.meta { font-size: 14px; color: var(--muted); margin-top: 10px; }
.meta b { color: var(--ink); }

/* --- noi dung huong dan / FAQ --- */
.faq { margin-top: 40px; }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; color: var(--muted); }

footer { margin-top: 48px; border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 14px; }

@media (min-width: 720px) {
  .wrap { padding: 32px 24px 80px; }
  h1 { font-size: 40px; }
  .panel { padding: 26px; }
}
