/* Bảng màu & kiểu chữ lấy theo hoc.duongcaotri.com để đồng bộ khi nhúng vào trang đó. */
:root{
  --bg:#f8fafc;
  --paper:#ffffff;
  --ink:#0f172a;
  --muted:#64748b;
  --hairline:#e2e8f0;
  --accent:#2563eb;
  --accent-ink:#ffffff;
  --accent-hover:#1d4ed8;
  --accent-soft-bg:#eff6ff;
  --accent-soft-ink:#1d4ed8;
  --tab-active:#f59e0b;
  --danger:#dc2626;
  --danger-bg:#fef2f2;
  --field-bg:#ffffff;
  --field-border:#cbd5e1;
  --focus:#2563eb;
  --shadow:0 1px 2px rgba(15,23,42,0.06), 0 1px 1px rgba(15,23,42,0.04);
  --mono-bg:#0f172a;
  --mono-ink:#e2e8f0;
  --mono-accent:#7dd3fc;
}

*{box-sizing:border-box;}
html,body{margin:0;background:var(--bg);}
body{
  color:var(--ink);
  font-family:"Be Vietnam Pro","Be Vietnam Pro Fallback",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  line-height:1.55;
}
h1,h2,h3{
  font-family:ui-serif,Georgia,Cambria,"Times New Roman",Times,serif;
  font-weight:400;
  text-wrap:balance;
  margin:0;
  color:var(--ink);
}
::selection{background:var(--accent);color:var(--accent-ink);}
a{color:var(--accent);}
img{max-width:100%;}

.shell{max-width:1280px;margin:0 auto;padding:32px 24px 80px;}

header.top{
  display:flex;align-items:center;justify-content:space-between;gap:24px;
  padding-bottom:20px;border-bottom:1px solid var(--hairline);margin-bottom:28px;flex-wrap:wrap;
}
.brand{display:flex;align-items:center;gap:12px;}
.brand-mark{
  width:38px;height:38px;flex:none;border-radius:9px;background:var(--accent);
  display:flex;align-items:center;justify-content:center;color:#fff;font-weight:700;font-size:1.1rem;
  font-family:ui-serif,Georgia,serif;
}
.brand h1{font-size:1.35rem;font-weight:600;font-family:inherit;letter-spacing:-0.01em;}
.brand .sub{color:var(--muted);font-size:0.82rem;margin-top:1px;}

.badge-pill{
  display:inline-flex;align-items:center;font-size:0.72rem;font-weight:600;letter-spacing:0.02em;
  color:var(--accent-soft-ink);background:var(--accent-soft-bg);border-radius:999px;padding:3px 11px;
}

.tabbar{display:flex;gap:22px;margin-bottom:26px;border-bottom:1px solid var(--hairline);}
.tabbtn{
  font:inherit;font-size:0.94rem;font-weight:500;color:var(--muted);background:none;border:none;
  padding:10px 2px;margin-bottom:-1px;border-bottom:2px solid transparent;cursor:pointer;
}
.tabbtn.active{color:var(--ink);font-weight:600;border-bottom-color:var(--tab-active);}
.tabbtn:focus-visible{outline:2px solid var(--focus);outline-offset:2px;}

.view[hidden]{display:none;}

.card{
  background:var(--paper);border:1px solid var(--hairline);border-radius:12px;
  padding:22px 24px;box-shadow:var(--shadow);
}
.section + .section{margin-top:18px;}
.section-head{display:flex;align-items:baseline;gap:10px;margin-bottom:16px;}
.section-head .num{
  font-size:0.72rem;font-weight:700;color:var(--accent-soft-ink);background:var(--accent-soft-bg);
  border-radius:999px;width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;flex:none;
}
.section-head h2{font-size:1.08rem;font-family:inherit;font-weight:600;}
.section-head .hint{color:var(--muted);font-size:0.8rem;margin-left:auto;}

.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px 16px;}
@media (max-width:560px){.grid2{grid-template-columns:1fr;}}

.field{display:flex;flex-direction:column;gap:6px;}
.field.full{grid-column:1 / -1;}
label{font-size:0.78rem;color:var(--muted);font-weight:500;}
select, input[type=text], input[type=password], textarea{
  font:inherit;font-size:0.92rem;color:var(--ink);background:var(--field-bg);
  border:1px solid var(--field-border);border-radius:8px;padding:9px 11px;width:100%;appearance:none;
}
select{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%2364748b' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 11px center;padding-right:30px;
}
textarea{resize:vertical;min-height:56px;font-family:inherit;}
select:focus, input:focus, textarea:focus{outline:2px solid var(--focus);outline-offset:1px;border-color:var(--focus);}
select:disabled, input:disabled{opacity:0.55;cursor:not-allowed;}

.output-card{
  background:var(--mono-bg);color:var(--mono-ink);border-radius:12px;padding:20px 20px 18px;
  box-shadow:var(--shadow);display:flex;flex-direction:column;gap:12px;
}
.output-head{display:flex;align-items:center;justify-content:space-between;gap:10px;}
.output-head h2{font-family:inherit;font-size:1rem;color:var(--mono-ink);font-weight:600;}
.output-head .tag{
  font-family:"IBM Plex Mono",monospace;font-size:0.65rem;letter-spacing:0.08em;color:var(--mono-accent);
  text-transform:uppercase;border:1px solid rgba(125,211,252,0.35);padding:3px 8px;border-radius:999px;
}
.mono-scroll{
  font-family:"IBM Plex Mono",monospace;font-size:0.81rem;line-height:1.65;white-space:pre-wrap;
  word-break:break-word;color:var(--mono-ink);overflow-y:auto;padding-right:4px;
}
.mono-scroll::selection{background:var(--mono-accent);color:var(--mono-bg);}
.mono-scroll::-webkit-scrollbar{width:8px;}
.mono-scroll::-webkit-scrollbar-thumb{background:#334155;border-radius:8px;}

.output-actions{display:flex;gap:10px;}
button.copy, button.primary{
  flex:1;font:inherit;font-weight:600;font-size:0.88rem;background:var(--accent);color:var(--accent-ink);
  border:none;border-radius:8px;padding:11px 14px;cursor:pointer;transition:background .15s, transform .1s, opacity .15s;
}
button.copy:hover:not(:disabled), button.primary:hover:not(:disabled){background:var(--accent-hover);}
button.copy:active, button.primary:active{transform:translateY(1px);}
button.copy:focus-visible, button.primary:focus-visible{outline:2px solid var(--focus);outline-offset:2px;}
button.copy.done{background:#16a34a;}
button.primary:disabled{opacity:0.5;cursor:not-allowed;}
button.secondary, a.secondary{
  font:inherit;font-weight:600;font-size:0.85rem;background:var(--paper);color:var(--ink);
  border:1px solid var(--field-border);border-radius:8px;padding:9px 13px;cursor:pointer;
}
button.secondary:hover, a.secondary:hover{background:var(--bg);}
button.danger-link{
  font:inherit;font-size:0.8rem;font-weight:600;color:var(--danger);background:none;border:none;cursor:pointer;padding:4px 0;
}

.charcount{font-family:"IBM Plex Mono",monospace;font-size:0.7rem;color:#94a3b8;}

.note-card{
  font-size:0.82rem;color:var(--muted);background:var(--paper);border:1px solid var(--hairline);
  border-radius:10px;padding:14px 16px;
}
.note-card b{color:var(--ink);}

.status-line{font-size:0.82rem;color:var(--muted);min-height:1.2em;}
.status-line.error{color:var(--danger);}
.status-line.success{color:#16a34a;}

footer{
  margin-top:40px;padding-top:18px;border-top:1px solid var(--hairline);font-size:0.78rem;color:var(--muted);
  display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;
}
