:root {
    --accent: #1f7a68;
    --accent-dark: #155e52;
    --navy: #17233a;
    --ink: #15171a;
    --muted: #657080;
    --page-bg: #f6f7f8;
    --soft: #f3f4f6;
    --surface: #ffffff;
    --surface-2: #fafafa;
    --line: #e5e7eb;
    --line-strong: #d1d5db;
    --shadow: 0 18px 50px rgba(29, 24, 16, 0.08);
    --radius: 8px;
    --font: "Tajawal", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --navy: #2C3947;
    --ink: #f7f1e8;
    --muted: #c7d0da;
    --page-bg: #1f2933;
    --surface: #2C3947;
    --surface-2: #243140;
    --soft: #344455;
    --line: rgba(230, 238, 246, 0.14);
    --line-strong: rgba(230, 238, 246, 0.24);
    --shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    position: relative;
    margin: 0;
    color: var(--ink);
    background: var(--page-bg);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(color-mix(in srgb, var(--navy) 5%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--navy) 5%, transparent) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.26), transparent 620px);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.26), transparent 620px);
}

html[data-theme="dark"] body::before {
    background-image:
        linear-gradient(color-mix(in srgb, #ffffff 7%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, #ffffff 7%, transparent) 1px, transparent 1px);
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.2), transparent 600px);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.2), transparent 600px);
}

body > * {
    position: relative;
    z-index: 1;
}

body,
button,
input,
textarea,
select {
    font-family: var(--font);
}

a {
    color: inherit;
}

svg {
    display: block;
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(209, 213, 219, 0.8);
    backdrop-filter: blur(16px);
}

html[data-theme="dark"] .site-header {
    background: rgba(44, 57, 71, 0.92);
    border-bottom-color: var(--line);
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--navy);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    line-height: 1;
}

.brand-image {
    width: auto;
    max-width: 150px;
    height: 40px;
    display: block;
    object-fit: contain;
}

.brand-image-dark {
    display: none;
}

html[data-theme="dark"] .brand.has-dark-logo .brand-image-light {
    display: none;
}

html[data-theme="dark"] .brand-image-dark {
    display: block;
}

.brand-text {
    font-size: 18px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav a,
.language-switch,
.back-link,
.btn-primary {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 700;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.site-nav a {
    padding: 8px 13px;
    color: var(--muted);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.is-active {
    color: var(--ink);
    background: var(--soft);
}

.site-nav .language-switch,
.btn-primary {
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    color: var(--ink);
    background: var(--soft);
    border-color: var(--accent);
    outline: 0;
    transform: translateY(-1px);
}

.theme-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-icon-sun,
html[data-theme="dark"] .theme-icon-moon {
    display: none;
}

html[data-theme="dark"] .theme-icon-sun {
    display: block;
}

.site-nav .language-switch:hover,
.btn-primary:hover {
    color: #fff;
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    transform: translateY(-1px);
}

.menu-toggle {
    width: 42px;
    height: 42px;
    display: none;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}

.menu-toggle span {
    width: 18px;
    height: 2px;
    display: block;
    margin: 3px 0;
    background: currentColor;
}

.hero {
    padding: 64px 0 40px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 247, 248, 0.92) 100%);
    border-bottom: 1px solid var(--line);
}

html[data-theme="dark"] .hero {
    background:
        radial-gradient(circle at 20% 20%, rgba(31, 122, 104, 0.14), transparent 32%),
        linear-gradient(180deg, #2C3947 0%, #1f2933 100%);
    border-bottom-color: var(--line);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
    align-items: center;
    gap: 44px;
}

.hero-copy h1,
.section-heading h1,
.section-heading h2,
.empty-state h1 {
    margin: 0;
    color: var(--ink);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: 0;
}

.hero-copy h1 {
    max-width: 760px;
    font-size: clamp(34px, 5.2vw, 58px);
}

.hero-lead,
.section-heading p,
.empty-state p {
    max-width: 720px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 24px;
}

.hero-actions .btn-primary {
    margin-top: 0;
}

.hero-actions span {
    color: var(--muted);
    font-weight: 700;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.tool-search {
    position: relative;
    padding: 18px;
    background: color-mix(in srgb, var(--surface) 88%, var(--page-bg));
    border: 1px solid color-mix(in srgb, var(--navy) 10%, var(--line));
    border-radius: 16px;
    box-shadow: none;
}

html[data-theme="dark"] .tool-search,
html[data-theme="dark"] .trust-grid,
html[data-theme="dark"] .category-filter-card,
html[data-theme="dark"] .tool-page,
html[data-theme="dark"] .side-panel,
html[data-theme="dark"] .ad-slot,
html[data-theme="dark"] .tool-card,
html[data-theme="dark"] .tool-surface,
html[data-theme="dark"] .utility-tool-preview,
html[data-theme="dark"] .utility-tool-controls,
html[data-theme="dark"] .ai-tool-preview,
html[data-theme="dark"] .ai-tool-controls {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: var(--shadow);
}

.tool-search label {
    display: block;
    margin-bottom: 10px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
}

.search-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid color-mix(in srgb, var(--navy) 12%, var(--line));
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.search-control:focus-within {
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.search-control svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--muted);
    fill: currentColor;
    transition: color 180ms ease;
}

.search-control:focus-within svg {
    color: var(--accent-dark);
}

html[data-theme="dark"] .search-control,
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    color: var(--ink);
    background: var(--surface-2);
    border-color: var(--line);
}

html[data-theme="dark"] .tool-search {
    box-shadow: none;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: rgba(199, 208, 218, 0.72);
}

.search-control input {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
}

.search-control input::placeholder {
    color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.trust-strip {
    padding: 24px 0 0;
    background: var(--page-bg);
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    padding: 26px 28px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 16px 44px rgba(23, 35, 58, 0.055);
}

html[data-theme="dark"] .trust-strip,
html[data-theme="dark"] .category-filter-band,
html[data-theme="dark"] .ad-band,
html[data-theme="dark"] .page-grid {
    background: var(--page-bg);
}

.trust-item {
    display: grid;
    justify-items: center;
    gap: 12px;
    text-align: center;
}

.trust-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: var(--accent);
    background: #fff8ee;
    border: 1px solid #efd8b7;
    background: color-mix(in srgb, var(--accent) 13%, #ffffff);
    border: 1px solid color-mix(in srgb, var(--accent) 18%, #ffffff);
    border-radius: var(--radius);
}

html[data-theme="dark"] .trust-icon,
html[data-theme="dark"] .category-filter-icon,
html[data-theme="dark"] .tool-icon,
html[data-theme="dark"] .side-icon,
html[data-theme="dark"] .category-count,
html[data-theme="dark"] .category-filter-count,
html[data-theme="dark"] .tool-arrow {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}

.trust-icon svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.trust-item h2 {
    margin: 0;
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
}

.trust-item p {
    display: -webkit-box;
    max-width: 390px;
    min-height: 48px;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.category-filter-band {
    padding: 20px 0 0;
    background: var(--body-bg);
}

.category-filter-card {
    padding: 14px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 16px 44px rgba(23, 35, 58, 0.055);
}

.category-filter-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.category-filter-head > div {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.category-filter-head span {
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.category-filter-head small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}

.category-filter-head [data-active-category-description] {
    max-width: 680px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.6;
}

.category-filter {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    overflow: visible;
    padding: 2px;
}

.category-filter-btn {
    width: 100%;
    min-width: 0;
    min-height: 58px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
    cursor: pointer;
    text-align: start;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease, background 180ms ease;
}

.category-filter-btn:hover,
.category-filter-btn:focus-visible,
.category-filter-btn.is-active {
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    border-color: var(--accent);
    box-shadow: none;
    outline: 0;
}

html[data-theme="dark"] .category-filter-btn {
    background: var(--surface-2);
    border-color: var(--line);
}

html[data-theme="dark"] .category-filter-btn:hover,
html[data-theme="dark"] .category-filter-btn:focus-visible,
html[data-theme="dark"] .category-filter-btn.is-active {
    background: color-mix(in srgb, var(--accent) 14%, var(--surface-2));
    border-color: var(--accent);
}

.category-filter-btn:hover,
.category-filter-btn:focus-visible {
    transform: none;
}

.category-filter-btn.is-active {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
}

.category-filter-btn:hover .category-filter-icon,
.category-filter-btn:focus-visible .category-filter-icon,
.category-filter-btn.is-active .category-filter-icon {
    color: var(--navy);
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.category-filter-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--navy);
    background: color-mix(in srgb, var(--navy) 4%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--navy) 16%, var(--line));
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.category-filter-icon svg {
    width: 21px;
    height: 21px;
}

.category-filter-icon svg :where(path, rect, circle, line, polyline, polygon),
.tool-icon svg :where(path, rect, circle, line, polyline, polygon) {
    stroke: currentColor !important;
}

.category-filter-icon svg :where(path, rect, circle, polygon)[fill]:not([fill="none"]) {
    fill: color-mix(in srgb, var(--navy) 9%, transparent) !important;
}

.category-filter-btn:hover .category-filter-icon svg :where(path, rect, circle, polygon)[fill]:not([fill="none"]),
.category-filter-btn:focus-visible .category-filter-icon svg :where(path, rect, circle, polygon)[fill]:not([fill="none"]),
.category-filter-btn.is-active .category-filter-icon svg :where(path, rect, circle, polygon)[fill]:not([fill="none"]) {
    fill: color-mix(in srgb, var(--accent) 10%, transparent) !important;
}

.icon-mark {
    display: block;
    vector-effect: non-scaling-stroke;
}

.icon-image,
.icon-pdf,
.icon-code,
.icon-video,
.icon-seo,
.icon-text,
.icon-calc,
.icon-link,
.icon-tool {
    color: var(--navy);
}

.category-filter-copy {
    min-width: 0;
}

.category-filter-copy span {
    display: -webkit-box;
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.category-filter-count {
    min-width: 26px;
    height: 26px;
    display: inline-grid;
    place-items: center;
    padding: 0 8px;
    color: var(--navy);
    background: color-mix(in srgb, var(--navy) 4%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--navy) 14%, var(--line));
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.category-filter-btn:hover .category-filter-count,
.category-filter-btn:focus-visible .category-filter-count,
.category-filter-btn.is-active .category-filter-count {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    align-items: start;
    padding: 34px 0 58px;
}

.page-grid-full {
    grid-template-columns: minmax(0, 1fr);
    max-width: 1080px;
}

.content-area {
    min-width: 0;
}

.tool-category,
.tool-page,
.text-page,
.empty-state,
.side-panel,
.seo-panel,
.ad-slot {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(29, 24, 16, 0.04);
}

.tool-category {
    padding: 0;
    margin-bottom: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.tool-category:last-child {
    border-bottom: 0;
}

.tool-category.is-category-hidden,
.tool-category.is-hidden {
    display: none;
}

.category-titlebar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 0 0 14px;
    border-bottom: 1px solid var(--line);
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading h1 {
    max-width: 820px;
    font-size: clamp(32px, 3.6vw, 44px);
    letter-spacing: 0;
}

.section-heading h2 {
    font-size: 24px;
}

.section-heading.compact {
    margin-bottom: 0;
}

.category-count {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
    border-radius: var(--radius);
    font-weight: 800;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 16px;
}

.related-tools {
    margin-top: 28px;
}

.tool-quality-section {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.tool-quality-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.tool-quality-card,
.tool-howto-panel,
.tool-faq-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.tool-quality-card {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 166px;
    padding: 16px;
}

.tool-quality-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: var(--navy);
    background: color-mix(in srgb, var(--navy) 3%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--navy) 14%, var(--line));
    border-radius: var(--radius);
}

.tool-quality-icon svg {
    width: 22px;
    height: 22px;
}

.tool-quality-card strong {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.45;
}

.tool-quality-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.75;
}

.tool-howto-panel {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.tool-howto-panel h2,
.tool-faq-panel h2 {
    margin: 0;
    color: var(--ink);
    font-size: 20px;
    line-height: 1.35;
}

.tool-howto-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tool-howto-list li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    background: color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.tool-howto-list span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--accent);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 800;
}

.tool-howto-list p {
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.tool-faq-panel {
    display: grid;
    gap: 10px;
    padding: 18px;
}

.tool-faq-panel details {
    padding: 13px 14px;
    background: color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.tool-faq-panel summary {
    color: var(--ink);
    cursor: pointer;
    font-weight: 800;
}

.tool-faq-panel details p {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.8;
}

.tool-alternatives {
    display: grid;
    gap: 14px;
    margin-top: 28px;
    padding: 18px;
    background: color-mix(in srgb, var(--accent) 3%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
    border-radius: var(--radius);
}

.related-tools .section-heading {
    margin-bottom: 14px;
}

.tool-alternatives .section-heading {
    margin-bottom: 0;
}

.tool-alternatives .section-heading p {
    max-width: 760px;
    font-size: 14px;
}

.alternative-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.alternative-link-card {
    min-height: 138px;
    display: grid;
    align-content: start;
    gap: 7px;
    padding: 15px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    transition: background 180ms ease, border-color 180ms ease;
}

.alternative-link-card:hover,
.alternative-link-card:focus-visible {
    background: color-mix(in srgb, var(--accent) 4%, var(--surface));
    border-color: var(--accent);
    outline: 0;
}

.alternative-link-card span {
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
}

.alternative-link-card strong {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.45;
}

.alternative-link-card small {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.related-tools-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.alternative-page {
    display: grid;
    gap: 18px;
}

.comparison-note,
.comparison-panel {
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.comparison-note {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
}

.comparison-panel h2 {
    margin: 0 0 12px;
    color: var(--ink);
    font-size: 20px;
}

.comparison-panel p {
    margin: 0;
    color: var(--muted);
}

.comparison-panel-head {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.comparison-panel-head h2 {
    margin-bottom: 0;
}

.comparison-panel-head p {
    line-height: 1.8;
}

.task-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
    gap: 12px;
}

.task-picker-card {
    min-height: 170px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 14px;
    align-content: start;
    padding: 16px;
    color: var(--ink);
    background: color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.task-picker-card:hover,
.task-picker-card:focus-visible {
    background: color-mix(in srgb, var(--accent) 4%, var(--surface));
    border-color: var(--accent);
    outline: 0;
    transform: none;
}

.task-picker-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    color: var(--navy);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--navy) 12%, var(--line));
    border-radius: 12px;
}

.task-picker-icon svg {
    width: 26px;
    height: 26px;
}

.task-picker-copy {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.task-picker-label {
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
}

.task-picker-copy strong {
    color: var(--ink);
    font-size: 16px;
    line-height: 1.4;
}

.task-picker-copy small {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.task-picker-action {
    grid-column: 1 / -1;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 8px 12px;
    color: var(--accent-dark);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
}

.task-picker-action svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.comparison-list {
    margin: 0;
    padding-inline-start: 22px;
    color: var(--muted);
    line-height: 1.9;
}

.comparison-list li + li {
    margin-top: 6px;
}

.comparison-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.comparison-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    color: var(--ink);
    font-size: 14px;
}

.comparison-table th,
.comparison-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line);
    text-align: start;
    vertical-align: top;
}

.comparison-table th {
    color: var(--ink);
    background: color-mix(in srgb, var(--navy) 4%, var(--surface));
    font-weight: 800;
}

.alternative-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.alternative-card {
    min-height: 158px;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 18px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.alternative-card:hover,
.alternative-card:focus-visible {
    background: color-mix(in srgb, var(--accent) 4%, var(--surface));
    border-color: var(--accent);
    outline: 0;
    transform: none;
}

.alternative-card span {
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
}

.alternative-card strong {
    font-size: 17px;
    line-height: 1.4;
}

.alternative-card small {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.faq-panel {
    display: grid;
    gap: 10px;
}

.faq-panel details {
    padding: 14px 16px;
    background: color-mix(in srgb, var(--navy) 3%, var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.faq-panel summary {
    color: var(--ink);
    cursor: pointer;
    font-weight: 800;
}

.faq-panel details p {
    margin-top: 10px;
}

.tool-card {
    min-height: 104px;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 20px;
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid rgba(209, 213, 219, 0.9);
    border-radius: var(--radius);
    text-decoration: none;
    box-shadow: 0 12px 32px rgba(23, 35, 58, 0.045);
    transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.tool-card:hover,
.tool-card:focus-visible {
    background: color-mix(in srgb, var(--accent) 3%, var(--surface));
    border-color: var(--accent);
    box-shadow: none;
    transform: none;
    outline: 0;
}

html[data-theme="dark"] .tool-card:hover,
html[data-theme="dark"] .tool-card:focus-visible {
    background: #344455;
    border-color: var(--accent);
}

.tool-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    color: var(--navy);
    background: color-mix(in srgb, var(--navy) 4%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--navy) 14%, var(--line));
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74), 0 10px 22px rgba(23, 35, 58, 0.045);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.tool-icon svg {
    width: 30px;
    height: 30px;
}

.tool-card:hover .tool-icon,
.tool-card:focus-visible .tool-icon {
    color: var(--navy);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
    box-shadow: none;
    transform: none;
}

.tool-card-copy {
    min-width: 0;
}

.tool-title,
.tool-card-copy strong {
    display: block;
    color: var(--ink);
    font-size: 14px;
    font-weight: 400 !important;
    line-height: 1.5;
    letter-spacing: 0;
}

.tool-card-copy small {
    display: -webkit-box;
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.6;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tool-arrow {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    border-radius: 999px;
    font-size: 18px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 180ms ease, transform 180ms ease;
}

[dir="rtl"] .tool-arrow {
    transform: scaleX(-1);
}

.tool-card:hover .tool-arrow,
.tool-card:focus-visible .tool-arrow {
    opacity: 1;
    transform: translateX(0);
}

[dir="rtl"] .tool-card:hover .tool-arrow,
[dir="rtl"] .tool-card:focus-visible .tool-arrow {
    transform: scaleX(-1) translateX(0);
}

.games-index-page {
    display: grid;
    gap: 18px;
}

.games-index-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
    gap: 18px;
    align-items: stretch;
    padding: clamp(22px, 4vw, 34px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(29, 24, 16, 0.04);
}

.games-index-hero h1 {
    max-width: 780px;
    margin: 6px 0 10px;
    color: var(--ink);
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.2;
    letter-spacing: 0;
}

.games-index-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.85;
}

.games-index-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.games-index-stats span {
    display: grid;
    align-content: center;
    gap: 6px;
    min-height: 96px;
    padding: 16px;
    color: var(--muted);
    background: color-mix(in srgb, var(--navy) 3%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--navy) 12%, var(--line));
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
}

.games-index-stats strong {
    color: var(--accent-dark);
    font-size: 28px;
    line-height: 1;
}

.games-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.game-index-card {
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: start;
    min-height: 182px;
}

.game-index-card .tool-icon {
    margin-top: 2px;
}

.game-index-card .tool-title {
    font-size: 17px;
    font-weight: 800 !important;
}

.game-index-card .tool-card-copy small {
    -webkit-line-clamp: 3;
}

.game-index-action {
    grid-column: 1 / -1;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    color: #fff;
    background: var(--accent);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 800;
}

.game-index-action svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

[dir="rtl"] .game-index-action svg {
    transform: scaleX(-1);
}

.sidebar {
    position: sticky;
    top: 94px;
    display: grid;
    gap: 18px;
}

.side-panel {
    padding: 18px;
    border-top: 4px solid var(--navy);
}

.side-panel h2 {
    margin: 0 0 14px;
    color: var(--ink);
    font-size: 18px;
    line-height: 1.3;
    font-weight: 800;
}

.side-list {
    display: grid;
    gap: 6px;
}

.side-list a {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 8px 10px;
    color: var(--muted);
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400 !important;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    transition: color 180ms ease, background 180ms ease;
}

.side-list a:hover,
.side-list a:focus-visible {
    color: var(--ink);
    background: color-mix(in srgb, var(--navy) 4%, var(--surface));
    outline: 0;
}

html[data-theme="dark"] .side-list a:hover,
html[data-theme="dark"] .side-list a:focus-visible {
    background: var(--soft);
}

.side-icon {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    color: var(--navy);
    background: color-mix(in srgb, var(--navy) 4%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--navy) 14%, var(--line));
    border-radius: 7px;
}

.side-icon svg {
    width: 14px;
    height: 14px;
}

.side-icon svg :where(path, rect, circle, line, polyline, polygon) {
    stroke: currentColor !important;
}

.side-icon svg :where(path, rect, circle, polygon)[fill]:not([fill="none"]) {
    fill: color-mix(in srgb, var(--navy) 9%, transparent) !important;
}

.side-list a:hover .side-icon,
.side-list a:focus-visible .side-icon {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
}

.side-list a:hover .side-icon svg :where(path, rect, circle, polygon)[fill]:not([fill="none"]),
.side-list a:focus-visible .side-icon svg :where(path, rect, circle, polygon)[fill]:not([fill="none"]) {
    fill: color-mix(in srgb, var(--accent) 15%, transparent) !important;
}

.side-title {
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 400 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-list a:hover .side-title,
.side-list a:focus-visible .side-title {
    color: var(--ink);
}

.side-custom-content {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.side-custom-content img,
.side-custom-content iframe,
.side-custom-content ins {
    max-width: 100%;
}

.side-custom-content img {
    height: auto;
    border-radius: var(--radius);
}

.tool-page,
.text-page,
.empty-state {
    padding: clamp(20px, 4vw, 34px);
}

.tool-page .section-heading h1 {
    max-width: 760px;
    font-size: clamp(30px, 3vw, 40px);
    font-weight: 800;
}

.tool-page .section-heading p {
    max-width: 760px;
    font-size: 16px;
    line-height: 1.8;
}

.tool-page .section-heading .eyebrow {
    font-size: 12px;
    font-weight: 800;
}

.tool-hero-heading.has-tool-hero-visual {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(18px, 4vw, 36px);
    min-height: 190px;
    direction: ltr;
}

.tool-hero-copy {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
}

html[dir="rtl"] .tool-hero-copy {
    order: 2;
    direction: rtl;
    text-align: right;
}

html[dir="ltr"] .tool-hero-copy {
    direction: ltr;
    text-align: left;
}

.tool-hero-heading.has-tool-hero-visual h1 {
    max-width: 100%;
    font-size: clamp(24px, 2vw, 32px);
    line-height: 1.18;
    text-wrap: balance;
}

.tool-hero-visual {
    order: 2;
    position: relative;
    flex: 0 0 clamp(250px, 29vw, 310px);
    width: clamp(250px, 29vw, 310px);
    min-height: 154px;
    display: grid;
    place-items: center;
    color: var(--accent-dark);
}

html[dir="rtl"] .tool-hero-visual {
    order: 1;
}

.tool-hero-visual::before {
    content: "";
    position: absolute;
    inset: 12px 8px;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
    border-radius: 24px;
    background:
        linear-gradient(color-mix(in srgb, var(--accent) 9%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--navy) 7%, transparent) 1px, transparent 1px);
    background-size: 22px 22px;
    opacity: .75;
}

.hero-visual-caption {
    position: absolute;
    inset-inline: 28px;
    bottom: 2px;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 11px;
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--surface) 88%, var(--accent) 12%);
    border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    box-shadow: 0 12px 28px rgba(15, 118, 110, .08);
}

.hero-memory-board {
    position: relative;
    z-index: 1;
    width: 204px;
    display: grid;
    grid-template-columns: repeat(3, 54px);
    gap: 10px;
    justify-content: center;
    padding-bottom: 20px;
}

.hero-memory-card {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--navy);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
    border-radius: 10px;
    box-shadow: 0 18px 28px rgba(23, 35, 58, .16);
    transform-origin: center;
    animation: heroCardFloat 3.8s ease-in-out infinite;
}

.hero-memory-card b {
    font-size: 22px;
    line-height: 1;
}

.hero-memory-card.is-a {
    background: #2563eb;
}

.hero-memory-card.is-b {
    background: #1f7a68;
    animation-delay: 140ms;
}

.hero-memory-card.is-c {
    background: #f59e0b;
    animation-delay: 280ms;
}

.hero-memory-card.is-match {
    box-shadow: 0 0 0 4px rgba(22, 163, 74, .16), 0 18px 28px rgba(23, 35, 58, .16);
    animation-name: heroCardMatch;
}

.hero-barcode-card {
    position: relative;
    z-index: 1;
    width: min(236px, 92%);
    display: grid;
    gap: 10px;
    justify-items: center;
    padding: 20px 18px 36px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--line-strong) 70%, var(--accent) 30%);
    border-radius: 16px;
    box-shadow: 0 18px 34px rgba(23, 35, 58, .11);
}

.hero-barcode-lines {
    position: relative;
    width: 178px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: hidden;
}

.hero-barcode-lines span {
    width: 3px;
    height: var(--bar-h);
    min-height: 18px;
    background: var(--ink);
    border-radius: 999px;
    opacity: .92;
    animation: heroBarPulse 2.4s ease-in-out infinite;
    animation-delay: var(--bar-delay);
}

.hero-barcode-lines i {
    position: absolute;
    inset-block: 3px;
    width: 3px;
    background: #16a34a;
    box-shadow: 0 0 18px rgba(22, 163, 74, .82);
    animation: heroScanLine 2.8s ease-in-out infinite;
}

.hero-barcode-card strong {
    color: var(--ink);
    font-size: 18px;
    letter-spacing: 0 !important;
    line-height: 1;
}

.hero-qr-card,
.hero-doc-stack,
.hero-image-card,
.hero-whatsapp-card,
.hero-hsl-card,
.hero-gradient-card,
.hero-color-card,
.hero-text-card,
.hero-calc-card,
.hero-code-card,
.hero-network-card,
.hero-tool-card,
.hero-game-card {
    position: relative;
    z-index: 1;
    width: min(236px, 92%);
    min-height: 112px;
    display: grid;
    place-items: center;
    padding: 18px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--line-strong) 70%, var(--accent) 30%);
    border-radius: 16px;
    box-shadow: 0 18px 34px rgba(23, 35, 58, .11);
    overflow: hidden;
}

.hero-qr-card {
    grid-template-columns: repeat(2, 46px);
    grid-template-rows: repeat(2, 46px);
    gap: 10px;
}

.hero-qr-card span {
    display: block;
    width: 46px;
    height: 46px;
    border: 7px solid var(--ink);
    border-radius: 8px;
}

.hero-qr-card span:nth-child(2),
.hero-qr-card span:nth-child(3) {
    border-width: 5px;
    opacity: .78;
}

.hero-qr-card i {
    position: absolute;
    width: 54px;
    height: 54px;
    right: 24px;
    bottom: 22px;
    background:
        linear-gradient(var(--accent), var(--accent)) 0 0 / 14px 14px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 28px 0 / 10px 10px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 14px 22px / 12px 12px no-repeat,
        linear-gradient(var(--accent), var(--accent)) 36px 34px / 14px 14px no-repeat;
    border-radius: 6px;
}

.hero-doc-stack span {
    position: absolute;
    width: 112px;
    height: 132px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--accent);
    border-radius: 12px;
    box-shadow: 0 14px 26px rgba(23, 35, 58, .14);
    font-weight: 900;
}

.hero-doc-stack span:nth-child(1) {
    z-index: 3;
}

.hero-doc-stack span:nth-child(2) {
    z-index: 2;
    transform: translateX(-28px) rotate(-7deg);
    background: #2563eb;
    opacity: .9;
}

.hero-doc-stack span:nth-child(3) {
    z-index: 1;
    transform: translateX(28px) rotate(7deg);
    background: #f59e0b;
    opacity: .86;
}

.hero-image-card {
    place-items: stretch;
}

.hero-image-card::before {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 12px;
    background: linear-gradient(135deg, #dbeafe, #ecfeff);
}

.hero-image-card i {
    position: absolute;
    top: 30px;
    right: 36px;
    width: 26px;
    height: 26px;
    background: #f59e0b;
    border-radius: 50%;
}

.hero-image-card span {
    position: absolute;
    left: 34px;
    right: 34px;
    bottom: 34px;
    height: 44px;
    background: linear-gradient(135deg, #1f7a68 0 48%, #155e52 48% 100%);
    clip-path: polygon(0 100%, 28% 28%, 48% 66%, 68% 18%, 100% 100%);
}

.hero-image-card b {
    position: absolute;
    left: 26px;
    top: 26px;
    width: 28px;
    height: 28px;
    border: 3px solid #fff;
    border-radius: 8px;
}

.hero-whatsapp-card {
    background:
        radial-gradient(circle at 80% 18%, rgba(37, 211, 102, .18), transparent 32%),
        var(--surface);
}

.hero-whatsapp-card span {
    width: 126px;
    height: 82px;
    display: block;
    border-radius: 24px;
    background: #1f7a68;
    box-shadow: 0 16px 28px rgba(31, 122, 104, .18);
}

.hero-whatsapp-card span::after {
    content: "";
    position: absolute;
    left: 74px;
    bottom: 32px;
    width: 24px;
    height: 24px;
    background: #1f7a68;
    clip-path: polygon(0 0, 100% 18%, 18% 100%);
}

.hero-whatsapp-card i,
.hero-whatsapp-card b {
    position: absolute;
    z-index: 2;
    display: block;
}

.hero-whatsapp-card i {
    width: 54px;
    height: 54px;
    border: 6px solid #fff;
    border-radius: 50%;
}

.hero-whatsapp-card i::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 14px;
    width: 24px;
    height: 14px;
    border-left: 6px solid #fff;
    border-bottom: 6px solid #fff;
    border-radius: 0 0 0 12px;
    transform: rotate(-35deg);
}

.hero-whatsapp-card b {
    right: 34px;
    top: 28px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background:
        linear-gradient(135deg, transparent 0 42%, #fff 43% 57%, transparent 58%),
        linear-gradient(45deg, transparent 0 48%, #fff 49% 56%, transparent 57%),
        #2563eb;
    box-shadow: 0 12px 20px rgba(37, 99, 235, .2);
}

.hero-hsl-card span {
    width: 104px;
    height: 104px;
    display: block;
    border-radius: 50%;
    background: conic-gradient(#ef4444, #f59e0b, #22c55e, #06b6d4, #2563eb, #a855f7, #ef4444);
    box-shadow: inset 0 0 0 16px var(--surface), 0 16px 28px rgba(23, 35, 58, .14);
}

.hero-hsl-card i,
.hero-hsl-card b {
    position: absolute;
    display: block;
    border-radius: 999px;
}

.hero-hsl-card i {
    width: 118px;
    height: 4px;
    background: var(--accent);
    transform: rotate(-28deg);
}

.hero-hsl-card b {
    width: 18px;
    height: 18px;
    background: #fff;
    border: 5px solid var(--accent);
    box-shadow: 0 8px 16px rgba(23, 35, 58, .18);
}

.hero-gradient-card {
    justify-items: stretch;
    gap: 12px;
}

.hero-gradient-card span {
    height: 24px;
    border-radius: 999px;
    box-shadow: 0 10px 18px rgba(23, 35, 58, .12);
}

.hero-gradient-card span:nth-child(1) {
    background: linear-gradient(90deg, #0f766e, #06b6d4);
}

.hero-gradient-card span:nth-child(2) {
    background: linear-gradient(90deg, #2563eb, #a855f7, #ef4444);
}

.hero-gradient-card span:nth-child(3) {
    background: linear-gradient(90deg, #f59e0b, #22c55e);
}

.hero-color-card {
    grid-template-columns: repeat(3, 48px);
    gap: 10px;
    background:
        radial-gradient(circle at 18% 22%, rgba(37, 99, 235, .18), transparent 34%),
        radial-gradient(circle at 84% 28%, rgba(245, 158, 11, .2), transparent 34%),
        var(--surface);
}

.hero-color-card span {
    width: 48px;
    height: 74px;
    display: block;
    border-radius: 14px;
    box-shadow: 0 14px 24px rgba(23, 35, 58, .14);
}

.hero-color-card span:nth-child(1) {
    background: linear-gradient(180deg, #0f766e, #22c55e);
}

.hero-color-card span:nth-child(2) {
    background: linear-gradient(180deg, #2563eb, #06b6d4);
}

.hero-color-card span:nth-child(3) {
    background: linear-gradient(180deg, #f59e0b, #ef4444);
}

.hero-color-card i {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 18px;
    height: 10px;
    border-radius: 999px;
    background: linear-gradient(90deg, #0f766e, #2563eb, #f59e0b, #ef4444);
}

.hero-text-card {
    justify-items: stretch;
    gap: 10px;
}

.hero-text-card span {
    height: 11px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 70%, #ffffff 30%);
}

.hero-text-card span:nth-child(1) {
    width: 78%;
}

.hero-text-card span:nth-child(2) {
    width: 92%;
    background: color-mix(in srgb, var(--navy) 72%, #ffffff 28%);
}

.hero-text-card span:nth-child(3) {
    width: 62%;
}

.hero-text-card b {
    position: absolute;
    right: 24px;
    bottom: 18px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--accent);
    border-radius: 12px;
    font-size: 22px;
    line-height: 1;
}

.hero-calc-card {
    grid-template-columns: repeat(3, 48px);
    gap: 10px;
}

.hero-calc-card span,
.hero-calc-card strong {
    min-height: 46px;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: var(--soft);
    border: 1px solid var(--line);
    border-radius: 12px;
    font-weight: 900;
}

.hero-calc-card strong {
    grid-column: 1 / -1;
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.hero-code-card {
    justify-items: stretch;
    gap: 10px;
}

.hero-code-card span {
    color: var(--accent-dark);
    font-size: 30px;
    font-weight: 900;
    text-align: center;
}

.hero-code-card i {
    height: 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--navy) 68%, #ffffff 32%);
}

.hero-code-card i:nth-child(3) {
    width: 72%;
}

.hero-code-card i:nth-child(4) {
    width: 54%;
}

.hero-network-card span {
    position: absolute;
    width: 34px;
    height: 34px;
    background: #fff;
    border: 8px solid var(--accent);
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(23, 35, 58, .12);
}

.hero-network-card span:nth-child(1) {
    top: 28px;
    left: 42px;
}

.hero-network-card span:nth-child(2) {
    top: 34px;
    right: 42px;
    border-color: #2563eb;
}

.hero-network-card span:nth-child(3) {
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    border-color: #f59e0b;
}

.hero-network-card i,
.hero-network-card b {
    position: absolute;
    width: 118px;
    height: 3px;
    background: color-mix(in srgb, var(--accent) 60%, transparent);
    transform-origin: center;
}

.hero-network-card i {
    transform: rotate(22deg);
}

.hero-network-card b {
    transform: rotate(-24deg);
}

.hero-tool-card,
.hero-game-card {
    grid-template-columns: repeat(2, 56px);
    gap: 12px;
}

.hero-tool-card span,
.hero-tool-card b,
.hero-game-card span {
    min-height: 54px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--accent);
    border-radius: 14px;
    font-size: 21px;
    font-weight: 900;
    box-shadow: 0 12px 22px rgba(23, 35, 58, .13);
}

.hero-tool-card span:nth-child(2),
.hero-game-card span:nth-child(2) {
    background: #2563eb;
}

.hero-tool-card span:nth-child(3),
.hero-game-card span:nth-child(3) {
    background: #f59e0b;
}

.hero-game-card span:nth-child(4) {
    background: var(--navy);
}

@keyframes heroCardFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes heroCardMatch {
    0%, 100% {
        transform: translateY(0) rotate(0);
    }
    45% {
        transform: translateY(-10px) rotate(-3deg);
    }
    70% {
        transform: translateY(-4px) rotate(2deg);
    }
}

@keyframes heroBarPulse {
    0%, 100% {
        opacity: .7;
    }
    50% {
        opacity: 1;
    }
}

@keyframes heroScanLine {
    0%, 100% {
        inset-inline-start: 6px;
    }
    50% {
        inset-inline-start: calc(100% - 8px);
    }
}

html[data-theme="dark"] .tool-hero-visual::before {
    background:
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
}

html[data-theme="dark"] .hero-barcode-card {
    background: var(--surface-2);
}

@media (prefers-reduced-motion: reduce) {
    .hero-memory-card,
    .hero-barcode-lines span,
    .hero-barcode-lines i {
        animation: none;
    }
}

@media (max-width: 760px) {
    .tool-hero-heading.has-tool-hero-visual,
    [dir="rtl"] .tool-hero-heading.has-tool-hero-visual {
        flex-direction: column;
        align-items: stretch;
        min-height: 0;
        gap: 18px;
    }

    .tool-hero-heading.has-tool-hero-visual h1 {
        font-size: clamp(24px, 8vw, 30px);
    }

    html[dir="rtl"] .tool-hero-copy,
    html[dir="ltr"] .tool-hero-copy {
        order: 1;
    }

    .tool-hero-visual {
        order: 2;
        flex-basis: auto;
        width: min(100%, 286px);
        min-height: 148px;
        align-self: center;
    }

    .hero-memory-board {
        width: 190px;
        grid-template-columns: repeat(3, 50px);
        gap: 10px;
    }

    .hero-barcode-card {
        width: min(228px, 94%);
        padding-inline: 18px;
    }

    .hero-barcode-lines {
        width: 168px;
    }
}

.legal-page {
    max-width: 860px;
    margin-inline: auto;
    overflow: visible;
}

.legal-page .compact-page-heading {
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.legal-page .compact-page-heading h1 {
    max-width: 100%;
    font-size: clamp(26px, 2.4vw, 34px);
    line-height: 1.25;
    font-weight: 800;
}

.page-rich-text {
    max-width: 100%;
    overflow: visible;
    font-size: 16px;
    line-height: 1.95;
    overflow-wrap: break-word;
    word-break: normal;
}

.page-rich-text :where(p, ul, ol) {
    margin: 0 0 16px;
}

.page-rich-text :where(ul, ol) {
    padding-inline-start: 1.45rem;
    padding-inline-end: 1.45rem;
}

.page-rich-text :where(h2, h3) {
    margin: 26px 0 12px;
    font-size: 22px;
    line-height: 1.35;
}

.page-rich-text :where(a) {
    color: var(--accent-dark);
    overflow-wrap: anywhere;
}

.page-rich-text :where(img, video, iframe, embed, object) {
    max-width: 100%;
}

.page-rich-text :where(img, video) {
    height: auto;
}

.page-rich-text :where(table) {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.page-rich-text :where(th, td) {
    padding: 10px 12px;
    border: 1px solid var(--line);
    vertical-align: top;
}

.page-rich-text :where(pre) {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
}

.page-rich-text :where(.wp-block-heading) {
    color: var(--ink);
}

.page-rich-text :where(.wp-block-list) {
    margin: 0 0 16px;
    padding-inline-start: 1.45rem;
    padding-inline-end: 1.45rem;
}

.page-rich-text :where(.wp-block-list li) {
    margin-bottom: 8px;
}

.page-rich-text :where(.wp-block-quote, blockquote) {
    margin: 22px 0;
    padding: 14px 18px;
    color: var(--ink);
    background: var(--surface-2);
    border-inline-start: 4px solid var(--accent);
    border-radius: var(--radius);
}

.page-rich-text :where(.wp-block-table) {
    max-width: 100%;
    margin: 18px 0;
    overflow-x: auto;
}

.page-rich-text :where(.wp-block-table table) {
    display: table;
    min-width: 100%;
}

.page-rich-text :where(.wp-block-image, figure) {
    max-width: 100%;
    margin: 20px 0;
}

.page-rich-text :where(.wp-block-image img, figure img) {
    display: block;
    max-width: 100%;
    height: auto;
}

.page-rich-text :where(figcaption, .wp-element-caption) {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
}

.page-rich-text :where(.aligncenter) {
    margin-inline: auto;
    text-align: center;
}

.page-rich-text :where(.alignleft) {
    float: inline-start;
    max-width: min(45%, 320px);
    margin-inline-end: 18px;
}

.page-rich-text :where(.alignright) {
    float: inline-end;
    max-width: min(45%, 320px);
    margin-inline-start: 18px;
}

.page-rich-text :where(.has-text-align-center) {
    text-align: center;
}

.page-rich-text :where(.has-text-align-left) {
    text-align: left;
}

.page-rich-text :where(.has-text-align-right) {
    text-align: right;
}

.page-rich-text :where(.wp-block-separator, hr) {
    height: 1px;
    margin: 28px 0;
    background: var(--line);
    border: 0;
}

.page-rich-text::after {
    content: "";
    display: table;
    clear: both;
}

.legal-html-cleaner .legal-html-paste {
    display: block;
    width: 100%;
    min-height: 180px;
    padding: 12px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    outline: 0;
    overflow: auto;
}

.legal-html-cleaner .legal-html-paste:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(31, 122, 104, 0.14);
}

.legal-html-cleaner .legal-html-preview-stage {
    align-items: stretch;
    justify-content: stretch;
    padding: 18px;
}

.legal-html-cleaner .legal-html-preview {
    width: 100%;
    min-height: 240px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.85;
    overflow-wrap: break-word;
}

.legal-html-cleaner .legal-html-preview :where(h2, h3, h4) {
    margin: 18px 0 10px;
    color: var(--ink);
    line-height: 1.35;
}

.legal-html-cleaner .legal-html-preview :where(p, ul, ol) {
    margin: 0 0 12px;
}

.legal-html-cleaner .legal-html-preview :where(ul, ol) {
    padding-inline-start: 1.35rem;
    padding-inline-end: 1.35rem;
}

.legal-html-cleaner .tool-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr) minmax(0, 0.58fr);
    align-items: stretch;
}

.legal-html-cleaner .tool-actions button {
    width: 100%;
}

.legal-html-cleaner .tool-actions [data-copy] {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
}

.legal-html-cleaner .tool-actions [data-copy]:hover {
    color: #fff;
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.legal-html-cleaner .tool-actions [data-clear] {
    color: var(--muted);
    background: transparent;
    border-color: var(--line-strong);
}

.legal-html-cleaner .tool-actions [data-clear]:hover {
    color: var(--ink);
    background: var(--soft);
    border-color: var(--line-strong);
}

.back-link {
    width: fit-content;
    margin-bottom: 20px;
    padding: 8px 12px;
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 7%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
}

.back-link:hover,
.back-link:focus-visible {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 12%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 54%, var(--line));
    outline: 0;
}

.tool-surface {
    margin-top: 22px;
    padding: clamp(16px, 4vw, 28px);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.tool-surface,
.tool-surface :where(*) {
    font-family: var(--font) !important;
    letter-spacing: 0 !important;
}

.is-game-page .tool-page {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.is-game-page .tool-page > .back-link,
.is-game-page .tool-page > .section-heading {
    margin-inline: clamp(16px, 3vw, 28px);
}

.is-game-page .tool-surface {
    padding: 0;
    overflow: hidden;
    background: var(--surface);
}

.uft-game {
    --game-blue: #2563eb;
    --game-green: #16a34a;
    --game-amber: #f59e0b;
    --game-red: #ef4444;
    display: grid;
    gap: 18px;
    padding: clamp(16px, 3vw, 24px);
}

.uft-game,
.uft-game * {
    box-sizing: border-box;
}

.game-topbar,
.game-toolbar,
.game-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.game-title-block {
    display: grid;
    gap: 4px;
}

.game-title-block strong {
    color: var(--ink);
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.25;
}

.game-title-block span,
.game-stat span,
.game-note {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.game-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.game-stat {
    min-width: 92px;
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--navy) 3%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--navy) 12%, var(--line));
    border-radius: var(--radius);
}

.game-stat b {
    color: var(--ink);
    font-size: 18px;
    line-height: 1;
}

.uft-arabic-number {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    direction: ltr;
    unicode-bidi: isolate;
}

.game-toolbar {
    padding: 12px;
    background: color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.game-control {
    display: grid;
    gap: 6px;
    min-width: 150px;
}

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

.game-control :where(select, input) {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font: inherit;
}

.game-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.game-check-option {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.game-check-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.game-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    font: inherit;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.game-btn:hover,
.game-btn:focus-visible {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    outline: 0;
    transform: translateY(-1px);
}

.game-btn:disabled {
    opacity: .58;
    cursor: not-allowed;
    transform: none;
}

.game-btn.secondary {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line);
}

.game-btn.secondary:hover,
.game-btn.secondary:focus-visible {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.game-btn.secondary.is-active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.game-play-area {
    display: grid;
    gap: 14px;
    padding: clamp(12px, 2vw, 18px);
    background:
        linear-gradient(color-mix(in srgb, var(--navy) 4%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--navy) 4%, transparent) 1px, transparent 1px),
        color-mix(in srgb, var(--navy) 2%, var(--surface));
    background-size: 24px 24px;
    border: 1px solid color-mix(in srgb, var(--navy) 12%, var(--line));
    border-radius: var(--radius);
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(var(--memory-cols, 4), minmax(54px, 1fr));
    gap: 10px;
}

.memory-card {
    position: relative;
    aspect-ratio: 1;
    min-height: 58px;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--navy) 14%, var(--line));
    border-radius: var(--radius);
    box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--navy) 5%, transparent);
    cursor: pointer;
    font-size: clamp(20px, 4vw, 34px);
    font-weight: 900;
    overflow: hidden;
    isolation: isolate;
}

.memory-card.is-hidden-value {
    color: transparent;
    background: linear-gradient(135deg, var(--navy), color-mix(in srgb, var(--accent) 55%, var(--navy)));
}

.memory-card.is-matched {
    color: #fff;
    background: var(--game-green);
    border-color: var(--game-green);
}

.memory-card-back,
.memory-card-face,
.memory-mark {
    grid-area: 1 / 1;
}

.memory-card-back {
    width: 46%;
    aspect-ratio: 1;
    border: 3px solid rgba(255, 255, 255, 0.75);
    border-radius: 16px;
    transform: rotate(12deg);
    opacity: 0;
    transition: opacity 180ms ease, transform 180ms ease;
}

.memory-card.is-hidden-value .memory-card-back {
    opacity: 1;
}

.memory-card-face {
    width: 74%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    color: var(--card-color);
    background: color-mix(in srgb, var(--card-color) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--card-color) 26%, var(--line));
    border-radius: 18px;
    transform: scale(1);
    opacity: 1;
    transition: opacity 180ms ease, transform 180ms ease;
}

.memory-card.is-hidden-value .memory-card-face {
    opacity: 0;
    transform: scale(.78) rotate(-8deg);
}

.memory-visual {
    width: 70%;
    display: grid;
    place-items: center;
}

.memory-visual svg {
    width: 100%;
    height: auto;
    fill: currentColor;
}

.memory-mark {
    position: absolute;
    inset-block-start: 8px;
    inset-inline-end: 8px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 50%;
    font-size: 17px;
    line-height: 1;
    font-weight: 900;
    opacity: 0;
    transform: scale(.8);
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 2;
}

.memory-card.is-matched .memory-mark {
    background: var(--game-green);
    opacity: 1;
    transform: scale(1);
}

.memory-card.is-matched .memory-mark::before {
    content: "✓";
}

.memory-card.is-wrong .memory-mark {
    background: var(--game-red);
    opacity: 1;
    transform: scale(1);
}

.memory-card.is-wrong {
    border-color: var(--game-red);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--game-red) 16%, transparent);
}

.memory-card.is-wrong .memory-mark::before {
    content: "×";
}

.memory-card.is-right-pulse {
    animation: memoryRightPulse 520ms ease;
}

.memory-card.is-wrong-pulse {
    animation: memoryWrongShake 420ms ease;
}

@keyframes memoryRightPulse {
    0% { transform: scale(1); }
    45% { transform: scale(1.035); box-shadow: 0 0 0 5px color-mix(in srgb, var(--game-green) 18%, transparent); }
    100% { transform: scale(1); }
}

@keyframes memoryWrongShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-5px); }
    40% { transform: translateX(5px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.sudoku-wrap {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(180px, 240px);
    gap: 16px;
    align-items: start;
}

.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    overflow: hidden;
    background: var(--navy);
    border: 3px solid var(--navy);
    border-radius: var(--radius);
}

.sudoku-cell {
    aspect-ratio: 1;
    min-width: 0;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--navy) 16%, var(--line));
    font: inherit;
    font-size: clamp(16px, 3vw, 24px);
    font-weight: 800;
    text-align: center;
}

.sudoku-cell:nth-child(3n) {
    border-inline-end-width: 3px;
}

.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom-width: 3px;
}

.sudoku-cell.is-given {
    color: #fff;
    background: var(--navy);
}

.sudoku-cell.is-wrong {
    color: #fff;
    background: var(--game-red);
}

.sudoku-cell.is-correct {
    color: #fff;
    background: var(--game-green);
    border-color: var(--game-green);
}

.sudoku-cell.is-close {
    color: #7c2d12;
    background: #ffedd5;
    border-color: #fdba74;
}

.sudoku-cell.is-hint {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 14%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
}

.sudoku-help {
    display: grid;
    gap: 8px;
    padding: 12px;
    color: var(--ink);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
    border-radius: var(--radius);
}

.sudoku-help strong {
    font-size: 14px;
    font-weight: 900;
}

.sudoku-hint-box {
    min-height: 44px;
    display: grid;
    place-items: center;
    padding: 10px 12px;
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 7%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 900;
    text-align: center;
}

.sudoku-color-guide {
    display: grid;
    gap: 8px;
    padding: 12px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.sudoku-color-guide strong {
    font-size: 14px;
    font-weight: 900;
}

.sudoku-color-guide span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.sudoku-color-dot {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    border-radius: 4px;
}

.sudoku-color-dot.is-correct {
    background: var(--game-green);
}

.sudoku-color-dot.is-close {
    background: #f97316;
}

.sudoku-color-dot.is-wrong {
    background: var(--game-red);
}

.sudoku-pad,
.word-letters,
.robot-program {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
    gap: 8px;
}

.pad-btn,
.letter-btn,
.robot-cell {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.pad-btn:hover,
.letter-btn:hover {
    border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.quiz-card,
.word-card {
    display: grid;
    gap: 14px;
    max-width: 720px;
    margin-inline: auto;
    padding: clamp(16px, 3vw, 24px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.word-upload {
    min-height: 54px;
    display: grid;
    gap: 2px;
    align-content: center;
    padding: 8px 14px;
    color: var(--ink);
    background: var(--surface);
    border: 1px dashed color-mix(in srgb, var(--accent) 34%, var(--line));
    border-radius: var(--radius);
    cursor: pointer;
}

.word-upload span {
    font-size: 13px;
    font-weight: 800;
}

.word-upload small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.word-upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.word-options {
    margin-top: 8px;
}

.word-choice-layout {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    gap: 14px;
    align-items: start;
}

.word-choice-panel {
    min-width: 0;
}

.word-choice-layout .word-letters {
    grid-template-columns: repeat(4, minmax(42px, 1fr));
}

.word-choice-layout .answer-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.letter-btn.is-hidden-choice {
    display: none;
}

.quiz-question {
    color: var(--ink);
    font-size: clamp(34px, 8vw, 72px);
    line-height: 1;
    text-align: center;
    font-weight: 900;
}

.answer-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.answer-option {
    min-height: 52px;
    padding: 0 12px;
    color: var(--ink);
    background: color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.answer-option.is-correct,
.letter-btn.is-used.is-correct {
    color: #fff;
    background: var(--game-green);
    border-color: var(--game-green);
}

.answer-option.is-wrong,
.letter-btn.is-used:not(.is-correct) {
    color: #fff;
    background: var(--game-red);
    border-color: var(--game-red);
}

.word-blanks {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.word-blank {
    width: 42px;
    height: 50px;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
    border-radius: var(--radius);
    font-size: 24px;
    font-weight: 900;
}

.language-play-area {
    align-items: start;
}

.language-card {
    width: min(100%, 860px);
    margin-inline: auto;
}

.language-question {
    min-height: 78px;
    display: grid;
    place-items: center;
    padding: clamp(14px, 3vw, 22px);
    color: var(--ink);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
    border-radius: var(--radius);
    font-size: clamp(22px, 4vw, 38px);
    font-weight: 900;
    line-height: 1.35;
    text-align: center;
}

.language-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.language-option {
    min-height: 62px;
    padding-inline: 16px;
    font-size: clamp(16px, 2.4vw, 20px);
    white-space: normal;
}

.language-builder {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    min-height: 68px;
    padding: 12px;
    background: var(--surface);
    border: 1px dashed color-mix(in srgb, var(--accent) 34%, var(--line));
    border-radius: var(--radius);
}

.language-builder[hidden],
.language-input-row[hidden] {
    display: none;
}

.language-slot,
.language-built-word {
    min-width: 76px;
    min-height: 44px;
    display: inline-grid;
    place-items: center;
    padding: 8px 12px;
    color: var(--ink);
    background: color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 900;
}

.language-built-word {
    min-width: min(100%, 260px);
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.language-chip {
    min-height: 52px;
    padding: 0 18px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--navy) 5%, transparent);
}

.language-chip:hover,
.language-chip:focus-visible {
    border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
    transform: translateY(-1px);
}

.language-chip:disabled {
    color: color-mix(in srgb, var(--ink) 45%, transparent);
    background: color-mix(in srgb, var(--navy) 4%, var(--surface));
    cursor: default;
    transform: none;
}

.language-input-row {
    display: grid;
}

.language-input-row input {
    min-height: 58px;
    padding: 0 16px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 800;
    text-align: center;
}

.game-note.is-correct {
    color: #166534;
    background: color-mix(in srgb, var(--game-green) 12%, var(--surface));
    border-color: color-mix(in srgb, var(--game-green) 28%, var(--line));
}

.game-note.is-wrong {
    color: #991b1b;
    background: color-mix(in srgb, var(--game-red) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--game-red) 26%, var(--line));
}

.robot-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(220px, 320px);
    gap: 16px;
}

.robot-board-panel {
    display: grid;
    gap: 12px;
}

.robot-legend {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.robot-legend span {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 800;
}

.legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    background: var(--line);
}

.legend-dot.is-robot {
    background: var(--game-blue);
}

.legend-dot.is-goal {
    background: var(--game-green);
}

.legend-dot.is-block {
    background: var(--navy);
}

.robot-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    direction: ltr;
}

.robot-cell {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    cursor: default;
    font-size: clamp(20px, 4vw, 34px);
}

.robot-cell.is-block {
    background: var(--navy);
}

.robot-cell.is-start {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
}

.robot-cell.is-path {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--game-blue) 14%, var(--surface));
    border-color: color-mix(in srgb, var(--game-blue) 28%, var(--line));
}

.robot-cell.is-fail {
    color: #fff;
    background: var(--game-red);
    border-color: var(--game-red);
    animation: robotFailShake 420ms ease;
}

.robot-cell.is-goal {
    color: #fff;
    background: var(--game-green);
}

.robot-cell.is-robot {
    color: #fff;
    background: var(--game-blue);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--game-blue) 16%, transparent);
}

.robot-program {
    grid-template-columns: 1fr;
}

.robot-help {
    display: grid;
    gap: 8px;
    padding: 12px;
    color: var(--ink);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
    border-radius: var(--radius);
}

.robot-help strong {
    font-size: 14px;
    font-weight: 900;
}

.robot-help-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-inline-start: 20px;
    padding-inline-end: 20px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.robot-queue {
    min-height: 48px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px;
    background: var(--surface);
    border: 1px dashed color-mix(in srgb, var(--navy) 20%, var(--line));
    border-radius: var(--radius);
    direction: ltr;
}

.robot-queue-empty {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
    align-self: center;
}

.robot-step {
    min-width: 38px;
    min-height: 34px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--navy);
    border-radius: 7px;
    font-weight: 900;
}

.robot-dir-btn {
    min-width: 70px;
    flex-direction: column;
    gap: 3px;
    padding-block: 8px;
}

.robot-dir-btn span {
    font-size: 20px;
    line-height: 1;
}

.robot-dir-btn small {
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
}

.robot-result {
    min-height: 42px;
    display: grid;
    place-items: center;
    padding: 10px 12px;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 900;
    text-align: center;
}

.robot-result.is-success {
    color: #fff;
    background: var(--game-green);
    border-color: var(--game-green);
    animation: robotSuccessPop 520ms ease;
}

.robot-result.is-error {
    color: #fff;
    background: var(--game-red);
    border-color: var(--game-red);
    animation: robotFailShake 420ms ease;
}

.robot-result.is-warning {
    color: #7c2d12;
    background: #ffedd5;
    border-color: #fdba74;
}

.robot-result.is-info {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.logic-game-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(240px, .48fr);
    gap: 16px;
    align-items: start;
}

.logic-card,
.logic-side-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: clamp(16px, 3vw, 22px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.logic-options {
    max-width: 640px;
    margin-inline: auto;
}

.math-puzzle-game .logic-options {
    width: fit-content;
    max-width: 100%;
    grid-template-columns: repeat(4, minmax(64px, 78px));
    justify-content: center;
}

.math-puzzle-game .answer-option {
    min-height: 62px;
    padding: 0 14px;
    font-size: 17px;
}

.math-logic-game .logic-card {
    display: grid;
    gap: 16px;
    align-content: start;
}

.math-logic-game .math-question {
    min-height: 104px;
    display: grid;
    place-items: center;
    padding: 22px;
    color: var(--ink);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
    border-radius: var(--radius);
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 900;
    line-height: 1.4;
    text-align: center;
}

.comparison-expression {
    width: min(100%, 560px);
    display: grid;
    grid-template-columns: minmax(86px, 1fr) 76px minmax(86px, 1fr);
    align-items: center;
    gap: clamp(10px, 3vw, 22px);
    direction: ltr;
}

.comparison-expression > span,
.comparison-expression > strong {
    min-height: 74px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    line-height: 1;
}

.comparison-expression > span {
    color: var(--ink);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
    font-size: clamp(30px, 5vw, 48px);
    font-weight: 900;
}

.comparison-expression > strong {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 10%, var(--surface));
    border: 2px solid color-mix(in srgb, var(--accent) 42%, var(--line));
    font-size: clamp(30px, 5vw, 46px);
    font-weight: 900;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 12%, transparent);
}

.comparison-expression .uft-arabic-number {
    min-height: 0;
    display: inline;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-size: inherit;
    line-height: 1;
}

.math-logic-game .logic-options {
    grid-template-columns: repeat(4, minmax(84px, 1fr));
}

.math-logic-game .answer-option {
    min-height: 62px;
    font-size: 20px;
    font-weight: 900;
}

.math-visual {
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 16px;
    overflow: hidden;
    background:
        linear-gradient(color-mix(in srgb, var(--line) 58%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--line) 58%, transparent) 1px, transparent 1px),
        color-mix(in srgb, var(--navy) 2%, var(--surface));
    background-size: 24px 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.angle-stage {
    position: relative;
    width: min(100%, 360px);
    height: 190px;
}

.angle-stage span,
.angle-stage i {
    position: absolute;
    left: 50%;
    bottom: 32px;
    width: min(128px, 36vw);
    height: 8px;
    display: block;
    background: var(--accent);
    border-radius: 999px;
    transform-origin: left center;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 18%, transparent);
}

.angle-stage i {
    background: var(--game-blue);
}

.angle-stage::before {
    content: "";
    position: absolute;
    left: calc(50% - 8px);
    bottom: 24px;
    width: 24px;
    height: 24px;
    background: var(--ink);
    border: 4px solid var(--surface);
    border-radius: 999px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .18);
}

.coin-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.coin-row span {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    color: #7c2d12;
    background:
        radial-gradient(circle at 35% 30%, #fff7ed, transparent 32%),
        linear-gradient(135deg, #fde68a, #f59e0b);
    border: 3px solid #d97706;
    border-radius: 999px;
    font-size: 20px;
    font-weight: 900;
    box-shadow: inset 0 -8px 12px rgba(124, 45, 18, .16), 0 12px 22px rgba(15, 23, 42, .12);
}

.puzzle15-board,
.maze-grid {
    width: min(100%, 560px);
    display: grid;
    gap: 8px;
    margin-inline: auto;
    padding: 10px;
    background: color-mix(in srgb, var(--navy) 4%, var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.puzzle15-board {
    grid-template-columns: repeat(var(--puzzle-size, 4), minmax(48px, 1fr));
}

.puzzle15-tile {
    aspect-ratio: 1;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 74%, #2563eb));
    border: 1px solid color-mix(in srgb, var(--accent) 65%, #fff);
    border-radius: 10px;
    font: inherit;
    font-size: clamp(18px, 4vw, 30px);
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 18%, transparent);
}

.puzzle15-tile.is-empty {
    background: color-mix(in srgb, var(--navy) 5%, var(--surface));
    border-style: dashed;
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--navy) 5%, transparent);
    cursor: default;
}

.maze-grid {
    grid-template-columns: repeat(var(--maze-size, 7), minmax(34px, 1fr));
    direction: ltr;
}

.maze-cell {
    aspect-ratio: 1;
    border: 1px solid color-mix(in srgb, var(--navy) 9%, var(--line));
    border-radius: 8px;
    background: var(--surface);
}

.maze-cell.is-wall {
    background: var(--navy);
    border-color: var(--navy);
}

.maze-cell.is-goal {
    background: #dcfce7;
    border-color: var(--game-green);
    box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--game-green) 20%, transparent);
}

.maze-cell.is-player {
    background: #2563eb;
    border-color: #1d4ed8;
    box-shadow: 0 0 0 4px color-mix(in srgb, #2563eb 18%, transparent);
}

.maze-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    direction: ltr;
}

.maze-controls .game-btn {
    min-height: 54px;
}

.maze-controls small {
    font-size: 12px;
    unicode-bidi: plaintext;
}

html[dir="rtl"] .maze-controls small {
    direction: rtl;
}

.maze-toast {
    position: fixed;
    inset-inline: 24px;
    bottom: 24px;
    z-index: 30;
    width: min(420px, calc(100% - 48px));
    display: grid;
    gap: 8px;
    margin-inline-start: auto;
    padding: 16px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .16);
    animation: mazeToastIn 220ms ease;
}

.maze-toast[hidden] {
    display: none;
}

.maze-toast strong {
    color: var(--accent-dark);
    font-size: 15px;
    font-weight: 900;
}

.maze-toast span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.maze-toast button {
    justify-self: start;
    min-height: 36px;
    padding: 0 14px;
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

@keyframes mazeToastIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pattern-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.pattern-help,
.pattern-example {
    display: grid;
    gap: 6px;
    padding: 12px 14px;
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
    border-radius: 12px;
}

.pattern-help strong,
.pattern-example b {
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
}

.pattern-help span,
.pattern-example span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.pattern-example {
    background: color-mix(in srgb, #f59e0b 8%, var(--surface));
    border-color: color-mix(in srgb, #f59e0b 24%, var(--line));
}

.pattern-token {
    min-width: 58px;
    min-height: 58px;
    display: grid;
    place-items: center;
    padding: 10px 14px;
    color: var(--ink);
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
    border-radius: 12px;
    font-size: 22px;
    font-weight: 900;
}

.pattern-token.is-missing {
    color: var(--accent);
    border-style: dashed;
    background: var(--surface);
}

.diff-scenes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.diff-scene {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.diff-scene svg {
    display: block;
    width: 100%;
    height: auto;
}

.diff-hotspot {
    position: absolute;
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    border: 2px solid transparent;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.diff-hotspot.is-found {
    border-color: var(--game-green);
    background: var(--game-green);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--game-green) 18%, transparent), 0 10px 20px rgba(15, 23, 42, .18);
    cursor: default;
}

.diff-hotspot.is-found::after {
    content: "";
    position: absolute;
    inset: 7px;
    border: 2px solid rgba(255, 255, 255, .82);
    border-radius: inherit;
    pointer-events: none;
}

.diff-miss-marker {
    position: absolute;
    width: 42px;
    height: 42px;
    transform: translate(-50%, -50%);
    border: 2px solid var(--game-red);
    border-radius: 999px;
    background: color-mix(in srgb, var(--game-red) 14%, transparent);
    pointer-events: none;
    animation: diffMissPulse 520ms ease both;
}

@keyframes diffMissPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.72);
    }
    35% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.28);
    }
}

.shape-bank,
.shape-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    gap: 10px;
}

.shape-pick,
.shape-slot {
    min-height: 76px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.shape-pick {
    cursor: pointer;
}

.shape-pick.is-picked {
    opacity: .42;
}

.shape-slots.is-correct {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--game-green) 18%, transparent);
}

.shape-slots.is-wrong {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--game-red) 16%, transparent);
}

.logic-shape {
    width: calc(42px * var(--shape-scale, 1));
    height: calc(42px * var(--shape-scale, 1));
    display: grid;
    place-items: center;
    background: var(--shape-color);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(15, 23, 42, .26);
}

.logic-shape span {
    position: relative;
    z-index: 1;
}

.logic-shape.is-circle {
    border-radius: 999px;
}

.logic-shape.is-triangle {
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.logic-shape.is-square {
    border-radius: 9px;
}

.logic-shape.is-squircle {
    border-radius: 18px;
}

.logic-shape.is-diamond {
    transform: rotate(45deg);
    border-radius: 8px;
}

.logic-shape.is-diamond span {
    transform: rotate(-45deg);
}

.logic-shape.is-pentagon {
    clip-path: polygon(50% 0, 100% 38%, 82% 100%, 18% 100%, 0 38%);
}

.logic-shape.is-hexagon {
    clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
}

.logic-shape.is-octagon {
    clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}

.logic-shape.is-star {
    clip-path: polygon(50% 0, 62% 33%, 98% 35%, 69% 56%, 79% 91%, 50% 70%, 21% 91%, 31% 56%, 2% 35%, 38% 33%);
}

.math-question {
    padding: clamp(18px, 4vw, 28px);
    color: var(--ink);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
    border-radius: var(--radius);
    font-size: clamp(22px, 4vw, 34px);
    font-weight: 900;
    line-height: 1.35;
    text-align: center;
}

.code-picker,
.code-palette {
    display: grid;
    grid-template-columns: repeat(4, minmax(54px, 1fr));
    gap: 10px;
}

.code-breaker-game {
    position: relative;
}

.code-palette {
    grid-template-columns: repeat(6, minmax(40px, 1fr));
}

.code-slot,
.code-color {
    aspect-ratio: 1;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--code-color);
    cursor: pointer;
}

.code-slot {
    background: color-mix(in srgb, var(--code-color) 78%, var(--surface));
}

.code-slot.is-selected {
    outline: 4px solid color-mix(in srgb, var(--accent) 24%, transparent);
    border-color: var(--accent);
}

.code-help {
    display: grid;
    gap: 12px;
    padding: 14px;
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
    border-radius: var(--radius);
}

.code-help strong {
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
}

.code-help div,
.code-help p {
    margin: 0;
}

.code-help b {
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
}

.code-help span,
.code-help li,
.code-help p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.code-help ol {
    margin: 6px 0 0;
    padding-inline-start: 20px;
}

.code-feedback-help {
    display: grid;
    gap: 6px;
}

.code-feedback-help span {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.code-help-dot {
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
    margin-top: 5px;
    border-radius: 999px;
}

.code-help-dot.is-exact {
    background: var(--game-green);
}

.code-help-dot.is-near {
    background: #f59e0b;
}

.code-attempts-panel {
    display: grid;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.code-attempts-panel > strong {
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
}

.code-history {
    display: grid;
    gap: 8px;
    max-height: 420px;
    overflow: auto;
}

.code-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px;
    background: color-mix(in srgb, var(--navy) 3%, var(--surface));
    border: 1px solid var(--line);
    border-radius: 10px;
}

.code-history-row span {
    display: flex;
    gap: 6px;
}

.code-history-row i {
    width: 18px;
    height: 18px;
    display: block;
    border-radius: 999px;
    background: var(--code-color);
}

.code-celebration {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    pointer-events: none;
    overflow: hidden;
}

.code-celebration span {
    position: absolute;
    width: 10px;
    height: 28px;
    background: var(--color);
    border-radius: 999px;
    opacity: 0;
    animation: codeCelebrationFly 1100ms ease-out var(--delay) forwards;
}

.code-celebration span.is-bubble {
    width: 16px;
    height: 16px;
    border: 3px solid var(--color);
    background: transparent;
}

.kids-layout {
    display: grid;
    gap: 16px;
}

.kids-focus-card {
    min-height: 230px;
    display: grid;
    grid-template-columns: minmax(120px, .7fr) minmax(120px, .7fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(16px, 4vw, 28px);
    padding: clamp(18px, 4vw, 30px);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
    border-radius: var(--radius);
}

.kids-big-letter {
    width: min(100%, 230px);
    min-height: 170px;
    aspect-ratio: 1;
    justify-self: center;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #2563eb));
    border-radius: 24px;
    font-size: clamp(82px, 16vw, 150px);
    font-weight: 900;
    line-height: .9;
    text-align: center;
    box-shadow: inset 0 -10px 0 rgba(15, 23, 42, .12);
}

.letters-game .kids-big-letter {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    overflow: hidden;
}

.kids-letter-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: .82;
    transform: translateY(-.055em);
    width: 100%;
    height: 100%;
}

.kids-big-letter.is-latin,
.kids-big-letter.is-number {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.kids-focus-meta {
    display: grid;
    gap: 8px;
}

.kids-focus-meta span {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

.kids-focus-meta strong {
    color: var(--ink);
    font-size: clamp(28px, 5vw, 54px);
    font-weight: 900;
    line-height: 1.15;
}

.kids-focus-meta b {
    color: var(--accent-dark);
    font-size: clamp(22px, 4vw, 36px);
    line-height: 1.2;
}

.kids-letter-grid,
.kids-number-grid {
    display: grid;
    gap: 8px;
}

.kids-letter-grid {
    grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
}

.kids-letter-grid.is-english {
    direction: ltr;
}

.kids-number-grid {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    overflow: auto;
    padding: 10px;
    background: color-mix(in srgb, var(--navy) 3%, var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.kids-letter-btn,
.kids-number-btn {
    min-height: 52px;
    display: grid;
    place-items: center;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    font: inherit;
    font-size: 24px;
    font-weight: 900;
    cursor: pointer;
}

.kids-number-btn {
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    min-height: 82px;
    font-size: 16px;
}

.kids-number-btn strong {
    font-size: clamp(34px, 5vw, 48px);
    line-height: 1;
}

.kids-number-btn > span {
    max-width: 100%;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kids-number-btn strong .uft-arabic-number,
.kids-number-btn strong span {
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.kids-letter-btn.is-active,
.kids-number-btn.is-active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.kids-number-btn.is-active > span {
    color: rgba(255, 255, 255, .82);
}

.kids-number-btn.is-correct {
    color: #fff;
    background: var(--game-green);
    border-color: var(--game-green);
}

.kids-number-btn.is-wrong {
    color: #fff;
    background: var(--game-red);
    border-color: var(--game-red);
}

.kids-picture {
    min-height: 170px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
    border-radius: 24px;
    font-size: clamp(72px, 14vw, 130px);
}

.kids-picture-card {
    min-height: 170px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, #f59e0b 10%, var(--surface));
    border: 1px solid color-mix(in srgb, #f59e0b 28%, var(--line));
    border-radius: 24px;
    font: inherit;
    font-size: clamp(64px, 12vw, 120px);
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.kids-picture-card:hover,
.kids-picture-card:focus-visible {
    outline: 0;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 16px 32px rgba(15, 23, 42, .12);
}

.kids-count-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.kids-count-dots span,
.kids-count-dots b {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--accent);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 900;
}

.kids-options {
    grid-template-columns: repeat(4, minmax(62px, 1fr));
}

.kids-clock {
    position: relative;
    width: min(310px, 82vw);
    aspect-ratio: 1;
    margin-inline: auto;
    background:
        radial-gradient(circle at center, var(--accent) 0 8px, transparent 9px),
        var(--surface);
    border: 10px solid color-mix(in srgb, var(--accent) 18%, var(--line));
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px var(--line), 0 18px 48px rgba(15, 23, 42, .12);
}

.kids-clock b {
    position: absolute;
    color: var(--ink);
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 20px;
    font-weight: 900;
}

.kids-clock b:nth-of-type(1) { top: 14px; left: 50%; transform: translateX(-50%); }
.kids-clock b:nth-of-type(2) { right: 18px; top: 50%; transform: translateY(-50%); }
.kids-clock b:nth-of-type(3) { bottom: 14px; left: 50%; transform: translateX(-50%); }
.kids-clock b:nth-of-type(4) { left: 20px; top: 50%; transform: translateY(-50%); }

.clock-hand {
    position: absolute;
    left: 50%;
    bottom: 50%;
    width: 7px;
    transform: translateX(-50%) rotate(var(--angle));
    transform-origin: 50% 100%;
    border-radius: 999px;
}

.clock-hand.is-hour {
    height: 30%;
    background: var(--navy);
}

.clock-hand.is-minute {
    height: 40%;
    width: 5px;
    background: var(--accent);
}

@keyframes codeCelebrationFly {
    0% {
        opacity: 0;
        transform: translate(0, 40px) rotate(0deg) scale(.72);
    }
    18% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(var(--x), -260px) rotate(520deg) scale(1.05);
    }
}

@keyframes robotSuccessPop {
    0% { transform: scale(.98); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes robotFailShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    50% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
}

.tool-surface :where(h1, h2, h3, h4) {
    margin-top: 0 !important;
    color: var(--ink) !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
}

.tool-surface :where(h1) {
    font-size: 24px !important;
}

.tool-surface :where(h2) {
    font-size: 22px !important;
}

.tool-surface :where(h3, h4) {
    font-size: 18px !important;
}

.tool-surface :where(p, li, span, small) {
    line-height: 1.75;
}

.tool-surface :where(input, textarea, select) {
    width: 100%;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    outline: 0;
    font-size: 15px;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.tool-surface :where(label) {
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.tool-surface :where(input, textarea, select):focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(31, 122, 104, 0.16);
}

.tool-surface :where(button, .button, input[type="button"], input[type="submit"]) {
    min-height: 44px;
    padding: 10px 16px;
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 700;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.tool-surface :where(button, .button, input[type="button"], input[type="submit"]):hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    transform: translateY(-1px);
}

.tool-surface :where(.preview-box, .preview, [data-preview], #preview, #canvas, .result, .output) {
    width: 100%;
    min-height: 220px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: #fff;
}

.tool-surface .qr-frame {
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: center;
    font-family: var(--font);
}

.tool-surface .qr-frame h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.tool-surface .qr-frame input,
.tool-surface .qr-frame .buttons {
    margin: 0;
}

.tool-surface .qr-frame .preview-box {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
}

.tool-surface .qr-frame button,
.tool-surface .popup-box button {
    color: #fff !important;
    background: var(--accent) !important;
    border: 1px solid var(--accent) !important;
    border-radius: var(--radius) !important;
}

.tool-surface .qr-frame button:hover,
.tool-surface .popup-box button:hover {
    background: var(--accent-dark) !important;
    border-color: var(--accent-dark) !important;
}

.image-file-tool {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 420px);
    gap: 22px;
    align-items: start;
}

.image-tool-preview,
.image-tool-controls {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.image-tool-preview {
    padding: 18px;
}

.image-preview-stage {
    min-height: 340px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #f8fafc;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}

.image-preview-stage :where(canvas, img) {
    max-width: 100%;
    max-height: 520px;
    border-radius: var(--radius);
    box-shadow: 0 12px 34px rgba(23, 35, 58, 0.12);
}

.image-preview-empty {
    color: var(--muted);
    font-size: 15px;
    text-align: center;
}

.image-tool-controls {
    display: grid;
    gap: 14px;
    padding: 20px;
}

.image-tool-controls h3 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.image-tool-controls p {
    margin: 0;
    color: var(--muted);
}

.tool-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tool-field-grid label,
.image-tool-controls > label {
    display: grid;
    gap: 7px;
}

.text-tool-grid label:first-child {
    grid-column: 1 / -1;
}

.text-tool-grid label:has(.watermark-image-input) {
    grid-column: 1 / -1;
}

.image-option-row input[type="range"] {
    accent-color: var(--accent);
}

.image-tool-controls input[type="range"].watermark-opacity {
    accent-color: var(--accent);
}

.image-file-picker,
.watermark-file-picker {
    position: relative;
}

.image-file-picker input[type="file"],
.watermark-file-picker input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.image-file-picker-ui {
    min-height: 52px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease;
}

.image-file-picker:hover .image-file-picker-ui,
.image-file-picker:focus-within .image-file-picker-ui,
.image-file-picker.is-dragover .image-file-picker-ui,
.watermark-file-picker:hover .image-file-picker-ui,
.watermark-file-picker:focus-within .image-file-picker-ui,
.watermark-file-picker.is-dragover .image-file-picker-ui {
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    border-color: var(--accent);
}

.image-file-picker-ui strong {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 6px 13px;
    color: #fff;
    background: var(--accent);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.image-file-picker-ui small {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-tool-controls .range-value {
    display: inline-flex;
    width: max-content;
    min-height: 26px;
    align-items: center;
    padding: 0 8px;
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.image-tool-controls .watermark-image-input {
    padding-block: 10px;
}

.image-file-tool .tool-actions {
    display: grid;
    gap: 10px;
}

.image-file-tool .secondary-action {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
}

.image-file-tool .secondary-action:hover {
    color: #fff;
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.image-file-tool .privacy-note,
.image-file-tool .tool-status {
    color: var(--muted);
    font-size: 13px;
}

.image-file-tool .privacy-note {
    padding: 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.image-file-tool .tool-status {
    min-height: 22px;
    margin: 12px 0 0;
}

.pdf-file-tool {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 420px);
    gap: 22px;
    align-items: start;
}

.pdf-tool-preview,
.pdf-tool-controls {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.pdf-tool-preview {
    padding: 18px;
}

.pdf-preview-stage {
    min-height: 300px;
    display: grid;
    place-items: center;
    overflow: auto;
    background:
        linear-gradient(color-mix(in srgb, var(--navy) 4%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--navy) 4%, transparent) 1px, transparent 1px),
        color-mix(in srgb, var(--navy) 2%, var(--surface));
    background-size: 28px 28px;
    border: 1px dashed color-mix(in srgb, var(--navy) 18%, var(--line));
    border-radius: var(--radius);
}

.pdf-preview-empty,
.pdf-result-message {
    max-width: 220px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.8;
    text-align: center;
    white-space: pre-line;
}

.pdf-result-list {
    width: 100%;
    display: grid;
    gap: 10px;
    padding: 10px;
}

.pdf-result-list img {
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: var(--radius);
    box-shadow: 0 12px 34px rgba(23, 35, 58, 0.12);
}

.pdf-meta-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.45fr) 1fr;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.pdf-meta-row strong {
    color: var(--ink);
    font-weight: 700;
}

.pdf-meta-row span {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.pdf-tool-controls {
    display: grid;
    gap: 14px;
    padding: 20px;
}

.pdf-tool-controls h3 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.pdf-tool-controls p {
    margin: 0;
    color: var(--muted);
}

.pdf-tool-controls > label {
    display: grid;
    gap: 7px;
}

.pdf-option-hint {
    padding: 10px 12px;
    color: var(--muted);
    background: color-mix(in srgb, var(--accent) 4%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.7;
}

.pdf-file-picker input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.pdf-file-picker-ui {
    min-height: 48px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease;
}

.pdf-file-picker:hover .pdf-file-picker-ui,
.pdf-file-picker:focus-within .pdf-file-picker-ui {
    background: color-mix(in srgb, var(--accent) 4%, var(--surface));
    border-color: var(--accent);
}

.pdf-file-picker-ui strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    color: #fff;
    background: var(--accent);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.pdf-file-picker-ui small {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-selected-files {
    display: grid;
    gap: 9px;
    padding: 12px;
    background: color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px solid var(--line);
    border-radius: 10px;
}

.pdf-selected-files[hidden] {
    display: none;
}

.pdf-selected-files > strong {
    color: var(--ink);
    font-size: 13px;
}

.pdf-selected-list {
    display: grid;
    gap: 8px;
}

.pdf-selected-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.pdf-selected-item span {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 7%, var(--surface));
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.pdf-selected-item strong {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-selected-item small {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.pdf-selected-item button {
    min-height: 28px;
    padding: 4px 8px;
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.pdf-selected-item button:hover,
.pdf-selected-item button:focus-visible {
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border-color: var(--accent);
    outline: 0;
}

.pdf-selected-item button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

@media (max-width: 720px) {
    .pdf-selected-item {
        grid-template-columns: 28px minmax(0, 1fr) auto;
    }

    .pdf-selected-item small {
        grid-column: 2 / -1;
    }
}

.pdf-file-tool .tool-actions {
    display: grid;
    gap: 10px;
}

.pdf-file-tool .privacy-note,
.pdf-file-tool .tool-status {
    color: var(--muted);
    font-size: 13px;
}

.pdf-file-tool .privacy-note {
    padding: 10px;
    background: color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.pdf-file-tool .tool-status {
    min-height: 22px;
    margin: 12px 0 0;
}

.utility-file-tool {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 420px);
    gap: 22px;
    align-items: start;
}

.utility-tool-preview,
.utility-tool-controls {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.utility-tool-preview {
    padding: 18px;
}

.utility-preview-stage {
    min-height: 300px;
    display: grid;
    gap: 12px;
    overflow: auto;
    background: #f8fafc;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    padding: 14px;
}

html[data-theme="dark"] .utility-preview-stage,
html[data-theme="dark"] .ai-result,
html[data-theme="dark"] .tool-surface :where(.preview-box, .preview, [data-preview], #preview, #canvas, .result, .output) {
    background: var(--surface-2);
    border-color: var(--line-strong);
}

.utility-preview-stage textarea {
    min-height: 250px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace !important;
    font-size: 13px;
    direction: ltr;
}

.utility-tool-controls {
    display: grid;
    gap: 14px;
    padding: 20px;
}

.utility-tool-controls h3 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.utility-tool-controls p {
    margin: 0;
    color: var(--muted);
}

.utility-tool-controls > label {
    display: grid;
    gap: 7px;
}

.utility-file-tool .tool-actions {
    display: grid;
    gap: 10px;
}

.utility-file-tool .secondary-action {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
}

.utility-file-tool .secondary-action:hover {
    color: #fff;
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.utility-file-tool .privacy-note,
.utility-file-tool .tool-status {
    color: var(--muted);
    font-size: 13px;
}

.utility-file-tool .privacy-note {
    padding: 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.utility-file-tool .tool-status {
    min-height: 22px;
    margin: 12px 0 0;
}

.utility-file-tool .result-list {
    display: grid;
    gap: 8px;
}

.utility-file-tool .result-list a {
    display: block;
    padding: 10px 12px;
    color: var(--accent-dark);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.networking-tool .network-result {
    width: 100%;
}

.networking-tool .network-empty {
    display: grid;
    min-height: 250px;
    margin: 0;
    place-items: center;
    color: var(--muted);
    text-align: center;
}

.network-result-grid {
    display: grid;
    gap: 10px;
}

.network-result-card {
    display: grid;
    gap: 5px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

html[data-theme="dark"] .network-result-card,
html[data-theme="dark"] .serp-preview,
html[data-theme="dark"] .og-preview-card,
html[data-theme="dark"] .utility-file-tool .result-list a,
html[data-theme="dark"] .utility-file-tool .privacy-note {
    background: var(--surface-2);
    border-color: var(--line);
}

.network-result-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.network-result-card strong {
    color: var(--ink);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
    direction: ltr;
    text-align: left;
}

.browser-utility-tool .browser-result {
    width: 100%;
}

.browser-utility-tool .result-output {
    min-height: 250px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace !important;
    font-size: 13px;
    direction: ltr;
    text-align: left;
}

.serp-preview {
    display: grid;
    gap: 6px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.serp-preview span {
    color: #475569;
    font-size: 13px;
}

.serp-preview h4 {
    margin: 0;
    color: #1a0dab;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.3;
}

.serp-preview p {
    margin: 0;
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
}

.og-preview-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.og-preview-card img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    background: #f8fafc;
}

.og-preview-card div {
    display: grid;
    gap: 6px;
    padding: 16px;
}

.og-preview-card strong {
    color: var(--ink);
    font-size: 18px;
}

.og-preview-card p,
.og-preview-card span {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.light-tool .light-result {
    width: 100%;
}

.date-math-tool .date-math-result {
    width: 100%;
}

.color-swatch-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.color-swatch-row span {
    display: block;
    width: 56px;
    height: 56px;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.color-picker-label {
    gap: 8px;
}

.color-picker-control {
    display: grid;
    grid-template-columns: 58px 1fr;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 6px 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.color-picker-control input[type="color"] {
    width: 42px;
    height: 34px;
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.color-picker-control input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-control input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--line-strong);
    border-radius: 8px;
}

.color-picker-control input[type="color"]::-moz-color-swatch {
    border: 1px solid var(--line-strong);
    border-radius: 8px;
}

.color-picker-control .color-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 10px;
    color: var(--ink);
    background: color-mix(in srgb, var(--accent) 7%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    font-weight: 700;
    direction: ltr;
}

.palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
}

.palette-grid button {
    position: relative;
    min-height: 120px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
}

.palette-grid button span {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 5px 8px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.gradient-preview {
    min-height: 180px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.operational-tool .code-input,
.operational-tool .result-output {
    direction: ltr;
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.operational-image-preview {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.operational-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    width: 100%;
}

.operational-link-grid a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 12px;
    color: var(--accent-dark);
    text-decoration: none;
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
    border-radius: 10px;
    font-weight: 800;
    overflow-wrap: anywhere;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.operational-link-grid a:hover,
.operational-link-grid a:focus-visible {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 15%, var(--surface));
    border-color: var(--accent-dark);
}

.seo-audit-result {
    width: 100%;
    display: grid;
    gap: 12px;
}

.seo-score-card {
    min-height: 118px;
    display: grid;
    place-items: center;
    gap: 2px;
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: var(--radius);
}

.seo-score-card strong {
    color: var(--accent-dark);
    font-size: 42px;
    line-height: 1;
}

.seo-score-card span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.seo-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.seo-metric-grid div,
.seo-check-list div {
    min-width: 0;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.seo-metric-grid strong,
.seo-check-list strong {
    display: block;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.4;
}

.seo-metric-grid span,
.seo-check-list span {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.65;
}

.seo-check-list {
    display: grid;
    gap: 8px;
}

.seo-check-list div {
    border-inline-start: 4px solid var(--line-strong);
}

.seo-check-list .is-pass {
    border-inline-start-color: var(--accent);
}

.seo-check-list .is-warning {
    border-inline-start-color: #d97706;
}

.seo-code-output {
    width: 100%;
    max-height: 520px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
    line-height: 1.6;
}

.qr-barcode-result {
    width: 100%;
    min-width: 0;
}

.qr-render-box,
.barcode-render-box {
    display: grid;
    place-items: center;
    min-height: 260px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 20px;
    margin-bottom: 12px;
    overflow: auto;
    background:
        linear-gradient(45deg, rgba(100, 116, 139, 0.07) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(100, 116, 139, 0.07) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(100, 116, 139, 0.07) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(100, 116, 139, 0.07) 75%),
        var(--surface);
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    background-size: 20px 20px;
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
}

.qr-render-box > *,
.barcode-render-box > * {
    max-width: 100% !important;
}

.qr-render-box {
    aspect-ratio: 1 / 1;
    max-height: none;
    overflow: visible;
}

.qr-render-box > div {
    display: grid !important;
    place-items: center;
    width: 100% !important;
    max-width: 300px !important;
    height: auto !important;
    margin: 0 auto !important;
}

.qr-render-box canvas,
.qr-render-box svg {
    display: block;
    width: min(100%, 300px) !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    margin: 0 auto;
    background: #fff;
    border-radius: 10px;
}

.barcode-svg {
    display: block;
    width: min(100%, 560px) !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
}

.qr-barcode-tool .download-format-input,
.qr-barcode-tool .qr-size-input,
.qr-barcode-tool .qr-margin-input,
.qr-barcode-tool .qr-error-level-input {
    font-weight: 800;
}

.qr-barcode-tool .result-output {
    width: 100%;
    min-height: 96px;
    max-height: 180px;
    box-sizing: border-box;
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-writing-tool {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(280px, 420px);
    gap: 22px;
    align-items: start;
}

.ai-tool-preview,
.ai-tool-controls {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.ai-tool-preview {
    padding: 18px;
}

.ai-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.ai-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
    font-size: 12px;
}

html[data-theme="dark"] .ai-chip,
html[data-theme="dark"] .image-file-tool .secondary-action,
html[data-theme="dark"] .utility-file-tool .secondary-action,
html[data-theme="dark"] .ai-writing-tool .secondary-action {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 16%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
}

.ai-result {
    min-height: 340px;
    resize: vertical;
    line-height: 1.85;
    background: #f8fafc;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}

.ai-tool-controls {
    display: grid;
    gap: 14px;
    padding: 20px;
}

.ai-tool-controls h3 {
    margin: 0;
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

.ai-tool-controls p {
    margin: 0;
    color: var(--muted);
}

.ai-tool-controls > label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}

.ai-writing-tool .tool-actions {
    display: grid;
    gap: 10px;
}

.ai-writing-tool .secondary-action {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 9%, var(--surface));
    border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
}

.ai-writing-tool .secondary-action:hover {
    color: #fff;
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

.ai-writing-tool .privacy-note,
.ai-writing-tool .tool-status {
    color: var(--muted);
    font-size: 13px;
}

.ai-writing-tool .privacy-note {
    padding: 10px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.ai-writing-tool .tool-status {
    min-height: 22px;
    margin: 12px 0 0;
}

.seo-panel {
    margin-top: 22px;
    padding: clamp(18px, 4vw, 30px);
    color: var(--muted);
}

.seo-panel :where(h1, h2, h3) {
    color: var(--ink) !important;
}

.seo-panel a {
    color: var(--accent-dark);
}

.rich-text {
    color: var(--muted);
}

.rich-text :where(h1, h2, h3) {
    color: var(--ink);
}

.ad-slot {
    margin: 18px 0;
    padding: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.tool-page > .ad-slot {
    margin-block: 24px;
    padding: 12px;
    background: color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.tool-page > .ad-slot-after-tool {
    margin-top: 18px;
    margin-bottom: 26px;
}

.tool-page > .ad-slot-low-priority {
    margin-top: 34px;
    opacity: 0.92;
}

.ad-header,
.ad-footer,
.sidebar-ad {
    box-shadow: none;
}

.ad-band {
    width: 100%;
    display: flex;
    justify-content: center;
}

.ad-band-after-hero {
    padding: 20px 0 4px;
    background: var(--page-bg);
}

.ad-band-page-top {
    padding: 20px 0 0;
    background: var(--page-bg);
}

.ad-band-before-footer {
    padding: 26px 0;
    background: var(--page-bg);
}

.ad-header,
.ad-footer {
    margin-inline: auto;
}

.ad-slot :where(img, iframe, ins) {
    max-width: 100%;
}

.ad-slot img {
    height: auto;
    object-fit: contain;
}

.ad-slot > * {
    margin-inline: auto;
}

.ad-slot-placeholder {
    min-height: 92px;
    color: color-mix(in srgb, var(--muted) 82%, transparent);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent),
        color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px dashed color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 900;
}

.game-ad-zone {
    margin-block: 18px;
    padding-inline: clamp(16px, 3vw, 28px);
}

.game-ad-zone-top {
    margin-top: 20px;
}

.game-ad-zone-bottom {
    margin-bottom: 0;
}

.game-content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding-inline: clamp(16px, 3vw, 28px);
}

.game-content-layout.has-game-ad-rail {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 300px);
}

.game-main-column {
    min-width: 0;
}

.game-ad-rail {
    position: sticky;
    top: 92px;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: 0;
}

.game-ad-slot {
    width: 100%;
    margin: 0;
    background: color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.game-ad-slot-horizontal {
    min-height: 96px;
}

.game-ad-slot-vertical {
    min-height: 520px;
    padding: 14px;
    align-items: flex-start;
    padding-top: 34px;
}

.game-ad-slot-vertical :where(img, iframe, ins) {
    max-height: 640px;
}

.is-game-page .tool-page .game-ad-slot {
    box-shadow: 0 12px 34px rgba(23, 35, 58, 0.055);
}

.sidebar-ad {
    margin: 0;
    padding: 10px;
    background: color-mix(in srgb, var(--navy) 2%, var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.empty-state {
    text-align: center;
}

.empty-state p {
    margin-inline: auto;
}

.btn-primary {
    margin-top: 22px;
    padding: 10px 18px;
}

.not-found-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.not-found-page {
    flex: 1;
    display: flex;
    align-items: center;
    padding: clamp(42px, 6vw, 76px) 0 clamp(70px, 8vw, 108px);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(246, 247, 248, 0.98) 100%),
        var(--page-bg);
}

html[data-theme="dark"] .not-found-page {
    background:
        radial-gradient(circle at 50% 0%, rgba(31, 122, 104, 0.12), transparent 34%),
        var(--page-bg);
}

.not-found-shell {
    display: grid;
    place-items: center;
}

.not-found-card {
    width: min(820px, 100%);
    padding: clamp(26px, 5vw, 52px);
    text-align: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(23, 35, 58, 0.09);
}

html[data-theme="dark"] .not-found-card,
html[data-theme="dark"] .not-found-actions .back-link {
    background: var(--surface);
    border-color: var(--line);
}

.not-found-visual {
    width: min(420px, 100%);
    margin: 0 auto 4px;
    color: var(--accent);
}

.not-found-visual svg {
    width: 100%;
    height: auto;
}

.not-found-visual .nf-window {
    fill: #fff;
    stroke: var(--line);
    stroke-width: 2;
}

.not-found-visual .nf-topbar {
    fill: #fbf7ef;
}

.not-found-visual .nf-dot,
.not-found-visual .nf-badge {
    fill: var(--accent);
}

.not-found-visual .nf-dot-soft {
    opacity: 0.38;
}

.not-found-visual .nf-line {
    fill: none;
    stroke: #cbd5e1;
    stroke-linecap: round;
    stroke-width: 8;
}

.not-found-visual .nf-short {
    stroke-width: 7;
}

.not-found-visual .nf-shorter {
    stroke-width: 7;
    opacity: 0.75;
}

.not-found-visual .nf-link,
.not-found-visual .nf-search {
    fill: none;
    stroke: var(--navy);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 6;
}

.not-found-card .eyebrow {
    margin: 0;
    color: var(--accent-dark);
    font-size: clamp(72px, 10vw, 116px);
    font-weight: 800;
    line-height: 0.92;
    letter-spacing: 0;
}

.not-found-card h1 {
    max-width: 680px;
    margin: 16px auto 0;
    color: var(--ink);
    font-size: clamp(30px, 4vw, 44px);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: 0;
}

.not-found-card p:not(.eyebrow) {
    max-width: 610px;
    margin: 14px auto 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.85;
}

.not-found-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 28px;
}

.not-found-actions .btn-primary,
.not-found-actions .back-link {
    min-width: 160px;
    min-height: 46px;
    margin: 0;
    padding: 10px 18px;
}

.not-found-actions .back-link {
    color: var(--ink);
    background: #fff;
    border: 1px solid var(--line);
}

.not-found-actions .back-link:hover,
.not-found-actions .back-link:focus-visible {
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
    border-color: rgba(31, 122, 104, 0.4);
}

.site-footer {
    border-top: 1px solid var(--line);
    background: #fff;
}

html[data-theme="dark"] .site-footer {
    background: var(--surface);
}

.footer-shell {
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--muted);
}

.footer-branding {
    display: grid;
    gap: 4px;
}

.footer-branding span:first-child {
    color: var(--ink);
    font-weight: 800;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 16px;
}

.footer-links a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--accent-dark);
}

[hidden],
.is-hidden {
    display: none !important;
}

@media (max-width: 980px) {
    .game-content-layout {
        grid-template-columns: 1fr;
    }

    .game-ad-rail {
        position: static;
    }

    .game-ad-slot-vertical {
        min-height: 120px;
    }

    .hero-grid,
    .page-grid,
    .games-index-hero {
        grid-template-columns: 1fr;
    }

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

    .sidebar {
        position: static;
        order: 2;
    }
}

@media (max-width: 760px) {
    .game-ad-zone {
        margin-block: 12px;
    }

    .game-ad-slot-horizontal,
    .game-ad-slot-vertical {
        min-height: 92px;
        padding: 10px;
    }

    .sudoku-wrap,
    .robot-layout,
    .logic-game-layout,
    .diff-scenes {
        grid-template-columns: 1fr;
    }

    .game-control {
        min-width: min(100%, 220px);
        flex: 1 1 150px;
    }

    .game-actions,
    .game-actions .game-btn {
        width: 100%;
    }

    .word-upload {
        width: 100%;
    }

    .answer-options {
        grid-template-columns: 1fr;
    }

    .language-question {
        min-height: 68px;
    }

    .language-slot {
        min-width: 62px;
    }

    .math-puzzle-game .logic-options {
        grid-template-columns: repeat(4, minmax(54px, 1fr));
        width: 100%;
    }

    .math-puzzle-game .answer-option {
        min-height: 58px;
        padding: 0 8px;
    }

    .word-choice-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .word-choice-layout .answer-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .word-choice-layout .word-letters {
        grid-template-columns: repeat(2, minmax(42px, 1fr));
    }

    .kids-focus-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .kids-big-letter,
    .kids-picture {
        min-height: 140px;
    }

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

    .memory-grid {
        gap: 8px;
    }

    .shape-bank,
    .shape-slots,
    .code-palette {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pattern-token {
        min-width: 48px;
        min-height: 48px;
        font-size: 18px;
    }

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

    .header-shell {
        min-height: 64px;
    }

    .menu-toggle {
        display: grid;
    }

    .site-nav {
        position: absolute;
        inset-inline: 12px;
        top: calc(100% + 8px);
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        justify-content: flex-start;
    }

    .hero {
        padding: 34px 0 16px;
    }

    .hero-copy h1 {
        font-size: 34px;
    }

    .trust-strip {
        padding: 18px 0 0;
    }

    .trust-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 22px 18px;
    }

    .trust-item {
        gap: 9px;
    }

    .trust-icon {
        width: 44px;
        height: 44px;
    }

    .trust-item h2 {
        font-size: 16px;
    }

    .trust-item p {
        max-width: 430px;
        min-height: 44px;
        font-size: 13px;
    }

    .hero-lead,
    .section-heading p {
        font-size: 16px;
    }

    .category-filter-band {
        padding-top: 14px;
    }

    .category-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-inline: 0;
        padding-inline: 0;
    }

    .category-filter-btn {
        min-width: 0;
        min-height: 54px;
        gap: 7px;
        padding: 8px;
        grid-template-columns: 30px minmax(0, 1fr) auto;
    }

    .legal-html-cleaner .tool-actions {
        grid-template-columns: 1fr;
    }

    .category-filter-icon {
        width: 30px;
        height: 30px;
        border-radius: 9px;
    }

    .category-filter-icon svg {
        width: 21px;
        height: 21px;
    }

    .category-filter-copy span {
        font-size: 11px;
        line-height: 1.3;
    }

    .category-filter-count {
        min-width: 24px;
        height: 24px;
        padding: 0 6px;
        font-size: 11px;
    }

    .category-filter-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .page-grid {
        padding-top: 20px;
        gap: 20px;
    }

    .text-page.alternative-page {
        gap: 14px;
        padding: 16px;
        overflow: hidden;
    }

    .alternative-page .section-heading {
        margin-bottom: 4px;
    }

    .alternative-page .section-heading h1 {
        font-size: clamp(28px, 9vw, 34px);
        line-height: 1.25;
    }

    .alternative-page .section-heading p {
        font-size: 15px;
        line-height: 1.85;
    }

    .alternative-page .back-link {
        width: 100%;
    }

    .comparison-note,
    .comparison-panel {
        padding: 14px;
    }

    .comparison-panel h2 {
        font-size: 18px;
        line-height: 1.45;
    }

    .task-picker-grid,
    .alternative-list,
    .alternative-link-grid {
        grid-template-columns: 1fr;
    }

    .task-picker-card {
        min-height: 0;
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 12px;
        padding: 14px;
    }

    .task-picker-icon {
        width: 42px;
        height: 42px;
        border-radius: 10px;
    }

    .task-picker-icon svg {
        width: 22px;
        height: 22px;
    }

    .task-picker-copy strong {
        font-size: 15px;
    }

    .task-picker-action {
        width: 100%;
        justify-content: center;
    }

    .comparison-table-wrap {
        overflow: visible;
    }

    .comparison-table {
        min-width: 0;
        display: block;
        font-size: 13px;
    }

    .comparison-table thead {
        display: none;
    }

    .comparison-table tbody,
    .comparison-table tr,
    .comparison-table td {
        display: block;
        width: 100%;
    }

    .comparison-table tr {
        overflow: hidden;
        background: color-mix(in srgb, var(--navy) 2%, var(--surface));
        border: 1px solid var(--line);
        border-radius: var(--radius);
    }

    .comparison-table tr + tr {
        margin-top: 12px;
    }

    .comparison-table td {
        display: grid;
        gap: 6px;
        padding: 12px;
        border-bottom: 1px solid var(--line);
        line-height: 1.75;
    }

    .comparison-table td:last-child {
        border-bottom: 0;
    }

    .comparison-table td::before {
        content: attr(data-label);
        color: var(--accent-dark);
        font-size: 12px;
        font-weight: 800;
        line-height: 1.3;
    }

    .alternative-card,
    .alternative-link-card {
        min-height: 0;
        padding: 14px;
    }

    .tool-category {
        padding: 0 0 24px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .tool-card {
        min-height: 108px;
    }

    .tool-quality-grid {
        grid-template-columns: 1fr;
    }

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

    .tool-howto-panel,
    .tool-faq-panel {
        padding: 14px;
    }

    .tool-howto-panel h2,
    .tool-faq-panel h2 {
        font-size: 18px;
    }

    .tool-howto-list li {
        grid-template-columns: 30px minmax(0, 1fr);
        padding: 10px;
    }

    .tool-howto-list span {
        width: 30px;
        height: 30px;
    }

    .tool-surface {
        padding: 14px;
    }

    .tool-surface .qr-frame {
        display: flex;
    }

    .image-file-tool {
        display: flex;
        flex-direction: column;
    }

    .pdf-file-tool {
        display: flex;
        flex-direction: column;
    }

    .utility-file-tool {
        display: flex;
        flex-direction: column;
    }

    .ai-writing-tool {
        display: flex;
        flex-direction: column;
    }

    .image-tool-preview,
    .image-tool-controls,
    .pdf-tool-preview,
    .pdf-tool-controls,
    .utility-tool-preview,
    .utility-tool-controls,
    .ai-tool-preview,
    .ai-tool-controls {
        width: 100%;
    }

    .image-preview-stage,
    .pdf-preview-stage,
    .utility-preview-stage,
    .ai-result {
        min-height: 260px;
    }

    .tool-surface :where(.preview-box, .preview, [data-preview], #preview, #canvas, .result, .output) {
        order: 1;
        min-height: 210px;
    }

    .tool-surface :where(input, textarea, select, .buttons, form, .tool-inputs, .tool-controls, .controls, .input-box, .link-box) {
        order: 2;
    }

    .tool-surface [data-mobile-preview-promoted] {
        order: -1;
    }

    .footer-shell {
        min-height: 88px;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
    }

    .not-found-page {
        align-items: flex-start;
        padding: 28px 0 52px;
    }

    .not-found-card {
        padding: 24px 16px;
        border-radius: 12px;
    }

    .not-found-visual {
        width: min(300px, 100%);
    }

    .not-found-card p:not(.eyebrow) {
        font-size: 16px;
    }

    .not-found-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .not-found-actions .btn-primary,
    .not-found-actions .back-link {
        width: 100%;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

/* Unified secondary tool actions: clear outline, calm hover, no beige legacy styling. */
.tool-surface :where(.image-file-tool, .utility-file-tool, .ai-writing-tool) .secondary-action:not([data-clear]),
.tool-surface :where(.image-file-tool, .pdf-file-tool, .utility-file-tool) .download-btn,
.tool-surface .legal-html-cleaner .tool-actions [data-copy] {
    color: var(--accent-dark) !important;
    background: transparent !important;
    border-color: var(--accent) !important;
    box-shadow: none !important;
    transform: none !important;
}

.tool-surface :where(.image-file-tool, .utility-file-tool, .ai-writing-tool) .secondary-action:not([data-clear]):hover,
.tool-surface :where(.image-file-tool, .utility-file-tool, .ai-writing-tool) .secondary-action:not([data-clear]):focus-visible,
.tool-surface :where(.image-file-tool, .pdf-file-tool, .utility-file-tool) .download-btn:hover,
.tool-surface :where(.image-file-tool, .pdf-file-tool, .utility-file-tool) .download-btn:focus-visible,
.tool-surface .legal-html-cleaner .tool-actions [data-copy]:hover,
.tool-surface .legal-html-cleaner .tool-actions [data-copy]:focus-visible {
    color: var(--accent-dark) !important;
    background: var(--surface-2) !important;
    border-color: var(--accent-dark) !important;
    box-shadow: inset 0 0 0 1px var(--accent-dark) !important;
    transform: none !important;
}

html[data-theme="dark"] .tool-surface :where(.image-file-tool, .utility-file-tool, .ai-writing-tool) .secondary-action:not([data-clear]),
html[data-theme="dark"] .tool-surface :where(.image-file-tool, .pdf-file-tool, .utility-file-tool) .download-btn,
html[data-theme="dark"] .tool-surface .legal-html-cleaner .tool-actions [data-copy] {
    color: var(--accent) !important;
    background: transparent !important;
    border-color: var(--accent) !important;
}

html[data-theme="dark"] .tool-surface :where(.image-file-tool, .utility-file-tool, .ai-writing-tool) .secondary-action:not([data-clear]):hover,
html[data-theme="dark"] .tool-surface :where(.image-file-tool, .utility-file-tool, .ai-writing-tool) .secondary-action:not([data-clear]):focus-visible,
html[data-theme="dark"] .tool-surface :where(.image-file-tool, .pdf-file-tool, .utility-file-tool) .download-btn:hover,
html[data-theme="dark"] .tool-surface :where(.image-file-tool, .pdf-file-tool, .utility-file-tool) .download-btn:focus-visible,
html[data-theme="dark"] .tool-surface .legal-html-cleaner .tool-actions [data-copy]:hover,
html[data-theme="dark"] .tool-surface .legal-html-cleaner .tool-actions [data-copy]:focus-visible {
    color: var(--accent) !important;
    background: var(--surface-2) !important;
    border-color: var(--accent) !important;
    box-shadow: inset 0 0 0 1px var(--accent) !important;
}

.tool-surface .uft-game .game-btn {
    min-height: 44px !important;
    padding: 0 16px !important;
    color: #fff !important;
    background: var(--accent) !important;
    border: 1px solid var(--accent) !important;
    border-radius: var(--radius) !important;
    box-shadow: none !important;
}

.tool-surface .uft-game .game-btn.secondary,
.tool-surface .uft-game .pad-btn,
.tool-surface .uft-game .letter-btn,
.tool-surface .uft-game .answer-option,
.tool-surface .uft-game .memory-card,
.tool-surface .uft-game .shape-pick {
    color: var(--ink) !important;
    background: var(--surface) !important;
    border-color: var(--line) !important;
    box-shadow: none !important;
}

.tool-surface .uft-game .game-btn.secondary.is-active {
    color: #fff !important;
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}

.tool-surface .uft-game .puzzle15-tile {
    min-height: 0 !important;
    padding: 0 !important;
    color: #fff !important;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 74%, #2563eb)) !important;
    border-color: color-mix(in srgb, var(--accent) 65%, #fff) !important;
}

.tool-surface .uft-game .puzzle15-tile.is-empty {
    background: color-mix(in srgb, var(--navy) 5%, var(--surface)) !important;
    border-color: var(--line) !important;
}

.tool-surface .uft-game .diff-hotspot,
.tool-surface .uft-game .code-slot,
.tool-surface .uft-game .code-color {
    min-height: 0 !important;
    padding: 0 !important;
    background: var(--code-color, transparent) !important;
    border-color: var(--line) !important;
    box-shadow: none !important;
}

.tool-surface .uft-game .diff-hotspot {
    background: transparent !important;
    border-color: transparent !important;
}

.tool-surface .uft-game .diff-hotspot.is-found {
    border-color: var(--game-green) !important;
    color: #fff !important;
    background: var(--game-green) !important;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--game-green) 18%, transparent), 0 10px 20px rgba(15, 23, 42, .18) !important;
}

.tool-surface .uft-game .code-slot {
    background: color-mix(in srgb, var(--code-color) 78%, var(--surface)) !important;
}

.tool-surface .uft-game .memory-card.is-hidden-value {
    color: transparent !important;
    background: linear-gradient(135deg, var(--navy), color-mix(in srgb, var(--accent) 55%, var(--navy))) !important;
}

.tool-surface .uft-game .memory-card .memory-card-face {
    background: color-mix(in srgb, var(--card-color) 9%, var(--surface)) !important;
    border-color: color-mix(in srgb, var(--card-color) 26%, var(--line)) !important;
}

.tool-surface .uft-game .memory-card.is-matched,
.tool-surface .uft-game .answer-option.is-correct,
.tool-surface .uft-game .letter-btn.is-used.is-correct {
    color: #fff !important;
    background: var(--game-green) !important;
    border-color: var(--game-green) !important;
}

.tool-surface .uft-game .memory-card.is-wrong {
    border-color: var(--game-red) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--game-red) 16%, transparent) !important;
}

.tool-surface .uft-game .answer-option.is-wrong,
.tool-surface .uft-game .letter-btn.is-used:not(.is-correct),
.tool-surface .uft-game .sudoku-cell.is-wrong {
    color: #fff !important;
    background: var(--game-red) !important;
    border-color: var(--game-red) !important;
}

.tool-surface .uft-game .sudoku-cell.is-correct {
    color: #fff !important;
    background: var(--game-green) !important;
    border-color: var(--game-green) !important;
}

.tool-surface .uft-game .sudoku-cell.is-close {
    color: #7c2d12 !important;
    background: #ffedd5 !important;
    border-color: #fdba74 !important;
}

.tool-surface .uft-game .sudoku-cell.is-selected {
    outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
    outline-offset: -3px;
}

.tool-surface .uft-game .sudoku-cell.is-hint {
    color: var(--accent-dark) !important;
    background: color-mix(in srgb, var(--accent) 14%, var(--surface)) !important;
    border-color: color-mix(in srgb, var(--accent) 48%, var(--line)) !important;
}

.tool-surface .uft-game .sudoku-cell.is-given,
.tool-surface .uft-game .robot-cell.is-block,
.tool-surface .uft-game .robot-step {
    color: #fff !important;
    background: var(--navy) !important;
}

.tool-surface .uft-game .robot-cell.is-start {
    color: var(--accent-dark) !important;
    background: color-mix(in srgb, var(--accent) 8%, var(--surface)) !important;
}

.tool-surface .uft-game .robot-cell.is-path {
    color: var(--accent-dark) !important;
    background: color-mix(in srgb, var(--game-blue) 14%, var(--surface)) !important;
}

.tool-surface .uft-game .robot-cell.is-fail {
    color: #fff !important;
    background: var(--game-red) !important;
    border-color: var(--game-red) !important;
}

.tool-surface .uft-game .robot-cell.is-goal {
    color: #fff !important;
    background: var(--game-green) !important;
}

.tool-surface .uft-game .robot-cell.is-robot {
    color: #fff !important;
    background: var(--game-blue) !important;
}

.activity-toast {
    position: fixed;
    left: max(18px, env(safe-area-inset-left));
    bottom: 20px;
    z-index: 90;
    width: min(340px, calc(100vw - 36px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 28px;
    align-items: start;
    gap: 12px;
    padding: 14px;
    color: var(--ink);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
    border-radius: 18px;
    box-shadow: 0 18px 46px rgba(15, 23, 42, .16);
    backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity 220ms ease, transform 220ms ease;
}

.visit-counter-pill {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    color: var(--muted);
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

.visit-counter-pill[hidden] {
    display: none;
}

.visit-counter-pill b {
    color: var(--accent-dark);
    font-size: 17px;
    font-weight: 900;
}

.tool-live-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.share-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding: 16px;
    color: var(--ink);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 54%),
        var(--surface);
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
    border-radius: 18px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .08);
}

.is-game-page .share-panel {
    margin-inline: clamp(16px, 3vw, 28px);
}

.share-panel-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-panel-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--accent);
    border-radius: 14px;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--accent) 24%, transparent);
}

.share-panel :where(svg) {
    width: 20px;
    height: 20px;
}

.share-panel-copy strong {
    display: block;
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.35;
}

.share-panel-copy p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
}

.share-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.share-btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    color: var(--accent-dark);
    background: color-mix(in srgb, var(--accent) 7%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: 999px;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.share-btn:hover,
.share-btn:focus-visible {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 22%, transparent);
    outline: 0;
    transform: translateY(-1px);
}

.share-btn-icon {
    width: 42px;
    padding: 0;
}

.share-whatsapp:hover,
.share-whatsapp:focus-visible {
    background: #16a34a;
    border-color: #16a34a;
}

.share-telegram:hover,
.share-telegram:focus-visible {
    background: #0284c7;
    border-color: #0284c7;
}

.share-x:hover,
.share-x:focus-visible {
    background: #0f172a;
    border-color: #0f172a;
}

.share-facebook:hover,
.share-facebook:focus-visible {
    background: #2563eb;
    border-color: #2563eb;
}

.share-btn-copy.is-copied {
    color: #fff;
    background: var(--game-green, #16a34a);
    border-color: var(--game-green, #16a34a);
}

.activity-toast.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.activity-toast-pulse {
    position: relative;
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    background: var(--game-green);
    border-radius: 999px;
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--game-green) 14%, transparent);
}

.activity-toast-pulse::after {
    content: "";
    position: absolute;
    inset: -7px;
    border: 1px solid color-mix(in srgb, var(--game-green) 48%, transparent);
    border-radius: inherit;
    animation: activityPulse 1500ms ease-out infinite;
}

.activity-toast-copy {
    min-width: 0;
}

.activity-toast-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
}

.activity-toast p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.55;
}

.activity-toast-count {
    min-width: 46px;
    min-height: 32px;
    display: inline-grid;
    place-items: center;
    padding: 0 10px;
    color: #fff;
    background: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 75%, #fff);
    border-radius: 999px;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 24%, transparent);
}

.activity-toast button {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: color-mix(in srgb, var(--navy) 3%, var(--surface));
    border: 1px solid var(--line);
    border-radius: 999px;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

@media (max-width: 520px) {
    .share-panel {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
        padding: 14px;
    }

    .share-actions {
        justify-content: stretch;
    }

    .share-btn-primary,
    .share-btn-copy {
        flex: 1 1 140px;
    }

    .share-btn-icon {
        flex: 1 1 42px;
    }

    .activity-toast {
        left: 12px;
        right: 12px;
        bottom: 14px;
        width: auto;
        grid-template-columns: minmax(0, 1fr) auto 28px;
    }
}

@keyframes activityPulse {
    from {
        opacity: .9;
        transform: scale(.72);
    }
    to {
        opacity: 0;
        transform: scale(1.55);
    }
}

.achievement-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(6px);
}

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

.achievement-card {
    position: relative;
    width: min(420px, 100%);
    display: grid;
    justify-items: center;
    gap: 12px;
    overflow: hidden;
    padding: 28px 24px 22px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
    text-align: center;
    animation: achievementPop 260ms ease;
}

.achievement-mark {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--game-green);
    border-radius: 999px;
    font-size: 36px;
    font-weight: 900;
    box-shadow: 0 14px 30px color-mix(in srgb, var(--game-green) 28%, transparent);
}

.achievement-card strong {
    color: var(--ink);
    font-size: 22px;
    line-height: 1.25;
}

.achievement-card p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.7;
}

.achievement-card small {
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
}

.achievement-card button {
    min-height: 42px;
    padding: 0 20px;
    color: #fff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.achievement-burst {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.achievement-burst span {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 999px;
    opacity: .26;
}

.achievement-burst span:nth-child(1) { inset-inline-start: 14%; top: 18%; }
.achievement-burst span:nth-child(2) { inset-inline-start: 24%; bottom: 18%; background: #f59e0b; }
.achievement-burst span:nth-child(3) { inset-inline-end: 18%; top: 22%; background: #2563eb; }
.achievement-burst span:nth-child(4) { inset-inline-end: 24%; bottom: 20%; background: #db2777; }
.achievement-burst span:nth-child(5) { inset-inline-start: 50%; top: 10%; background: var(--game-green); }

@keyframes achievementPop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
