:root {
    --bg: #fff;
    --ink: #1a1917;
    --muted: #8a8a8a;
    --line: #e8e8e8;
}

* { box-sizing: border-box; }

html {
    overflow-y: scroll;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
    --pad-x: 20px;
    width: min(530px, 100%);
    margin: 0 auto;
    padding: 22px var(--pad-x) 72px;
}

@media (min-width: 721px) {
    .wrap {
        width: min(700px, 100%);
    }
}

.scroll-edge {
    display: none;
}

@media (min-width: 721px) {
    .scroll-edge {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 70;
        width: clamp(200px, 22vw, 320px);
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        cursor: default;
        pointer-events: none;
        -webkit-tap-highlight-color: transparent;
    }

    .scroll-edge.is-scrolled {
        cursor: pointer;
        pointer-events: auto;
    }

    .scroll-edge[hidden] {
        display: none !important;
    }

    /* Узкий блок внутри широкого (широкий — сам .scroll-edge) */
    .scroll-edge-mark {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 120px;
        height: 100%;
        margin: 0;
        border-radius: 0;
        background: rgba(26, 25, 23, 0.04);
        transform: none;
        opacity: 0;
        transition: opacity 0.2s ease;
        pointer-events: none;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        padding: 36px 8px 0;
    }

    .scroll-edge-mark-inner {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 100%;
        max-width: 100%;
        padding: 0;
        color: var(--muted);
        font-size: 11px;
        font-weight: 600;
        line-height: 1.15;
        text-align: center;
        user-select: none;
    }

    .scroll-edge-mark-arrow {
        flex-shrink: 0;
        font-size: 16px;
        font-weight: 400;
        line-height: 1;
        color: rgba(26, 25, 23, 0.28);
    }

    .scroll-edge-mark-label {
        letter-spacing: 0.02em;
    }

    .scroll-edge:not(.is-scrolled) .scroll-edge-mark {
        opacity: 0 !important;
    }

    /* Проскролили — полоска видна (глубже ~140px) */
    .scroll-edge.is-scrolled-deep .scroll-edge-mark {
        opacity: 0.85;
    }

    .scroll-edge.is-scrolled-deep:hover .scroll-edge-mark {
        opacity: 1;
    }

    /* Чуть проскролили — полоска только едва при hover на широкую зону */
    .scroll-edge.is-scrolled-soft:not(:hover) .scroll-edge-mark {
        opacity: 0;
    }

    .scroll-edge.is-scrolled-soft:hover .scroll-edge-mark {
        opacity: 0.4;
    }

    .scroll-edge.is-scrolled:active .scroll-edge-mark {
        opacity: 1;
    }

    .scroll-edge:focus-visible {
        outline: none;
    }

    .scroll-edge.is-scrolled:focus-visible .scroll-edge-mark {
        opacity: 0.75;
    }
}

header {
    position: relative;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    text-decoration: none;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1;
}

.brand-word {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.brand-oo {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.brand svg.mark {
    display: block;
    width: 28px;
    height: 25px;
    margin: 0 1px;
    flex: none;
}

.header-start,
nav {
    display: flex;
    align-items: center;
    min-width: 0;
}

.header-start { gap: 8px; flex: none; }

nav {
    gap: 10px;
    margin-left: auto;
    color: var(--muted);
    font-size: 13px;
}

nav > span { white-space: nowrap; }

nav a,
header > a:not(.brand):not(.create-goal) {
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

nav a:hover,
nav a.is-on,
header > a:not(.brand):not(.create-goal):hover { color: var(--ink); }

a.create-goal {
    display: inline-flex;
    align-items: center;
    flex: none;
    height: 35px;
    margin-left: auto;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

nav + a.create-goal { margin-left: 0; }

a.create-goal:hover { color: var(--bg); background: #000; }

@media (max-width: 540px) {
    .wrap {
        --pad-x: 16px;
        padding-left: var(--pad-x);
        padding-right: var(--pad-x);
    }
    header { gap: 8px; }
    a.create-goal { padding: 0 10px; }
}

@media (max-width: 480px) {
    header { flex-wrap: wrap; row-gap: 8px; }

    header > nav {
        order: 1;
        flex: 1 0 100%;
        margin-left: 0;
    }

    a.create-goal { margin-left: auto; }
}

.account {
    position: relative;
    display: flex;
    align-items: center;
}

header .avatar-btn {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 50%;
    background: #f3f3f3;
}

header .avatar-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account .menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 81;
    min-width: 168px;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(26, 25, 23, 0.08);
}

.account .menu[hidden] { display: none; }

.account .menu a {
    display: block;
    padding: 9px 12px;
    border-radius: 10px;
    color: var(--ink);
    font-size: 14px;
    text-decoration: none;
}

.account .menu a:hover { background: #f6f6f6; color: var(--ink); }

.locale {
    display: inline-flex;
    margin: 0;
}

.locale-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.locale select {
    margin: 0;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 13px;
}

button {
    border: 0;
    border-radius: 999px;
    padding: 11px 18px;
    background: var(--ink);
    color: var(--bg);
    font: inherit;
    font-size: 14px;
    cursor: pointer;
}

button:disabled { opacity: 0.4; cursor: default; }

.note {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 13px;
}

.empty { padding: 18vh 0 0; }

.empty-title {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.04em;
}

.empty-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.45;
}

.breadcrumbs_wrapper {
    width: 100%;
    min-height: 28px;
    margin: 0 0 16px;
    overflow: visible;
}

.breadcrumbs_wrapper > .inner {
    max-width: 100%;
    margin: 0;
}

ul.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    vertical-align: middle;
}

ul.breadcrumbs > li {
    display: inline-block;
    position: relative;
    margin: 0 28px 0 0;
    line-height: 21px;
}

ul.breadcrumbs > li > a,
ul.breadcrumbs > li > span {
    display: inline-block;
    position: relative;
    vertical-align: middle;
    color: #777;
    font-size: 11px;
    text-transform: uppercase;
    text-decoration: none;
}

ul.breadcrumbs > li > a:hover {
    text-decoration: underline;
}

ul.breadcrumbs > li > a img {
    display: block;
    width: 19px;
    height: 19px;
}

ul.breadcrumbs > li:after {
    content: '';
    position: absolute;
    top: 6px;
    right: -20px;
    display: inline-block;
    border: 5px solid transparent;
    border-left: 6px solid #1a1917;
}

ul.breadcrumbs > li:before {
    content: '';
    position: absolute;
    top: 6px;
    right: -18px;
    z-index: 10;
    display: inline-block;
    border: 5px solid transparent;
    border-left: 6px solid #fff;
}

ul.breadcrumbs > li:last-child > a,
ul.breadcrumbs > li:last-child > span {
    color: #4b5563;
}

ul.breadcrumbs > li:last-child > a:hover {
    color: #4b5563;
    text-decoration: none;
    cursor: default;
}

ul.breadcrumbs > li:last-child:after,
ul.breadcrumbs > li:last-child:before {
    display: none;
}
