:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --text: #1d1d1f;
    --muted: #6e6e73;
    --line: rgba(0, 0, 0, 0.08);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    --radius: 18px;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.container.narrow {
    width: min(780px, calc(100% - 40px));
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: saturate(180%) blur(16px);
    background: rgba(245, 245, 247, 0.82);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 10px 0;
}

.brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.brand-name {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.brand-tag {
    font-size: 13px;
    color: var(--muted);
}

.env-badge {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
}

/* Hero */
.home-hero {
    padding: 72px 0 36px;
    text-align: center;
}

.home-hero h1 {
    margin: 0 0 16px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.home-hero .lead {
    margin: 0 auto;
    max-width: 640px;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--muted);
}

/* Services grid */
.home-services {
    padding: 12px 0 56px;
}

.home-branch + .home-branch {
    margin-top: 40px;
}

.home-branch-head {
    margin-bottom: 16px;
}

.home-branch-head h2 {
    margin: 0 0 6px;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    letter-spacing: -0.02em;
    color: #2c3e50;
}

.home-branch-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

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

.service-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 88px;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}

.service-label {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.service-arrow {
    font-size: 18px;
    color: var(--muted);
    transition: transform .2s ease, color .2s ease;
}

.service-card:hover .service-arrow {
    transform: translateX(3px);
    color: var(--text);
}

.service-card--soon {
    opacity: 0.72;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.72);
}

.service-card--more {
    border-style: dashed;
    background: rgba(255, 255, 255, 0.55);
}

.service-card--more:hover {
    background: var(--surface);
}

.service-more {
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
}

.home-branch-link {
    color: inherit;
    text-decoration: none;
}

.home-branch-link:hover {
    color: #2c3e50;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.service-soon {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
}

/* About */
.home-about {
    padding: 20px 0 80px;
}

.home-about h2 {
    margin: 0 0 20px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    letter-spacing: -0.02em;
}

.benefits-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 12px;
}

.benefits-list li {
    position: relative;
    padding: 16px 18px 16px 44px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    color: #333;
}

.benefits-list li::before {
    content: "";
    position: absolute;
    left: 18px;
    top: 22px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text);
}

.other-title {
    margin: 40px 0 12px;
    font-size: 1.1rem;
    color: var(--muted);
    font-weight: 600;
}

.other-links {
    margin: 0;
    padding: 0;
    list-style: none;
}

.other-links a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}

.other-links a:hover {
    border-bottom-color: var(--text);
}

/* Module pages */
.site-main {
    flex: 1 0 auto;
    padding: 32px 0 64px;
}

.site-main:has(.module-breadcrumb-bar) {
    padding-top: 0;
}

.site-main .container {
    width: min(1000px, calc(100% - 40px));
    margin: 0 auto;
}

.module-breadcrumb-bar {
    padding: 8px 0 6px;
    background: rgba(245, 245, 247, 0.72);
}

.module-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    line-height: 1.25;
    color: var(--muted);
}

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

.module-breadcrumb a:hover {
    color: var(--text);
}

.module-breadcrumb-sep {
    color: var(--muted);
    opacity: 0.45;
    user-select: none;
}

.module-breadcrumb-current {
    color: var(--text);
    font-weight: 500;
}

.module-wrap {
    width: min(1000px, calc(100% - 40px));
    margin: 0 auto;
    padding: 12px 0 48px;
}

/* Меньше воздуха над заголовком в карточке конвертера — все модули */
.module-wrap > #jpgtopptx-wrapper,
.module-wrap > #converton-converter,
.module-wrap > #pdf-split-ui,
.module-wrap > #pdf-rotator-ui,
.module-wrap > #ocr-converter,
.module-wrap > #text-analyzer-ui,
.module-wrap > #ptg-generator,
.module-wrap > .converton-box {
    padding-top: 1.25rem;
}

.module-wrap > #jpgtopptx-wrapper > :first-child,
.module-wrap > #converton-converter > :first-child,
.module-wrap > #pdf-split-ui > :first-child,
.module-wrap > #pdf-rotator-ui > :first-child,
.module-wrap > #ocr-converter > :first-child,
.module-wrap > #text-analyzer-ui > :first-child,
.module-wrap > #ptg-generator > :first-child,
.module-wrap > .converton-box > :first-child {
    margin-top: 0;
}

.cms-page-wrap {
    width: min(800px, calc(100% - 40px));
    margin: 0 auto;
    padding: 32px 0 48px;
}

.cms-page-title {
    margin: 0 0 24px;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    letter-spacing: -0.03em;
    color: #2c3e50;
}

.cms-page .module-page-content {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.module-page-content {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--line);
    color: var(--text);
    font-size: 16px;
    line-height: 1.65;
}

.module-page-content h2,
.module-page-content h3,
.module-page-content h4 {
    color: #2c3e50;
    margin: 1.5em 0 0.75em;
}

.module-page-content h2:first-child,
.module-page-content h3:first-child {
    margin-top: 0;
}

.module-page-content p {
    margin: 0 0 1em;
    color: var(--muted);
}

.module-page-content ul,
.module-page-content ol {
    margin: 0 0 1.25em 1.25em;
    color: var(--muted);
}

.module-page-content li {
    margin-bottom: 0.35em;
}

.module-page-content hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 2em 0;
}

.module-page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0 1.5em;
    font-size: 15px;
}

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

.module-page-content strong {
    color: var(--text);
}

/* Footer */
.site-footer {
    flex-shrink: 0;
    background: #111;
    color: #a1a1a6;
    padding: 28px 0 36px;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-copy {
    font-size: 13px;
    text-align: center;
}

.footer-link {
    font-size: 12px;
    color: #86868b;
    text-decoration: none;
}

.footer-link:hover {
    color: #fff;
}

/* Cookie */
.cookie-bar {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    z-index: 50;
}

.cookie-bar[hidden] {
    display: none !important;
}

.cookie-bar p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    flex: 1;
}

.cookie-bar button {
    border: none;
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
}

/* Feedback popup */
.cv-feedback {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: auto;
    max-width: 360px;
    width: calc(100% - 32px);
    padding: 14px 16px 12px;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
    z-index: 60;
}

.cv-feedback[hidden] {
    display: none !important;
}

.cv-feedback-close {
    position: absolute;
    top: 8px;
    right: 10px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
}

.cv-feedback-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    padding-right: 24px;
}

.cv-feedback-stars {
    display: flex;
    gap: 4px;
}

.cv-feedback-stars button {
    border: none;
    background: none;
    font-size: 26px;
    line-height: 1;
    color: #ddd;
    cursor: pointer;
    padding: 0 2px;
    transition: color .15s, transform .15s;
}

.cv-feedback-stars button:hover,
.cv-feedback-stars button:focus-visible {
    color: #f5a623;
    transform: scale(1.1);
}

.cv-feedback-input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    resize: none;
    margin-bottom: 8px;
}

.cv-feedback-send {
    border: none;
    background: #111;
    color: #fff;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
}

@media (max-width: 480px) {
    .cv-feedback {
        right: 12px;
        bottom: 12px;
        width: calc(100% - 24px);
        max-width: 320px;
    }
}

/* 404 / misc */
.hero {
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: 2rem;
}

.hero p, .muted { color: var(--muted); }

.hero a, .module-list a {
    color: var(--text);
}

code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .9em;
}

.branch-hero {
    padding: 48px 0 24px;
    text-align: center;
}

.branch-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--muted);
}

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

.branch-breadcrumb a:hover {
    color: var(--text);
}

.branch-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.branch-hero .lead {
    margin: 0 auto;
    max-width: 640px;
    color: var(--muted);
    font-size: 1.05rem;
}

.branch-intro {
    margin: 16px auto 0;
    max-width: 680px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.branch-services {
    padding: 8px 0 48px;
}

.services-grid--branch {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.branch-back {
    padding: 0 0 64px;
    text-align: center;
}

.branch-back-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 15px;
}

.branch-back-link:hover {
    color: var(--text);
}

@media (max-width: 900px) {
    .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .home-hero { padding-top: 48px; }
    .services-grid { grid-template-columns: 1fr; }
    .service-card { min-height: 72px; padding: 18px 20px; }
    .cookie-bar { flex-direction: column; align-items: stretch; }
}
