@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --accent: #4f46e5;
    --accent-dark: #4338ca;
    --accent-light: #eef0fd;
    --blue-link: #2563eb;
    --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;

    --bg: #ffffff;
    --bg-subtle: #f8f9fb;
    --surface: #ffffff;
    --text: #14151f;
    --text-muted: #666b7a;
    --border: #e7e8ee;

    --success: #16a34a;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;

    --radius: 14px;
    --radius-sm: 10px;
    --ring: 0 0 0 1px var(--border);
    --shadow-sm: 0 1px 2px rgba(16, 17, 31, 0.04);
    --shadow-md: 0 4px 16px rgba(16, 17, 31, 0.06);
    --shadow-lg: 0 12px 32px rgba(16, 17, 31, 0.10);
    --shine: linear-gradient(180deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 55%);

    color-scheme: light;
}

:root[data-theme="dark"] {
    --accent: #8b8cf0;
    --accent-dark: #6d6ce0;
    --accent-light: #262a4a;

    --bg: #121214;
    --bg-subtle: #18181b;
    --surface: #1c1c20;
    --text: #f2f2f4;
    --text-muted: #9a9aa4;
    --border: #2c2c32;

    --success: #4ade80;
    --danger: #f87171;
    --danger-bg: #2a1414;
    --danger-border: #4c1d1d;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 3px 10px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.3);

    color-scheme: dark;
}

* { box-sizing: border-box; }

.icon { vertical-align: -2px; flex-shrink: 0; }

:root {
    --header-h: 66px;
    /* Wide, near-full-width layout. Bump this one value to go wider/narrower. */
    --page-max: 1600px;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg);
    transition: background-color 0.2s ease, color 0.2s ease;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { letter-spacing: -0.02em; font-weight: 800; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.container {
    width: 100%;
    max-width: var(--page-max);
    margin: 0 auto;
    padding: 0 clamp(20px, 3vw, 48px);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Main header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(10px);
}
.site-header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    min-height: var(--header-h);
}
.site-header .logo { flex-shrink: 0; }

.nav-toggle {
    display: none;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    color: var(--text);
    cursor: pointer;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    white-space: nowrap;
    letter-spacing: -0.01em;
}
.logo:hover { text-decoration: none; }

.logo-mark {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    font-size: 1.15rem;
    background: linear-gradient(145deg, #8080e8 0%, var(--accent) 55%, var(--accent-dark) 100%);
    box-shadow: 0 3px 8px rgba(91, 91, 214, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    overflow: hidden;
    transition: transform 0.2s ease;
}
.logo-mark::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 45%);
}
.logo-mark-img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.05); }
.logo-mark::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: rgba(255, 255, 255, 0.55);
    transform: rotate(20deg);
    transition: left 0.6s ease;
}
.logo:hover .logo-mark::before { left: 130%; }

.logo-text { position: relative; }
.logo-accent {
    background: linear-gradient(120deg, #8f8ff2 0%, var(--accent) 45%, var(--accent-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.main-nav { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; }
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    color: var(--text);
    font-weight: 700;
    font-size: 0.92rem;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-family: inherit;
}
.nav-link:hover { color: var(--accent); text-decoration: none; background: var(--bg-subtle); }
.nav-link.active { color: var(--accent); position: relative; }
.nav-link.active::after {
    content: "";
    position: absolute;
    left: 12px; right: 12px; bottom: -13px;
    height: 2px;
    background: var(--accent);
}
.chevron { transition: transform 0.15s ease; }

.nav-item { position: relative; padding-bottom: 8px; margin-bottom: -8px; }
.nav-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    display: flex;
    flex-direction: column;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.nav-item:hover .nav-dropdown,
.nav-item.open .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-item:hover .chevron,
.nav-item.open .chevron { transform: rotate(180deg); }
.nav-dropdown a { padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.nav-dropdown a:hover { background: var(--bg-subtle); color: var(--accent); text-decoration: none; }
.nav-dropdown a.active { color: var(--accent); background: var(--accent-light); }

.nav-cat-icon { opacity: 0.65; }
.main-nav .nav-link { white-space: nowrap; }

/* Category dropdowns: allow a longer tool list, keep them on-screen */
.main-nav .nav-dropdown {
    min-width: 232px;
    max-width: calc(100vw - 32px);
    max-height: min(70vh, 460px);
    overflow-y: auto;
}
.main-nav .nav-item:nth-last-of-type(-n+2) .nav-dropdown { left: auto; right: 0; }
.nav-dropdown-all {
    margin-top: 4px;
    padding-top: 10px !important;
    border-top: 1px solid var(--border);
    color: var(--blue-link) !important;
    text-transform: capitalize;
}

/* Language menu sits at the right edge */
.header-actions .nav-item { padding-bottom: 0; margin-bottom: 0; }
.lang-item .nav-dropdown { left: auto; right: 0; min-width: 150px; top: calc(100% + 8px); }
.lang-item::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 10px; }
.lang-item .icon-btn { gap: 6px; }

[dir="rtl"] .chevron { transform: scaleX(-1); }
[dir="rtl"] .tool-arrow,
[dir="rtl"] .view-all { direction: rtl; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-subtle);
    color: var(--text);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    font-family: inherit;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover { border-color: var(--accent); }
#theme-toggle { width: 36px; padding: 0; justify-content: center; }
.theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-light { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: inline; }

.btn-sm { padding: 9px 20px; font-size: 0.9rem; }

.hero {
    padding: 72px 0;
    background:
        radial-gradient(60% 90% at 88% 15%, rgba(129, 106, 246, 0.10) 0%, rgba(129, 106, 246, 0) 60%),
        radial-gradient(50% 80% at 70% 60%, rgba(91, 91, 214, 0.05) 0%, rgba(91, 91, 214, 0) 60%),
        var(--bg);
    overflow: hidden;
}
.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
    gap: 40px;
}
.hero h1 { font-size: 2.75rem; line-height: 1.15; margin: 0 0 16px; letter-spacing: -0.02em; }
.hero h1 .accent { color: var(--accent); }
.hero h1 .brand-name {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
    background: linear-gradient(120deg, #8f8ff2 0%, var(--accent) 45%, var(--accent-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero .subtitle { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 28px; max-width: 46ch; }

.hero-search {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 4px 4px 20px;
    box-shadow: var(--shadow-md);
    max-width: 460px;
    margin-bottom: 20px;
}
.hero-search input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--text);
    padding: 10px 0;
}
.hero-search button {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: none;
    background: linear-gradient(145deg, #8080e8 0%, var(--accent) 45%, var(--accent-dark) 100%);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(91, 91, 214, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero-search button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--shine);
}
.hero-search button::before {
    content: "";
    position: absolute;
    top: -60%;
    left: -60%;
    width: 40%;
    height: 220%;
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(20deg);
    transition: left 0.6s ease;
}
.hero-search button:hover::before { left: 130%; }
.hero-search button:hover { transform: scale(1.05); box-shadow: 0 3px 8px rgba(91, 91, 214, 0.28); }

.hero-badges {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 0;
    margin: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.hero-badges li { display: flex; align-items: center; gap: 8px; }
.badge-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    font-size: 0.8rem;
}
.badge-green { background: #dcfce7; }
.badge-blue { background: #dbeafe; }
.badge-purple { background: #ede9fe; }
.badge-amber { background: #fef3c7; }
:root[data-theme="dark"] .badge-green { background: rgba(74, 222, 128, 0.16); }
:root[data-theme="dark"] .badge-blue { background: rgba(96, 165, 250, 0.16); }
:root[data-theme="dark"] .badge-purple { background: rgba(139, 140, 240, 0.18); }
:root[data-theme="dark"] .badge-amber { background: rgba(245, 158, 11, 0.16); }

.trust-row { display: flex; align-items: center; gap: 14px; margin-top: 24px; }
.avatar-stack { display: flex; }
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 2px solid var(--bg);
    font-size: 1.1rem;
    margin-left: -10px;
    box-shadow: var(--shadow-sm);
}
.avatar:first-child { margin-left: 0; }
.av-1 { background: #fde68a; }
.av-2 { background: #bfdbfe; }
.av-3 { background: #fbcfe8; }
.av-4 { background: #bbf7d0; }
.trust-copy { display: flex; flex-direction: column; gap: 2px; }
.stars { display: flex; gap: 2px; color: #f59e0b; }
.trust-text { font-size: 0.85rem; color: var(--text-muted); }
.trust-text strong { color: var(--text); }

.hero-art { position: relative; height: 320px; display: flex; align-items: center; justify-content: center; }
.hero-doc {
    width: 220px;
    min-height: 280px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.hero-doc-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 32px;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dark) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.75rem;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}
.hero-doc-badge::after { content: ""; position: absolute; inset: 0; background: var(--shine); }
.doc-line { height: 8px; border-radius: 4px; background: var(--bg-subtle); width: 100%; }
.doc-line.short { width: 40%; }

.float-chip {
    position: absolute;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.2rem;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: float 5s ease-in-out infinite;
    overflow: hidden;
}
.float-chip::after { content: ""; position: absolute; inset: 0; background: var(--shine); }
.chip-1 { top: 6%; left: 4%; animation-delay: 0s; }
.chip-2 { bottom: 12%; right: 6%; animation-delay: 1s; }
.chip-3 { top: 12%; right: 0%; animation-delay: 2s; }
.chip-4 { bottom: 4%; left: 10%; animation-delay: 3s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    cursor: pointer;
    border: none;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
    text-decoration: none;
    background: var(--accent-dark);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
    background: #9a9aa4;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    filter: none;
}
.btn-lg { padding: 14px 36px; font-size: 1.05rem; }

.tools-grid { padding: 48px 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-heading h2 { margin: 0; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.01em; }
.view-all { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 0.9rem; color: var(--blue-link); }

.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}
.tool-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.tool-card[hidden] { display: none; }
.tool-card:hover {
    text-decoration: none;
    box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
    transform: translateY(-2px);
}
.tool-card:hover .tool-arrow { color: var(--accent); transform: translateX(2px); }

.tool-icon-tile {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: #fff;
    margin-bottom: 12px;
    overflow: hidden;
}
.tool-icon-tile::after { content: ""; position: absolute; inset: 0; background: var(--shine); }
.tool-icon-svg { position: relative; z-index: 1; }
.hue-0 .tool-icon-tile { background: #ef4444; box-shadow: 0 3px 8px rgba(239, 68, 68, 0.2); }
.hue-1 .tool-icon-tile { background: #f59e0b; box-shadow: 0 3px 8px rgba(245, 158, 11, 0.2); }
.hue-2 .tool-icon-tile { background: #22c55e; box-shadow: 0 3px 8px rgba(34, 197, 94, 0.2); }
.hue-3 .tool-icon-tile { background: #3b82f6; box-shadow: 0 3px 8px rgba(59, 130, 246, 0.2); }
.hue-4 .tool-icon-tile { background: #8b5cf6; box-shadow: 0 3px 8px rgba(139, 92, 246, 0.2); }
.hue-5 .tool-icon-tile { background: #ec4899; box-shadow: 0 3px 8px rgba(236, 72, 153, 0.2); }

.tool-page-icon.hue-0, .related-icon.hue-0 { background: #ef4444; }
.tool-page-icon.hue-1, .related-icon.hue-1 { background: #f59e0b; }
.tool-page-icon.hue-2, .related-icon.hue-2 { background: #22c55e; }
.tool-page-icon.hue-3, .related-icon.hue-3 { background: #3b82f6; }
.tool-page-icon.hue-4, .related-icon.hue-4 { background: #8b5cf6; }
.tool-page-icon.hue-5, .related-icon.hue-5 { background: #ec4899; }

.tool-name { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.tool-desc { display: block; font-size: 0.83rem; line-height: 1.4; color: var(--text-muted); padding-right: 20px; }
.tool-arrow {
    position: absolute;
    bottom: 18px;
    right: 18px;
    color: var(--text-muted);
    opacity: 0.6;
    transition: color 0.15s ease, transform 0.15s ease;
}

@media (min-width: 1400px) {
    .grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 1100px) {
    .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .grid { grid-template-columns: 1fr; }
}

.home-info { padding: 8px 0 48px; }
.home-info-inner { max-width: 74ch; margin: 0 auto; }
.home-info-inner h2 { font-size: 1.4rem; margin: 40px 0 12px; }
.home-info-inner h2:first-child { margin-top: 0; }
.home-info-inner h3 { font-size: 1.1rem; margin: 20px 0 10px; }
.home-info-inner p { font-size: 0.95rem; line-height: 1.7; color: var(--text-muted); margin: 0 0 12px; }
.home-info-inner a { color: var(--accent); font-weight: 600; }
.home-info-privacy-link { display: inline-flex; margin-top: 8px; }

.stats-bar { padding-bottom: 56px; }
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 32px 16px;
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    font-size: 1.2rem;
    margin-bottom: 4px;
}
.stat-icon-red { background: var(--accent-light); }
.stat-icon-blue { background: #dbeafe; }
.stat-icon-green { background: #dcfce7; }
.stat-icon-purple { background: #ede9fe; }
.stat-num { font-size: 1.7rem; font-weight: 800; }
.stat-num-text { font-size: 1.15rem; }
.stat-num-red { color: var(--accent); }
.stat-num-blue { color: #2563eb; }
.stat-num-green { color: #16a34a; }
.stat-num-purple { color: #7c3aed; }
.stat-label { color: var(--text-muted); font-size: 0.9rem; }

.page-header { padding: 32px 0 8px; }
.page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.page-header-row h1 { margin: 0; }

.tools-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 340px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}
.tools-search input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.9rem;
    color: var(--text);
}
.tools-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
}

.tool-page { padding: 32px 0 64px; }
.breadcrumbs { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); margin-bottom: 20px; }
.tool-page h1 { margin: 0 0 6px; }
.lead { color: var(--text-muted); margin: 0; }

.tool-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.tool-page-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.hint { color: var(--text-muted); font-size: 0.85rem; margin-top: 16px; }

.option-radio, .option-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    cursor: pointer;
}
.option-radio:last-child, .option-check:last-child { margin-bottom: 0; }
.option-radio input, .option-check input { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.option-text { display: flex; flex-direction: column; gap: 1px; }
.option-text strong { font-size: 0.88rem; }
.option-text small { color: var(--text-muted); font-size: 0.78rem; }
.option-check span { font-size: 0.88rem; flex: 1; }
.is-disabled { cursor: pointer; opacity: 0.8; }

.trust-bar {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 20px;
}
.trust-bar-item { display: flex; align-items: center; gap: 12px; }
.trust-bar-item-clickable { cursor: pointer; border-radius: var(--radius-sm); padding: 4px; margin: -4px; transition: background-color 0.15s ease; }
.trust-bar-item-clickable:hover { background: var(--bg-subtle); }
.trust-bar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: #fff;
    flex-shrink: 0;
}
.trust-bar-item strong { display: block; font-size: 0.9rem; }
.trust-bar-item small { display: block; color: var(--text-muted); font-size: 0.78rem; }

@media (max-width: 900px) {
    .trust-bar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .trust-bar { grid-template-columns: 1fr; }
}

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }

.how-it-works, .features, .related-tools, .about-tool, .formats-section, .faq-section, .privacy-section, .why-section, .audience-section, .tips-section, .problems-section { margin-top: 48px; }
.how-it-works h2, .features h2, .related-tools h2, .about-tool h2, .formats-section h2, .faq-section h2, .privacy-section h2, .why-section h2, .audience-section h2, .tips-section h2, .problems-section h2 { font-size: 1.2rem; margin-bottom: 20px; }

.about-tool p, .why-section p { color: var(--text-muted); line-height: 1.65; max-width: 72ch; }
.about-tool p + p, .why-section p + p { margin-top: 12px; }
.about-tool p + p { margin-top: 12px; }

.formats-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.format-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 0.85rem;
    font-weight: 600;
}
.format-chip-arrow { color: var(--text-muted); }

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 14px 16px;
    margin-bottom: 10px;
}
.faq-item:last-child { margin-bottom: 0; }
.faq-question {
    cursor: pointer;
    font-weight: 700;
    font-size: 0.92rem;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
    content: "+";
    flex-shrink: 0;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 1.1rem;
}
.faq-item[open] .faq-question::after { content: "\2212"; }
.faq-answer { margin: 10px 0 0; color: var(--text-muted); font-size: 0.88rem; line-height: 1.6; }

.privacy-block {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
}
.privacy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: #dcfce7;
    color: var(--success);
    flex-shrink: 0;
}
.privacy-block p { margin: 4px 0 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; max-width: 68ch; }
.privacy-block h3 { margin: 0; font-size: 1rem; }
.privacy-block ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; max-width: 68ch; }
.privacy-block li { margin-bottom: 6px; }
.privacy-block li strong { color: var(--text); }

.why-trust-section, .cta-section { margin-top: 48px; }
.why-trust-section h2, .cta-section h2 { font-size: 1.2rem; margin-bottom: 20px; }
.why-trust-section > p { color: var(--text-muted); line-height: 1.65; max-width: 72ch; margin-bottom: 20px; }
.why-trust-section .privacy-block { margin-bottom: 12px; }

.cta-section {
    text-align: center;
    padding: 36px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
}
.cta-section p { color: var(--text-muted); margin: 0 0 20px; }

.comparison-section { margin-top: 48px; }
.comparison-section h2 { font-size: 1.2rem; margin-bottom: 20px; }
.comparison-table-wrap { overflow-x: auto; }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.comparison-table th, .comparison-table td { text-align: left; padding: 10px 14px; border: 1px solid var(--border); }
.comparison-table th { background: var(--bg-subtle); font-weight: 700; }
.comparison-table td:first-child { font-weight: 600; color: var(--text); white-space: nowrap; }
.comparison-table td { color: var(--text-muted); }

.step-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.step-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: linear-gradient(145deg, #8080e8 0%, var(--accent) 100%);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 12px;
}
.step-card p { margin: 0; font-size: 0.9rem; color: var(--text); }

.feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
}
.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text);
}
.feature-check::before {
    content: "\2713";
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #dcfce7;
    color: var(--success);
    font-size: 0.78rem;
    font-weight: 700;
    margin-top: 1px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.related-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.related-card:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.related-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #fff;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .step-grid { grid-template-columns: repeat(2, 1fr); }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .feature-list { grid-template-columns: 1fr; }
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1.5px solid var(--accent);
    color: var(--accent);
}
.btn-outline:hover { background: var(--accent-light); text-decoration: none; }

.related-card span:not(.related-icon) { display: flex; flex-direction: column; gap: 1px; }
.related-card small { color: var(--text-muted); font-weight: 400; font-size: 0.75rem; }
.related-card-all { background: var(--bg-subtle); }

.error-page { text-align: center; padding: 80px 0; }

.static-page { padding: 48px 0 80px; }
.static-page-head { max-width: 720px; margin: 0 0 32px; }
.static-page-head h1 { margin: 0 0 8px; }
.static-page-head .updated-at { color: var(--text-muted); font-size: 0.85rem; }
.static-page-body {
    max-width: 720px;
    line-height: 1.7;
    color: var(--text);
}
.static-page-body h2 { margin: 32px 0 12px; font-size: 1.3rem; }
.static-page-body h2:first-child { margin-top: 0; }
.static-page-body h3 { margin: 22px 0 8px; font-size: 1.05rem; font-weight: 700; }
.static-page-body p { margin: 0 0 14px; color: var(--text-muted); }
.static-page-body ul,
.static-page-body ol { margin: 0 0 14px; padding-left: 22px; color: var(--text-muted); }
.static-page-body li { margin-bottom: 6px; }
.static-page-body a { color: var(--blue-link); }
.static-page-body strong { color: var(--text); }
.static-page-body code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
}
.static-page-body kbd {
    font-family: var(--font-mono);
    font-size: 0.82em;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    box-shadow: 0 1px 0 var(--border);
}
.static-page-body pre {
    margin: 0 0 16px;
    padding: 14px 16px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-subtle);
    font-size: 0.85rem;
    line-height: 1.55;
}
.static-page-body pre code {
    padding: 0;
    border: 0;
    background: none;
    font-size: inherit;
}
.static-page-body table {
    width: 100%;
    margin: 0 0 18px;
    border-collapse: collapse;
    font-size: 0.9rem;
    display: block;
    overflow-x: auto;
}
.static-page-body th,
.static-page-body td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}
.static-page-body th { background: var(--bg-subtle); font-weight: 700; }
.static-page-body td { color: var(--text-muted); }
.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    max-width: 720px;
    margin: 0 0 32px;
}
.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
}
.contact-card h3 { margin: 8px 0 4px; font-size: 1rem; }
.contact-card p { margin: 0; color: var(--text-muted); font-size: 0.88rem; }
.contact-card a { color: var(--blue-link); font-weight: 600; }
.contact-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--accent-light);
    color: var(--accent);
}

.site-footer {
    border-top: 1px solid var(--border);
    padding: 48px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 64px;
    background: var(--bg-subtle);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    padding-bottom: 40px;
}
.footer-brand { max-width: 320px; }
.footer-logo { margin-bottom: 12px; }
.footer-tagline {
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0 0 16px;
}
.footer-trust {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8rem;
}
.footer-trust span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}
.footer-trust svg { color: var(--accent); flex-shrink: 0; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text);
    margin: 0 0 4px;
}
.footer-col a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
}
.footer-col a:hover { color: var(--accent); text-decoration: underline; }
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    border-top: 1px solid var(--border);
    padding: 18px 0;
    font-size: 0.8rem;
}
.footer-bottom p { margin: 0; }
.footer-bottom-links { display: flex; align-items: center; gap: 8px; }
.footer-bottom-links a { color: var(--text-muted); text-decoration: none; }
.footer-bottom-links a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 980px) {
    .site-header-inner { flex-wrap: wrap; position: relative; gap: 12px; }
    .header-actions { order: 2; margin-left: auto; }
    .nav-toggle { display: inline-flex; order: 3; margin-left: 0; }
    .main-nav {
        order: 4;
        flex-basis: 100%;
        display: none;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 2px;
        padding: 8px 0 12px;
        border-top: 1px solid var(--border);
    }
    .main-nav.open { display: flex; }
    .nav-link { justify-content: flex-start; }
    .nav-link.active::after { display: none; }
    .nav-link.active { background: var(--accent-light); }
    .nav-item { padding: 0; margin: 0; }
    .nav-item .nav-item-toggle { width: 100%; }
    .nav-item .chevron { margin-left: auto; }
    .nav-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 2px 0 6px 30px;
        min-width: 0;
        max-height: none;
    }
    .nav-item.open .nav-dropdown { display: flex; }
    .lang-item { flex-basis: auto; }
    .lang-item .nav-dropdown { position: absolute; right: 0; left: auto; padding: 8px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--radius); }
}

@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; }
    .hero-art { height: 220px; }
}

@media (max-width: 640px) {
    .hero h1 { font-size: 1.8rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   Image tool workspace
   ========================================================================== */

.tool-workspace {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.tool-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.tool-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-bottom: 12px;
}
.tool-options .checkbox-row { font-size: 0.85rem; font-weight: 600; }
.field-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}
.field-inline label { font-weight: 600; font-size: 0.85rem; }
.field-inline select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    outline: none;
}
.field-inline select:focus { border-color: var(--accent); }

.field-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 14px;
}
.tool-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 400;
}
.tool-hint kbd,
.tool-hint code,
.step-note kbd {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 1px 5px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-subtle);
}
.step-note {
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.code-textarea.is-dragover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
    background: var(--bg-subtle);
}
.tool-privacy {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}
.tool-privacy svg { flex-shrink: 0; opacity: 0.85; }

.json-history { margin-top: 18px; }
.history-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}
.history-list {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.history-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
.history-item:hover { border-color: var(--accent); }

.field-inline input[type="number"] {
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    outline: none;
}
.field-inline input[type="number"]:focus { border-color: var(--accent); }

/* JSON syntax highlighting in tool output */
.code-output.nowrap { white-space: pre; }
.tok-key { color: #a21caf; }
.tok-str { color: #15803d; }
.tok-num { color: #b45309; }
.tok-bool { color: #2563eb; }
.tok-null { color: #6b7280; }
:root[data-theme="dark"] .tok-key { color: #f0abfc; }
:root[data-theme="dark"] .tok-str { color: #86efac; }
:root[data-theme="dark"] .tok-num { color: #fcd34d; }
:root[data-theme="dark"] .tok-bool { color: #93c5fd; }
:root[data-theme="dark"] .tok-null { color: #9ca3af; }

.pointer-row { margin-top: 4px; }
.pointer-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}
.pointer-controls #pointer-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
    outline: none;
}
.pointer-controls #pointer-input:focus { border-color: var(--accent); }
#pointer-result {
    min-height: 0;
    margin-top: 8px;
    padding: 10px 12px;
    font-size: 0.82rem;
}
#pointer-result:empty { display: none; }

.code-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    padding: 16px;
    font-family: var(--font-mono);
}

.code-textarea,
.code-output {
    width: 100%;
    min-height: 220px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.55;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
}
.code-textarea {
    background: var(--surface);
    color: var(--text);
    resize: vertical;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.code-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}
.code-output {
    background: var(--bg-subtle);
    color: var(--text);
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.mono { font-family: var(--font-mono); }

.field-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.field-row label { font-weight: 600; font-size: 0.85rem; }
.field-row input[type="text"],
.field-row input[type="number"],
.field-row input[type="search"],
.field-row select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
}
.field-row input:focus, .field-row select:focus { border-color: var(--accent); }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.checkbox-row input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }

.range-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.range-row input[type="range"] { flex: 1; accent-color: var(--accent); }
.range-row output, .range-row .range-value {
    min-width: 3ch;
    text-align: right;
    font-weight: 700;
    font-family: var(--font-mono);
    font-size: 0.88rem;
}

.swatch {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.tag, .pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

kbd, .kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
    color: var(--text);
}

.diff-add { background: rgba(22, 163, 74, 0.12); }
.diff-del { background: rgba(220, 38, 38, 0.12); }
:root[data-theme="dark"] .diff-add { background: rgba(74, 222, 128, 0.16); }
:root[data-theme="dark"] .diff-del { background: rgba(248, 113, 113, 0.18); }

.tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.strength-meter {
    height: 6px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}
.strength-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.2s ease, background-color 0.2s ease;
}
.strength-weak { background: var(--danger); }
.strength-fair { background: #f59e0b; }
.strength-strong { background: var(--accent); }
.strength-very-strong { background: var(--success); }

/* ==========================================================================
   Cookie banner
   ========================================================================== */

.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    padding: 16px 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.cookie-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.cookie-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
@media (max-width: 600px) {
    .cookie-banner-inner { flex-direction: column; align-items: stretch; text-align: center; }
    .cookie-banner-actions { justify-content: center; }
}

/* ==========================================================================
   Blog
   ========================================================================== */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.article-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.article-card:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.article-card img { width: 100%; height: 160px; object-fit: cover; background: var(--bg-subtle); }
.article-card-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.article-card h3 { margin: 0; font-size: 1.02rem; }
.article-card p { margin: 0; color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; }
.article-card-featured {
    grid-column: 1 / -1;
    flex-direction: row;
}
.article-card-featured img { width: 42%; height: auto; min-height: 220px; }
.article-card-featured .article-card-body { flex: 1; padding: 24px; justify-content: center; }
.article-card-featured h3 { font-size: 1.4rem; }
.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.78rem;
}
.article-category {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
}

@media (max-width: 1100px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .blog-grid { grid-template-columns: 1fr; }
    .article-card-featured { flex-direction: column; }
    .article-card-featured img { width: 100%; }
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
}
.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
}
.pagination-link:hover { border-color: var(--accent); text-decoration: none; }
.pagination-link.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ==========================================================================
   Blog article (detail) - reading experience
   ========================================================================== */

/* Centred, comfortable reading column. */
.blog-detail .container { max-width: 860px; }
.blog-detail .page-header { padding: 40px 0 4px; }
.blog-detail .page-header h1 {
    margin: 0;
    font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.5rem);
    line-height: 1.2;
}
.blog-detail .article-meta {
    margin: 16px 0 0;
    font-size: 0.9rem;
    gap: 6px;
}
.blog-detail .article-meta .icon { opacity: 0.65; }

.blog-detail .article-body-section { padding: 24px 0 72px; }

/* Guide video embed. */
.video-embed { margin: 8px 0 40px; }
.video-embed-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-subtle);
    box-shadow: var(--shadow-md);
}
.video-embed-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.video-embed figcaption {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* Long-form typography: larger type, roomier rhythm, full-contrast body text. */
.blog-detail .static-page-body {
    max-width: none;
    font-size: 1.06rem;
    line-height: 1.75;
}
.blog-detail .static-page-body p,
.blog-detail .static-page-body li { color: var(--text); }
.blog-detail .static-page-body p { margin: 0 0 20px; }
.blog-detail .static-page-body h2 {
    margin: 48px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-size: 1.5rem;
    line-height: 1.3;
    scroll-margin-top: 84px;
}
.blog-detail .static-page-body h3 {
    margin: 32px 0 10px;
    font-size: 1.15rem;
    scroll-margin-top: 84px;
}
.blog-detail .static-page-body ul,
.blog-detail .static-page-body ol { margin: 0 0 20px; padding-left: 26px; }
.blog-detail .static-page-body li { margin-bottom: 10px; }
.blog-detail .static-page-body li::marker { color: var(--text-muted); }
.blog-detail .static-page-body a { text-decoration: underline; text-underline-offset: 2px; }
.blog-detail .static-page-body pre {
    margin: 0 0 24px;
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    line-height: 1.6;
}
.blog-detail .static-page-body blockquote {
    margin: 0 0 24px;
    padding: 4px 18px;
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
    font-style: italic;
}
.blog-detail .static-page-body hr {
    margin: 40px 0;
    border: 0;
    border-top: 1px solid var(--border);
}
.blog-detail .static-page-body table {
    margin: 0 0 24px;
    font-size: 0.92rem;
    border-radius: var(--radius-sm);
}
.blog-detail .static-page-body th,
.blog-detail .static-page-body td { padding: 10px 14px; }

/* Share bar. */
.blog-detail .article-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 48px 0 0;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.blog-detail .article-share span { color: var(--text-muted); font-weight: 600; }
.blog-detail .article-share a {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
}
.blog-detail .article-share a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Related articles + closing call-to-action. */
.blog-detail .blog-related { margin-top: 56px; }
.blog-detail .blog-related .blog-grid { grid-template-columns: repeat(2, 1fr); }
.blog-detail .blog-related .article-card { padding: 20px; }
.blog-detail .home-cta {
    margin-top: 40px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    text-align: center;
}
.blog-detail .home-cta p { margin: 0; color: var(--text-muted); }

@media (max-width: 720px) {
    .blog-detail .blog-related .blog-grid { grid-template-columns: 1fr; }
    .blog-detail .static-page-body { font-size: 1.02rem; }
    .blog-detail .static-page-body h2 { margin-top: 36px; font-size: 1.3rem; }
}

/* ==========================================================================
   Image Berry — image tool UI (drop zones, previews, canvases, results)
   ========================================================================== */

.ib-drop {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    padding: 34px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.ib-drop:hover { border-color: var(--accent); }
.ib-drop.is-dragover {
    border-color: var(--accent);
    background: var(--accent-light);
}
.ib-drop p { margin: 6px 0 0; font-size: 0.9rem; color: var(--text-muted); }
.ib-drop strong { color: var(--text); font-size: 0.95rem; }
.ib-drop input[type="file"] { display: none; }

.ib-stage {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
}
.ib-canvas, .ib-preview {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background:
        repeating-conic-gradient(var(--bg-subtle) 0% 25%, var(--surface) 0% 50%) 50% / 20px 20px;
}
.ib-canvas-scroll { max-width: 100%; overflow: auto; }

.ib-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}
.ib-meta b { color: var(--text); font-weight: 700; }

.ib-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    align-items: flex-end;
}
.ib-fields .field-row { margin-bottom: 0; }

.ib-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 14px;
    margin-top: 6px;
}
.ib-thumb {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.76rem;
    color: var(--text-muted);
    word-break: break-word;
}
.ib-thumb img {
    width: 100%;
    height: 110px;
    object-fit: contain;
    border-radius: 4px;
    background:
        repeating-conic-gradient(var(--bg-subtle) 0% 25%, var(--surface) 0% 50%) 50% / 16px 16px;
}

.ib-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}
.ib-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    cursor: pointer;
}
.ib-swatch span.chip {
    width: 72px;
    height: 52px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.ib-kv {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.ib-kv td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.ib-kv td:first-child {
    font-weight: 600;
    white-space: nowrap;
    width: 34%;
    color: var(--text-muted);
}
.ib-kv td:last-child { font-family: var(--font-mono); word-break: break-word; }
