:root {
    --bg: #f2f6f5;
    --surface: #ffffff;
    --surface-soft: #f7faf9;
    --surface-tint: #e8f2ef;
    --text: #10211d;
    --muted: #53655f;
    --line: #d7e2de;
    --line-strong: #b9cbc5;
    --brand: #0e4d3b;
    --brand-strong: #083b2d;
    --brand-soft: #dcebe6;
    --teal: #2f6f6e;
    --accent: #f5a623;
    --accent-soft: #fff3dc;
    --legal: #6f5aa8;
    --legal-soft: #eee8fb;
    --danger: #a03232;
    --focus: #0b66c3;
    --shadow: 0 18px 48px rgba(16, 33, 29, .08);
    --shadow-soft: 0 8px 24px rgba(16, 33, 29, .06);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(47, 111, 110, .08), transparent 34rem),
        linear-gradient(180deg, #fbfdfc 0, var(--bg) 42rem);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

a {
    color: var(--brand);
    text-underline-offset: .18em;
}

a:hover {
    color: var(--brand-strong);
}

.skip {
    position: absolute;
    left: -999px;
    top: .75rem;
}

.skip:focus {
    left: 1rem;
    z-index: 20;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    padding: .75rem 1rem;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 1180px;
    margin: 0 auto;
    padding: .9rem 1rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    color: var(--brand-strong);
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}

.logo-mark {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background:
        radial-gradient(circle at 28% 25%, rgba(255, 255, 255, .35), transparent 26%),
        linear-gradient(145deg, var(--brand), var(--teal));
    color: #fff;
    display: grid;
    place-items: center;
    font-size: .82rem;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(14, 77, 59, .2);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .25rem;
}

.nav-links a {
    border-radius: 8px;
    color: var(--text);
    font-size: .92rem;
    font-weight: 650;
    line-height: 1;
    padding: .72rem .8rem;
    text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus {
    background: var(--surface-tint);
    color: var(--brand-strong);
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.page-header h1,
.panel h1,
.hero h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.04;
    letter-spacing: 0;
}

.panel h1,
.page-header h1 {
    font-size: clamp(1.85rem, 3vw, 2.65rem);
}

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

.page-header p {
    margin: .3rem 0 0;
    max-width: 46rem;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(320px, 1.05fr);
    gap: 2rem;
    align-items: stretch;
    margin: .5rem 0 1.5rem;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 28rem;
    padding: clamp(2rem, 5vw, 3.75rem);
}

.hero-content p {
    max-width: 32rem;
    margin: 1.2rem 0 0;
    font-size: 1.08rem;
}

.hero-media {
    min-height: 28rem;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .92) 0, rgba(255, 255, 255, .15) 28%, rgba(255, 255, 255, 0) 52%),
        url("/assets/myapes-hero.png") center / cover;
}

.trust-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    margin-bottom: 2rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
}

.trust-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .85rem;
    align-items: start;
    background: rgba(255, 255, 255, .82);
    padding: 1.15rem;
}

.trust-icon,
.metric-icon {
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 8px;
    background: var(--surface-tint);
    color: var(--brand);
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    font-weight: 800;
}

.trust-item h2,
.trust-item p {
    margin: 0;
}

.trust-item h2 {
    font-size: 1rem;
}

.trust-item p {
    margin-top: .2rem;
    color: var(--muted);
    font-size: .92rem;
}

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

.section-stack {
    display: grid;
    gap: 1rem;
}

.card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.card {
    display: block;
    padding: 1.25rem;
    text-decoration: none;
}

.card h2,
.panel h2 {
    margin: 0 0 .45rem;
    color: var(--text);
    font-size: 1.18rem;
    line-height: 1.25;
}

.card p {
    margin: .35rem 0 0;
    color: var(--muted);
}

a.card:hover,
a.task-row:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.panel {
    padding: clamp(1.25rem, 3vw, 2rem);
    max-width: 920px;
}

.panel-wide {
    max-width: none;
}

.auth-panel {
    max-width: 560px;
    margin: 1rem auto 0;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    padding: .72rem 1rem;
    font: inherit;
    font-size: .95rem;
    font-weight: 750;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.button:hover,
button:hover {
    background: var(--brand-strong);
    color: #fff;
    box-shadow: 0 8px 18px rgba(14, 77, 59, .18);
}

.button.secondary {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--text);
}

.button.secondary:hover {
    background: var(--surface-tint);
    color: var(--brand-strong);
}

.button.danger {
    background: var(--danger);
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #b9c8c2;
    border-radius: 8px;
    padding: .78rem .85rem;
    background: #fff;
    color: var(--text);
    font: inherit;
    min-height: 44px;
}

input[type="checkbox"] {
    width: auto;
    min-height: auto;
    margin-right: .45rem;
}

textarea {
    min-height: 132px;
    resize: vertical;
}

label {
    display: block;
    font-size: .93rem;
    font-weight: 750;
    margin: 1rem 0 .35rem;
}

.form-grid {
    display: grid;
    gap: 1rem 1.25rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field {
    display: grid;
    gap: .35rem;
}

.form-field label {
    margin: 0;
}

.form-field.full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

input:focus,
select:focus,
textarea:focus,
button:focus,
a:focus {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.alert {
    border-radius: 8px;
    padding: .85rem 1rem;
    margin-bottom: 1rem;
}

.alert.error {
    background: #f8e7e7;
    color: #671b1b;
}

.alert.success {
    background: #e4f3ea;
    color: #163d2a;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #dff0f6;
    color: #15566b;
    padding: .24rem .55rem;
    font-size: .82rem;
    font-weight: 750;
    line-height: 1.15;
}

.badge.legal {
    background: var(--legal-soft);
    color: var(--legal);
}

.badge.urgent,
.badge.status-urgent {
    background: var(--accent-soft);
    color: #8a4f00;
}

.badge.status-low {
    background: var(--surface-tint);
    color: var(--teal);
}

.badge.status-closed,
.badge.status-resolved {
    background: #e8eeee;
    color: #42514d;
}

.section-label {
    margin: 0 0 .45rem;
    color: var(--brand);
    font-size: .82rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.changelog-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
    gap: 1.25rem;
    align-items: stretch;
    margin-bottom: 1.25rem;
}

.changelog-hero > div,
.version-card,
.release-card,
.mini-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
}

.changelog-hero > div {
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.changelog-hero h1 {
    margin: 0;
    font-size: clamp(2.35rem, 5vw, 4.6rem);
    line-height: 1;
}

.changelog-hero p {
    max-width: 44rem;
    color: var(--muted);
}

.version-card {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    justify-content: center;
    padding: 1.4rem;
}

.version-card__label {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 800;
}

.version-card strong {
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1;
}

.version-card p {
    margin: 0;
    color: var(--muted);
}

.changelog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1rem;
    align-items: start;
}

.release-list {
    display: grid;
    gap: 1rem;
}

.release-card {
    padding: clamp(1.25rem, 3vw, 1.65rem);
}

.release-card h2 {
    margin: .75rem 0 .45rem;
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    line-height: 1.14;
}

.release-card p {
    color: var(--muted);
}

.release-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 750;
}

.release-card details {
    margin-top: 1rem;
    border-top: 1px solid var(--line);
    padding-top: 1rem;
}

.release-card summary {
    cursor: pointer;
    color: var(--brand);
    font-weight: 850;
}

.release-notes {
    display: grid;
    gap: .35rem;
    margin-top: .85rem;
}

.release-notes h3 {
    margin: .8rem 0 .1rem;
    font-size: 1rem;
}

.release-notes p {
    margin: 0;
}

.release-note-item {
    border-left: 3px solid var(--brand-soft);
    padding-left: .75rem;
}

.release-sidebar {
    display: grid;
    gap: 1rem;
    position: sticky;
    top: 6rem;
}

.mini-panel {
    padding: 1rem;
}

.mini-panel p {
    margin: .45rem 0;
    color: var(--muted);
}

.actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: 1.25rem;
}

.action-rail {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    margin-bottom: 1.25rem;
}

.task-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 4.75rem;
    padding: 1rem;
    border-right: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
    transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease, background .16s ease;
}

.task-row:last-child {
    border-right: 0;
}

.task-row strong {
    display: block;
    line-height: 1.2;
}

.task-row span {
    display: block;
    color: var(--muted);
    font-size: .86rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--line);
    margin-bottom: 1.5rem;
}

.metric {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
    align-items: center;
    background: var(--surface);
    padding: 1.2rem;
}

.metric-label {
    display: block;
    color: var(--text);
    font-weight: 800;
}

.metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 850;
    line-height: 1;
}

.metric-note {
    display: block;
    color: var(--brand);
    font-size: .9rem;
    font-weight: 750;
    margin-top: .2rem;
}

.table-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.table-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--line);
}

.table-panel-header h2 {
    margin: 0;
    font-size: 1.15rem;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    min-width: 620px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: .86rem 1rem;
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--text);
    font-size: .82rem;
    font-weight: 850;
}

td {
    color: #263a34;
}

tbody tr:hover {
    background: var(--surface-soft);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.pet-card {
    display: grid;
    gap: .75rem;
}

.pet-card h2 {
    margin-bottom: 0;
}

.pet-species {
    color: var(--muted);
    font-weight: 650;
}

.footer {
    border-top: 1px solid rgba(255, 255, 255, .18);
    background:
        radial-gradient(circle at bottom left, rgba(47, 111, 110, .45), transparent 28rem),
        var(--brand-strong);
    color: rgba(255, 255, 255, .82);
    margin-top: 2rem;
}

.footer .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.footer p {
    margin: .25rem 0;
}

.footer a {
    color: #fff;
}

@media (max-width: 840px) {
    .nav,
    .page-header,
    .footer .container {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-links {
        justify-content: flex-start;
    }

    .hero {
        grid-template-columns: 1fr;
    }

    .hero-content {
        min-height: auto;
    }

    .hero-media {
        min-height: 22rem;
        order: -1;
    }

    .trust-strip,
    .summary-grid,
    .action-rail,
    .form-grid,
    .changelog-hero,
    .changelog-layout {
        grid-template-columns: 1fr;
    }

    .release-sidebar {
        position: static;
    }

    .task-row {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .task-row:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 520px) {
    .container {
        padding: 1.25rem .85rem;
    }

    .nav-links a {
        padding: .65rem .55rem;
    }

    .hero-content {
        padding: 1.5rem;
    }

    .button,
    button {
        width: 100%;
    }

    .actions,
    .form-actions {
        align-items: stretch;
        flex-direction: column;
    }
}
