:root {
    --bg: #f6f9fc;
    --bg-panel: #eef5fb;
    --surface: #ffffff;
    --surface-soft: #eef7f8;
    --ink: #102033;
    --muted: #64748b;
    --line: #d9e5ec;
    --primary: #0b79d0;
    --primary-dark: #07599a;
    --teal: #12b3a8;
    --green: #17a34a;
    --amber: #d97706;
    --danger: #dc2626;
    --shadow: 0 18px 45px rgba(15, 35, 55, .10);
    --topbar-bg: rgba(246, 249, 252, .92);
    --stat-bg: #fbfdff;
    --sidebar-bg: #ffffff;
    --table-bg: #ffffff;
    --table-head: #f8fbfd;
    --secondary-bg: #e8f1f7;
    --secondary-ink: #07599a;
    --label: #334155;
    --input-bg: #ffffff;
    --pill-bg: #e6f8f6;
    --pill-ink: #087b74;
    --pill-gray-bg: #edf2f7;
    --pill-gray-ink: #475569;
    --pill-amber-bg: #fff5dd;
    --alert-bg: #e9f9ef;
    --alert-ink: #126b32;
    --error-bg: #fff1f2;
    --error-ink: #be123c;
}

[data-theme="dark"] {
    --bg: #07111d;
    --bg-panel: #0a1522;
    --surface: #0f1b2a;
    --surface-soft: #122c3b;
    --ink: #e7f0f7;
    --muted: #9fb1c2;
    --line: #203448;
    --primary: #38a5f8;
    --primary-dark: #7cc7ff;
    --teal: #2dd6ca;
    --green: #4ade80;
    --amber: #fbbf24;
    --danger: #ef4444;
    --shadow: 0 18px 45px rgba(0, 0, 0, .28);
    --topbar-bg: rgba(7, 17, 29, .92);
    --stat-bg: #0b1624;
    --sidebar-bg: #0b1624;
    --table-bg: #0f1b2a;
    --table-head: #0b1624;
    --secondary-bg: #14324b;
    --secondary-ink: #b9e3ff;
    --label: #c9d7e3;
    --input-bg: #0b1624;
    --pill-bg: #0c3838;
    --pill-ink: #9ff4ea;
    --pill-gray-bg: #172638;
    --pill-gray-ink: #bdd0e0;
    --pill-amber-bg: #3f2d0d;
    --alert-bg: #0d2f1c;
    --alert-ink: #b7f7c8;
    --error-bg: #3a111b;
    --error-ink: #fecdd3;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        linear-gradient(180deg, var(--bg) 0, var(--bg-panel) 58%, var(--bg) 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.shell {
    width: min(1240px, calc(100% - 36px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--line);
    background: var(--topbar-bg);
    backdrop-filter: blur(14px);
}

.nav {
    display: flex;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 14px;
    color: var(--ink);
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.brand-logo {
    display: block;
    width: 52px;
    height: 52px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 35, 55, .06);
    object-fit: contain;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--teal));
    color: #fff;
    font-weight: 900;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    max-width: 100%;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 12px 30px rgba(15, 35, 55, .06);
    color: var(--muted);
    font-size: 14px;
}

.nav-link {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 800;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--surface-soft);
    color: var(--ink);
}

.nav-link-strong {
    background: var(--secondary-bg);
    color: var(--secondary-ink);
}

.nav-link-strong:hover {
    background: var(--primary);
    color: #fff;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(11, 121, 208, .22);
}

.button:hover {
    background: var(--primary-dark);
}

.button.secondary {
    background: var(--secondary-bg);
    color: var(--secondary-ink);
    box-shadow: none;
}

.button.ghost {
    background: transparent;
    color: var(--primary);
    box-shadow: none;
}

.button.disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
}

.language-switch {
    min-width: 48px;
    justify-content: center;
    padding-inline: 13px;
    font-weight: 900;
}

.button.danger {
    background: var(--danger);
    box-shadow: none;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.theme-toggle:hover {
    background: var(--surface-soft);
}

.theme-dot {
    width: 16px;
    height: 16px;
    border: 2px solid var(--teal);
    border-radius: 999px;
    background: linear-gradient(90deg, var(--teal) 50%, transparent 50%);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr);
    gap: 34px;
    align-items: center;
    padding: 54px 0 36px;
}

.hero-compact {
    grid-template-columns: minmax(0, 860px);
    padding-bottom: 24px;
}

.eyebrow {
    color: var(--teal);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 760px;
    margin-bottom: 18px;
    font-size: 56px;
    line-height: 1.05;
}

.lead {
    max-width: 700px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

.download-page {
    min-height: 100vh;
    padding-bottom: 28px;
}

.public-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
    gap: 34px;
    align-items: stretch;
    padding: 58px 0 26px;
}

.hero-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
}

.hero-copy h1 {
    max-width: 850px;
    margin-bottom: 16px;
}

.hero-command {
    display: grid;
    align-content: space-between;
    gap: 18px;
    min-height: 310px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.command-head,
.command-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.command-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.command-stats div {
    display: grid;
    min-width: 0;
    gap: 5px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--stat-bg);
}

.command-stats strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 28px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.command-stats span,
.command-line span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.command-line {
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.command-line strong {
    color: var(--green);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.search-panel {
    display: grid;
    max-width: 760px;
    gap: 10px;
    margin-top: 24px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 12px 30px rgba(15, 35, 55, .06);
}

.search-panel-prominent {
    max-width: none;
    margin: 0 0 18px;
    padding: 18px;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
}

.search-row input {
    min-height: 42px;
}

.search-hint {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
}

.card,
.table-wrap,
.form-panel,
.auth-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.status-row,
.meta-row,
.stats-grid,
.form-grid,
.admin-stats {
    display: grid;
    gap: 14px;
}

.status-row {
    grid-template-columns: repeat(3, 1fr);
    margin: 18px 0;
}

.stat,
.mini-stat {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--stat-bg);
    padding: 14px;
}

.mini-stat {
    display: flex;
    min-width: 0;
    min-height: 70px;
    flex-direction: column;
    justify-content: flex-start;
}

.stat strong,
.mini-stat strong {
    display: block;
    margin-bottom: 4px;
    font-size: 22px;
}

.mini-stat strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.stat span,
.mini-stat span,
.muted {
    color: var(--muted);
    font-size: 13px;
}

.live-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--pill-bg);
    color: var(--pill-ink);
    font-size: 12px;
    font-weight: 800;
}

.pill.gray {
    background: var(--pill-gray-bg);
    color: var(--pill-gray-ink);
}

.pill.amber {
    background: var(--pill-amber-bg);
    color: var(--amber);
}

.card-status {
    gap: 7px;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .58);
    box-shadow: 0 12px 26px rgba(10, 49, 84, .12), inset 0 1px 0 rgba(255, 255, 255, .42);
    font-size: 13px;
    letter-spacing: .01em;
}

.card-status::before {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent);
    content: "";
}

.card-status.featured {
    background: linear-gradient(135deg, rgba(15, 184, 168, .18), rgba(14, 126, 214, .14));
    color: #007b72;
}

.card-status.ready {
    background: linear-gradient(135deg, rgba(8, 119, 217, .16), rgba(34, 180, 214, .18));
    color: #075eaf;
}

[data-theme="dark"] .card-status.featured {
    color: #74f0e0;
}

[data-theme="dark"] .card-status.ready {
    color: #80caff;
}

.section {
    padding: 36px 0;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-head h2 {
    margin-bottom: 8px;
    font-size: 30px;
    line-height: 1.15;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 20px;
}

.card {
    display: flex;
    min-height: 260px;
    flex-direction: column;
    padding: 20px;
}

.tool-card {
    min-height: 510px;
    padding: 22px;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.tool-card:hover {
    border-color: color-mix(in srgb, var(--primary) 36%, var(--line));
    box-shadow: 0 22px 54px rgba(15, 35, 55, .14);
    transform: translateY(-2px);
}

.card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.tool-icon {
    display: grid;
    position: relative;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .58);
    border-radius: 16px;
    background:
        radial-gradient(circle at 28% 20%, rgba(255, 255, 255, .72), transparent 28%),
        linear-gradient(145deg, var(--icon-start, #1284d6), var(--icon-end, #10b3a4));
    box-shadow: 0 16px 32px rgba(10, 49, 84, .16), inset 0 1px 0 rgba(255, 255, 255, .44);
    color: #fff;
    font-size: 19px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 2px 8px rgba(0, 24, 48, .24);
}

.tool-icon::after {
    position: absolute;
    right: -16px;
    bottom: -18px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    content: "";
}

.icon-theme-1 {
    --icon-start: #0877d9;
    --icon-end: #10b8aa;
}

.icon-theme-2 {
    --icon-start: #0f6ec9;
    --icon-end: #5a7cf0;
}

.icon-theme-3 {
    --icon-start: #078f7f;
    --icon-end: #57b857;
}

.icon-theme-4 {
    --icon-start: #0f82b8;
    --icon-end: #22b4d6;
}

.icon-theme-5 {
    --icon-start: #1b67c9;
    --icon-end: #8a6ee8;
}

.icon-theme-6 {
    --icon-start: #087c9f;
    --icon-end: #14a974;
}

.card-main {
    display: grid;
    gap: 8px;
    min-height: 120px;
    margin-top: 16px;
}

.card h3 {
    margin: 14px 0 8px;
    font-size: 22px;
    line-height: 1.22;
}

.tool-title-link {
    color: inherit;
    text-decoration: none;
}

.tool-title-link:hover {
    color: var(--primary);
}

.card p {
    color: var(--muted);
    line-height: 1.6;
}

.card-main h3,
.card-main p {
    margin: 0;
}

.card-main p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.breadcrumb {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 28px 0 18px;
    color: var(--muted);
    font-weight: 800;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.tool-profile {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 22px;
    align-items: start;
    margin-bottom: 56px;
}

.tool-profile-main,
.tool-download-panel,
.content-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.tool-profile-main {
    display: grid;
    gap: 18px;
    padding: 28px;
}

.tool-profile-heading {
    display: flex;
    gap: 16px;
    align-items: center;
}

.tool-profile-heading h1 {
    margin: 4px 0 0;
    font-size: 38px;
    line-height: 1.08;
}

.content-panel {
    display: grid;
    gap: 10px;
    padding: 18px;
    box-shadow: none;
}

.content-panel h2 {
    margin: 0;
    font-size: 18px;
}

.content-panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    white-space: pre-line;
}

.tool-download-panel {
    position: sticky;
    top: 104px;
    display: grid;
    gap: 18px;
    padding: 20px;
}

.tool-profile-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.tool-detail {
    display: grid;
    gap: 6px;
    min-height: 122px;
    max-height: 150px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--stat-bg);
    overflow: auto;
}

.tool-detail span {
    color: var(--secondary-ink);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.tool-detail p {
    margin-bottom: 0;
    white-space: pre-line;
}

.card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.meta-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    margin: 16px 0 18px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--stat-bg);
}

.meta-row .mini-stat {
    min-height: 86px;
    border: 0;
    background: transparent;
    padding: 14px;
    justify-content: center;
}

.meta-row .mini-stat + .mini-stat {
    border-left: 1px solid var(--line);
}

.meta-row .mini-stat span {
    order: -1;
    margin-bottom: 4px;
    color: var(--muted);
}

.meta-row .mini-stat strong {
    margin-bottom: 0;
    font-size: 19px;
    overflow-wrap: anywhere;
    white-space: normal;
}

.category-band {
    margin-bottom: 34px;
    padding-top: 10px;
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.empty {
    padding: 28px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    text-align: center;
}

.footer {
    margin-top: 34px;
    padding: 28px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
}

.modal-open {
    overflow: hidden;
}

.download-modal[hidden] {
    display: none;
}

.download-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 20px;
}

.download-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 17, 29, .56);
    backdrop-filter: blur(6px);
}

.download-dialog {
    position: relative;
    display: grid;
    width: min(520px, 100%);
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.download-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.download-dialog h2 {
    margin-bottom: 0;
    font-size: 24px;
}

.download-modal-close {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.download-modal-close:hover {
    background: var(--surface-soft);
}

.password-box {
    display: grid;
    gap: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--stat-bg);
}

.password-box span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.password-box strong {
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 22px;
}

.password-copy-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.password-copy-button {
    min-width: 92px;
    box-shadow: none;
}

.password-copy-button[data-state="copied"] {
    background: var(--pill-bg);
    color: var(--pill-ink);
}

.password-confirm {
    align-items: flex-start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.download-modal-warning {
    margin: -4px 0 0;
    color: var(--danger);
    font-size: 13px;
    font-weight: 800;
}

.download-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.auth-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.auth-panel {
    width: min(440px, 100%);
    padding: 26px;
}

.admin-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    border-right: 1px solid var(--line);
    background: var(--sidebar-bg);
    padding: 22px;
}

.sidebar > .theme-toggle {
    width: 100%;
    margin-top: 20px;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    margin-top: 28px;
}

.sidebar-nav a,
.sidebar-nav button {
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.sidebar-nav a.active,
.sidebar-nav a:hover,
.sidebar-nav button:hover {
    background: var(--surface-soft);
    color: var(--secondary-ink);
}

.admin-main {
    padding: 28px;
}

.admin-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}

.admin-stats {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 22px;
}

.table-wrap {
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--table-bg);
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--table-head);
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.form-panel {
    padding: 22px;
}

.form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.field {
    display: grid;
    gap: 7px;
    margin-bottom: 16px;
}

.field.full {
    grid-column: 1 / -1;
}

label {
    color: var(--label);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--ink);
    font: inherit;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.code-textarea {
    min-height: 280px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.6;
}

.input-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.input-action .button {
    min-height: 42px;
    white-space: nowrap;
}

.icon-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 10px;
    align-items: center;
}

.admin-icon-preview {
    width: 54px;
    height: 54px;
    font-size: 18px;
}

.locale-panel {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--stat-bg);
}

.locale-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.locale-head h3 {
    margin: 4px 0 0;
    font-size: 18px;
}

.locale-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.auto-translate-toggle {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.setting-toggle {
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--stat-bg);
}

.setting-preview {
    display: grid;
    gap: 4px;
    margin: 0 0 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.setting-preview strong {
    color: var(--secondary-ink);
}

.setting-preview span {
    color: var(--muted);
    font-size: 13px;
}

.translation-status {
    margin-bottom: 0;
}

.translation-status[data-state="success"] {
    color: var(--secondary-ink);
}

.translation-status[data-state="error"] {
    color: var(--danger);
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox input {
    width: 18px;
    min-height: 18px;
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--alert-bg);
    color: var(--alert-ink);
    font-weight: 700;
}

.error-list {
    margin-bottom: 18px;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--error-bg);
    color: var(--error-ink);
}

.auth-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.pagination {
    padding: 16px;
}

@media (max-width: 920px) {
    .hero,
    .public-hero,
    .tool-profile,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 44px;
    }

    .public-hero {
        padding-top: 40px;
    }

    .hero-command {
        min-height: 0;
    }

    .tool-download-panel {
        position: static;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .tools-grid,
    .admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .nav,
    .section-head,
    .admin-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav {
        gap: 14px;
        padding: 12px 0;
    }

    .shell {
        width: min(100% - 24px, 1240px);
    }

    .brand {
        font-size: 20px;
    }

    .brand-logo {
        width: 46px;
        height: 46px;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
    }

    .nav-link,
    .theme-toggle {
        flex: 1 1 auto;
    }

    h1 {
        font-size: 36px;
        line-height: 1.08;
    }

    .lead {
        font-size: 16px;
    }

    .public-hero {
        gap: 18px;
        padding: 30px 0 18px;
    }

    .tool-profile-main {
        padding: 20px;
    }

    .tool-profile-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .tool-profile-heading h1 {
        font-size: 30px;
    }

    .hero-command,
    .search-panel-prominent {
        padding: 14px;
    }

    .command-head,
    .command-line {
        align-items: flex-start;
        flex-direction: column;
    }

    .command-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .command-stats div {
        padding: 10px;
    }

    .command-stats strong {
        font-size: 22px;
    }

    .tools-grid,
    .status-row,
    .search-row,
    .form-grid,
    .admin-stats {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 26px 0;
    }

    .section-head h2 {
        font-size: 26px;
    }

    .tool-card {
        min-height: 0;
        padding: 18px;
    }

    .card-main {
        min-height: 0;
    }

    .tool-detail {
        min-height: 0;
        max-height: 180px;
    }

    .meta-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .meta-row .mini-stat {
        min-height: 78px;
        padding: 10px;
    }

    .meta-row .mini-stat strong {
        font-size: 16px;
    }

    .card-footer,
    .tool-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .tool-actions .button,
    .card-footer > .button {
        width: 100%;
    }

    .admin-main {
        padding: 18px;
    }

    th,
    td {
        padding: 12px;
    }
}
