:root {
    --bg: #f6f7f9;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --blue: #2563eb;
    --blue-hover: #1d4ed8;
    --disabled: #f3f4f6;
    --disabled-text: #9ca3af;
    --max: 800px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input {
    font: inherit;
    border: none;
    outline: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.container {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 16px;
}

.header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-inner {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    gap: 20px;
}

.nav a {
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

.nav a:hover {
    color: var(--text);
}

.menu-button {
    display: none;
    width: 44px;
    height: 44px;
    background: transparent;
    padding: 10px;
    cursor: pointer;
}

.menu-button span {
    display: block;
    height: 2px;
    margin: 5px 0;
    background: var(--text);
    border-radius: 2px;
}

.search-section {
    padding: 32px 0 16px;
}

.hero-description {
    color: var(--muted);
    font-size: 15px;
    margin: 0 0 24px;
    line-height: 1.6;
}

.search-section input {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.search-section input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.section {
    padding: 24px 0;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.section-header span {
    color: var(--muted);
    font-size: 13px;
}

.grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.card-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    object-fit: cover;
    background: var(--bg);
}

.card-icon-fallback {
    display: grid;
    place-items: center;
    background: var(--bg);
    color: var(--text);
    font-size: 20px;
    font-weight: 600;
}

.card-info {
    min-width: 0;
}

.card-name {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-category {
    margin-top: 2px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 500;
}

.card-description {
    margin: 12px 0;
    color: var(--muted);
    font-size: 14px;
    flex-grow: 1;
}

.card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    background: var(--blue);
    color: var(--card);
    cursor: pointer;
}

.card-button:active {
    background: var(--blue-hover);
}

.card-button:disabled {
    background: var(--disabled);
    color: var(--disabled-text);
    cursor: not-allowed;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--card);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.link-card:active {
    background: var(--bg);
}

.link-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.link-name {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-desc {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--muted);
}

.seo-text-section {
    padding: 40px 0;
    border-top: 1px solid var(--border);
}

.seo-text-section h2 {
    font-size: 18px;
    margin: 0 0 12px;
    color: var(--text);
}

.seo-text-section p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.footer {
    padding: 32px 0;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    place-items: flex-end;
    z-index: 100;
    padding: 16px;
}

.modal.open {
    display: grid;
}

.modal-content {
    background: var(--card);
    padding: 24px;
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.close-button {
    background: transparent;
    font-size: 28px;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.contact-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-button {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    color: var(--card);
}

.contact-button.telegram { background: #229ED9; }
.contact-button.email { background: #ea4335; }

@media (max-width: 600px) {
    .nav {
        display: none;
    }
    
    .menu-button {
        display: block;
    }

    .nav.open {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        display: flex;
        flex-direction: column;
        gap: 0;
        background: var(--card);
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    }

    .nav.open a {
        padding: 16px;
        font-size: 16px;
        border-bottom: 1px solid var(--border);
    }

    .nav.open a:last-child {
        border-bottom: none;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .modal {
        place-items: flex-end;
        padding: 0;
    }

    .modal-content {
        border-radius: 24px 24px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 24px);
    }
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: bold;
}

.logo-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}