/* Base design system — dùng chung cho mọi web tool (import từ style.css từng tool).
   Light/dark qua [data-theme] trên <html>. Responsive mobile + desktop. */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #eef1f5;
  --text: #1a2233; --muted: #5b6b82; --border: #d8dee8;
  --accent: #2563eb; --accent-2: #1d4ed8; --accent-soft: #dbeafe;
  --ok: #15803d; --ok-soft: #dcfce7; --err: #b91c1c; --err-soft: #fee2e2;
  --warn: #92400e; --warn-soft: #fef3c7;
  --radius: 12px; --shadow: 0 2px 10px rgba(15, 23, 42, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
html[data-theme="dark"] {
  --bg: #0f172a; --surface: #1e293b; --surface-2: #273449;
  --text: #e2e8f0; --muted: #94a3b8; --border: #334155;
  --accent: #60a5fa; --accent-2: #93c5fd; --accent-soft: #1e3a5f;
  --ok: #4ade80; --ok-soft: #14532d; --err: #f87171; --err-soft: #450a0a;
  --warn: #fbbf24; --warn-soft: #451a03;
  --shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--accent); }
h1 { font-size: 1.7rem; line-height: 1.3; margin: .2em 0 .4em; }
h2 { font-size: 1.25rem; margin: 1.6em 0 .5em; }
h3 { font-size: 1.05rem; margin: 1.2em 0 .4em; }
p { margin: .4em 0 .8em; }
.container { max-width: 960px; margin: 0 auto; padding: 0 16px 64px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 16px; max-width: 960px; margin: 0 auto; flex-wrap: wrap; }
.topbar .brand { font-weight: 700; text-decoration: none; color: var(--text); font-size: 1.05rem; }
.topbar .spacer { flex: 1; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.wtf-plan-badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.wtf-plan-badge.pro { background: var(--ok-soft); color: var(--ok); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 16px 0; }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px 16px; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface-2); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone input[type="file"] { display: none; }
label { display: block; font-weight: 600; margin: 12px 0 4px; font-size: .95rem; }
input[type="text"], input[type="number"], input[type="email"], input[type="url"], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .95rem;
}
textarea { min-height: 120px; resize: vertical; }
input[type="checkbox"] { width: auto; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: .9rem; }
.status { margin: 12px 0; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.err { background: var(--err-soft); color: var(--err); }
.status.warn { background: var(--warn-soft); color: var(--warn); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { border-bottom: 1px solid var(--border); padding: 7px 8px; text-align: left; vertical-align: top; }
th { background: var(--surface-2); }
.table-wrap { overflow-x: auto; }
.file-list { list-style: none; padding: 0; margin: 10px 0; }
.file-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .93rem; }
.muted { color: var(--muted); font-size: .9rem; }
.pro-note { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.faq details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 20px 0; }
.tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.tool-card h3 { margin: 0; font-size: 1.05rem; }
.tool-card h3 a { color: var(--text); text-decoration: none; }
.tool-card h3 a:hover { color: var(--accent); }
.tool-card p { margin: 0; color: var(--muted); font-size: .92rem; flex: 1; }
.tool-card .free-limit { font-size: .8rem; color: var(--muted); }
/* Pro modal (dùng chung qua pro-gate.js) */
.wtf-modal { display: none; position: fixed; inset: 0; background: rgba(2, 6, 23, .6); z-index: 100; align-items: center; justify-content: center; padding: 16px; }
.wtf-modal.open { display: flex; }
.wtf-modal-card { background: var(--surface); color: var(--text); border-radius: 14px; max-width: 460px; width: 100%; padding: 24px; position: relative; box-shadow: var(--shadow); }
.wtf-modal-card h2 { margin-top: 0; }
.wtf-modal-close { position: absolute; top: 10px; right: 12px; border: none; background: none; font-size: 1.1rem; cursor: pointer; color: var(--muted); }
.wtf-modal-msg { min-height: 1.4em; font-size: .92rem; }
.wtf-modal-msg.ok { color: var(--ok); }
.wtf-modal-msg.err { color: var(--err); }
.wtf-modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.wtf-btn { padding: 9px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.wtf-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.wtf-modal-buy { font-size: .9rem; color: var(--muted); margin-top: 14px; }
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  h1 { font-size: 1.4rem; }
  .card { padding: 16px; }
}
@media print { .topbar, .no-print { display: none !important; } }
