/* MXTOOL — vanilla CSS. Logical properties only, so dir="rtl" mirrors the layout. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --ink: #0b1220;
  --ink-2: #3c4658;
  --muted: #6b7486;
  --line: #dde2ea;
  --accent: #0b1220;
  --accent-ink: #c6f432;
  --brand: #4f46e5;
  --brand-ink: #ffffff;
  --pass: #0f9d58;
  --pass-bg: #e6f6ee;
  --warn: #b26a00;
  --warn-bg: #fff4e0;
  --fail: #d1293d;
  --fail-bg: #fde8eb;
  --info: #2563eb;
  --info-bg: #e8f0fe;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(11 18 32 / 6%), 0 4px 16px rgb(11 18 32 / 6%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --density: 1;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070b14; --surface: #0e1524; --surface-2: #152036; --ink: #e8edf6; --ink-2: #b7c1d3; --muted: #8592a8;
    --line: #23304a; --accent: #c6f432; --accent-ink: #0b1220; --brand: #818cf8; --brand-ink: #0b1220;
    --pass: #34d399; --pass-bg: #0d2a22; --warn: #fbbf24; --warn-bg: #2d2410; --fail: #f87171; --fail-bg: #331418;
    --info: #60a5fa; --info-bg: #10213d; --shadow: 0 1px 2px rgb(0 0 0 / 40%); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070b14; --surface: #0e1524; --surface-2: #152036; --ink: #e8edf6; --ink-2: #b7c1d3; --muted: #8592a8;
  --line: #23304a; --accent: #c6f432; --accent-ink: #0b1220; --brand: #818cf8; --brand-ink: #0b1220;
  --pass: #34d399; --pass-bg: #0d2a22; --warn: #fbbf24; --warn-bg: #2d2410; --fail: #f87171; --fail-bg: #331418;
  --info: #60a5fa; --info-bg: #10213d; --shadow: 0 1px 2px rgb(0 0 0 / 40%); color-scheme: dark;
}

/* Script-specific font stacks and line heights. */
:lang(ar), :lang(ur) { --font: "Noto Naskh Arabic", "Segoe UI", Tahoma, "Geeza Pro", system-ui, sans-serif; }
:lang(ur) { --font: "Noto Nastaliq Urdu", "Jameel Noori Nastaleeq", "Noto Naskh Arabic", Tahoma, sans-serif; line-height: 1.9; }
:lang(ja) { --font: "Hiragino Sans", "Yu Gothic UI", Meiryo, "Noto Sans JP", system-ui, sans-serif; }
:lang(ko) { --font: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif; }
:lang(zh-Hans) { --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif; }
:lang(zh-Hant) { --font: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif; }
:lang(th) { --font: "Thonburi", "Leelawadee UI", "Noto Sans Thai", system-ui, sans-serif; line-height: 1.8; }
:lang(hi) { --font: "Kohinoor Devanagari", "Nirmala UI", "Noto Sans Devanagari", system-ui, sans-serif; line-height: 1.8; }
:lang(bn) { --font: "Kohinoor Bangla", "Nirmala UI", "Noto Sans Bengali", system-ui, sans-serif; line-height: 1.8; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.2; margin-block: 0 .5em; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); letter-spacing: -.02em; }
h2 { font-size: 1.15rem; }
code, pre, .mono { font-family: var(--mono); font-size: .88em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 8px; top: 8px; z-index: 99; background: var(--surface); padding: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.wrap { max-width: 1200px; margin-inline: auto; padding-inline: 16px; }
.narrow { max-width: 860px; }
.muted { color: var(--muted); }
.lede { color: var(--ink-2); font-size: 1.05rem; max-width: 70ch; }
.flash { background: var(--info-bg); color: var(--info); padding: 10px 14px; border-radius: var(--radius); }

/* Header */
.site-header { background: var(--surface); border-block-end: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-row { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .04em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.header-search { flex: 1; max-width: 420px; }
.header-search input { width: 100%; }
.main-nav { display: flex; align-items: center; gap: 14px; position: relative; }
.main-nav > a, .nav-toggle { color: var(--ink-2); font-weight: 600; background: none; border: 0; font: inherit; cursor: pointer; padding: 6px 4px; }
.mega { position: absolute; inset-block-start: calc(100% + 10px); inset-inline-end: -160px; width: min(880px, 92vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.mega[hidden] { display: none; }
.mega h3 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.mega a { display: block; padding: 3px 0; color: var(--ink); font-size: .92rem; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.icon-btn { background: var(--surface-2); color: var(--ink-2); border: 0; border-radius: 8px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; }
.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; background: var(--surface-2); border-radius: 8px; padding: 7px 10px; font-weight: 700; font-size: .85rem; }
.lang summary::-webkit-details-marker { display: none; }
.lang ul { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); list-style: none; margin: 0; padding: 6px; width: 200px; max-height: 70vh; overflow: auto; z-index: 30; }
.lang a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink); }
.lang a[aria-current] { background: var(--surface-2); font-weight: 700; }

/* Forms */
input[type=text], input[type=number], input[type=email], input[type=password], input:not([type]), select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 42px;
}
textarea { width: 100%; font-family: var(--mono); font-size: .85rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; border-radius: 8px; padding: 10px 18px; min-height: 42px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn[disabled] { opacity: .6; cursor: progress; }
.st-row { display: flex; gap: 8px; }
.st-row input { flex: 1; min-width: 0; }
.tool-options { display: flex; flex-wrap: wrap; gap: 12px; margin-block: 12px; }
.tool-options label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--ink-2); }
.tool-options label.check { flex-direction: row; align-items: center; }
fieldset.gen { border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; width: 100%; padding: 14px; }
.quota { font-size: .82rem; color: var(--muted); margin-block: 8px 0; }

/* Hero / SuperTool */
.hero { background: radial-gradient(1200px 400px at 50% -10%, color-mix(in srgb, var(--brand) 14%, transparent), transparent), var(--surface); border-block-end: 1px solid var(--line); padding-block: 56px 40px; }
.hero h1 { max-width: 20ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--brand); margin: 0 0 8px; }
.supertool { margin-block-start: 24px; max-width: 820px; }
.supertool .st-row { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); }
.supertool .st-row input, .supertool .st-row select { border: 0; box-shadow: none; }
.supertool select { max-width: 170px; background: var(--surface-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: 12px; }
.chip { font: inherit; font-family: var(--mono); font-size: .8rem; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; cursor: pointer; }

/* Tool groups */
.tool-groups { padding-block: 32px; display: grid; gap: 28px; }
.group h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.tool-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tool-card { display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--brand); text-decoration: none; transform: translateY(-1px); }
.tool-card small { color: var(--muted); line-height: 1.4; }
.ti { width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2); display: inline-block; margin-block-end: 6px; }
.recent { padding-block: 0 40px; }
.recent-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.recent-list li { display: flex; gap: 10px; align-items: center; }
.recent-list time { color: var(--muted); font-size: .82rem; margin-inline-start: auto; }

/* Tool page */
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding-block: 28px 48px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-block-end: 8px; }
.tool-form { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-block: 16px; }
.tool-form textarea { margin-block-end: 10px; }
.tool-side { display: grid; gap: 16px; align-content: start; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 6px; }
.side-card h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.explainer { margin-block-start: 32px; color: var(--ink-2); }
.prose p { max-width: 72ch; }

/* Results (Generative-UI blocks) */
.result:empty { display: none; }
.result { margin-block: 20px; display: grid; gap: 14px; }
.gx-head { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.gx-head .gx-title { flex: 1; min-width: 0; }
.gx-head h2 { margin: 0; font-size: 1.05rem; }
.gx-head p { margin: 2px 0 0; color: var(--muted); font-family: var(--mono); font-size: .82rem; overflow-wrap: anywhere; }
.gx-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.gx-actions .btn { padding: 6px 10px; min-height: 32px; font-size: .82rem; }
.score-ring { --v: 0; --c: var(--pass); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--surface-2) 0); }
.score-ring span { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; }
.gx-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gx-card > h3 { margin: 0; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 12px 16px; border-block-end: 1px solid var(--line); background: var(--surface-2); }
.gx-body { padding: 12px 16px; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 70px minmax(120px, 220px) 1fr; gap: 10px; padding: 9px 16px; border-block-end: 1px solid var(--line); align-items: start; }
.checks li:last-child { border-block-end: 0; }
.checks .help { grid-column: 3; color: var(--muted); font-size: .85rem; }
.badge { display: inline-block; font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; text-align: center; background: var(--surface-2); color: var(--ink-2); }
.badge-pass { background: var(--pass-bg); color: var(--pass); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-fail, .badge-error { background: var(--fail-bg); color: var(--fail); }
.badge-info { background: var(--info-bg); color: var(--info); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.data th { text-align: start; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 16px; border-block-end: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 8px 16px; border-block-end: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; white-space: pre-line; }
table.data tr:last-child td { border-block-end: 0; }
table.data tr.row-fail td:first-child { box-shadow: inset 3px 0 0 var(--fail); }
table.data tr.row-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
table.data tr.row-pass td:first-child { box-shadow: inset 3px 0 0 var(--pass); }
[dir=rtl] table.data tr td:first-child { box-shadow: none; }
[dir=rtl] table.data tr.row-fail td:first-child { box-shadow: inset -3px 0 0 var(--fail); }
[dir=rtl] table.data tr.row-warn td:first-child { box-shadow: inset -3px 0 0 var(--warn); }
[dir=rtl] table.data tr.row-pass td:first-child { box-shadow: inset -3px 0 0 var(--pass); }
dl.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 6px 16px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: .85rem; }
dl.kv dd { margin: 0; font-family: var(--mono); font-size: .85rem; overflow-wrap: anywhere; }
pre.code { margin: 0; padding: 12px 16px; background: var(--surface-2); overflow-x: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .82rem; direction: ltr; text-align: left; } /* rtl-ok: code is always LTR */
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: minmax(80px, 180px) 1fr 52px; gap: 10px; align-items: center; font-size: .85rem; }
.bar-track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--brand); border-radius: 99px; }
.gauge { display: flex; align-items: center; gap: 18px; }
.gauge .score-ring { width: 96px; height: 96px; }
.gauge .score-ring span { width: 76px; height: 76px; font-size: 1.3rem; }
.grade { font-size: 2.2rem; font-weight: 900; }
.tree ul { list-style: none; margin: 0; padding-inline-start: 18px; border-inline-start: 1px dashed var(--line); }
.tree > ul { padding-inline-start: 0; border: 0; }
.tree li { padding-block: 4px; }
.tree .node-detail { display: block; font-family: var(--mono); font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }
.regions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.region { border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.region h4 { margin: 0 0 6px; font-size: .85rem; }
.dots { display: flex; flex-wrap: wrap; gap: 4px; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); }
.dot.pass { background: var(--pass); } .dot.warn { background: var(--warn); } .dot.fail { background: var(--fail); }
details.section { border-block-end: 1px solid var(--line); }
details.section summary { cursor: pointer; padding: 10px 16px; display: flex; gap: 10px; align-items: center; }
details.section .result { margin: 0; padding: 0 16px 16px; }
.loading { display: flex; align-items: center; gap: 10px; padding: 18px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-block-start-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.err { background: var(--fail-bg); color: var(--fail); padding: 12px 16px; border-radius: var(--radius); }

/* Pricing */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-block: 24px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.plan-featured { border: 2px solid var(--brand); }
.price { font-size: 2rem; font-weight: 800; margin: 0; }
.price small { font-size: .9rem; color: var(--muted); }

/* Ads */
.ad-slot:empty { display: none; }
.ad-slot { margin-block: 12px; text-align: center; }
.ad-header { max-width: 970px; margin-inline: auto; }

/* Footer */
.site-footer { border-block-start: 1px solid var(--line); background: var(--surface); padding-block: 32px 16px; margin-block-start: 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 24px; }
.footer-grid h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.footer-grid a { display: block; color: var(--ink-2); font-size: .88rem; padding-block: 2px; }
.copyright { color: var(--muted); font-size: .8rem; margin-block-start: 24px; }

/* Responsive */
@media (max-width: 960px) {
  .tool-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .mega { grid-template-columns: repeat(2, 1fr); inset-inline-end: -60px; }
}
@media (max-width: 680px) {
  .header-search { display: none; }
  .header-row { gap: 10px; }
  .main-nav > a { display: none; }
  .mega { position: fixed; inset-inline: 8px; width: auto; top: 64px; grid-template-columns: 1fr 1fr; max-height: 75vh; overflow: auto; }
  .st-row { flex-wrap: wrap; }
  .st-row .btn { flex: 1 1 100%; }
  .supertool select { max-width: none; flex: 1 1 100%; }
  .checks li { grid-template-columns: 64px 1fr; }
  .checks li > :nth-child(3), .checks .help { grid-column: 1 / -1; }
  .bar { grid-template-columns: 90px 1fr 44px; }
  .regions { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding-block: 32px 24px; }
}

/* Generative-UI density modes (set by the adaptive runtime). */
[data-density="compact"] { --density: .8; }
[data-density="compact"] .checks li, [data-density="compact"] table.data td { padding-block: 5px; }
[data-density="compact"] .tool-card small { display: none; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .site-header, .site-footer, .tool-side, .ad-slot, .tool-form, .gx-actions { display: none !important; } body { background: #fff; } }

/* Auth & account */
.auth { max-width: 420px; padding-block: 40px; }
.stack { display: grid; gap: 14px; }
.stack label { display: grid; gap: 4px; font-size: .9rem; color: var(--ink-2); }
.stack label.check { display: flex; align-items: center; gap: 8px; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; padding-block: 24px 48px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.panel h2 { font-size: 1rem; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline-form input[type=text], .inline-form input[type=url], .inline-form input[type=email] { flex: 1 1 200px; }
.token { font-family: var(--mono); background: var(--surface-2); padding: 8px 10px; border-radius: 8px; overflow-wrap: anywhere; direction: ltr; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-block: 16px; }
.stat { display: grid; gap: 4px; }
.stat strong { font-size: 1.6rem; }

/* Graph & line blocks */
.graph-wrap { padding: 8px; }
svg.graph { width: 100%; height: auto; aspect-ratio: 900 / 560; background: var(--surface-2); border-radius: 8px; touch-action: none; cursor: grab; }
.g-edge { stroke: var(--line); stroke-width: 1.2; }
.g-listed { stroke: var(--fail); stroke-dasharray: 4 3; }
.g-node { cursor: pointer; }
.g-node:focus-visible circle, .g-node:focus-visible rect { stroke: var(--brand); stroke-width: 3; }
.g-domain circle { stroke: var(--ink); stroke-width: 2; }
.g-label { font: 11px var(--mono); fill: var(--ink-2); pointer-events: none; }
.g-dim { opacity: .15; }
.g-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .8rem; padding: 8px 4px 0; align-items: center; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 5px; vertical-align: middle; }
.lg-pass { background: var(--pass); } .lg-warn { background: var(--warn); } .lg-fail { background: var(--fail); }
svg.linechart { width: 100%; height: auto; }
.lc-grid { stroke: var(--line); stroke-dasharray: 3 4; }
.lc-axis { font: 10px var(--mono); fill: var(--muted); }
[dir=rtl] svg.graph, [dir=rtl] svg.linechart { direction: ltr; }

/* Assistant */
.chat-fab { position: fixed; inset-block-end: 18px; inset-inline-end: 18px; z-index: 40; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 999px; padding: 12px 18px; font: inherit; font-weight: 800; box-shadow: var(--shadow); cursor: pointer; }
.chat { position: fixed; inset-block-end: 76px; inset-inline-end: 18px; z-index: 41; width: min(420px, calc(100vw - 32px)); height: min(620px, calc(100vh - 110px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgb(0 0 0 / 25%); display: flex; flex-direction: column; overflow: hidden; }
.chat[hidden] { display: none; }
.chat header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-block-end: 1px solid var(--line); }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; display: grid; gap: 10px; align-content: start; }
.msg { max-width: 92%; padding: 8px 12px; border-radius: 12px; font-size: .9rem; overflow-wrap: anywhere; }
.msg p { margin: 0 0 .5em; } .msg p:last-child { margin: 0; }
.msg-user { background: var(--brand); color: var(--brand-ink); justify-self: end; }
.msg-assistant { background: var(--surface-2); justify-self: start; }
.msg pre.code { margin: 6px 0; border-radius: 6px; }
.chat-context { margin: 0; padding: 4px 14px; font-size: .78rem; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-block-start: 1px solid var(--line); }
.chat-form textarea { flex: 1; font-family: var(--font); min-height: 42px; }
.chat-sources { font-size: .75rem; margin: 6px 0 0; }
.fixes { display: grid; gap: 10px; padding: 10px 16px; }
.fix { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: grid; gap: 6px; }
.fix p { margin: 0; }
.fix .btn { justify-self: start; padding: 4px 10px; min-height: 30px; }

/* Adaptive modes */
[data-lite] .hero { background: var(--surface); }
[data-lite] .tool-card { transition: none; }
[data-input="touch"] .btn, [data-input="touch"] .chip { min-height: 44px; }
[data-expertise="expert"] .tool-card small { display: none; }
.group-personal h2 { color: var(--brand); }
@media print { .chat, .chat-fab { display: none !important; } }
.account-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.panel .checks li { grid-template-columns: 64px 1fr; padding-inline: 0; }
.panel .checks li > :nth-child(3) { grid-column: 1 / -1; }
.panel td.gx-actions { display: flex; gap: 6px; flex-wrap: nowrap; }

/* Pagination (simple view) */
.pagination { display: flex; gap: 8px; list-style: none; padding: 0; margin: 16px 0; }
.pagination .page-link, .pagination .page-item span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.pagination .disabled span { color: var(--muted); }
.gx-head { flex-wrap: wrap; }
.gx-head .gx-title { flex: 1 1 260px; min-width: min(100%, 280px); }
.gx-head .gx-actions { margin-inline-start: auto; }
