:root {
    --bg: #f7faf9;
    --surface: #ffffff;
    --ink: #17211f;
    --muted: #5d6c68;
    --line: #dce7e3;
    --accent: #0f8a7c;
    --accent-strong: #0b6f64;
    --warm: #f4b860;
    --soft: #eaf5f2;
    --shadow: 0 18px 60px rgba(24, 51, 46, 0.12);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
}

a { color: inherit; }

.site-header,
.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: rgba(247, 250, 249, 0.92);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    color: #fff;
    background: var(--accent);
    font-size: 13px;
}

.main-nav,
.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--muted);
    font-size: 15px;
}

.main-nav a,
.site-footer a {
    text-decoration: none;
}

.home-hero,
.tool-hero,
.page-header,
.tool-grid-section,
.feature-band,
.content-section,
.tool-layout {
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 20px;
}

.home-hero {
    min-height: 560px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    align-items: center;
    gap: 44px;
}

.hero-copy h1,
.tool-hero h1,
.page-header h1 {
    max-width: 780px;
    margin: 0 0 18px;
    font-size: clamp(42px, 7vw, 78px);
    line-height: 1;
    letter-spacing: 0;
}

.tool-hero h1,
.page-header h1 {
    font-size: clamp(36px, 6vw, 64px);
}

.hero-copy p,
.tool-hero p,
.page-header p {
    max-width: 660px;
    color: var(--muted);
    font-size: 19px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent-strong);
    font-weight: 800;
    text-transform: uppercase;
    font-size: 13px;
}

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

.primary-link,
.secondary-link,
.primary-action,
.secondary-action,
.download-button,
.upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.primary-link,
.primary-action,
.download-button,
.upload-button {
    color: #fff;
    background: var(--accent);
}

.secondary-link {
    color: var(--accent-strong);
    background: var(--soft);
    border-color: var(--line);
}

.secondary-action {
    color: var(--accent-strong);
    background: #ffffff;
    border-color: var(--line);
}

.hero-preview {
    position: relative;
    min-height: 420px;
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(15,138,124,0.15), rgba(244,184,96,0.22)),
        repeating-linear-gradient(45deg, #ffffff 0 18px, #edf5f2 18px 36px);
    box-shadow: var(--shadow);
}

.preview-card {
    position: absolute;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(23, 33, 31, 0.16);
}

.preview-card.large {
    inset: 60px 70px 100px 60px;
    background: linear-gradient(135deg, #d9f1eb, #fff7e8);
}

.preview-card.small {
    right: 42px;
    bottom: 50px;
    width: 170px;
    height: 130px;
    background: linear-gradient(135deg, #0f8a7c, #f4b860);
}

.preview-stat {
    position: absolute;
    left: 42px;
    bottom: 48px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff;
    font-weight: 900;
}

.ad-slot {
    display: grid;
    place-items: center;
    min-height: 92px;
    max-width: 1180px;
    margin: 0 auto 24px;
    border: 1px dashed #b9cbc5;
    border-radius: 8px;
    color: #78908a;
    background: rgba(255,255,255,0.66);
    font-size: 14px;
}

.top-ad {
    width: calc(100% - 40px);
    margin: 0 auto 24px;
}

.section-heading h2,
.content-section h2,
.related-box h2 {
    margin: 0 0 18px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.12;
}

.tool-grid,
.feature-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
}

.tool-card,
.feature-grid div,
.tool-panel,
.related-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 6px 26px rgba(24, 51, 46, 0.06);
}

.tool-card {
    min-height: 180px;
    padding: 20px;
    text-decoration: none;
}

.tool-card span,
.feature-grid strong {
    display: block;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 900;
}

.tool-card p,
.feature-grid p,
.content-section p,
details p {
    color: var(--muted);
}

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

.feature-grid div { padding: 20px; }

.tool-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
}

.mini-trust {
    display: grid;
    gap: 8px;
    min-width: 210px;
}

.mini-trust span {
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--soft);
    color: var(--accent-strong);
    font-weight: 800;
}

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

.tool-panel { padding: 22px; }

.upload-zone {
    display: grid;
    place-items: center;
    min-height: 270px;
    padding: 30px;
    border: 2px dashed #b7cbc5;
    border-radius: 8px;
    text-align: center;
    background: #fbfdfc;
}

.upload-zone.is-dragging {
    border-color: var(--accent);
    background: var(--soft);
}

.upload-zone p { margin: 12px 0 2px; color: var(--muted); }
.upload-zone small { color: #72847f; }

.workspace {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 320px;
    gap: 20px;
    margin-top: 22px;
}

.preview-wrap {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 360px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: repeating-conic-gradient(#edf3f1 0% 25%, #fff 0% 50%) 50% / 28px 28px;
}

.preview-wrap img {
    max-width: 100%;
    max-height: 520px;
    display: block;
}

.crop-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.crop-box {
    position: absolute;
    width: 80%;
    height: 80%;
    border: 2px solid var(--warm);
    box-shadow: 0 0 0 999px rgba(0,0,0,0.42);
}

.controls {
    display: grid;
    align-content: start;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-weight: 800;
}

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

input[type="range"] { padding: 0; accent-color: var(--accent); }

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

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

.check-row input { width: auto; min-height: auto; }

.preset-info {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--accent-strong);
    background: var(--soft);
    font-weight: 800;
    font-size: 14px;
}

.result {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.result-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 16px;
}

.result-grid div {
    padding: 14px;
    border-radius: 8px;
    background: var(--soft);
}

.result-grid span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.result-grid strong { font-size: 18px; }

.result-preview {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
}

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

.result-preview img {
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: repeating-conic-gradient(#edf3f1 0% 25%, #fff 0% 50%) 50% / 24px 24px;
}

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

.side-ad { min-height: 280px; margin: 0; }

.related-box { padding: 18px; }

.related-box h2 { font-size: 22px; }

.related-box a {
    display: block;
    padding: 10px 0;
    color: var(--accent-strong);
    font-weight: 800;
    text-decoration: none;
    border-top: 1px solid var(--line);
}

.content-section {
    max-width: 860px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 28px 0;
}

.guide-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.guide-card.wide {
    margin-bottom: 30px;
}

.guide-card h2 {
    margin-bottom: 14px;
    font-size: 24px;
}

.guide-card ol,
.guide-card ul {
    margin: 0;
    padding-left: 22px;
    color: var(--muted);
}

.guide-card li + li {
    margin-top: 10px;
}

.use-list {
    columns: 2;
    column-gap: 28px;
}

details {
    margin: 12px 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

summary {
    cursor: pointer;
    font-weight: 900;
}

.site-footer {
    margin-top: 40px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.is-hidden { display: none !important; }

@media (max-width: 980px) {
    .home-hero,
    .tool-layout,
    .workspace {
        grid-template-columns: 1fr;
    }

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

    .tool-hero {
        display: block;
    }

    .mini-trust {
        margin-top: 20px;
    }

    .sidebar {
        position: static;
    }

    .side-ad { min-height: 120px; }
}

@media (max-width: 680px) {
    .site-header,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .home-hero {
        min-height: auto;
        padding-top: 30px;
    }

    .hero-preview {
        min-height: 260px;
    }

    .tool-grid,
    .feature-grid,
    .guide-grid,
    .control-grid,
    .result-grid {
        grid-template-columns: 1fr;
    }

    .use-list {
        columns: 1;
    }

    .tool-panel {
        padding: 14px;
    }

    .preview-wrap {
        min-height: 260px;
    }
}
