/* ==========================================================================
   ToolMakersHub — shared styles for every page.
   Brand rules: docs/brand-guidelines.md
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f4f5f9;
    --text: #1d1f2b;
    --muted: #636779;
    --border: #dcdfe8;
    --shadow: 0 1px 6px rgba(32, 33, 54, .18);
    --shadow-lg: 0 8px 24px rgba(32, 33, 54, .12);
    --logo-from: #00b4db;
    --logo-to: #00d4aa;
    --brand: #007a99;
    --brand-2: #00b4db;
    --brand-ink: #ffffff;
    --brand-soft: rgba(0, 180, 219, .10);
    --ok: #16a34a;
    --warn-bg: #fff4d6;
    --warn-ink: #8a5a00;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}
:root[data-theme="dark"] {
    --bg: #14151c;
    --surface: #1d1f29;
    --surface-2: #262935;
    --text: #e8e9f0;
    --muted: #9a9db0;
    --border: #353846;
    --shadow: 0 1px 8px rgba(0, 0, 0, .55);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, .5);
    --brand: #22c7e6;
    --brand-2: #2dd4bf;
    --brand-ink: #14151c;
    --brand-soft: rgba(34, 199, 230, .12);
    --ok: #4ade80;
    --warn-bg: #3a2f12;
    --warn-ink: #f5c451;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.page { flex: 1; display: flex; flex-direction: column; }
[hidden] { display: none !important; }   /* the hidden attribute must always win over display rules */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 6px; padding: 14px 20px; font-size: 14px;
}
.topbar.with-brand { border-bottom: 1px solid var(--border); padding: 10px 20px; position: sticky; top: 0; z-index: 30; background: var(--bg); }
.topbar-brand { margin-right: auto; display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; }
.topbar-brand .logo-cog { width: 30px; height: 30px; }
.topbar a.link { padding: 6px 10px; border-radius: 6px; }
.topbar a.link:hover { text-decoration: underline; }
.topbar a.link.active { color: var(--brand); font-weight: 600; }
.hub { background: linear-gradient(90deg, var(--logo-from), var(--logo-to)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.icon-btn {
    width: 40px; height: 40px; border-radius: 50%;
    border: 0; background: transparent;
    display: grid; place-items: center; color: var(--muted);
}
.icon-btn:hover { background: var(--surface-2); }
.btn-primary {
    border: 0; border-radius: 999px; padding: 9px 22px;
    background: var(--brand); color: var(--brand-ink);
    font-weight: 600; font-size: 14px; margin-left: 6px;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-soft {
    border: 1px solid transparent; background: var(--surface-2);
    border-radius: 6px; padding: 9px 18px; font-size: 14px;
}
.btn-soft:hover { border-color: var(--border); box-shadow: 0 1px 1px rgba(0,0,0,.1); }

/* ---------- Glyph tile (category / tool icon) ---------- */
.glyph {
    display: inline-grid; place-items: center; flex: none;
    width: 44px; height: 44px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(0,180,219,.16), rgba(0,212,170,.16));
    color: var(--brand); font-family: var(--mono); font-weight: 700; font-size: 14px;
    letter-spacing: -0.02em; white-space: nowrap; overflow: hidden;
}
.glyph-sm { width: 26px; height: 26px; border-radius: 7px; font-size: 10px; }
.glyph-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 18px; }

/* ---------- Product menu ---------- */
.menu-wrap { position: relative; }
.apps-menu {
    position: absolute; right: 0; top: 46px; width: 300px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 18px; box-shadow: var(--shadow); padding: 14px;
    display: none; grid-template-columns: repeat(2, 1fr); gap: 6px; z-index: 40;
}
.apps-menu.open { display: grid; }
.apps-menu a, .apps-menu .locked {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 6px; border-radius: 12px; font-size: 13px; text-align: center;
}
.apps-menu a:hover { background: var(--surface-2); }
.apps-menu .locked { opacity: .5; cursor: not-allowed; }
.apps-menu small { font-size: 11px; color: var(--muted); }
.apps-menu .all + .all { border-top: 0; padding-top: 0; }
.apps-menu .all { grid-column: 1 / -1; flex-direction: row; justify-content: center; padding: 10px; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; color: var(--brand); font-weight: 600; }

/* ---------- Search box (home + dev tools) ---------- */
.search { position: relative; width: 100%; max-width: 584px; }
.search-box {
    display: flex; align-items: center; gap: 10px;
    height: 50px; padding: 0 16px;
    border: 1px solid var(--border); border-radius: 25px; background: var(--surface);
    transition: box-shadow .15s, border-color .15s;
}
.search-box:hover, .search-box:focus-within { box-shadow: var(--shadow); border-color: transparent; }
.search.has-results .search-box { border-radius: 25px 25px 0 0; box-shadow: var(--shadow); border-color: transparent; }
.search-box svg { flex: none; color: var(--muted); }
.search-box input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; color: var(--text); min-width: 0; }
.clear-btn { border: 0; background: none; color: var(--muted); font-size: 22px; line-height: 1; display: none; padding: 0 4px; }
.search.typing .clear-btn { display: block; }
.suggestions {
    position: absolute; left: 0; right: 0; top: 50px; z-index: 25;
    background: var(--surface); border-radius: 0 0 25px 25px; box-shadow: var(--shadow);
    padding: 4px 0 14px; display: none; list-style: none; margin: 0;
    border-top: 1px solid var(--border); text-align: left;
}
.search.has-results .suggestions { display: block; }
.suggestions li a { display: flex; align-items: center; gap: 12px; padding: 8px 20px; font-size: 15px; }
.suggestions li a:hover, .suggestions li.active a { background: var(--surface-2); }
.suggestions .cat { margin-left: auto; font-size: 12px; color: var(--muted); }
.suggestions .type { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px; }

/* ---------- Cards ---------- */
.card {
    display: flex; flex-direction: column; gap: 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.card:hover { border-color: transparent; box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.card h3 { margin: 0; font-size: 16px; font-weight: 650; }
.card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.card .meta { margin-top: auto; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.card-head { display: flex; align-items: center; gap: 12px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); white-space: nowrap; }
.badge.draft { background: var(--surface-2); color: var(--muted); }
.badge.live { background: var(--brand-soft); color: var(--brand); }

.empty-state {
    text-align: center; padding: 48px 20px; border: 1px dashed var(--border); border-radius: 16px; color: var(--muted);
}
.empty-state h3 { color: var(--text); margin: 14px 0 6px; font-size: 17px; }
.empty-state p { margin: 0 auto; max-width: 440px; font-size: 14px; line-height: 1.5; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a:hover { color: var(--brand); text-decoration: underline; }

/* ---------- Footer ---------- */
footer { background: var(--surface-2); font-size: 14px; color: var(--muted); }
footer .row { padding: 14px 28px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
footer .row + .row { border-top: 1px solid var(--border); }
footer nav { display: flex; gap: 24px; flex-wrap: wrap; }
footer a:hover { text-decoration: underline; }
.loc { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.loc svg { flex: none; }
.loc-btn { border: 0; background: none; padding: 0; color: var(--brand); font-size: 14px; }
.loc-btn:hover { text-decoration: underline; }
.loc-btn[disabled] { color: var(--muted); cursor: default; text-decoration: none; }

/* ---------- Sign-in dialog ---------- */
.overlay {
    position: fixed; inset: 0; background: rgba(10, 11, 20, .55);
    display: none; align-items: center; justify-content: center; padding: 16px; z-index: 60;
}
.overlay.open { display: flex; }
.dialog {
    width: 100%; max-width: 420px; background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: 20px; padding: 32px 28px 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3); position: relative;
}
.dialog .logo-cog { display: block; margin: 0 auto 12px; }
.dialog h2 { margin: 0 0 4px; font-size: 22px; text-align: center; }
.dialog p.sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; text-align: center; }
.dialog .close { position: absolute; top: 12px; right: 12px; }
.provider {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 11px 14px; margin-bottom: 10px;
    border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
    font-weight: 500; font-size: 15px;
}
.provider:hover { background: var(--surface-2); }
.provider svg { width: 18px; height: 18px; flex: none; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field input {
    width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg); color: var(--text); font-size: 15px;
}
.field input:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.dialog .btn-primary { width: 100%; margin: 6px 0 0; padding: 12px; }
.fine { font-size: 12px; color: var(--muted); text-align: center; margin: 16px 0 0; }
.fine a { color: var(--brand); }

.flash {
    max-width: 584px; width: calc(100% - 32px); margin: 16px auto 0; padding: 10px 14px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; text-align: center;
}

/* ==========================================================================
   Dev Tools pages
   ========================================================================== */
.dt-shell { flex: 1; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.dt-sidebar {
    border-right: 1px solid var(--border); padding: 16px 12px 40px;
    position: sticky; top: 61px; height: calc(100vh - 61px); overflow-y: auto; font-size: 14px;
}
.dt-side-filter {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--text); font-size: 14px; margin-bottom: 12px;
}
.dt-side-filter:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.dt-side-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; }
.dt-side-link:hover { background: var(--surface-2); }
.dt-side-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.dt-side-head { display: block; margin: 18px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.dt-side-head:hover { color: var(--brand); }
.dt-side-sub summary {
    list-style: none; display: flex; align-items: center; gap: 10px;
    padding: 6px 10px; border-radius: 8px; cursor: pointer; user-select: none;
}
.dt-side-sub summary::-webkit-details-marker { display: none; }
.dt-side-sub summary:hover { background: var(--surface-2); }
.dt-side-sub summary .name { flex: 1; }
.dt-side-sub summary .count { font-size: 11px; color: var(--muted); }
.dt-side-sub summary::after { content: '›'; color: var(--muted); transition: transform .15s; }
.dt-side-sub[open] summary::after { transform: rotate(90deg); }
.dt-side-sub.current > summary { color: var(--brand); font-weight: 600; }
.dt-side-sub ul { list-style: none; margin: 2px 0 6px; padding: 0 0 0 46px; }
.dt-side-sub li a, .dt-side-sub li.empty { display: block; padding: 5px 8px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.dt-side-sub li a:hover { color: var(--text); background: var(--surface-2); }
.dt-side-sub li a.active { color: var(--brand); font-weight: 600; }
.dt-side-sub li.empty { font-style: italic; }
.dt-side-none { display: none; padding: 10px; color: var(--muted); font-size: 13px; }

.dt-main { padding: 28px 32px 56px; min-width: 0; }
.dt-wrap { max-width: 1100px; margin: 0 auto; }
.dt-hero { text-align: center; padding: 18px 0 30px; }
.dt-hero h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.03em; margin: 0 0 10px; }
.dt-hero p { color: var(--muted); margin: 0 auto 22px; max-width: 620px; line-height: 1.55; }
.dt-hero .search { margin: 0 auto; }
.dt-stats { margin-top: 16px; font-size: 13px; color: var(--muted); }
.dt-section { margin-top: 34px; }
.dt-section-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.dt-section-head h2 { margin: 0; font-size: 21px; letter-spacing: -0.02em; }
.dt-section-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.dt-section-head .more { margin-left: auto; font-size: 14px; color: var(--brand); font-weight: 600; white-space: nowrap; }
.dt-page-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.dt-page-head h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.03em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dt-page-head p { margin: 4px 0 0; color: var(--muted); line-height: 1.5; }

.tool-workspace { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); padding: 20px; }
.tool-placeholder { border: 1px dashed var(--border); border-radius: 12px; padding: 40px 20px; text-align: center; color: var(--muted); }
.tool-placeholder strong { display: block; color: var(--text); margin-bottom: 6px; }
.tool-about { margin-top: 28px; color: var(--muted); line-height: 1.6; }
.tool-about h2, .dt-related h2 { color: var(--text); font-size: 18px; margin: 0 0 8px; }
.dt-related { margin-top: 32px; }

.dt-browse-btn { display: none; }
.dt-scrim { display: none; }

@media (max-width: 900px) {
    .dt-shell { grid-template-columns: 1fr; }
    .dt-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); height: auto; z-index: 55;
        background: var(--bg); transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow-lg);
    }
    .dt-sidebar.open { transform: none; }
    .dt-browse-btn { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; }
    .dt-main { padding: 20px 16px 48px; }
    .dt-scrim { position: fixed; inset: 0; background: rgba(10,11,20,.45); z-index: 54; }
    .dt-scrim.open { display: block; }
}
@media (max-width: 560px) {
    .topbar .link { display: none; }
    .topbar-brand .word { display: none; }
    footer .row { justify-content: center; padding: 12px 16px; }
}

/* ==========================================================================
   Tool UI — shared by every tool view in resources/views/tools/
   ========================================================================== */
.tool { display: flex; flex-direction: column; gap: 16px; }
.tool-cols { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.tool-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tool-field > label, .tool-label { font-size: 13px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.tool-label .hint, .tool-field > label .hint { font-weight: 400; color: var(--muted); }
.tool-text, .tool-input, .tool-select {
    width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text);
    font-size: 14px; padding: 10px 12px;
}
.tool-text { font-family: var(--mono); line-height: 1.55; resize: vertical; min-height: 160px; }
.tool-text[readonly] { background: var(--surface-2); }
.tool-input { height: 40px; }
.tool-select { height: 40px; padding: 0 10px; width: auto; }
.tool-text:focus, .tool-input:focus, .tool-select:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.tool-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tool-bar .spacer { flex: 1; }
.btn-tool {
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500; line-height: 1.2;
}
.btn-tool:hover { border-color: var(--brand); color: var(--brand); }
.btn-tool.active, .btn-tool.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-tool.active:hover, .btn-tool.primary:hover { filter: brightness(1.08); color: var(--brand-ink); }
.tool-options { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; font-size: 14px; }
.tool-options label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tool-options input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }
.tool-stats { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tool-stat { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.tool-stat b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.tool-stat span { font-size: 12px; color: var(--muted); }
.tool-msg { font-size: 13px; color: var(--muted); min-height: 18px; }
.tool-msg.error { color: #d93025; }
:root[data-theme="dark"] .tool-msg.error { color: #ff8a80; }
.tool-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-chip { font-size: 12px; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 3px 10px; }
.diff-view { border: 1px solid var(--border); border-radius: 10px; overflow: auto; max-height: 520px; font-family: var(--mono); font-size: 13px; line-height: 1.55; background: var(--bg); }
.diff-line { display: grid; grid-template-columns: 44px 44px 18px 1fr; white-space: pre-wrap; word-break: break-word; }
.diff-line .ln { color: var(--muted); text-align: right; padding-right: 8px; user-select: none; }
.diff-line .sign { user-select: none; text-align: center; }
.diff-line.add { background: rgba(22, 163, 74, .12); }
.diff-line.del { background: rgba(217, 48, 37, .12); }
.diff-line.add .sign { color: var(--ok); }
.diff-line.del .sign { color: #d93025; }
.diff-empty { padding: 16px; color: var(--muted); }
@media (max-width: 760px) { .tool-cols { grid-template-columns: 1fr; } .tool-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kv-table { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; font-size: 14px; }
.kv-row { display: grid; grid-template-columns: minmax(110px, 180px) 1fr; border-top: 1px solid var(--border); }
.kv-row:first-child { border-top: 0; }
.kv-key { background: var(--surface-2); padding: 8px 12px; font-weight: 600; color: var(--muted); word-break: break-word; }
.kv-val { padding: 8px 12px; font-family: var(--mono); word-break: break-all; }
.kv-empty { padding: 10px 12px; color: var(--muted); font-size: 14px; }
.tool-preview { border: 1px solid var(--border); border-radius: 10px; background: #fff; min-height: 240px; width: 100%; }
.md-preview { border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; overflow: auto; min-height: 240px; line-height: 1.6; background: var(--bg); }
.md-preview pre { background: var(--surface-2); padding: 10px; border-radius: 8px; overflow: auto; }
.md-preview code { font-family: var(--mono); font-size: .92em; }
.md-preview table { border-collapse: collapse; }
.md-preview th, .md-preview td { border: 1px solid var(--border); padding: 4px 8px; }
.md-preview img { max-width: 100%; }
.md-preview a { color: var(--brand); }
.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tool-range { accent-color: var(--brand); }
.preview-box { height: 160px; border-radius: 12px; border: 1px solid var(--border); }
.tool-result { border-radius: 10px; padding: 12px 14px; background: var(--surface-2); font-size: 14px; color: var(--muted); }
.tool-result.ok { background: rgba(22, 163, 74, .12); color: var(--text); }
.tool-result.bad { background: rgba(217, 48, 37, .10); color: var(--text); }
.tool-result.ok strong { color: var(--ok); }
.tool-result.bad strong { color: #d93025; }
:root[data-theme="dark"] .tool-result.bad strong { color: #ff8a80; }
.tool-result pre { margin: 8px 0 0; font-family: var(--mono); font-size: 13px; white-space: pre; overflow: auto; }
.tool-snippet { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(217, 48, 37, .08); font-family: var(--mono); font-size: 13px; overflow: auto; }
.json-tree { font-family: var(--mono); font-size: 13px; line-height: 1.6; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; overflow: auto; max-height: 560px; background: var(--bg); }
.json-tree details { padding-left: 18px; }
.json-tree details > summary { margin-left: -18px; cursor: pointer; list-style: none; }
.json-tree details > summary::before { content: '▸'; display: inline-block; width: 14px; color: var(--muted); }
.json-tree details[open] > summary::before { content: '▾'; }
.json-tree .leaf { padding-left: 18px; }
.json-tree .k { color: var(--brand); }
.json-tree .s { color: #16a34a; }
.json-tree .n { color: #b45309; }
.json-tree .b { color: #7c3aed; }
.json-tree .z { color: var(--muted); }
.json-tree .meta { color: var(--muted); font-size: 12px; }
:root[data-theme="dark"] .json-tree .s { color: #4ade80; }
:root[data-theme="dark"] .json-tree .n { color: #fbbf24; }
:root[data-theme="dark"] .json-tree .b { color: #c4b5fd; }
.data-table-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: auto; max-height: 560px; }
.data-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.data-table th, .data-table td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 6px 10px; text-align: left; white-space: nowrap; max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.data-table th { background: var(--surface-2); position: sticky; top: 0; font-weight: 600; }
.data-table td.num { color: var(--muted); text-align: right; }
.drop-zone { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px; border: 2px dashed var(--border); border-radius: 12px; }
.drop-zone.over { border-color: var(--brand); background: var(--brand-soft); }
.hash-list { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.hash-row { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--border); }
.hash-row:first-child { border-top: 0; }
.hash-name { font-weight: 600; font-size: 13px; color: var(--muted); }
.hash-val { font-family: var(--mono); font-size: 13px; word-break: break-all; min-height: 1.2em; }
@media (max-width: 560px) { .hash-row { grid-template-columns: 1fr auto; } .hash-name { grid-column: 1 / -1; } }
.pw-display { display: flex; gap: 8px; align-items: center; }
.pw-display .tool-input { flex: 1; min-width: 0; }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter-bar { height: 100%; width: 0; border-radius: 999px; background: var(--muted); transition: width .2s, background .2s; }
.meter-bar.very-weak, .meter-bar.weak { background: #d93025; }
.meter-bar.fair { background: #e8a200; }
.meter-bar.strong { background: #16a34a; }
.meter-bar.very-strong { background: linear-gradient(90deg, var(--logo-from), var(--logo-to)); }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.check-list .ok { color: var(--ok); }
.check-list .bad { color: var(--muted); }
.big-number { font-size: clamp(36px, 8vw, 64px); font-weight: 800; letter-spacing: -0.03em; text-align: center; color: var(--brand); min-height: 0; }
.big-number:empty { display: none; }
.qr-stage { display: grid; place-items: center; background: var(--surface-2); border-radius: 12px; padding: 16px; }
.qr-stage canvas { max-width: 100%; height: auto; border-radius: 6px; image-rendering: pixelated; }
.hs-code { display: inline-block; font-family: var(--mono); font-weight: 700; padding: 1px 8px; border-radius: 6px; color: #fff; }
.hs-1 { background: #64748b; } .hs-2 { background: #16a34a; } .hs-3 { background: #0284c7; } .hs-4 { background: #d97706; } .hs-5 { background: #dc2626; }
.base-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.contrast-sample { border: 1px solid var(--border); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.shade-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.shade { border: 0; border-radius: 8px; height: 56px; font-family: var(--mono); font-size: 12px; cursor: pointer; }
.img-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.img-compare figure { margin: 0; border: 1px solid var(--border); border-radius: 12px; padding: 10px; background:
    repeating-conic-gradient(var(--surface-2) 0 25%, transparent 0 50%) 0 0 / 16px 16px; }
.img-compare img { display: block; max-width: 100%; max-height: 320px; margin: 0 auto; }
.img-compare figcaption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 8px; background: var(--surface); border-radius: 6px; padding: 2px 6px; }
@media (max-width: 760px) { .img-compare { grid-template-columns: 1fr; } }
.file-list { margin: 0; padding-left: 22px; display: grid; gap: 6px; font-size: 14px; }
.file-list:empty { display: none; }
.file-list li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.file-list li > span { flex: 1; min-width: 200px; }
.file-list li.bad { color: #d93025; }
.file-list .btn-tool { padding: 3px 10px; }
/* ---------- PDF page grid (public/js/tmh-pdf.js) ---------- */
.pdf-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pdf-grid:empty { display: none; }
.pdf-card {
    position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px;
    border: 2px solid var(--border); border-radius: 12px; background: var(--surface); user-select: none;
}
.pdf-grid.mode-select .pdf-card { cursor: pointer; }
.pdf-grid.mode-organize .pdf-card { cursor: grab; }
.pdf-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pdf-card.selected { border-color: var(--brand); background: var(--brand-soft); }
.pdf-card.selected::after {
    content: '✓'; position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; background: var(--brand); color: var(--brand-ink); font-size: 14px; font-weight: 700;
}
.pdf-grid.marks-remove .pdf-card.selected { border-color: #d93025; background: rgba(217, 48, 37, .08); }
.pdf-grid.marks-remove .pdf-card.selected::after { content: '×'; background: #d93025; color: #fff; font-size: 18px; }
.pdf-grid.marks-remove .pdf-card.selected .pdf-thumb { opacity: .45; }
.pdf-card.dragging { opacity: .4; }
.pdf-card.drop-target { border-color: var(--brand); border-style: dashed; }
.pdf-thumb {
    position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 8px;
    background: var(--surface-2); color: var(--muted); font-size: 12px;
}
.pdf-thumb canvas {
    position: absolute; inset: 0; margin: auto; max-width: 88%; max-height: 88%; width: auto; height: auto; box-shadow: 0 1px 4px rgba(0,0,0,.25);
    transform: rotate(var(--rot, 0deg)); transition: transform .2s; background: #fff;
}
.pdf-label { font-size: 12px; color: var(--muted); text-align: center; }
.pdf-card-bar { display: flex; justify-content: center; gap: 4px; }
.pdf-card-btn {
    border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px;
    min-width: 30px; height: 28px; font-size: 14px; line-height: 1; cursor: pointer;
}
.pdf-card-btn:hover { border-color: var(--brand); color: var(--brand); }
.pdf-images { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.pdf-images:empty { display: none; }
.pdf-images figure { margin: 0; border: 1px solid var(--border); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.pdf-images img { width: 100%; height: 160px; object-fit: contain; background: var(--surface-2); border-radius: 8px; }
.pdf-images figcaption { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 6px; }
@media (max-width: 560px) { .pdf-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }

/* ---------- ToolMakersHub DevTools brand (2026-11-22) ---------- */
.word-product { font-weight: 600; color: var(--muted); letter-spacing: -0.01em; }
.topbar-brand .logo-cog { width: 32px; height: 30px; }
.apps-head { grid-column: 1 / -1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 2px 6px 6px; }
.apps-menu a.soon { opacity: .75; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--text); letter-spacing: -0.03em; }
.footer-brand .logo-cog { width: 24px; height: 22px; }
.footer-social { display: flex; gap: 8px; flex-wrap: wrap; }
.footer-social a { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.footer-social a:hover { color: var(--brand); border-color: var(--brand); text-decoration: none; }

/* ---------- Contact + idea forms ---------- */
.form-page { max-width: 760px; margin: 0 auto; padding: 36px 20px 60px; width: 100%; }
.form-page h1 { font-size: clamp(28px, 4vw, 38px); letter-spacing: -0.03em; margin: 0 0 8px; }
.form-page .lead { color: var(--muted); margin: 0 0 24px; line-height: 1.6; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field .opt { color: var(--muted); font-weight: 400; }
.field input[type=text], .field input[type=email], .field input[type=url], .field select, .field textarea {
    width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
    background: var(--bg); color: var(--text); font: inherit; font-size: 15px; box-sizing: border-box;
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.field .err { color: #d14343; font-size: 13px; margin-top: 4px; display: block; }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 4px; display: block; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.form-actions small { color: var(--muted); }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.sent-card { text-align: center; padding: 40px 24px; }
.sent-card h2 { margin: 12px 0 8px; }
.sent-card p { color: var(--muted); margin: 0 auto 18px; max-width: 460px; line-height: 1.6; }
.tool-idea { margin-top: 26px; padding: 16px 18px; border: 1px dashed var(--border); border-radius: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } .form-card { padding: 18px; } }
/* Site links inside the menu: only on small screens, where the top links are hidden. */
.apps-menu .apps-links { display: none; grid-column: 1 / -1; border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 4px; }
.apps-menu .apps-links a { flex-direction: row; justify-content: flex-start; padding: 10px 8px; font-size: 15px; font-weight: 600; text-align: left; }
@media (max-width: 560px) { .apps-menu .apps-links { display: grid; } }

/* ---------- Sign in with the ToolMakersHub account (accounts.toolmakershub.com) ---------- */
.topbar .signin { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.topbar .signin:hover { text-decoration: none; }
.user-btn {
    width: 36px; height: 36px; margin-left: 6px; border-radius: 999px; border: 0; padding: 0; overflow: hidden; cursor: pointer;
    display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff;
    background: linear-gradient(135deg, var(--logo-from), var(--logo-to));
}
.user-btn img { width: 100%; height: 100%; object-fit: cover; }
.user-btn:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.user-menu {
    position: absolute; right: 0; top: 46px; width: 260px; z-index: 40; display: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 8px;
}
.user-menu.open { display: block; }
.user-who { display: flex; flex-direction: column; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-who span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.user-menu a, .user-menu button {
    display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px;
    background: none; border: 0; font: inherit; font-size: 14px; color: var(--text); cursor: pointer;
}
.user-menu a:hover, .user-menu button:hover { background: var(--surface-2); text-decoration: none; }
