:root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-soft: #f6f8fc;
    --ink: #172033;
    --muted: #667085;
    --line: #dce2eb;
    --line-strong: #bcc6d4;
    --brand: #3157d5;
    --brand-dark: #233fa8;
    --brand-soft: #eef2ff;
    --orange: #c25116;
    --orange-soft: #fff4e8;
    --red: #b3261e;
    --red-soft: #fce8e6;
    --blue: #1a73e8;
    --blue-soft: #edf4ff;
    --shadow: 0 8px 24px rgba(32, 33, 36, .07);
    --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--bg); }
body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
.icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
    align-items: center;
    gap: 24px;
    min-height: 76px;
    padding: 12px clamp(20px, 4vw, 64px);
    border-bottom: 1px solid rgba(218, 220, 224, .9);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(16px);
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    width: max-content;
    color: var(--ink);
    text-decoration: none;
}
.brand-logo { display: block; width: 174px; height: 40px; }
.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 9px;
    color: #fff;
    background: var(--brand);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .06em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; line-height: 1.2; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 11px; }

.main-nav {
    display: flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
}
.main-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}
.main-nav a:hover, .main-nav a.is-active { color: var(--brand-dark); background: var(--brand-soft); }
.main-nav .icon { width: 17px; height: 17px; }

.user-menu { position: relative; justify-self: end; }
.user-menu > summary { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 5px 7px; border-radius: 8px; cursor: pointer; list-style: none; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover, .user-menu[open] > summary { background: #f3f6fc; }
.user-menu > summary > .icon { width: 16px; height: 16px; transition: transform .16s ease; }
.user-menu[open] > summary > .icon { transform: rotate(90deg); }
.user-menu-popover { position: absolute; z-index: 40; top: calc(100% + 8px); right: 0; width: 310px; padding: 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; box-shadow: 0 18px 42px rgba(31, 48, 78, .16); }
.user-menu-popover > a { display: flex; align-items: center; gap: 11px; padding: 11px; border-radius: 7px; color: var(--text); text-decoration: none; }
.user-menu-popover > a:hover { background: #f3f6fc; }
.user-menu-popover > a .icon { flex: 0 0 auto; color: var(--brand); }
.user-menu-popover > a span { display: grid; gap: 2px; }
.user-menu-popover > a small { color: var(--muted); font-size: 12px; }
.user-menu-label { display: block; padding: 7px 11px 5px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.user-menu-popover > .user-menu-logout { margin-top: 5px; border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; }
.avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid #c7d7fb;
    border-radius: 50%;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-weight: 800;
}
.user-copy { min-width: 0; }
.user-copy strong, .user-copy small { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 13px; }
.user-copy small { color: var(--muted); font-size: 11px; }
.icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    background: var(--surface);
}
.icon-button:hover { color: var(--ink); border-color: var(--line-strong); }

.page-shell {
    width: min(1180px, calc(100% - 40px));
    min-height: calc(100vh - 146px);
    margin: 0 auto;
    padding: 34px 0 60px;
}
.page-narrow { width: min(820px, 100%); margin: 0 auto; }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 22px; color: var(--muted); font-size: 12px; }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs .icon { width: 13px; height: 13px; }

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}
.eyebrow {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
h1, h2, h3 { margin-top: 0; line-height: 1.18; letter-spacing: -.025em; }
h1 { margin-bottom: 8px; font-size: clamp(30px, 4vw, 46px); }
h2 { margin-bottom: 8px; font-size: 23px; }
h3 { margin-bottom: 7px; font-size: 17px; }
.lead { max-width: 720px; margin: 0; color: var(--muted); font-size: 16px; }
.muted { color: var(--muted); }
.text-small { font-size: 12px; }

.button {
    display: inline-flex;
    min-height: 43px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 9px 16px;
    border: 1px solid var(--brand);
    border-radius: 8px;
    color: #fff;
    background: var(--brand);
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
}
.button:hover { border-color: var(--brand-dark); background: var(--brand-dark); }
.button:disabled { cursor: wait; opacity: .68; }
.button-secondary { color: var(--ink); border-color: var(--line-strong); background: var(--surface); }
.button-secondary:hover { color: var(--brand-dark); border-color: #a9bfee; background: var(--brand-soft); }
.button-quiet { color: var(--muted); border-color: transparent; background: transparent; }
.button-quiet:hover { color: var(--ink); border-color: var(--line); background: var(--surface); }
.button-danger { color: var(--red); border-color: #ebc4c4; background: var(--red-soft); }
.button-danger:hover { color: #fff; border-color: var(--red); background: var(--red); }
.button .icon { width: 18px; height: 18px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sr-only {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    margin: -1px;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.tool-directory { padding: 20px 0 24px; }
.tool-directory-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(270px, 360px);
    align-items: end;
    gap: 40px;
    margin-bottom: 30px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--line);
}
.tool-directory-head h1 { margin-bottom: 9px; }
.tool-directory-search {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 46px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fff;
    transition: border-color .16s ease, box-shadow .16s ease;
}
.tool-directory-search:focus-within { border-color: #8da9ed; box-shadow: 0 0 0 3px var(--brand-soft); }
.tool-directory-search > .icon { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.tool-directory-search input[type="search"] { width: 100%; min-width: 0; height: 44px; min-height: 44px; padding: 9px 38px 9px 43px; border: 0; border-radius: 8px; outline: 0; color: var(--ink); background: transparent; box-shadow: none; }
.tool-directory-search input[type="search"]:focus { border: 0; box-shadow: none; }
.tool-directory-search input::placeholder { color: #8993a3; }
.tool-catalog-heading { align-items: end; }
.tool-catalog-heading .tool-directory-search { width: min(360px, 100%); }

.hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
    gap: 50px;
    padding: clamp(32px, 6vw, 66px);
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff, #f5f7fb);
    box-shadow: var(--shadow);
}
.hero::after {
    position: absolute;
    right: -100px;
    bottom: -160px;
    width: 430px;
    height: 430px;
    border: 65px solid rgba(37, 99, 235, .06);
    border-radius: 50%;
    content: "";
}
.hero-copy { position: relative; z-index: 1; }
.hero h1 { max-width: 700px; font-size: clamp(38px, 6vw, 68px); }
.hero .lead { max-width: 650px; font-size: 18px; }
.hero .actions { margin-top: 28px; }
.hero-panel {
    position: relative;
    z-index: 1;
    align-self: center;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, .86);
}
.source-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.source-row:last-child { border-bottom: 0; }
.source-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.source-row span:last-child { margin-left: auto; color: var(--muted); font-size: 12px; }

.section { margin-top: 36px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-heading p { margin: 0; color: var(--muted); }
.tool-grid, .project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool-card, .project-card, .card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 2px 10px rgba(32, 33, 36, .035);
}
.tool-card, .project-card { padding: 22px; }
.tool-card { display: flex; min-height: 230px; flex-direction: column; text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.tool-card:hover { transform: translateY(-2px); border-color: #b8c7ea; box-shadow: var(--shadow); }
.tool-icon {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    margin-bottom: 30px;
    border-radius: 9px;
    color: var(--brand);
    background: var(--brand-soft);
}
.tool-icon .icon { width: 24px; height: 24px; }
.tool-card p { margin: 0; color: var(--muted); }
.tool-card .card-link { display: flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 18px; color: var(--brand); font-weight: 750; }
.tool-card .card-link .icon { width: 16px; height: 16px; }
.tool-card.is-coming { cursor: default; opacity: .62; }
.tool-card.is-coming:hover { transform: none; border-color: var(--line); box-shadow: none; }
.tool-grid-compact { gap: 14px; }
.tool-card-compact {
    display: grid;
    min-height: 148px;
    grid-template-columns: 44px minmax(0, 1fr) 24px;
    align-items: start;
    gap: 15px;
    padding: 20px;
}
.tool-card-compact .tool-icon { width: 44px; height: 44px; margin: 0; border-radius: 8px; }
.tool-card-compact .tool-icon .icon { width: 22px; height: 22px; }
.tool-card-copy { display: grid; min-width: 0; }
.tool-card-copy > strong { margin: 4px 0 6px; font-size: 17px; line-height: 1.25; }
.tool-card-copy > small { color: var(--muted); font-size: 13px; line-height: 1.45; }
.tool-category { color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase; }
.tool-card-arrow { align-self: center; color: #8a94a5; transition: color .16s ease, transform .16s ease; }
.tool-card-arrow .icon { width: 18px; height: 18px; }
.tool-card-compact:hover .tool-card-arrow { color: var(--brand); transform: translateX(2px); }
.tool-directory-empty { min-height: 220px; place-items: center; padding: 40px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.tool-directory-empty:not([hidden]) { display: grid; }
.tool-directory-empty .icon { width: 28px; height: 28px; color: #98a2b3; }
.tool-directory-empty strong { margin-top: 8px; color: var(--ink); font-size: 17px; }
.tool-directory-empty span { font-size: 13px; }

.card { padding: 24px; }
.card + .card { margin-top: 16px; }
.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.card-header p { margin: 0; color: var(--muted); }
.project-card { display: flex; flex-direction: column; min-height: 210px; }
.project-domain { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.project-card .actions { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--line); }
.project-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: max-content;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--muted);
    background: #edf0ed;
    font-size: 11px;
    font-weight: 750;
}
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active, .status-connected, .status-ready { color: var(--brand-dark); background: var(--brand-soft); }
.status-paused, .status-pending, .status-placeholder { color: #925022; background: var(--orange-soft); }
.status-archived, .status-disabled, .status-unavailable { color: #657068; background: #ecefed; }
.status-error { color: var(--red); background: var(--red-soft); }

.alert {
    margin-bottom: 18px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}
.alert-success { color: #174ea6; border-color: #c5d7fb; background: #eef4ff; }
.alert-error { color: var(--red); border-color: #ebc4c4; background: var(--red-soft); }
.alert-warning { color: #85491f; border-color: #efc7a8; background: var(--orange-soft); }
.alert-info { color: var(--blue); border-color: #c6d9ea; background: var(--blue-soft); }
.notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid #c6d9ea;
    border-radius: 12px;
    color: #244c70;
    background: var(--blue-soft);
}

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: block; }
.field-wide { grid-column: 1 / -1; }
.field > span, .field legend { display: block; margin-bottom: 7px; color: #353941; font-size: 12px; font-weight: 750; }
.field small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
input[type="text"], input[type="password"], input[type="date"], input[type="number"], input[type="search"], input[type="url"], select, textarea {
    width: 100%;
    min-height: 43px;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    outline: none;
    color: var(--ink);
    background: var(--surface);
}
textarea { min-height: 100px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .11); }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }

.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segment { position: relative; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span {
    display: block;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--muted);
    background: var(--surface);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}
.segment input:checked + span { color: var(--brand-dark); border-color: #a9bfee; background: var(--brand-soft); }
.segment input:focus-visible + span { outline: 3px solid rgba(37, 99, 235, .18); }

.checkbox-list { display: grid; gap: 9px; }
.check-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    cursor: pointer;
}
.check-card:hover { border-color: var(--line-strong); }
.check-card input { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--brand); }
.check-card strong, .check-card small { display: block; }
.check-card small { margin-top: 2px; color: var(--muted); }
.check-card .status { margin-left: auto; }
.check-card.is-disabled { opacity: .58; cursor: not-allowed; }
.source-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}
.source-card:hover { border-color: var(--line-strong); }
.source-card.is-disabled { opacity: .58; }
.source-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px;
    cursor: pointer;
}
.source-main > input, .nested-check > input, .switch-check > input {
    width: 17px;
    height: 17px;
    margin: 3px 0 0;
    accent-color: var(--brand);
}
.source-main > span { min-width: 0; }
.source-main strong, .source-main small, .nested-check strong, .nested-check small { display: block; }
.source-main small, .nested-check small { margin-top: 2px; color: var(--muted); }
.source-main .status { margin-left: auto; }
.nested-options {
    margin: 0 13px 13px 42px;
    padding: 10px 12px;
    border-left: 3px solid #b7c9f5;
    border-radius: 0 7px 7px 0;
    background: #f2f6ff;
}
.nested-check { display: flex; align-items: flex-start; gap: 10px; padding: 7px 4px; cursor: pointer; }
.nested-check + .nested-check { border-top: 1px solid rgba(218, 220, 224, .8); }
.ahrefs-panel {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
}
.ahrefs-panel + .ahrefs-panel { margin-top: 16px; }
.ahrefs-object-settings { margin-bottom: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.ahrefs-object-settings .subsection-head { margin-bottom: 0; }
.ahrefs-object-settings .conditional.is-visible { margin-top: 12px; }
.subsection-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.subsection-head h3 { margin-bottom: 4px; }
.subsection-head p { margin: 0; color: var(--muted); font-size: 12px; }
.section-compact { margin-top: 14px; }
.switch-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    color: var(--brand-dark);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
}
.field-error { color: var(--red) !important; }
.searchable-select-field { position: relative; z-index: 2; align-self: start; }
.searchable-select-field:focus-within { z-index: 30; }
.step-card.has-open-select, .project-editor.has-open-select { overflow: visible; }
.searchable-select-native {
    display: none !important;
}
.searchable-select { position: relative; width: 100%; }
.searchable-select-trigger {
    display: grid;
    width: 100%;
    min-height: 43px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 11px 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: var(--ink);
    background: var(--surface);
    cursor: pointer;
    text-align: left;
}
.searchable-select-trigger:hover { border-color: #9fb0c6; }
.searchable-select-trigger:focus-visible, .searchable-select.is-open .searchable-select-trigger { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 3px rgba(37, 99, 235, .11); }
.searchable-select-trigger.is-invalid { border-color: var(--red); }
.searchable-select-trigger:disabled { color: #8c96a6; background: #f4f6f8; cursor: not-allowed; }
.searchable-select-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.searchable-select-chevron { width: 17px; height: 17px; color: var(--muted); transition: transform .15s ease; }
.searchable-select.is-open .searchable-select-chevron { transform: rotate(180deg); }
.searchable-select-panel {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    min-width: min(100%, 320px);
    padding: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(31, 48, 78, .17);
}
.searchable-select-panel[hidden] { display: none; }
.searchable-select-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: #f8faff; }
.searchable-select-search .icon { width: 17px; height: 17px; flex: 0 0 auto; color: var(--muted); }
.searchable-select-search input[type="search"] { min-height: 38px; padding: 6px 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.searchable-select-options { max-height: 286px; margin-top: 7px; overflow-y: auto; overscroll-behavior: contain; }
.searchable-select-option {
    display: grid;
    width: 100%;
    min-height: 38px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 9px;
    border: 0;
    border-radius: 6px;
    color: #263244;
    background: transparent;
    cursor: pointer;
    text-align: left;
}
.searchable-select-option:hover, .searchable-select-option.is-active { background: #f0f4ff; }
.searchable-select-option[aria-selected="true"] { color: var(--brand-dark); background: var(--brand-soft); font-weight: 750; }
.searchable-select-check { width: 16px; height: 16px; color: var(--brand); opacity: 0; }
.searchable-select-option[aria-selected="true"] .searchable-select-check { opacity: 1; }
.searchable-select-empty { padding: 18px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.searchable-select-empty[hidden] { display: none; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.button-small { min-height: 36px; padding: 7px 11px; font-size: 12px; }
.project-editor { padding: 0; overflow: hidden; }
.project-editor-head { margin: 0; padding: 24px 26px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.form-section { padding: 26px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 13px;
    margin-bottom: 20px;
}
.form-section-number {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid #c9d4f3;
    border-radius: 7px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: 11px;
    font-weight: 850;
}
.form-section-head h3 { margin: 1px 0 3px; font-size: 17px; }
.form-section-head p { margin: 0; color: var(--muted); font-size: 12px; }
.project-editor > .actions { margin: 0; padding: 20px 26px 26px; background: #fbfcfe; }
.service-picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.service-picker {
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.service-picker.is-wide { grid-column: 1 / -1; }
.service-picker-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 11px;
    min-height: 58px;
    margin-bottom: 14px;
}
.service-picker-head .tool-icon { width: 38px; height: 38px; margin: 0; border-radius: 7px; }
.service-picker-head .tool-icon .icon { width: 19px; height: 19px; }
.service-picker-head h4 { margin: 1px 0 2px; font-size: 14px; }
.service-picker-head p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.topvisor-project-settings { display: grid; gap: 18px; }
.topvisor-client-toggle { padding: 13px 14px; border: 1px solid #d8e2ef; border-radius: 7px; background: #f8fbff; }
.topvisor-period { border-left: 3px solid #2f9bd7; }
.topvisor-group-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.topvisor-document-bullet { font-weight: 400; }
.topvisor-donut-value { fill: #238e69; font-size: 25px; font-weight: 700; }
.topvisor-donut-label { fill: #7b8795; font-size: 10px; font-weight: 600; }
[data-provider-section][hidden] { display: none !important; }

.project-catalog-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 26px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f8faff;
}
.project-catalog-actions, .project-catalog-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.catalog-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: min(310px, 80vw);
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: #fff;
}
.catalog-search .icon { width: 18px; height: 18px; color: var(--muted); }
.catalog-search input { min-width: 0; min-height: 38px; padding: 0; border: 0; box-shadow: none !important; background: transparent; }
.view-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.view-switch button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 9px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; cursor: pointer; font-size: 12px; font-weight: 750; }
.view-switch button.is-active { color: var(--brand-dark); background: var(--brand-soft); }
.view-switch .icon { width: 16px; height: 16px; }
.catalog-heading { align-items: center; }
.catalog-more { display: flex; justify-content: center; margin-top: 22px; }
.project-grid [hidden] { display: none !important; }
.project-grid.is-list { display: grid; grid-template-columns: 1fr; gap: 8px; }
.project-grid.is-list .project-card {
    display: grid;
    grid-template-columns: 120px minmax(220px, 1fr) auto;
    align-items: center;
    gap: 18px;
    min-height: auto;
    padding: 15px 17px;
}
.project-grid.is-list .project-meta { margin: 0; }
.project-grid.is-list .project-card-main h3 { margin: 0 0 2px; font-size: 15px; }
.project-grid.is-list .project-domain { margin: 0; }
.project-grid.is-list .project-card .actions { margin: 0; padding: 0; border: 0; }
.project-aside-search { min-width: 0; width: 100%; margin-bottom: 12px; }
.project-aside-list { max-height: calc(100vh - 270px); overflow: auto; padding-right: 4px; }
.project-aside-list [hidden] { display: none; }
.integration-setup-list { display: grid; gap: 14px; }
.integration-setup {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}
.integration-setup-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    margin-bottom: 14px;
}
.integration-setup-head h3 { margin: 1px 0 3px; }
.integration-setup-head p { margin: 0; color: var(--muted); font-size: 12px; }
.connection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.connection-card { display: flex; flex-direction: column; margin: 0 !important; }
.connection-card .card-header { min-height: 90px; }
.connection-toggle { margin-bottom: 18px; }
.secret-fields { display: grid; gap: 14px; }
.connection-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 18px 0;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
}
.connection-card .button { align-self: flex-start; margin-top: auto; }
code { padding: 2px 5px; border-radius: 4px; background: #f0f1f3; font-family: Consolas, "Courier New", monospace; font-size: .92em; }

.builder-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.builder-main { display: grid; gap: 16px; }
.builder-aside { position: sticky; top: 96px; }
.step-card { padding: 0; overflow: hidden; }
.step-head {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}
.step-number { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 7px; color: var(--brand-dark); background: var(--brand-soft); font-size: 12px; font-weight: 850; }
.step-head h2 { margin: 0; font-size: 18px; }
.step-head p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.step-body { padding: 22px; }
.conditional { display: none; margin-top: 14px; }
.conditional.is-visible { display: block; }
.conditional.form-grid.is-visible { display: grid; }
.summary-list { margin: 0; padding: 0; list-style: none; }
.summary-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary-list li:last-child { border-bottom: 0; }
.summary-list span { color: var(--muted); }
.summary-list strong { text-align: right; }
.unit-box { margin-top: 16px; padding: 16px; border-radius: 8px; color: #754116; background: var(--orange-soft); }
.unit-box strong { display: block; font-size: 26px; }
.unit-box small { display: block; margin-top: 3px; }
.ahrefs-quota-compact { display: grid; gap: 4px; margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(117, 65, 22, .2); }
.ahrefs-quota-compact strong { font-size: 17px; }
.usage-meter { overflow: hidden; height: 6px; margin-top: 4px; border-radius: 999px; background: rgba(117, 65, 22, .14); }
.usage-meter span { display: block; height: 100%; border-radius: inherit; background: #d97706; }
.sticky-action { width: 100%; margin-top: 16px; }

.report-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}
.report-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.ahrefs-usage-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; margin: 0 0 20px; padding: 14px 16px; border: 1px solid #f0d5ad; border-radius: 8px; background: #fffaf2; }
.ahrefs-usage-strip > div { display: grid; gap: 2px; }
.ahrefs-usage-strip span, .ahrefs-usage-strip small { color: var(--muted); font-size: 12px; }
.ahrefs-usage-strip strong { font-size: 15px; }
.google-docs-export { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.google-docs-export-title { display: grid; width: min(340px, 100%); gap: 5px; color: var(--muted); font-size: 11px; text-align: left; }
.google-docs-export-title input { width: 100%; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: #fff; font: inherit; font-size: 13px; }
.google-docs-export-title input:focus { border-color: var(--brand); outline: 3px solid var(--brand-soft); }
.google-docs-export-status { max-width: 300px; color: var(--muted); font-size: 11px; line-height: 1.35; text-align: right; }
.google-docs-export-status.is-progress { color: var(--brand-dark); }
.google-docs-export-status.is-success { color: #19703d; }
.google-docs-export-status.is-error { color: var(--red); }
.google-docs-export-status a { font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.report-block { overflow: hidden; }
.report-block-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.report-block-head h2 { margin: 0; }
.report-block-head .status { margin-left: auto; }
.report-source {
    --source-accent: var(--brand);
    --source-accent-soft: var(--brand-soft);
    --source-ink: var(--ink);
    position: relative;
    border-top: 3px solid var(--source-accent);
}
.report-source .report-block-head > .tool-icon {
    color: var(--source-ink);
    background: var(--source-accent-soft);
}
.report-source-metrika {
    --source-accent: #ffcc00;
    --source-accent-soft: #fff8d6;
    --source-ink: #222222;
}
.report-source-gsc {
    --source-accent: #1a73e8;
    --source-accent-soft: #e8f0fe;
    --source-ink: #174ea6;
}
.report-source-ahrefs {
    --source-accent: #ff6b35;
    --source-accent-soft: #fff0ea;
    --source-ink: #b93812;
}
.report-source-moo {
    --source-accent: #6d5ce7;
    --source-accent-soft: #f0edff;
    --source-ink: #5144b5;
}
.report-source-shtab {
    --source-accent: #4f5968;
    --source-accent-soft: #eef0f3;
    --source-ink: #343b46;
}
.source-native {
    margin: 18px -24px -24px;
    color: #202124;
    background: #fff;
}
.source-toolbar {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 18px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.source-toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.source-filter {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 5px 10px;
    border: 1px solid #d8dce2;
    border-radius: 5px;
    color: #4e5661;
    background: #fff;
    font-size: 11px;
    line-height: 1.2;
}
.source-filter.is-primary { color: var(--source-ink); border-color: #a9bfee; }
.report-source-metrika .source-filter.is-primary { border-color: #e3bd19; }
.report-source-ahrefs .source-filter.is-primary { border-color: #f0a184; }
.source-toolbar-action { color: #6c737d; font-size: 11px; white-space: nowrap; }
.source-metrics {
    display: grid;
    border-bottom: 1px solid var(--line);
    background: #fff;
}
.source-metrics-metrika, .source-metrics-ahrefs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.source-metrics-gsc { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 16px 18px; }
.source-metric {
    min-width: 0;
    min-height: 90px;
    padding: 14px 16px;
    border-right: 1px solid var(--line);
    border-top: 3px solid transparent;
    background: #fff;
}
.source-metric:last-child { border-right: 0; }
.source-metric.is-active { border-top-color: var(--source-accent); background: var(--source-accent-soft); }
.source-metric span, .source-metric strong, .source-metric small { display: block; }
.source-metric span { overflow: hidden; color: #66707c; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.source-metric strong { margin-top: 7px; color: var(--source-ink); font-size: 25px; font-weight: 520; line-height: 1.1; }
.source-metric small { margin-top: 6px; color: #8a919b; font-size: 10px; }
.source-value-empty { opacity: .42; }
.source-chart-shell { border-bottom: 1px solid var(--line); background: #fff; }
.source-chart-toolbar {
    display: flex;
    min-height: 48px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px 8px;
}
.source-chart-toolbar > strong { color: #353a42; font-size: 15px; font-weight: 600; }
.source-chart-legend { display: flex; flex-wrap: wrap; gap: 14px; color: #6d737c; font-size: 14px; }
.source-chart-legend i {
    display: inline-block;
    width: 18px;
    height: 3px;
    margin-right: 6px;
    border-radius: 2px;
    background: var(--source-accent);
    vertical-align: middle;
}
.source-legend-2 i { opacity: .42; }
.report-source-gsc .source-legend-1 i { background: #1a73e8; }
.report-source-gsc .source-legend-2 i { background: #7e57c2; opacity: 1; }
.source-chart {
    position: relative;
    min-height: 280px;
    padding: 0 18px 12px;
    border: 0;
    background: #fff;
}
.source-chart-svg { display: block; width: 100%; height: 260px; }
.source-chart-grid line { stroke: #e7e9ed; stroke-width: 1; vector-effect: non-scaling-stroke; }
.source-chart-axis line { stroke: #cbd0d7; stroke-width: 1; vector-effect: non-scaling-stroke; }
.source-chart-line {
    fill: none;
    stroke: var(--source-chart-primary, var(--source-accent));
    stroke-width: 2.5;
    vector-effect: non-scaling-stroke;
}
.source-chart-line-2 { opacity: .42; }
.report-source-gsc .source-chart-line-1 { stroke: #1a73e8; }
.report-source-gsc .source-chart-line-2 { stroke: #7e57c2; opacity: 1; }
.source-chart-message {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: min(390px, calc(100% - 70px));
    gap: 4px;
    padding: 13px 16px;
    transform: translate(-50%, -42%);
    border: 1px solid #e0e3e8;
    border-radius: 6px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 3px 12px rgba(32, 33, 36, .06);
    text-align: center;
}
.source-chart-message strong { color: #3f454d; font-size: 12px; }
.source-chart-message span { color: #777f89; font-size: 11px; }
.source-table-panel { background: #fff; }
.source-tabs {
    display: flex;
    min-height: 46px;
    align-items: flex-end;
    gap: 22px;
    overflow-x: auto;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.source-tab {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    border-bottom: 3px solid transparent;
    color: #68707b;
    font-size: 11px;
    font-weight: 600;
    appearance: none;
    cursor: pointer;
    background: transparent;
    padding-right: 0;
    padding-left: 0;
}
.source-tab.is-active { color: var(--source-ink); border-bottom-color: var(--source-accent); }
.source-table { overflow-x: auto; margin: 0; border: 0; border-radius: 0; background: #fff; }
.source-table table { min-width: 700px; }
.source-table th {
    height: 44px;
    padding: 10px 13px;
    color: #5f6670;
    border-bottom: 1px solid #dfe2e7;
    background: #f8f9fa;
    font-size: 10px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}
.source-table th:not(:first-child), .source-table td:not(:first-child) { text-align: right; }
.source-table .source-table-primary { width: 42%; text-align: left; }
.source-table-empty {
    height: 82px;
    color: #8a919a;
    background: #fff;
    font-size: 11px;
    text-align: center !important;
    vertical-align: middle;
}

/* Яндекс Метрика: светлая таблица, жёлтый активный показатель и фиолетовая серия. */
.report-source-metrika { --source-chart-primary: #7c5ce7; }
.report-source-metrika .source-chart-legend i { background: var(--source-chart-primary); }
.report-source-metrika .source-tab.is-active { color: #222; }
.report-source-metrika .source-table th { color: #4d5056; background: #fbfbfc; }

/* Search Console: четыре цветные карточки метрик как в отчёте Performance. */
.report-source-gsc { --gsc-blue: #1a73e8; --gsc-purple: #7e57c2; --gsc-green: #0f9d58; --gsc-orange: #f29900; }
.report-source-gsc .source-metric {
    min-height: 104px;
    border: 0;
    border-radius: 5px;
    color: #fff;
}
.report-source-gsc .source-metric span,
.report-source-gsc .source-metric strong,
.report-source-gsc .source-metric small { color: inherit; }
.report-source-gsc .metric-clicks { background: var(--gsc-blue); }
.report-source-gsc .metric-impressions { background: var(--gsc-purple); }
.report-source-gsc .metric-ctr { background: var(--gsc-green); }
.report-source-gsc .metric-position { background: var(--gsc-orange); }
.report-source-gsc .source-value-empty { opacity: .72; }
.report-source-gsc .source-tabs { justify-content: center; }
.report-source-moo .source-native { --source-ink: #5144b5; }
.source-metrics-moo { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 16px 18px; }
.source-metrics-moo.has-hours { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.report-source-moo .source-metric {
    min-height: 96px;
    color: #fff;
    border: 0;
    border-radius: 5px;
}
.report-source-moo .source-metric span,
.report-source-moo .source-metric strong,
.report-source-moo .source-metric small { color: inherit; }
.report-source-moo .metric-moo-count { background: #6756dd; }
.report-source-moo .metric-moo-plan { background: #3c76d2; }
.report-source-moo .metric-moo-actual { background: #25866d; }
.report-source-moo .metric-moo-comments { background: #776345; }
.moo-report-text { margin-top: 8px; color: #5f6670; font-size: 12px; line-height: 1.55; white-space: normal; }

/* Ahrefs: плотные метрики Overview и нейтральная SEO-таблица с оранжевым акцентом. */
.report-source-ahrefs .source-metric strong { color: #242a33; font-weight: 650; }
.report-source-ahrefs .source-metric small { color: #ff6b35; font-weight: 700; }
.report-source-ahrefs .source-chart-legend i { background: #2684ff; }
.report-source-ahrefs .source-table th { color: #3f4752; background: #f5f6f7; }
.report-empty { display: grid; min-height: 180px; place-items: center; padding: 28px; text-align: center; }
.report-empty .tool-icon { margin: 0 auto 14px; }
.report-empty p { max-width: 520px; margin: 0; color: var(--muted); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: var(--surface-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }

.login-page { display: grid; min-height: 100vh; grid-template-columns: 1.1fr .9fr; }
.login-brand {
    position: relative;
    overflow: hidden;
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(34px, 6vw, 80px);
    color: #f8faff;
    background: #202735;
}
.login-brand::before, .login-brand::after {
    position: absolute;
    border: 80px solid rgba(255, 255, 255, .06);
    border-radius: 50%;
    content: "";
}
.login-brand::before { right: -180px; bottom: -210px; width: 520px; height: 520px; }
.login-brand::after { right: 120px; bottom: 40px; width: 180px; height: 180px; }
.login-brand .brand { position: relative; z-index: 1; color: #fff; }
.login-brand .brand { padding: 9px 11px; border-radius: 8px; background: #fff; }
.login-message { position: relative; z-index: 1; max-width: 610px; }
.login-message h1 { font-size: clamp(42px, 6vw, 76px); }
.login-message p { max-width: 540px; color: #c7cfdd; font-size: 18px; }
.login-form-wrap { display: grid; place-items: center; padding: 34px; background: var(--bg); }
.login-card { width: min(430px, 100%); padding: 34px; }
.login-card h1 { font-size: 32px; }
.login-card .button { width: 100%; margin-top: 8px; }
.login-help { margin-top: 22px; color: var(--muted); font-size: 12px; text-align: center; }
.auth-links { display: flex; justify-content: center; margin-top: 16px; font-size: 12px; }
.auth-links a { color: var(--brand); font-weight: 700; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
.login-help.auth-invite-note { margin-top: 8px; }
.auth-card-wide { width: min(480px, 100%); }
.auth-state-card .button { margin-top: 20px; }
.auth-page .alert { margin: 18px 0; }
.auth-page .field + .field { margin-top: 14px; }
.auth-page .field + .button { margin-top: 20px; }

.account-heading { max-width: 850px; }
.account-security-card { max-width: 850px; }
.account-identity { display: flex; align-items: baseline; gap: 10px; margin-bottom: 20px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.account-identity strong { font-size: 15px; }
.account-identity span { color: var(--muted); font-size: 12px; }
.account-password-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.empty-state { padding: 50px 24px; text-align: center; }
.empty-state .tool-icon { margin: 0 auto 16px; }
.empty-state p { max-width: 520px; margin: 0 auto 20px; color: var(--muted); }
.footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 18px clamp(20px, 4vw, 64px);
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11px;
}

.builder-project-step { order: 1; }
.builder-period-step { order: 2; }
.builder-sources-step { order: 3; }
.builder-data-period-step { order: 4; }
.builder-main > .step-card:not(.builder-period-step):not(.builder-project-step):not(.builder-sources-step):not(.builder-data-period-step) { order: 5; }
.period-copy-button { white-space: nowrap; align-self: center; }
.nested-hint { margin: 2px 4px 6px; color: var(--muted); font-size: 11px; }
.preset-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 360px) auto; align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px 16px; border-left: 3px solid var(--brand); }
.preset-toolbar strong, .preset-toolbar small { display: block; }
.preset-toolbar small { color: var(--muted); font-size: 11px; }
.preset-links { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 5px; }
.preset-chip { display: inline-flex; align-items: stretch; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.preset-chip:hover { border-color: var(--line-strong); }
.preset-chip.is-active { border-color: #b9cdfd; background: var(--brand-soft); }
.preset-chip a { display: inline-flex; align-items: center; padding: 5px 8px; color: var(--brand); font-size: 11px; font-weight: 650; text-decoration: none; }
.preset-chip.is-active a { color: var(--ink); }
.preset-delete { display: inline-flex; align-items: center; justify-content: center; width: 28px; padding: 0; color: var(--muted); border: 0; border-left: 1px solid var(--line); background: transparent; cursor: pointer; }
.preset-delete:hover { color: var(--red); background: var(--red-soft); }
.preset-delete .icon { width: 13px; height: 13px; }
.repeatable-periods { display: grid; gap: 14px; }
.repeatable-period { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.repeatable-period + .repeatable-period { border-color: #cbd7ee; background: #fbfcff; }
.repeatable-period-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.repeatable-period-head > strong { color: var(--ink); font-size: 14px; }
.repeatable-period-head.subsection-head { margin-bottom: 16px; }
.repeatable-remove { flex: 0 0 auto; color: var(--muted); }
.repeatable-remove:hover { color: var(--red); border-color: #efb8b8; background: var(--red-soft); }
.button-add-period { width: 100%; justify-content: center; margin-top: 14px; border: 1px dashed #9eb6e8; color: var(--brand); background: #f7f9ff; }
.button-add-period:hover { border-color: var(--brand); background: var(--brand-soft); }
.report-period-label { display: grid; gap: 4px; margin: 22px 0 10px; padding: 8px 10px; border-left: 3px solid var(--brand); color: var(--ink); background: #f5f8ff; font-size: 12px; font-weight: 700; }
.report-period-label:first-child { margin-top: 0; }
.report-period-target { color: var(--muted); font-weight: 400; overflow-wrap: anywhere; word-break: break-word; }
.report-period-target strong { color: var(--ink); font-weight: 700; }
.compact-project-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, .75fr); align-items: end; gap: 18px; }
.compact-project-select { margin: 0; }
.project-inline-meta { padding: 12px 14px; border-left: 3px solid var(--brand); background: var(--surface-soft); }
.project-inline-meta strong, .project-inline-meta span { display: block; }
.project-inline-meta span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.date-shift-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 14px; }
.mapping-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mapping-table { width: 100%; min-width: 0; table-layout: fixed; }
.mapping-table th, .mapping-table td { overflow-wrap: anywhere; word-break: normal; }
.mapping-table .mapping-col-task { width: 28%; }
.mapping-table .mapping-col-text { width: 29%; }
.mapping-table .mapping-col-category { width: 11%; }
.mapping-table .mapping-col-project { width: 10%; }
.mapping-table .mapping-col-editor { width: 10%; }
.mapping-table .mapping-col-actions { width: 12%; }
.mapping-table td small { display: block; margin-top: 4px; color: var(--muted); }
.mapping-report-text { line-height: 1.45; }
.mapping-alias-count { display: inline-flex; margin-top: 9px; padding: 3px 7px; border-radius: 999px; color: #3454b7; background: #eef3ff; font-size: 11px; font-weight: 700; cursor: help; }
.mapping-list-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.mapping-actions { vertical-align: top; }
.mapping-actions > * { display: block; margin: 0 0 9px; }
.mapping-actions > *:last-child { margin-bottom: 0; }
.mapping-actions form { margin: 0; }
.archive-confirm { position: relative; }
.archive-confirm > summary { cursor: pointer; list-style: none; }
.archive-confirm > summary::-webkit-details-marker { display: none; }
.archive-confirm form { position: absolute; z-index: 12; top: calc(100% + 7px); left: 0; width: 260px; padding: 14px; border: 1px solid #f1c2bd; border-radius: 8px; background: #fff; box-shadow: 0 14px 34px rgba(42, 48, 61, .15); }
.archive-confirm form p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.button-danger { border-color: #c83f37; background: #c83f37; color: #fff; }
.mapping-audit-table td:first-child { white-space: nowrap; }
.legacy-import-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; border-left: 4px solid #ff7a45; background: #fffaf7; }
.legacy-import-card h2 { margin-bottom: 6px; }
.legacy-import-card p:last-child { max-width: 760px; margin: 0; color: var(--muted); }
.legacy-import-card form { flex: 0 0 auto; }

.danger-zone { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .7fr); align-items: end; gap: 28px; margin-top: 20px; border-color: #edc5c2; background: #fffafa; }
.danger-zone h2 { margin: 3px 0 6px; }
.danger-zone p:last-child { margin: 0; color: var(--muted); }
.danger-zone-form { display: grid; gap: 10px; }
.danger-zone-form .button { justify-self: start; }

@media (max-width: 760px) {
    .danger-zone { grid-template-columns: 1fr; }
    .danger-zone-form .button { width: 100%; }
    .ahrefs-usage-strip { align-items: flex-start; flex-direction: column; }
}

.report-document {
    max-width: 1040px;
    margin: 0 auto;
    padding: clamp(32px, 5vw, 64px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(23, 32, 51, .06);
}
.report-document-title { max-width: 900px; margin: 0 auto 54px; text-align: center; }
.report-document-title h1 { margin: 0; font-size: clamp(30px, 4.2vw, 48px); font-weight: 620; line-height: 1.22; }
.report-document-section > h2:first-child { margin-top: 0; }
.report-document h2 { margin-top: 48px; margin-bottom: 22px; font-size: 29px; font-weight: 620; }
.report-document .document-major-title { margin-top: 58px; padding-top: 30px; border-top: 1px solid var(--line); font-size: 34px; }
.report-document-section > .document-major-title:first-child { padding-top: 0; border-top: 0; }
.document-bullet {
    position: relative;
    margin: 34px 0 10px;
    padding-left: 25px;
    font-size: 19px;
    font-weight: 650;
}
.document-bullet::before { position: absolute; top: .56em; left: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); content: ""; }
.document-caption { margin: 0 0 18px; color: #3f495a; font-size: 14px; }
.document-narrative { max-width: 850px; margin: 0 0 20px; color: #273142; font-size: 16px; line-height: 1.7; }
.document-gap-after { margin-bottom: 34px; }
.document-subtitle { margin: 28px 0 12px; font-size: 19px; font-weight: 620; }
.quality-score { display: inline-flex; align-items: baseline; gap: 8px; margin: 0 0 8px 25px; padding: 10px 14px; border: 1px solid #f1cbbd; border-radius: 7px; background: #fff7f3; }
.quality-score span, .quality-score small { color: var(--muted); font-size: 11px; }
.quality-score strong { color: #df5f32; font-size: 25px; }
.document-source-error { display: flex; align-items: flex-start; gap: 12px; margin: 22px 0; padding: 14px 16px; border-left: 3px solid var(--red); color: var(--red); background: var(--red-soft); }
.document-source-error span { color: #6f3936; }
.document-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 16px 0 0; border: 1px solid var(--line); border-bottom: 0; border-radius: 7px 7px 0 0; overflow: hidden; }
.document-metrics.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.document-metric {
    --metric-color: #3157d5;
    min-height: 126px;
    padding: 16px;
    border-right: 1px solid var(--line);
    border-top: 4px solid var(--metric-color);
    background: #fff;
    cursor: pointer;
}
.document-metric.metric-visits { --metric-color: #7058d7; }
.document-metric.metric-users { --metric-color: #138a80; }
.document-metric.metric-clicks { --metric-color: #4285f4; }
.document-metric.metric-impressions { --metric-color: #673ab7; }
.document-metric.metric-ctr { --metric-color: #0f9d58; }
.document-metric.metric-position { --metric-color: #f29900; }
.document-metric:last-child { border-right: 0; }
.document-metric.is-static { cursor: default; }
.document-metric.is-selected { color: #fff; background: var(--metric-color); }
.document-metric.is-selected .document-metric-label,
.document-metric.is-selected strong,
.document-metric.is-selected small { color: #fff; }
.document-metric-label { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.document-metric input { width: 16px; height: 16px; margin: 0; accent-color: currentColor; }
.document-metric strong { display: block; margin-top: 13px; font-size: 27px; line-height: 1; }
.document-metric small { display: block; margin-top: 8px; opacity: .78; font-size: 11px; }
.document-metric .document-metric-delta { margin-top: 3px; opacity: 1; font-weight: 700; }
.document-metric .document-metric-delta.is-up { color: #0d8b5f; }
.document-metric .document-metric-delta.is-down { color: #c9483d; }
.document-metric.is-selected .document-metric-delta { color: #fff; }
.document-chart { margin: 0 0 30px; border: 1px solid var(--line); border-radius: 0 0 7px 7px; background: #fff; overflow: hidden; }
.document-chart:not(:has(+ *)) { border-radius: 7px; }
.document-chart-toolbar { border-bottom: 1px solid #edf1f5; background: #fff; }
.document-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.document-chart-head > strong { flex: 0 0 auto; white-space: nowrap; font-size: 16px; }
.document-chart-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px; }
.document-period-legend { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 14px; }
.document-period-legend span { display: inline-flex; align-items: center; gap: 5px; }
.document-period-legend i { width: 22px; border-top: 3px solid #7a8493; }
.document-period-legend i.is-dashed { border-top-style: dashed; }
.document-chart-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; }
.document-chart-foot { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 10px 16px; border-top: 1px solid #edf1f5; background: #fff; }
.document-chart-foot .document-chart-controls { justify-content: flex-start; gap: 10px 20px; }
.chart-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; font-size: 14px; }
.chart-toggle input { width: 18px; height: 18px; margin: 0; }
.chart-toggle i { width: 22px; height: 5px; border-radius: 3px; background: #7a8493; flex: 0 0 auto; }
.chart-toggle input[data-chart-toggle="visits"] + i { background: #7058d7; }
.chart-toggle input[data-chart-toggle="users"] + i { background: #138a80; }
.chart-toggle input[data-chart-toggle="clicks"] + i { background: #4285f4; }
.chart-toggle input[data-chart-toggle="impressions"] + i { background: #673ab7; }
.chart-toggle input[data-chart-toggle="ctr"] + i { background: #0f9d58; }
.chart-toggle input[data-chart-toggle="position"] + i { background: #f29900; }
.chart-toggle input[data-chart-toggle^="sheets_yandex_"] + i { background: #ea4335; }
.chart-toggle input[data-chart-toggle^="sheets_google_"] + i { background: #4285f4; }
.chart-toggle input[data-chart-toggle^="sheets_total_"] + i { background: #f9ab00; }
.chart-toggle input[data-chart-toggle="organic_traffic"] + i,
.chart-toggle input[data-chart-toggle="refdomains"] + i,
.chart-toggle input[data-chart-toggle="main"] + i,
.chart-toggle input[data-chart-toggle="main_keywords"] + i,
.chart-toggle input[data-chart-toggle="main_links"] + i { background: #2f7de1; }
.chart-toggle input[data-chart-toggle="keywords"] + i { background: #ff7a45; }
.chart-toggle input[data-chart-toggle^="competitor_"][data-chart-toggle$="_0"] + i,
.chart-toggle input[data-chart-toggle="competitor_0"] + i { background: #f26c3d; }
.chart-toggle input[data-chart-toggle^="competitor_"][data-chart-toggle$="_1"] + i,
.chart-toggle input[data-chart-toggle="competitor_1"] + i { background: #13a38e; }
.chart-toggle input[data-chart-toggle^="competitor_"][data-chart-toggle$="_2"] + i,
.chart-toggle input[data-chart-toggle="competitor_2"] + i { background: #8a5bd2; }
.chart-toggle input[data-chart-toggle^="competitor_"][data-chart-toggle$="_3"] + i,
.chart-toggle input[data-chart-toggle="competitor_3"] + i { background: #d3a21c; }
.chart-toggle input[data-chart-toggle^="competitor_"][data-chart-toggle$="_4"] + i,
.chart-toggle input[data-chart-toggle="competitor_4"] + i { background: #cf4c73; }
.document-chart-canvas { position: relative; min-height: 330px; padding: 8px 12px 2px; }
.document-chart svg { display: block; width: 100%; height: 310px; overflow: visible; }
.chart-grid-line { stroke: #e6e9ef; stroke-width: 1; }
.chart-axis-line { stroke: #aeb6c2; stroke-width: 1.2; }
.chart-axis-label { fill: #596579 !important; color: #596579; font-size: 14px; font-weight: 600; }
.chart-axis-label-y { font-variant-numeric: tabular-nums; }
.document-chart-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.document-chart-area { stroke: none; }
.document-chart-line.is-dashed { stroke-dasharray: 7 6; opacity: .85; }
.document-chart-point { stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.document-chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.document-chart-empty[hidden] { display: none; }
.topvisor-document-chart { border-radius: 7px; }
.topvisor-document-chart .document-chart-head { display: none; }
.topvisor-document-chart .document-chart-canvas { min-height: 300px; padding-top: 4px; }
.topvisor-document-chart .document-chart-foot .chart-toggle { color: #667386; font-size: 13px; }
.topvisor-document-chart .document-chart-foot .chart-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.topvisor-document-chart .document-chart-foot .chart-toggle i { width: 10px; height: 10px; border-radius: 50%; }
.topvisor-document-chart .document-chart-foot .chart-toggle.is-donut-selected { color: #1f5e9f; font-weight: 650; }
.topvisor-document-chart .document-chart-foot .chart-toggle.is-donut-selected i { box-shadow: 0 0 0 4px rgba(35, 136, 246, .12); }
.topvisor-document-chart .document-chart-foot .chart-toggle:has(input:not(:checked)) { color: #b8c1cc; }
.topvisor-document-chart .document-chart-foot .chart-toggle:has(input:not(:checked)) i { background: #c7d0da !important; }
.topvisor-chart-toolbar { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(190px, 1fr) minmax(190px, 1fr) minmax(190px, 1fr) 34px; align-items: center; min-height: 48px; color: #677487; font-size: 14px; }
.topvisor-chart-toolbar > * { display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; border-right: 1px solid #edf1f5; }
.topvisor-chip { gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topvisor-chip b { color: #556272; font-weight: 600; }
.topvisor-searcher::before { content: "?"; display: inline-grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: #8190a3; color: #fff; font-weight: 800; line-height: 1; }
.topvisor-searcher-yandex::before { content: "Я"; background: #ef1d1d; }
.topvisor-searcher-google::before { content: "G"; background: #4285f4; font-family: Arial, sans-serif; }
.topvisor-region::before { content: "⌖"; color: #7b8795; font-size: 16px; }
.topvisor-project::before { content: "▦"; color: #7b8795; font-size: 16px; }
.topvisor-calendar::before { content: "▣"; color: #7b8795; font-size: 16px; }
.topvisor-chart-mode { justify-content: center; border-right: 0; color: #617085; font-size: 20px; }
.topvisor-chart-tabs { display: flex; align-items: center; gap: 26px; min-height: 37px; padding: 0 16px; border-top: 1px solid #f4f6f8; color: #6f7c8f; font-size: 14px; }
.topvisor-chart-tabs span { display: inline-flex; align-items: center; align-self: stretch; border-bottom: 2px solid transparent; }
.topvisor-chart-tabs .is-active { color: #4d5a6b; border-bottom-color: #2388f6; font-weight: 600; }
.ahrefs-profile-panel,
.ahrefs-ai-panel { margin-bottom: 24px; border: 1px solid #d8dce2; border-radius: 6px; background: #fff; box-shadow: 0 2px 8px rgba(35, 43, 54, .05); overflow: hidden; }
.ahrefs-profile-panel { border-top: 5px solid #f2f3f5; }
.ahrefs-profile-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ahrefs-kpi { min-height: 118px; padding: 20px; border-right: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; background: #fff; }
.ahrefs-kpi:nth-child(3n) { border-right: 0; }
.ahrefs-kpi:nth-last-child(-n+3) { border-bottom: 0; }
.ahrefs-kpi > span,
.ahrefs-kpi > strong,
.ahrefs-kpi small { display: block; }
.ahrefs-kpi > span { color: #4c5563; font-size: 12px; font-weight: 650; }
.ahrefs-kpi > strong { margin-top: 16px; color: #1665c1; font-size: 31px; font-weight: 500; line-height: 1; }
.ahrefs-kpi small { margin-top: 5px; color: #747c88; font-size: 10px; }
.ahrefs-kpi-score { display: flex; align-items: center; gap: 14px; }
.ahrefs-kpi-score > div:last-child strong { display: block; color: #333b46; font-size: 12px; }
.ahrefs-score-ring { position: relative; display: grid; flex: 0 0 68px; width: 68px; height: 68px; place-items: center; }
.ahrefs-score-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ahrefs-score-ring circle { fill: none; stroke-width: 6; }
.ahrefs-score-ring .score-track { stroke: #e9edf0; }
.ahrefs-score-ring .score-value { stroke: #7a62c9; stroke-linecap: butt; }
.ahrefs-score-ring span { position: relative; color: #2f3742; font-size: 22px; font-weight: 500; }
.metric-ur .ahrefs-score-ring .score-value { stroke: #78a837; }
.ahrefs-panel-caption { display: grid; grid-template-columns: 2fr 1fr; padding: 9px 20px; border-top: 7px solid #eef0f2; color: #5c6470; font-size: 11px; font-weight: 700; }
.ahrefs-dr-attribution { padding: 8px 20px; border-top: 1px solid #e5e7eb; color: #5c6470; font-size: 11px; }
.ahrefs-dr-attribution a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ahrefs-ai-panel { border-top: 5px solid #f2f3f5; }
.ai-mentions-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid #e5e7eb; background: #f8fafc; }
.ai-mentions-summary strong { color: #273244; font-size: 14px; }
.ai-mentions-summary span { color: #657185; font-size: 12px; }
.ai-mentions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ai-mention-card { display: flex; align-items: flex-start; gap: 12px; min-height: 108px; padding: 18px; border-right: 1px solid #e5e7eb; border-bottom: 1px solid #e5e7eb; background: #fff; }
.ai-mention-card:nth-child(3n) { border-right: 0; }
.ai-mention-card:nth-last-child(-n+3) { border-bottom: 0; }
.ai-mention-card i { display: grid; flex: 0 0 32px; width: 32px; height: 32px; place-items: center; border-radius: 9px; color: #fff; background: #4779de; font-size: 10px; font-style: normal; font-weight: 800; }
.ai-mention-card span,
.ai-mention-card strong,
.ai-mention-card small { display: block; }
.ai-mention-card span { color: #4b5461; font-size: 12px; font-weight: 650; }
.ai-mention-card strong { margin-top: 7px; color: #1665c1; font-size: 27px; font-weight: 500; line-height: 1; }
.ai-mention-card small { margin-top: 5px; color: #7c8490; font-size: 10px; }
.ai-chatgpt i { background: #202b2b; }
.ai-google-mode i { background: #3569ce; }
.ai-gemini i { background: linear-gradient(135deg, #557bed, #b05db7); }
.ai-perplexity i { background: #198c92; }
.ai-copilot i { background: linear-gradient(135deg, #2867dd, #ee4c84); }
.ai-grok i { background: #15191f; }
.service-table-wrap { margin: 18px 0 30px; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.service-table-wrap h4 { margin: 0; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.service-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.service-table th { padding: 11px 14px; color: #566074; background: #f7f8fb; text-align: left; font-size: 11px; font-weight: 650; }
.service-table td { padding: 12px 14px; border-top: 1px solid #edf0f4; }
.service-table td:not(:first-child), .service-table th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.metrika-engine-toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.metrika-engine-toggle input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.metrika-engine-toggle i { display: inline-block; width: 14px; height: 4px; border-radius: 3px; }
.metrika-engine-toggle span { color: var(--ink); }
.metrika-search-engines-table tr.is-output-disabled { opacity: .42; }
.metrika-selection-note { margin: 18px 0 -8px; }
.metrika-search-engines-table .metrika-period-cell { text-align: center; color: var(--muted); font-size: 12px; font-weight: 650; }
.metrika-search-engines-table .metrika-engine-repeat { color: var(--muted); padding-left: 54px; font-size: 12px; }
.metrika-search-engines-table tr[data-metrika-engine-comparison] td { background: #fff2cc; }
.work-list { display: grid; gap: 20px; }
.work-list article { padding: 0 0 20px; border-bottom: 1px solid var(--line); }
.document-task-title.document-bullet { margin: 0 0 8px; font-size: 16px; font-weight: 400; line-height: 1.55; }
.document-task-title.document-bullet::before { background: var(--ink); }
.work-list article p { margin: 0; color: #303a4a; white-space: normal; }
.task-description-editor { min-height: 72px; padding: 11px 12px; border: 1px solid transparent; border-radius: 5px; color: #303a4a; white-space: normal; outline: none; }
.task-description-editor:hover { border-color: var(--line); background: #fafbfc; }
.task-description-editor:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px var(--brand-soft); }
.editor-placeholder { color: #8a94a6; }
.task-suggestion { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 9px; padding: 9px 11px; border-radius: 5px; color: #70530d; background: #fff8dd; font-size: 11px; }
.task-comments-table { margin: 10px 0 0; }
.task-comments-table .service-table td { text-align: left; line-height: 1.6; white-space: normal; }
.closed-task-list { padding-left: 24px; }
.labor-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 520px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.labor-summary > div { padding: 18px; }
.labor-summary > div + div { border-left: 1px solid var(--line); }
.labor-summary span, .labor-summary strong { display: block; }
.labor-summary span { color: var(--muted); font-size: 12px; }
.labor-summary strong { margin-top: 5px; font-size: 24px; }

@media (max-width: 960px) {
    .topbar { grid-template-columns: 1fr auto; }
    .main-nav { order: 3; grid-column: 1 / -1; justify-self: center; }
    .builder-layout { grid-template-columns: 1fr; }
    .builder-aside { position: static; }
    .preset-toolbar, .date-shift-row, .compact-project-row { grid-template-columns: 1fr; }
    .tool-grid, .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero { grid-template-columns: 1fr; }
    .hero-panel { max-width: 520px; }
    .tool-directory-head { grid-template-columns: 1fr; gap: 20px; }
    .tool-directory-search { max-width: 520px; }
    .connection-grid { grid-template-columns: 1fr; }
    .service-picker-grid { grid-template-columns: 1fr; }
    .topvisor-group-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-catalog-toolbar { align-items: stretch; flex-direction: column; }
    .source-metrics-metrika, .source-metrics-ahrefs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .source-metrics-metrika .source-metric:nth-child(3n),
    .source-metrics-ahrefs .source-metric:nth-child(3n) { border-right: 0; }
    .source-metrics-metrika .source-metric:nth-child(-n+3),
    .source-metrics-ahrefs .source-metric:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
    .document-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .document-metric:nth-child(2) { border-right: 0; }
    .document-metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 700px) {
    .page-shell { width: min(100% - 24px, 1180px); padding-top: 22px; }
    .topbar { position: static; grid-template-columns: 1fr auto; padding: 12px; }
    .main-nav { width: 100%; }
    .main-nav a { flex: 1; justify-content: center; }
    .user-copy { display: none; }
    .hero { padding: 28px 22px; border-radius: 10px; }
    .hero h1 { font-size: 40px; }
    .tool-directory { padding-top: 6px; }
    .tool-directory-head { margin-bottom: 20px; padding-bottom: 22px; }
    .tool-directory-head h1 { font-size: 36px; }
    .tool-directory-search { width: 100%; max-width: none; }
    .tool-grid, .project-grid, .form-grid { grid-template-columns: 1fr; }
    .tool-card-compact { min-height: 132px; padding: 17px; }
    .field-wide { grid-column: auto; }
    .page-heading, .report-head { align-items: flex-start; flex-direction: column; }
    .google-docs-export { width: 100%; align-items: stretch; }
    .google-docs-export-status { max-width: none; text-align: left; }
    .login-page { grid-template-columns: 1fr; }
    .login-brand { min-height: 300px; padding: 30px; }
    .login-message h1 { font-size: 42px; }
    .login-form-wrap { padding: 24px 16px; }
    .footer { flex-direction: column; }
    .nested-options { margin-left: 18px; }
    .form-section, .project-editor-head { padding: 20px; }
    .form-section-head { grid-template-columns: auto minmax(0, 1fr); }
    .form-section-head .button { grid-column: 1 / -1; }
    .project-catalog-actions, .project-catalog-controls { align-items: stretch; flex-direction: column; }
    .catalog-search { min-width: 0; width: 100%; }
    .view-switch button { flex: 1; justify-content: center; }
    .project-grid.is-list .project-card { grid-template-columns: 1fr; gap: 8px; }
    .project-grid.is-list .project-card .actions { margin-top: 8px; }
    .report-document { padding: 28px 18px; border-right: 0; border-left: 0; border-radius: 0; box-shadow: none; }
    .report-document-title { margin-bottom: 38px; text-align: left; }
    .report-document-title h1 { font-size: 31px; }
    .report-document .document-major-title { font-size: 29px; }
    .document-metrics, .document-metrics.compact { grid-template-columns: 1fr; }
    .document-metric { border-right: 0; border-bottom: 1px solid var(--line); }
    .document-chart-head { align-items: flex-start; flex-direction: column; }
    .document-chart-controls { justify-content: flex-start; }
    .document-chart-canvas { min-height: 270px; }
    .document-chart svg { height: 250px; }
    .ahrefs-profile-grid, .ai-mentions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ai-mentions-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
    .ahrefs-kpi, .ai-mention-card { border-right: 1px solid var(--line) !important; border-bottom: 1px solid var(--line) !important; }
    .ahrefs-kpi:nth-child(2n), .ai-mention-card:nth-child(2n) { border-right: 0 !important; }
    .ahrefs-kpi:nth-last-child(-n+2), .ai-mention-card:nth-last-child(-n+2) { border-bottom: 0 !important; }
    .subsection-head { flex-direction: column; }
    .legacy-import-card { align-items: stretch; flex-direction: column; }
    .legacy-import-card .button { width: 100%; }
    .source-native { margin-right: -24px; margin-left: -24px; }
    .source-toolbar { align-items: flex-start; flex-direction: column; }
    .source-toolbar-action { white-space: normal; }
    .source-metrics-metrika, .source-metrics-ahrefs, .source-metrics-gsc, .source-metrics-moo, .source-metrics-moo.has-hours { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .source-metrics-gsc, .source-metrics-moo { gap: 6px; padding: 12px; }
    .source-metric:nth-child(even) { border-right: 0; }
    .source-metrics-metrika .source-metric:nth-child(-n+4),
    .source-metrics-ahrefs .source-metric:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
    .source-chart { min-height: 230px; padding-right: 8px; padding-left: 8px; }
    .source-chart-svg { height: 220px; }
    .source-tabs { justify-content: flex-start !important; }
}
.admin-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.admin-summary-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 104px;
    padding: 20px;
}

.admin-summary-card .tool-icon {
    flex: 0 0 auto;
}

.admin-summary-card div {
    display: grid;
    gap: 3px;
}

.admin-summary-card strong {
    font-size: 28px;
    line-height: 1;
}

.admin-summary-card:last-child strong {
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.25;
}

.admin-summary-card div > span {
    color: var(--muted);
}

.admin-section {
    margin-bottom: 20px;
    scroll-margin-top: 90px;
}

.admin-service-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.admin-service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.admin-service-item > div {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.admin-service-item small,
.admin-users-table td small {
    display: block;
    color: var(--muted);
}

.admin-user-search {
    max-width: 460px;
    margin: 16px 0;
}

.admin-users-table td {
    vertical-align: middle;
}

.admin-users-table-wrap {
    overflow: hidden;
}

.admin-users-table {
    table-layout: fixed;
}

.admin-users-table th:nth-child(1) { width: 29%; }
.admin-users-table th:nth-child(2) { width: 18%; }
.admin-users-table th:nth-child(3) { width: 22%; }
.admin-users-table th:nth-child(4) { width: 31%; }

.admin-employee-cell strong,
.admin-employee-cell small,
.admin-activity-cell span,
.admin-activity-cell small {
    display: block;
}

.admin-employee-cell small,
.admin-activity-cell small {
    margin-top: 4px;
}

.admin-employee-cell small:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-status-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-activity-cell {
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
}

.admin-actions-cell {
    min-width: 0;
}

.admin-invite-form { display: flex; align-items: end; gap: 9px; }
.admin-invite-form label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.admin-invite-form select { min-width: 120px; }
.admin-generated-link { display: grid; grid-template-columns: minmax(220px, .65fr) minmax(340px, 1.35fr); align-items: center; gap: 18px; margin-bottom: 18px; padding: 15px 16px; border: 1px solid #b8cdf9; border-radius: 9px; background: #f2f6ff; }
.admin-generated-link strong, .admin-generated-link small { display: block; }
.admin-generated-link small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.admin-generated-link input { min-width: 0; font-family: "SFMono-Regular", Consolas, monospace; font-size: 11px; }
.admin-security-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.admin-security-panel { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; }
.admin-security-panel .subsection-head { margin-bottom: 10px; }
.admin-security-list { display: grid; gap: 7px; }
.admin-security-list article { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.admin-security-list article > div { min-width: 0; }
.admin-security-list strong, .admin-security-list small { display: block; }
.admin-security-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.admin-security-list small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.admin-reset-direct-form { margin-top: 8px; }

.admin-access-form {
    display: grid;
    grid-template-columns: minmax(132px, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.admin-access-form select {
    min-width: 0;
}

.admin-access-form .compact-switch {
    margin: 0;
    white-space: nowrap;
}

.admin-access-form .button[disabled] {
    cursor: not-allowed;
    opacity: .5;
}

.admin-events-table td:first-child {
    white-space: nowrap;
}

.admin-backups-table td {
    vertical-align: middle;
}

.admin-backups-table td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.admin-backups-table td:nth-child(1),
.admin-backups-table td:nth-child(2),
.admin-backups-table td:nth-child(3) {
    white-space: nowrap;
}

.admin-backup-details {
    min-width: 220px;
    color: var(--muted);
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .admin-summary-grid,
    .admin-service-grid,
    .admin-security-grid {
        grid-template-columns: 1fr;
    }

    .admin-generated-link { grid-template-columns: 1fr; }

    .admin-invite-form { width: 100%; flex-wrap: wrap; }

    .admin-access-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .admin-users-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .admin-users-table,
    .admin-users-table tbody,
    .admin-users-table tr,
    .admin-users-table td {
        display: block;
        width: 100%;
    }

    .admin-users-table thead {
        display: none;
    }

    .admin-users-table tr {
        margin-bottom: 10px;
        overflow: hidden;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: #fff;
    }

    .admin-users-table td {
        display: grid;
        grid-template-columns: minmax(112px, 36%) minmax(0, 1fr);
        gap: 12px;
        padding: 11px 13px;
    }

    .admin-users-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .admin-status-stack {
        justify-content: flex-start;
    }

    .admin-access-form,
    .admin-reset-direct-form {
        width: 100%;
        margin-top: 0;
    }
}

@media (max-width: 620px) {
    .account-password-form { grid-template-columns: 1fr; }
    .account-password-form .field-wide { grid-column: auto; }
}

/* Time reconciliation tool */
.time-page-heading { align-items: center; }
.time-button-count { display: inline-grid; min-width: 22px; height: 22px; padding: 0 6px; place-items: center; border-radius: 99px; color: var(--brand); background: var(--brand-soft); font-size: 11px; }
.time-controls { margin-bottom: 18px; }
.time-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.time-date-form { display: grid; grid-template-columns: repeat(2, minmax(180px, 1fr)) auto; align-items: end; gap: 14px; }
.time-date-form .button { min-height: 44px; }
.time-scope-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.time-scope-card.is-limited { border-color: #eadca9; background: #fffdf5; }
.time-scope-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); }
.time-scope-card.is-limited .time-scope-icon { color: #8a650d; background: #fff3c9; }
.time-scope-card strong, .time-scope-card span { display: block; }
.time-scope-card > div:nth-child(2) span { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.time-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.time-summary article { min-width: 0; padding: 17px 18px; border-right: 1px solid var(--line); }
.time-summary article:last-child { border-right: 0; }
.time-summary span, .time-summary strong { display: block; }
.time-summary span { color: var(--muted); font-size: 11px; }
.time-summary strong { margin-top: 8px; font-size: 25px; font-variant-numeric: tabular-nums; }
.time-summary .is-good strong { color: #21834f; }
.time-summary .is-warning strong { color: #a96d00; }
.time-summary .is-danger strong { color: #c83f4f; }
.time-results { padding: 0; overflow: hidden; }
.time-results-heading { margin: 0; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.time-results-heading h2 { margin: 0; }
.time-meta { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.time-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 220px; gap: 12px; padding: 14px 18px; background: #f8f9fb; }
.time-toolbar .catalog-search { max-width: none; }
.time-table-wrap { margin: 0; border: 0; border-radius: 0; }
.time-table { min-width: 900px; }
.time-table td { vertical-align: top; font-variant-numeric: tabular-nums; }
.time-table td:first-child { min-width: 190px; }
.time-table td:last-child { min-width: 220px; color: #4a5566; }
.time-table tbody tr { transition: filter .15s ease; }
.time-table tbody tr:hover { filter: brightness(.988); }
.time-table tbody tr.row-green { background: #eaf8f1; }
.time-table tbody tr.row-orange { background: #fff4e5; }
.time-table tbody tr.row-red { background: #fff0f0; }
.time-table tbody tr.row-green td:first-child { box-shadow: inset 4px 0 0 #16845b; }
.time-table tbody tr.row-orange td:first-child { box-shadow: inset 4px 0 0 #b9600c; }
.time-table tbody tr.row-red td:first-child { box-shadow: inset 4px 0 0 #c43838; }
.time-table tbody tr.hidden-row { display: none !important; }
.time-table td strong, .time-table td small { display: block; }
.time-table td small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.time-deviation { display: inline-flex; min-width: 64px; justify-content: center; padding: 4px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.time-deviation.is-green { color: #17683d; background: #dff5e8; }
.time-deviation.is-orange { color: #865900; background: #fff0c7; }
.time-deviation.is-red { color: #9e2939; background: #ffe1e6; }
.time-missing { color: var(--muted); font-style: italic; }
.time-formula { margin: 0; padding: 12px 18px; border-top: 1px solid var(--line); color: var(--muted); background: #fafbfc; font-size: 10px; }
.time-empty-state { padding: 54px 24px; text-align: center; }
.time-empty-state .tool-icon { margin: 0 auto 14px; }
.time-empty-state h2 { margin: 0; }
.time-empty-state p { max-width: 600px; margin: 9px auto 0; color: var(--muted); }
body.time-modal-open { overflow: hidden; }
.time-modal[hidden] { display: none; }
.time-modal { position: fixed; z-index: 100; inset: 0; display: grid; padding: 28px; place-items: center; }
.time-modal-backdrop { position: absolute; inset: 0; background: rgba(20, 28, 43, .58); backdrop-filter: blur(2px); }
.time-modal-panel { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: min(1040px, 100%); max-height: min(820px, calc(100vh - 56px)); overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 24px 80px rgba(17, 29, 51, .28); }
.time-modal-panel > header, .time-modal-panel > footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; }
.time-modal-panel > header { border-bottom: 1px solid var(--line); }
.time-modal-panel > header h2 { margin: 0; }
.time-modal-panel > header span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.time-modal-panel > footer { position: relative; z-index: 1; border-top: 1px solid var(--line); background: #fafbfc; box-shadow: 0 -8px 20px rgba(17, 29, 51, .04); }
.time-mapping-list { min-height: 0; display: grid; align-content: start; gap: 10px; padding: 18px 20px; overflow-y: auto; overscroll-behavior: contain; }
.time-mapping-row { display: grid; grid-template-columns: minmax(180px, 1.4fr) minmax(130px, .7fr) minmax(130px, .7fr) auto auto; align-items: end; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.time-mapping-row .field span { font-size: 10px; }
.time-mapping-switch { min-height: 42px; margin: 0; white-space: nowrap; }
.time-mapping-remove { min-width: 42px; min-height: 42px; padding: 0; font-size: 20px; }
.time-mapping-empty { margin: 10px 0; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
    .time-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .time-summary article { border-bottom: 1px solid var(--line); }
    .time-summary article:nth-child(2n) { border-right: 0; }
    .time-summary article:last-child { grid-column: 1 / -1; border-bottom: 0; }
    .time-mapping-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .time-mapping-switch, .time-mapping-remove { justify-self: start; }
}

@media (max-width: 700px) {
    .time-date-form, .time-toolbar { grid-template-columns: 1fr; }
    .time-scope-card { grid-template-columns: auto minmax(0, 1fr); }
    .time-scope-card > .status { grid-column: 2; justify-self: start; }
    .time-summary { grid-template-columns: 1fr; }
    .time-summary article, .time-summary article:nth-child(2n) { grid-column: auto; border-right: 0; border-bottom: 1px solid var(--line); }
    .time-summary article:last-child { border-bottom: 0; }
    .time-results-heading { align-items: stretch; }
    .time-results-heading .actions { width: 100%; }
    .time-results-heading .actions .button { flex: 1; }
    .time-modal { padding: 10px; }
    .time-modal-panel { max-height: calc(100vh - 20px); }
    .time-modal-panel > header, .time-modal-panel > footer { align-items: stretch; flex-direction: column; }
    .time-modal-panel > header > .button { position: absolute; top: 12px; right: 12px; }
    .time-modal-panel > footer .actions { width: 100%; }
    .time-modal-panel > footer .actions .button { flex: 1; }
    .time-mapping-row { grid-template-columns: 1fr; }
}

/* Moo.team bulk task creator */
.moo-create-heading { align-items: center; }
.moo-connection {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: min(430px, 100%);
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
}
.moo-connection.is-ready { border-color: #c8d7f7; background: #f8faff; }
.moo-connection.is-missing { border-color: #ecd7bd; background: #fffaf4; }
.moo-connection-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 8px; color: var(--brand); background: var(--brand-soft); }
.moo-connection.is-missing .moo-connection-icon { color: #925022; background: var(--orange-soft); }
.moo-connection strong, .moo-connection small { display: block; }
.moo-connection strong { font-size: 13px; }
.moo-connection small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.moo-task-native-select { display: none; }
.moo-task-fallback-list { display: grid; gap: 7px; margin-top: 9px; }
.moo-task-fallback-option {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    width: 100%;
    padding: 9px 11px;
    border: 1px solid #d7e0ef;
    border-radius: 7px;
    color: var(--ink);
    background: #fff;
    cursor: pointer;
    text-align: left;
}
.moo-task-fallback-option:hover, .moo-task-fallback-option.is-selected {
    border-color: #9bb5ee;
    background: #f5f8ff;
}
.moo-task-fallback-check { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--brand); cursor: pointer; }
.moo-task-fallback-copy { display: grid; gap: 2px; min-width: 0; }
.moo-task-fallback-title { font-weight: 750; }
.moo-task-fallback-option small { color: var(--muted); font-size: 11px; }
.moo-create-form { overflow: visible; padding: 0; }
.moo-create-form .form-section:first-of-type { border-radius: var(--radius) var(--radius) 0 0; }
.moo-common-grid { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(360px, 1.3fr); align-items: start; gap: 16px; }
.moo-label-field { position: relative; z-index: 4; }
.moo-label-toggle {
    display: flex;
    width: 100%;
    min-height: 43px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: var(--ink);
    background: #fff;
    cursor: pointer;
    text-align: left;
}
.moo-label-toggle > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moo-label-toggle .icon { width: 16px; height: 16px; color: var(--muted); transition: transform .16s ease; }
.moo-label-toggle[aria-expanded="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .11); }
.moo-label-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }
.moo-label-panel {
    position: absolute;
    z-index: 10;
    top: 72px;
    right: 0;
    left: 0;
    padding: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 38px rgba(31, 48, 78, .16);
}
.moo-label-panel[hidden] { display: none; }
.moo-label-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.moo-label-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: #f8faff; }
.moo-label-search .icon { width: 17px; height: 17px; color: var(--muted); }
.moo-label-search input { min-height: 38px; padding: 6px 0; border: 0; background: transparent; box-shadow: none !important; }
.moo-label-options { max-height: 260px; margin-top: 8px; overflow-y: auto; overscroll-behavior: contain; }
.moo-label-state { padding: 18px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.moo-label-state[hidden] { display: none; }
.moo-label-option { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 9px 8px; border-radius: 6px; cursor: pointer; }
.moo-label-option:hover { background: var(--surface-soft); }
.moo-label-option input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.moo-label-option i, .moo-label-chip i { width: 9px; height: 9px; border-radius: 50%; }
.moo-label-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.moo-selected-labels { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.moo-selected-labels:empty { display: none; }
.moo-label-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 99px; color: #354052; background: #f8fafc; cursor: pointer; font-size: 11px; }
.moo-label-chip b { color: var(--muted); font-size: 15px; font-weight: 500; line-height: 1; }
.moo-line-counter { align-self: center; padding: 5px 9px; border-radius: 99px; color: var(--brand-dark); background: var(--brand-soft); font-size: 11px; font-weight: 750; white-space: nowrap; }
.moo-task-lines { min-height: 250px; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; line-height: 1.65; }
.moo-format-guide { margin-top: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfe; }
.moo-format-guide summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; color: var(--brand-dark); font-size: 12px; font-weight: 750; list-style: none; }
.moo-format-guide summary::-webkit-details-marker { display: none; }
.moo-format-guide summary .icon { width: 17px; height: 17px; }
.moo-format-guide[open] summary { border-bottom: 1px solid var(--line); }
.moo-format-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px; }
.moo-format-fields span { display: flex; align-items: center; gap: 8px; color: #4d596b; font-size: 11px; }
.moo-format-fields i { display: grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; border-radius: 6px; color: var(--brand-dark); background: var(--brand-soft); font-size: 9px; font-style: normal; font-weight: 800; }
.moo-format-guide p { margin: 0; padding: 0 14px 14px; color: var(--muted); font-size: 11px; }
.moo-format-guide code { padding: 2px 5px; border-radius: 4px; color: #5b3c00; background: #fff1cd; }
.moo-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 20px 26px; border-radius: 0 0 var(--radius) var(--radius); background: #f8faff; }
.moo-preview { margin-top: 18px; }
.moo-preview .section-heading { align-items: center; }
.moo-preview .section-heading h2 { margin: 0; }
.moo-preview-table { min-width: 900px; }
.moo-preview-table td { vertical-align: top; }
.moo-preview-table td:first-child, .moo-preview-table td:nth-child(3), .moo-preview-table td:nth-child(4), .moo-preview-table td:nth-child(5) { text-align: center; white-space: nowrap; }
.moo-preview-table td strong, .moo-preview-table td small, .moo-preview-table td span { display: block; }
.moo-preview-table td small { max-width: 420px; margin-top: 5px; color: var(--muted); font-size: 10px; white-space: pre-line; }
.moo-preview-table td span + span { margin-top: 4px; }
.moo-create-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 13px; margin-bottom: 14px; padding: 15px 17px; border: 1px solid #c5d7fb; border-radius: 9px; background: #f3f7ff; }
.moo-create-summary.has-errors { border-color: #efc7a8; background: #fff8f1; }
.moo-summary-number { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 9px; color: #fff; background: var(--brand); font-size: 18px; font-weight: 800; }
.moo-create-summary.has-errors .moo-summary-number { background: var(--orange); }
.moo-create-summary strong, .moo-create-summary span { display: block; }
.moo-create-summary span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.moo-result-list { margin-bottom: 16px; padding: 8px 18px; }
.moo-result-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.moo-result-row:last-child { border-bottom: 0; }
.moo-result-row > span { color: #237b4b; }
.moo-result-row.is-error > span { color: var(--red); }
.moo-result-row .icon { width: 18px; height: 18px; }
.moo-result-row strong, .moo-result-row small { display: block; }
.moo-result-row small { margin-top: 3px; color: var(--muted); }

@media (max-width: 800px) {
    .moo-common-grid, .moo-format-fields { grid-template-columns: 1fr; }
    .moo-connection { width: 100%; }
}

@media (max-width: 560px) {
    .moo-connection { grid-template-columns: auto minmax(0, 1fr); }
    .moo-connection > .status { grid-column: 2; }
    .moo-form-actions { align-items: stretch; flex-direction: column; }
    .moo-form-actions .button { width: 100%; }
    .moo-label-toolbar { grid-template-columns: 1fr; }
}

/* Anxiety analysis */
.anxiety-heading { align-items: end; }
.anxiety-project-catalog-section { margin-top: 8px; }
.anxiety-project-catalog-section .project-card.is-selected { border-color: #9bb5ee; box-shadow: 0 0 0 3px rgba(49, 87, 213, .10); }

.bulk-traffic-heading { margin-bottom: 24px; }
.bulk-traffic-form-card { width: 100%; }
.bulk-traffic-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 16px; }
.bulk-traffic-form-footer p { display: flex; align-items: flex-start; gap: 8px; max-width: 570px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.bulk-traffic-form-footer .icon { width: 17px; min-width: 17px; margin-top: 1px; color: var(--brand); }
.bulk-traffic-result-section { margin-top: 30px; }
.bulk-traffic-result-heading { align-items: center; margin-bottom: 14px; }
.bulk-traffic-result-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.bulk-traffic-copy-status { min-height: 18px; color: #08764c; font-size: 12px; font-weight: 700; white-space: nowrap; }
.bulk-traffic-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.bulk-traffic-table { width: 100%; min-width: 720px; table-layout: fixed; border-collapse: collapse; }
.bulk-traffic-table .bulk-traffic-domain-col { width: 48%; }
.bulk-traffic-table th, .bulk-traffic-table td { padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.bulk-traffic-table th { color: #596579; background: #f5f7fb; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.bulk-traffic-table th:not(:first-child), .bulk-traffic-table td:not(:first-child) { text-align: center; }
.bulk-traffic-table td:not(:first-child) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bulk-traffic-table td:first-child { overflow-wrap: anywhere; }
.bulk-traffic-table td small { display: block; max-width: 360px; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.bulk-traffic-table tbody tr:last-child td { border-bottom: 0; }
.bulk-traffic-table tbody tr:hover { background: #f8faff; }
.bulk-traffic-table .is-unavailable { color: var(--muted); background: #fcfcfd; }
.button-small { min-height: 34px; padding: 6px 10px; font-size: 12px; }
@media (max-width: 700px) {
    .bulk-traffic-form-footer { align-items: stretch; flex-direction: column; }
    .bulk-traffic-form-footer .button { width: 100%; justify-content: center; }
    .bulk-traffic-result-heading { align-items: stretch; flex-direction: column; }
    .bulk-traffic-result-actions .button { width: 100%; justify-content: center; }
}
.anxiety-controls { display: grid; gap: 13px; }
.anxiety-project-form { display: flex; align-items: end; gap: 12px; }
.anxiety-project-form .field { width: min(560px, 100%); }
.anxiety-project-form .button { flex: 0 0 auto; margin-bottom: 1px; }
.anxiety-method { max-width: 860px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.anxiety-overview { margin-top: 24px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.anxiety-overview .section-heading { margin-bottom: 16px; }
.anxiety-overview .section-heading h2, .anxiety-charts .section-heading h2 { margin: 0; }
.anxiety-overview .section-heading p, .anxiety-charts .section-heading p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.anxiety-summary-list { display: grid; gap: 10px; }
.anxiety-summary-card { padding: 15px 17px; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; background: #fbfcff; }
.anxiety-summary-card h3 { margin: 0 0 7px; color: var(--ink); font-size: 15px; }
.anxiety-summary-card p { margin: 0; color: #42516a; font-size: 14px; line-height: 1.65; }
.anxiety-trend { white-space: nowrap; }
.anxiety-trend.is-up { color: #08764c; }
.anxiety-trend.is-down { color: #b42d26; }
.anxiety-trend.is-stable, .anxiety-trend.is-unknown { color: #536276; }
.anxiety-summary-disclosure { padding: 0; overflow: hidden; }
.anxiety-summary-disclosure > summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 15px 17px; cursor: pointer; list-style: none; }
.anxiety-summary-disclosure > summary::-webkit-details-marker { display: none; }
.anxiety-summary-copy { min-width: 0; }
.anxiety-summary-copy p + p { margin-top: 4px; }
.anxiety-disclosure-toggle { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; color: var(--brand); font-size: 13px; font-weight: 700; white-space: nowrap; }
.anxiety-disclosure-toggle svg { width: 15px; height: 15px; transition: transform .18s ease; }
.anxiety-disclosure-hide { display: none; }
.anxiety-summary-disclosure[open] { background: #fff; }
.anxiety-summary-disclosure[open] .anxiety-disclosure-show { display: none; }
.anxiety-summary-disclosure[open] .anxiety-disclosure-hide { display: inline; }
.anxiety-summary-disclosure[open] .anxiety-disclosure-toggle svg { transform: rotate(90deg); }
.anxiety-summary-chart { border-top: 1px solid var(--line); padding: 14px 17px 0; background: #fff; }
.anxiety-summary-chart .anxiety-document-chart { margin-bottom: 16px; }
.anxiety-charts { margin-top: 20px; }
.anxiety-charts .section-heading { margin-bottom: 15px; }
.anxiety-document-chart { margin-bottom: 20px; border-radius: 8px; }
.anxiety-document-chart .document-chart-head { padding: 16px 18px; }
.anxiety-document-chart .document-chart-head > strong { white-space: normal; font-size: 16px; }
.anxiety-document-chart .document-chart-canvas { min-height: 338px; }

@media (max-width: 720px) {
    .anxiety-heading { align-items: start; }
    .anxiety-project-form { align-items: stretch; flex-direction: column; }
    .anxiety-project-form .field { width: 100%; }
    .anxiety-project-form .button { width: 100%; margin-bottom: 0; }
    .anxiety-overview { padding: 18px; }
    .anxiety-summary-card { padding: 13px 14px; }
    .anxiety-trend { white-space: normal; }
    .anxiety-summary-disclosure { padding: 0; }
    .anxiety-summary-disclosure > summary { align-items: flex-start; gap: 12px; padding: 13px 14px; }
    .anxiety-disclosure-toggle { font-size: 12px; }
    .anxiety-summary-chart { padding: 10px 10px 0; }
}
