/* Tools: link budget calculator, anchor generator, Google updates archive */

.lbt {
    --c-brand: #6666FF;
    --c-naked: #00D37A;
    --c-partial: #CC66FF;
    --c-exact: #FF8A3D;
    border: 1px solid var(--grey);
    border-radius: 24px;
    background: var(--white);
    box-shadow: 0 8px 40px rgba(0, 51, 204, 0.06);
    overflow: hidden;
}

.lbt *,
.lbt *::before,
.lbt *::after {
    box-sizing: border-box;
}

.lbt-budget {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.lbt__form {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 36px;
    margin: 0;
}

.lbt__form--row {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px 16px;
    align-items: end;
    border-bottom: 1px solid var(--grey-15);
}

.lbt__form--row .lbt__field--wide { grid-column: span 3; }
.lbt__form--row .lbt__field { grid-column: span 3; }
.lbt__form--row .lbt__field:nth-of-type(3) { grid-column: span 2; }
.lbt__form--row .lbt__field:nth-of-type(4),
.lbt__form--row .lbt__field:nth-of-type(5) { grid-column: span 2; }
.lbt__form--row .lbt__field--btn { grid-column: 1 / -1; }
.lbt__form--row .lbt__field--btn .lb-btn { width: 100%; }

.lbt__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.lbt__label {
    color: var(--black);
    padding: 0;
}

.lbt__hint {
    color: #8a8f98;
}

.lbt__input {
    width: 100%;
    height: 52px;
    padding: 0 18px;
    border: 1px solid var(--grey);
    border-radius: 14px;
    background: var(--white);
    color: var(--black);
    font: inherit;
    font-size: 15px;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
    appearance: none;
}

select.lbt__input {
    padding-right: 44px;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath stroke='%230B0B1F' stroke-width='1.6' d='m1 1 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 18px center;
    cursor: pointer;
}

.lbt__input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px var(--blue-20);
}

.lbt__input::placeholder { color: #a8adb5; }

/* Segmented age control */
.lbt__seg {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 5px;
    border-radius: 16px;
    background: var(--dark-grey);
}

.lbt__seg-item { position: relative; cursor: pointer; }

.lbt__seg-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lbt__seg-item span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 6px 8px;
    border-radius: 12px;
    color: #4a4a5e;
    text-align: center;
    transition: background .2s, color .2s, box-shadow .2s;
}

.lbt__seg-item:hover span { color: var(--black); }

.lbt__seg-item input:checked + span {
    background: var(--white);
    color: var(--blue);
    box-shadow: 0 2px 10px rgba(11, 11, 31, 0.08);
}

.lbt__seg-item input:focus-visible + span { box-shadow: 0 0 0 3px var(--blue-20); }

/* Budget result */
.lbt__result {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 36px;
    background: linear-gradient(160deg, #f3f3ff 0%, #f6fbf9 100%);
}

.lbt__empty {
    color: #8a8f98;
    text-align: center;
}

.lbt__res { display: flex; flex-direction: column; gap: 22px; }
.lbt__res[hidden], .lbt__empty[hidden] { display: none; }

.lbt__big { display: flex; flex-direction: column; gap: 4px; }
.lbt__big-label { color: #4a4a5e; }

.lbt__big-value {
    font-size: 64px;
    line-height: 1;
    color: var(--blue);
    font-variant-numeric: tabular-nums;
}

.lbt__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.lbt__stats > div {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
}

.lbt__stats dt { color: #8a8f98; margin-bottom: 4px; }
.lbt__stats dd { color: var(--black); font-variant-numeric: tabular-nums; }
.lbt__stats .lbt__stats-wide { grid-column: 1 / -1; border: 1px solid rgba(180, 180, 255, 0.16); background: var(--surface-indigo); }
.lbt__stats .lbt__stats-wide dt { color: rgba(225, 225, 255, 0.66); }
.lbt__stats .lbt__stats-wide dd { color: var(--white); }

.lbt__note {
    padding: 12px 16px;
    border-left: 3px solid var(--green);
    border-radius: 0 12px 12px 0;
    background: var(--green-20);
    color: var(--black);
}

.lbt__note[hidden] { display: none; }
.lbt__order { width: 100%; justify-content: center; text-align: center; }

/* Anchors result */
.lbt__err { grid-column: 1 / -1; color: #e5484d; }
.lbt__err[hidden] { display: none; }

.lbt__anchors { padding: 32px 36px 36px; }
.lbt__anchors[hidden] { display: none; }

.lbt__bar {
    display: flex;
    gap: 3px;
    height: 12px;
    margin-bottom: 28px;
    border-radius: 6px;
    overflow: hidden;
}

.lbt__bar-seg { min-width: 6px; }
.lbt__bar-seg--brand, .lbt__group--brand { --c: var(--c-brand); }
.lbt__bar-seg--naked, .lbt__group--naked { --c: var(--c-naked); }
.lbt__bar-seg--partial, .lbt__group--partial { --c: var(--c-partial); }
.lbt__bar-seg--exact, .lbt__group--exact { --c: var(--c-exact); }
.lbt__bar-seg { background: var(--c); }

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

.lbt__group {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--grey-15);
    border-top: 3px solid var(--c);
    border-radius: 16px;
    background: var(--dark-grey);
    min-width: 0;
}

.lbt__group-head { display: flex; align-items: center; gap: 8px; }

.lbt__group-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--c);
    flex-shrink: 0;
}

.lbt__group-pct {
    margin-left: auto;
    padding: 2px 10px;
    border-radius: 20px;
    background: var(--white);
    color: var(--black);
    white-space: nowrap;
}

.lbt__group-desc { margin: 8px 0 14px; color: #8a8f98; }

.lbt__group-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lbt__group-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--white);
    color: var(--black);
}

.lbt__group-list li span { min-width: 0; overflow-wrap: anywhere; }

.lbt__group-list em {
    margin-left: auto;
    color: #8a8f98;
    font-style: normal;
    font-size: 12px;
    white-space: nowrap;
}

.lbt__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.lbt__actions .lbt__order { width: auto; margin-left: auto; }

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

@media (max-width: 900px) {
    .lbt-budget { grid-template-columns: 1fr; }
    .lbt__big-value { font-size: 52px; }
}

@media (max-width: 767px) {
    .lbt { border-radius: 20px; }
    .lbt__form, .lbt__result, .lbt__anchors { padding: 22px 18px; }
    .lbt__form--row { grid-template-columns: 1fr; }
    .lbt__form--row .lbt__field,
    .lbt__form--row .lbt__field--wide,
    .lbt__form--row .lbt__field:nth-of-type(n) { grid-column: 1 / -1; }
    .lbt__seg { grid-template-columns: 1fr 1fr; }
    .lbt__groups { grid-template-columns: 1fr; }
    .lbt__actions .lb-btn, .lbt__actions .lbt__order { width: 100%; margin-left: 0; justify-content: center; }
    .lbt .lb-btn { padding: 16px 20px; box-sizing: border-box; text-align: center; }
}

/* ---------- Google updates archive ---------- */
.gua__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 24px;
}

.gua__fresh {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--green-20);
    color: var(--black);
}

.gua__pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: gua-pulse 2s infinite;
}

@keyframes gua-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 211, 122, .6); }
    70% { box-shadow: 0 0 0 8px rgba(0, 211, 122, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 211, 122, 0); }
}

.gua__filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 32px;
}

.gua__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--grey);
    border-radius: 30px;
    background: var(--white);
    color: var(--black);
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}

.gua__chip span { color: #8a8f98; }
.gua__chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--k); }
.gua__chip:hover { border-color: var(--blue); }
.gua__chip.is-active { background: #16163A; border-color: #16163A; color: var(--white); }
.gua__chip.is-active span { color: rgba(255, 255, 255, .6); }

.gua__chip--core, .gua__item--core { --k: #6666FF; }
.gua__chip--spam, .gua__item--spam { --k: #e5484d; }
.gua__chip--link, .gua__item--link { --k: #FF8A3D; }
.gua__chip--helpful, .gua__item--helpful { --k: #00B368; }
.gua__chip--discover, .gua__item--discover { --k: #CC66FF; }
.gua__chip--review, .gua__item--review { --k: #E0A800; }
.gua__chip--other, .gua__item--other { --k: #8a8f98; }

.gua__list {
    --gua-pad: 36px;   /* отступ карточек от левого края */
    --gua-rail: 8px;   /* центр вертикальной линии */
    position: relative;
    margin: 0;
    padding: 0 0 0 var(--gua-pad);
    list-style: none;
}

.gua__list::before {
    content: "";
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: calc(var(--gua-rail) - 1px);
    width: 2px;
    background: linear-gradient(var(--blue-20), var(--grey-15));
}

/* Год прилипает под шапкой, следующий год наезжает и сменяет его */
.gua__year {
    position: sticky;
    top: 92px;
    z-index: 3;
    width: fit-content;
    margin: 12px 0 16px calc(var(--gua-pad) * -1);
    padding: 4px 18px 4px var(--gua-pad);
    border-radius: 0 999px 999px 0;
    background: var(--white);
    color: var(--black);
}

body.admin-bar .gua__year { top: 124px; }

.gua__year:first-child { margin-top: 0; }

.gua__year::before {
    content: "";
    position: absolute;
    z-index: 1;
    left: var(--gua-rail);
    top: 50%;
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    border-radius: 50%;
    background: #16163A;
    box-shadow: 0 0 0 4px var(--white);
    transform: translate(-50%, -50%);
}

.gua__item { position: relative; margin-bottom: 16px; scroll-margin-top: 110px; }
.gua__item[hidden], .gua__year[hidden] { display: none; }

.gua__dot {
    position: absolute;
    z-index: 1;
    left: calc(var(--gua-rail) - var(--gua-pad));
    top: 26px;
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--k);
    transform: translateX(-50%);
}

.gua__item.is-ongoing .gua__dot { background: var(--k); animation: gua-pulse 2s infinite; }

.gua__card {
    padding: 22px 26px;
    border: 1px solid var(--grey);
    border-radius: 20px;
    background: var(--white);
    transition: box-shadow .2s, border-color .2s;
}

.gua__card:hover { border-color: #e0e0ff; box-shadow: 0 4px 24px rgba(0, 51, 204, .08); }
.gua__item:target .gua__card { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-20); }

.gua__card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin-bottom: 16px;
}

.gua__tag {
    padding: 4px 10px;
    border-radius: 20px;
    background: color-mix(in srgb, var(--k) 14%, transparent);
    color: var(--k);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.gua__name a { color: var(--black); text-decoration: none; }
.gua__name a:hover { color: var(--blue); }

.gua__dates {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    color: #8a8f98;
}

.gua__days { padding: 2px 8px; border-radius: 10px; background: var(--dark-grey); }

.gua__status {
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--green-20);
    color: #00995a;
}

.gua__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.gua__col {
    padding: 16px 18px;
    border-radius: 14px;
    background: var(--dark-grey);
}

.gua__col p { color: #2d2d40; line-height: 1.6; }
.gua__col--todo { background: #f3f3ff; }

.gua__col-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: var(--black);
}

.gua__col-title::before { content: "↻"; color: #8a8f98; }
.gua__col--todo .gua__col-title::before { content: "→"; color: var(--blue); }

.gua__src {
    display: inline-block;
    margin-top: 12px;
    color: var(--blue);
    text-decoration: none;
}

.gua__src:hover { text-decoration: underline; }

@media (max-width: 767px) {
    .gua__filter { flex-wrap: nowrap; overflow-x: auto; margin-inline: -15px; padding: 0 15px 4px; scrollbar-width: none; }
    .gua__filter::-webkit-scrollbar { display: none; }
    .gua__chip { flex-shrink: 0; }
    .gua__list { --gua-pad: 26px; --gua-rail: 7px; }
    .gua__year { top: 76px; }
    body.admin-bar .gua__year { top: 76px; }
    .gua__year::before { width: 12px; height: 12px; }
    .gua__dot { width: 12px; height: 12px; }
    .gua__card { padding: 18px; }
    .gua__dates { margin-left: 0; width: 100%; }
    .gua__body { grid-template-columns: 1fr; }
}

/* =========================================================
   Unified with the homepage traffic calculator
   ========================================================= */
.lbt {
    border: 1px solid var(--line, #E6E8EF);
    border-radius: 32px;
    background:
        radial-gradient(60% 80% at 100% 0%, rgba(102, 102, 255, 0.08), transparent 60%),
        radial-gradient(50% 70% at 0% 100%, rgba(0, 211, 122, 0.06), transparent 60%),
        #FAFAFD;
    box-shadow: 0 30px 60px -44px rgba(30, 30, 80, 0.35);
}

.lbt__input {
    border-color: #E6E8EF;
    border-radius: 14px;
    background: var(--white);
}

.lbt__input:hover { border-color: rgba(102, 102, 255, 0.35); }

.lbt__result {
    margin: 16px;
    border: 1px solid var(--line, #E6E8EF);
    border-radius: 26px;
    background: var(--surface-soft, linear-gradient(160deg, #f3f3ff 0%, #f6fbf9 100%));
}

@media (max-width: 768px) {
    .lbt { border-radius: 24px; }
    .lbt__result { margin: 10px; border-radius: 20px; }
}
