:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --bg-soft: #eef1f5;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-subtle: #f7f8fa;
    --text: #111318;
    --text-soft: #5d6471;
    --text-faint: #8c94a2;
    --line: #dfe3e8;
    --line-strong: #c9ced7;
    --accent: #3157f6;
    --accent-strong: #2447d6;
    --accent-soft: #e9edff;
    --signal: #15a67c;
    --signal-soft: #def7ee;
    --role-admin: #c9972f;
    --role-moderator: #d94b54;
    --role-user: #3157f6;
    --shadow-sm: 0 1px 2px rgba(18, 24, 40, 0.05);
    --shadow-md: 0 18px 50px rgba(18, 24, 40, 0.09);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shell: 1240px;
    --header-height: 76px;
    --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b0e13;
    --bg-soft: #0f131a;
    --surface: #121720;
    --surface-raised: #171d27;
    --surface-subtle: #10151d;
    --text: #f4f6fa;
    --text-soft: #a6afbe;
    --text-faint: #707b8d;
    --line: #252c38;
    --line-strong: #343d4d;
    --accent: #7188ff;
    --accent-strong: #8ea0ff;
    --accent-soft: #202a54;
    --signal: #42d3aa;
    --signal-soft: #153c35;
    --role-admin: #e0b84d;
    --role-moderator: #f0666e;
    --role-user: #7188ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
    --shadow-md: 0 22px 65px rgba(0, 0, 0, 0.38);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
    min-width: 320px;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 82% 4%, color-mix(in srgb, var(--text-faint) 7%, transparent), transparent 28rem),
        var(--bg);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 180ms ease, color 180ms ease;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    content: "";
    opacity: 0.42;
    background-image:
        linear-gradient(to right, color-mix(in srgb, var(--line) 38%, transparent) 1px, transparent 1px),
        linear-gradient(to bottom, color-mix(in srgb, var(--line) 38%, transparent) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(to bottom, black, transparent 34%);
}

button,
input,
textarea {
    color: inherit;
    font: inherit;
}

small {
    font-size: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 34%, transparent);
    outline-offset: 3px;
}

[hidden] {
    display: none !important;
}

kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 25px;
    min-height: 23px;
    padding: 1px 6px;
    border: 1px solid var(--line);
    border-bottom-color: var(--line-strong);
    border-radius: 6px;
    color: var(--text-faint);
    background: var(--surface-subtle);
    box-shadow: inset 0 -1px 0 var(--line);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.shell {
    width: min(calc(100% - 48px), var(--shell));
    margin-inline: auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    padding: 10px 14px;
    border-radius: 8px;
    color: #fff;
    background: var(--accent);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-height);
    border-bottom: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: blur(18px) saturate(150%);
}

.site-header__inner {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    height: 100%;
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 12px;
}

.brand__mark {
    position: relative;
    display: grid;
    width: 64px;
    height: 54px;
    place-items: center;
    padding: 0;
}

.brand__mark::before {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    background: var(--accent);
    filter:
        drop-shadow(0 3px 2px rgba(24, 48, 160, 0.18))
        drop-shadow(0 8px 8px rgba(49, 87, 246, 0.1));
    mask: url("../images/logo.svg") center / contain no-repeat;
    transform: translate(-0.5px, 1px) scale(1.34);
    transform-origin: center;
    transition: background-color 180ms ease, filter 180ms ease;
    -webkit-mask: url("../images/logo.svg") center / contain no-repeat;
}

.brand__mark::after {
    position: absolute;
    inset: 0;
    z-index: 0;
    content: "";
    background: var(--accent);
    filter: blur(4px);
    mask: url("../images/logo.svg") center / contain no-repeat;
    opacity: 0.14;
    transform: translate(-0.5px, 6px) scale(1.24);
    transform-origin: center;
    transition: opacity 180ms ease, filter 180ms ease, transform 180ms ease;
    -webkit-mask: url("../images/logo.svg") center / contain no-repeat;
}

.brand__mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
}

:root[data-theme="dark"] .brand__mark::before {
    filter:
        drop-shadow(0 0 2px rgba(158, 174, 255, 0.9))
        drop-shadow(0 0 5px rgba(113, 136, 255, 0.62))
        drop-shadow(0 0 10px rgba(49, 87, 246, 0.35));
}

:root[data-theme="dark"] .brand__mark::after {
    background: radial-gradient(circle, rgba(113, 136, 255, 0.5) 0%, rgba(49, 87, 246, 0.22) 40%, transparent 68%);
    filter: blur(4px);
    mask: none;
    opacity: 0.62;
    transform: translate(-0.5px, 1px) scale(1.18);
    -webkit-mask: none;
}

.brand__copy {
    display: grid;
    line-height: 1.05;
    transform: translateY(3px);
}

.brand__copy strong {
    font-size: 14px;
    letter-spacing: -0.02em;
}

.brand__copy small {
    margin-top: 5px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    transition:
        color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.main-nav a:hover {
    border-color: var(--line-strong);
    color: var(--text);
    background: var(--surface-raised);
}

.main-nav a.is-active {
    border-color: var(--line);
    color: var(--text-faint);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transform: none;
}

.site-header__actions {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 8px;
}

.command-trigger,
.icon-button,
.profile-button {
    height: 38px;
    border: 1px solid var(--line);
    color: var(--text-soft);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.command-trigger {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 8px 0 13px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 12px;
}

.icon-button,
.profile-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    padding: 0;
    border-radius: 10px;
    cursor: pointer;
}

.profile-button {
    overflow: hidden;
    border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
    color: var(--text-faint);
    background: var(--accent-soft);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
}

/* Role rings are ready for the authenticated profile component. */
.profile-button[data-user-role="admin"] {
    border-color: var(--role-admin);
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--role-admin);
}

.profile-button[data-user-role="moderator"] {
    border-color: var(--role-moderator);
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--role-moderator);
}

.profile-button[data-user-role="user"] {
    border-color: var(--role-user);
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--role-user);
}

.auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--accent);
    border-radius: 10px;
    color: #fff;
    background: var(--accent);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 22%, transparent);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease,
        transform 160ms ease;
}

.auth-button:hover {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 30%, transparent);
    transform: translateY(-1px);
}

.auth-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-menu {
    position: relative;
}

.profile-avatar {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 9px;
}

.profile-avatar img,
.profile-avatar-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 120;
    width: 184px;
    padding: 6px;
    visibility: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    opacity: 0;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px) saturate(140%);
    pointer-events: none;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    transition:
        opacity 150ms ease,
        transform 180ms cubic-bezier(0.23, 1, 0.32, 1),
        visibility 0s linear 180ms;
}

.profile-menu__panel::before {
    position: absolute;
    right: 0;
    bottom: 100%;
    left: 0;
    height: 12px;
    content: "";
}

.profile-menu:hover .profile-menu__panel,
.profile-menu:focus-within .profile-menu__panel,
.profile-menu.is-open .profile-menu__panel {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
}

.profile-menu__panel form {
    margin: 0;
}

.profile-menu__summary {
    display: grid;
    gap: 3px;
    margin: 2px 4px 6px;
    padding: 9px 7px 11px;
    border-bottom: 1px solid var(--line);
}

.profile-menu__summary strong {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-menu__summary span {
    color: var(--text-faint);
    font-size: 12px;
}

.profile-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 0 11px;
    border-radius: 8px;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 650;
    text-align: left;
}

.profile-menu__item:hover,
.profile-menu__item:focus-visible {
    background: var(--surface-subtle);
    outline: 0;
}

.profile-menu__item--danger {
    color: #d94b54;
}

.profile-menu__item--danger:hover,
.profile-menu__item--danger:focus-visible {
    background: color-mix(in srgb, #d94b54 9%, var(--surface));
}

.profile-menu__item svg,
.profile-dialog svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-dialog {
    width: min(calc(100% - 32px), 960px);
    max-height: min(88vh, 780px);
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 38px 100px rgba(0, 0, 0, 0.24);
}

.profile-dialog::backdrop {
    background: rgba(8, 11, 16, 0.58);
    backdrop-filter: blur(8px);
}

.profile-dialog__panel {
    display: flex;
    flex-direction: column;
    max-height: min(88vh, 780px);
}

.profile-dialog--compact {
    width: min(calc(100% - 32px), 720px);
}

.profile-dialog--compact .settings-panel__heading {
    padding-top: 24px;
}

.profile-dialog--compact .settings-panel {
    min-height: 0;
    flex: 1 1 auto;
}

.profile-dialog__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
}

.profile-dialog__header span {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.profile-dialog__header h2 {
    margin: 5px 0 0;
    font-size: 22px;
    letter-spacing: -0.035em;
}

.profile-dialog__close {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text-soft);
    background: var(--surface-subtle);
    cursor: pointer;
}

.profile-dialog__close:hover {
    color: var(--text);
    background: var(--surface-raised);
}

.settings-layout {
    display: grid;
    grid-template-columns: 208px minmax(0, 1fr);
    min-height: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.settings-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 12px;
    border-right: 1px solid var(--line);
    background: var(--surface-subtle);
}

.settings-nav__item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    width: 100%;
    min-height: 58px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: var(--text-soft);
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition:
        color 150ms ease,
        border-color 150ms ease,
        background-color 150ms ease;
}

.settings-nav__item:hover {
    color: var(--text);
    background: var(--surface);
}

.settings-nav__item.is-active {
    border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.settings-nav__icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: var(--text-faint);
    background: color-mix(in srgb, var(--line) 52%, transparent);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 750;
    line-height: 1;
}

.settings-nav__item.is-active .settings-nav__icon {
    color: var(--accent);
    background: var(--accent-soft);
}

.settings-nav__item > span:last-child {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.settings-nav__item strong {
    color: inherit;
    font-size: 13px;
}

.settings-nav__item small {
    overflow: hidden;
    color: var(--text-faint);
    font-size: 12px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-content {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.settings-panel {
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-color: var(--line-strong) transparent;
}

.settings-panel__heading {
    padding: 26px 28px 0;
}

.settings-panel__heading > span,
.users-heading > div > span {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.settings-panel__heading h3 {
    margin: 5px 0 0;
    font-size: 21px;
    letter-spacing: -0.025em;
}

.settings-panel__heading p {
    max-width: 650px;
    margin: 7px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.55;
}

.profile-dialog__body {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding: 30px 28px;
}

.profile-avatar-preview {
    display: grid;
    place-items: center;
    width: 132px;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    color: var(--text-soft);
    background:
        radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--text-faint) 12%, transparent), transparent 52%),
        var(--surface-subtle);
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 750;
}

.profile-avatar-editor {
    min-width: 0;
}

.profile-avatar-editor h3 {
    margin: 0;
    font-size: 17px;
}

.profile-avatar-editor p {
    margin: 8px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.55;
}

.profile-avatar-editor__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.profile-avatar-editor__actions .button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.profile-upload-button,
.profile-remove-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.profile-upload-button:hover,
.profile-remove-button:hover:not(:disabled) {
    border-color: var(--line-strong);
    background: var(--surface-raised);
}

.profile-remove-button {
    color: #d94b54;
}

.profile-remove-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.profile-avatar-message {
    min-height: 20px;
    margin-top: 12px;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.5;
}

.profile-avatar-message.is-error {
    color: #d94b54;
}

.profile-settings__account {
    display: grid;
    gap: 16px;
    padding: 0 28px 28px;
}

.profile-settings__section {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.profile-settings__section h3 {
    margin: 0;
    font-size: 17px;
}

.profile-settings__section > div > p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.55;
}

.profile-settings__section form {
    display: grid;
    gap: 12px;
}

.profile-settings__field {
    display: grid;
    gap: 7px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
}

.profile-settings__field input {
    width: 100%;
    min-height: 43px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text);
    background: var(--surface);
    font: inherit;
    font-size: 13px;
}

.profile-settings__field input:focus {
    border-color: var(--accent);
    outline: 3px solid color-mix(in srgb, var(--accent) 12%, transparent);
}

.profile-settings__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
}

.profile-settings__actions p {
    margin: 0;
    color: var(--signal);
    font-size: 12px;
    line-height: 1.5;
}

.profile-settings__actions p.is-error {
    color: #d94b54;
}

.profile-settings__actions .button {
    flex: none;
}

.integration-form {
    display: grid;
    gap: 14px;
    padding: 24px 28px 28px;
}

.integration-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.integration-card__header {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.integration-card__mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 800;
}

.integration-card__mark--moo {
    background: linear-gradient(145deg, #5969e8, #3847bd);
}

.integration-card__mark--shtab {
    background: linear-gradient(145deg, #4779ff, #2354d6);
}

.integration-card__mark--semrush {
    background: linear-gradient(145deg, #ff7259, #e7472e);
}

.integration-card__mark--ahrefs {
    background: linear-gradient(145deg, #ff9d2f, #f06b13);
}

.integration-card__header h4 {
    margin: 0;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.integration-card__header p {
    margin: 2px 0 0;
    color: var(--text-faint);
    font-size: 12px;
}

.integration-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 27px;
    padding: 0 9px;
    border-radius: 999px;
    color: var(--text-faint);
    background: var(--surface-subtle);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.integration-status::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    content: "";
    background: currentColor;
}

.integration-status.is-connected {
    color: var(--signal);
    background: var(--signal-soft);
}

.integration-card__fields {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    gap: 12px;
}

.settings-field {
    display: grid;
    gap: 7px;
    margin-top: 16px;
}

.settings-field > span {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.settings-field input,
.settings-field textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    color: var(--text);
    outline: none;
    background: var(--surface-subtle);
    font-family: var(--font-mono);
    font-size: 12px;
    transition:
        border-color 150ms ease,
        background-color 150ms ease,
        box-shadow 150ms ease;
}

.settings-field input {
    height: 43px;
    padding: 0 12px;
}

.settings-field textarea {
    min-height: 86px;
    padding: 11px 12px;
    resize: vertical;
    line-height: 1.45;
}

.settings-field input:hover,
.settings-field textarea:hover {
    border-color: color-mix(in srgb, var(--accent) 34%, var(--line-strong));
}

.settings-field input:focus,
.settings-field textarea:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 11%, transparent);
}

.integration-clear {
    margin-top: 12px;
    padding: 0;
    color: #d94b54;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.integration-clear:hover:not(:disabled) {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.integration-clear:disabled {
    cursor: default;
    opacity: 0.38;
}

.integration-form__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 4px;
}

.settings-form-message {
    min-height: 20px;
    margin: 0;
    color: var(--signal);
    font-size: 12px;
}

.settings-form-message.is-error {
    color: #d94b54;
}

.integration-form__footer .button {
    flex: 0 0 auto;
    min-height: 44px;
}

.invite-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 24px 28px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background:
        radial-gradient(circle at 92% 8%, color-mix(in srgb, var(--text-faint) 8%, transparent), transparent 11rem),
        var(--surface);
}

.invite-card > div:first-child {
    min-width: 0;
}

.invite-card > div:first-child > span {
    display: block;
    color: var(--text-faint);
    font-size: 12px;
    font-weight: 650;
}

.invite-card code {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 19px;
    font-weight: 750;
    letter-spacing: 0.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invite-card p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 12px;
}

.invite-card__actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.invite-card__actions .button {
    min-height: 42px;
    padding: 0 14px;
}

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

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

.button:disabled {
    cursor: not-allowed;
    opacity: 0.44;
    transform: none;
}

.users-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin: 0 28px 11px;
}

.users-heading h4 {
    margin: 3px 0 0;
    font-size: 16px;
}

.users-heading > strong {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 13px;
}

.users-list {
    display: grid;
    gap: 1px;
    margin: 0 28px 28px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--line);
}

.user-row {
    display: grid;
    grid-template-columns: 38px minmax(150px, 1fr) minmax(118px, auto) auto auto;
    gap: 12px;
    align-items: center;
    min-height: 64px;
    padding: 10px 13px;
    background: var(--surface);
}

.user-row__avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 2px solid var(--role-user);
    border-radius: 10px;
    color: var(--text);
    background: var(--surface-subtle);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 750;
}

.user-row__avatar--admin {
    border-color: var(--role-admin);
}

.user-row__avatar--moderator {
    border-color: var(--role-moderator);
}

.user-row__identity {
    display: grid;
    min-width: 0;
}

.user-row__identity strong,
.user-row__identity span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-row__identity strong {
    font-size: 13px;
}

.user-row__identity span {
    color: var(--text-faint);
    font-size: 12px;
}

.user-role {
    color: var(--role-user);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.user-role--admin {
    color: var(--role-admin);
}

.user-role--moderator {
    color: var(--role-moderator);
}

.user-integrations {
    display: flex;
    gap: 4px;
}

.user-integrations span {
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 4px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text-faint);
    background: var(--surface-subtle);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 750;
    opacity: 0.42;
}

.user-integrations span.is-active {
    border-color: color-mix(in srgb, var(--signal) 22%, var(--line));
    color: var(--signal);
    background: var(--signal-soft);
    opacity: 1;
}

.user-state {
    color: var(--text-faint);
    font-size: 12px;
    white-space: nowrap;
}

.user-state.is-active {
    color: var(--signal);
}

.theme-toggle {
    position: relative;
    overflow: hidden;
}

.theme-toggle span {
    position: absolute;
    font-size: 18px;
    transition: transform 220ms ease, opacity 180ms ease;
}

.theme-toggle__sun {
    opacity: 1;
    transform: translateY(0) rotate(0);
}

.theme-toggle__moon {
    opacity: 0;
    transform: translateY(24px) rotate(45deg);
}

[data-theme="dark"] .theme-toggle__sun {
    opacity: 0;
    transform: translateY(-24px) rotate(-45deg);
}

[data-theme="dark"] .theme-toggle__moon {
    opacity: 1;
    transform: translateY(0) rotate(0);
}

.hero {
    padding: 88px 0 74px;
    overflow: hidden;
}

.hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.42fr) minmax(360px, 0.75fr);
    gap: clamp(54px, 7vw, 112px);
    align-items: center;
}

.eyebrow,
.section-heading__index,
.system-note span {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
}

.eyebrow span {
    display: inline-block;
    width: 26px;
    height: 2px;
    background: var(--line-strong);
}

.hero h1 {
    max-width: 800px;
    margin: 25px 0 24px;
    font-size: clamp(48px, 6.4vw, 88px);
    font-weight: 690;
    letter-spacing: -0.067em;
    line-height: 0.97;
}

.hero h1 em {
    color: var(--text-faint);
    font-style: normal;
    font-weight: 540;
}

.hero__lead {
    max-width: 650px;
    margin: 0;
    color: var(--text-soft);
    font-size: clamp(17px, 1.6vw, 20px);
    line-height: 1.65;
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 34px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button--primary {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 28%, transparent);
}

.button--primary:hover {
    background: var(--accent-strong);
}

.button--ghost {
    border-color: var(--line);
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.hero__meta {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-top: 47px;
}

.hero__meta div {
    display: grid;
    gap: 3px;
}

.hero__meta div + div {
    padding-left: 32px;
    border-left: 1px solid var(--line);
}

.hero__meta strong {
    font-family: var(--font-mono);
    font-size: 15px;
}

.hero__meta span {
    color: var(--text-faint);
    font-size: 12px;
}

.workspace-card {
    position: relative;
    min-height: 470px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: var(--shadow-md);
}

.workspace-card::before {
    position: absolute;
    inset: 0;
    content: "";
    background-image:
        linear-gradient(to right, var(--line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--line) 1px, transparent 1px);
    background-size: 38px 38px;
    opacity: 0.46;
    mask-image: radial-gradient(circle at center, black, transparent 72%);
}

.workspace-card__head,
.workspace-card__footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.workspace-card__head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--signal);
    background: var(--signal-soft);
    letter-spacing: 0.04em;
}

.live-badge i,
.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--signal) 14%, transparent);
}

.workspace-card__visual {
    position: relative;
    height: 340px;
}

.workspace-card__core {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 94px;
    height: 94px;
    border: 1px solid var(--line-strong);
    border-radius: 28px;
    color: var(--text);
    background: var(--surface-subtle);
    box-shadow:
        0 0 0 12px color-mix(in srgb, var(--text-faint) 8%, transparent),
        var(--shadow-md);
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 800;
    transform: translate(-50%, -50%) rotate(-4deg);
}

.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid var(--line);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.orbit--one {
    width: 210px;
    height: 210px;
}

.orbit--two {
    width: 318px;
    height: 318px;
    border-style: dashed;
}

.node {
    position: absolute;
    z-index: 3;
    padding: 7px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    color: var(--text-soft);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.node--one {
    top: 20%;
    left: 12%;
}

.node--two {
    top: 36%;
    right: 8%;
}

.node--three {
    bottom: 15%;
    left: 17%;
}

.workspace-card__footer {
    padding: 20px;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.workspace-card__footer div {
    display: grid;
    gap: 3px;
}

.workspace-card__footer span {
    color: var(--text-faint);
    font-size: 12px;
}

.workspace-card__footer strong {
    font-size: 13px;
}

.workspace-card__signal {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: var(--text-soft) !important;
    background: var(--surface-subtle);
    font-size: 17px !important;
}

.quick-access {
    padding: 24px 0 84px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 32px;
}

.section-heading--compact {
    align-items: center;
    margin-bottom: 20px;
}

.section-heading h1,
.section-heading h2 {
    margin: 7px 0 0;
    font-size: clamp(31px, 3vw, 44px);
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.section-heading p {
    max-width: 520px;
    margin: 12px 0 0;
    color: var(--text-soft);
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    color: var(--text-soft);
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.quick-item {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background-color 160ms ease;
}

.quick-item + .quick-item {
    border-left: 1px solid var(--line);
}

.quick-item:hover {
    background: var(--surface-subtle);
}

.quick-item__number {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
}

.quick-item__copy {
    display: grid;
    min-width: 0;
}

.quick-item__copy strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-item__copy small {
    margin-top: 3px;
    color: var(--text-faint);
    font-size: 12px;
}

.quick-item__arrow {
    color: var(--text-faint);
    font-size: 17px;
}

.tools-section {
    overflow-x: clip;
    padding: 82px 0 0;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg-soft) 72%, transparent);
}

.page-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-bottom: 10px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
}

.page-breadcrumbs a {
    color: var(--text-soft);
    transition: color 150ms ease;
}

.page-breadcrumbs a:hover,
.page-breadcrumbs a:focus-visible {
    color: var(--accent);
}

.tools-screen .tools-section {
    margin-top: 0;
    padding-top: 54px;
}

/* All-page corner-grid experiment. Remove this block to restore plain backgrounds. */
.tools-screen .tools-section,
.home-screen .home-intro,
body:not(.tools-screen):not(.home-screen) {
    position: relative;
    isolation: isolate;
}

.tools-screen .tools-section::before,
.home-screen .home-intro::before,
body:not(.tools-screen):not(.home-screen)::before {
    position: absolute;
    inset: 0;
    z-index: 0;
    content: "";
    pointer-events: none;
    background-image:
        linear-gradient(to right, color-mix(in srgb, var(--text-faint) 20%, transparent) 1px, transparent 1px),
        linear-gradient(to bottom, color-mix(in srgb, var(--text-faint) 20%, transparent) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.88;
    mask-image:
        radial-gradient(ellipse 430px 320px at 0 0, #000 0%, rgba(0, 0, 0, 0.72) 34%, transparent 76%),
        radial-gradient(ellipse 430px 320px at 100% 0, #000 0%, rgba(0, 0, 0, 0.72) 34%, transparent 76%),
        radial-gradient(ellipse 430px 320px at 0 100%, #000 0%, rgba(0, 0, 0, 0.72) 34%, transparent 76%),
        radial-gradient(ellipse 430px 320px at 100% 100%, #000 0%, rgba(0, 0, 0, 0.72) 34%, transparent 76%);
    mask-repeat: no-repeat;
    -webkit-mask-image:
        radial-gradient(ellipse 430px 320px at 0 0, #000 0%, rgba(0, 0, 0, 0.72) 34%, transparent 76%),
        radial-gradient(ellipse 430px 320px at 100% 0, #000 0%, rgba(0, 0, 0, 0.72) 34%, transparent 76%),
        radial-gradient(ellipse 430px 320px at 0 100%, #000 0%, rgba(0, 0, 0, 0.72) 34%, transparent 76%),
        radial-gradient(ellipse 430px 320px at 100% 100%, #000 0%, rgba(0, 0, 0, 0.72) 34%, transparent 76%);
    -webkit-mask-repeat: no-repeat;
}

body:not(.tools-screen):not(.home-screen)::before {
    position: fixed;
    top: var(--header-height);
}

.tools-screen .tools-layout,
.home-screen .home-intro__inner,
body:not(.tools-screen):not(.home-screen) > main,
body:not(.tools-screen):not(.home-screen) > .site-footer {
    position: relative;
    z-index: 1;
}

.tools-layout {
    --section-nav-stretch: 20px;
    display: grid;
    grid-template-columns: minmax(220px, 240px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    width: min(calc(100% - 48px), calc(var(--shell) + 528px));
    margin-inline: auto;
}

.tools-catalog {
    min-width: 0;
    padding-bottom: 59px;
}

.tools-page {
    --tool-card-width: 320px;
    container-name: tools-page;
    container-type: inline-size;
    min-width: 0;
}

@media (min-width: 1560px) {
    .tools-layout {
        grid-template-columns: minmax(220px, 240px) minmax(0, 1fr) minmax(220px, 240px);
    }
}

.section-nav {
    position: sticky;
    top: calc(var(--header-height) + 22px);
    z-index: 20;
    width: calc(100% + var(--section-nav-stretch));
    margin-left: calc(0px - var(--section-nav-stretch));
    align-self: start;
    padding: 12px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.section-nav__head {
    display: grid;
    gap: 3px;
    padding: 11px 11px 13px;
    border-bottom: 1px solid var(--line);
}

.section-nav__head span {
    color: var(--text-soft);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.section-nav__head strong {
    font-size: 15px;
    letter-spacing: -0.02em;
}

.section-nav__links {
    display: grid;
    gap: 3px;
    padding: 8px 0;
}

.section-nav__link {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) 7px;
    gap: 10px;
    align-items: center;
    min-height: 50px;
    padding: 8px;
    border-radius: 7px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    transition: color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.section-nav__link:hover {
    color: var(--text);
    background: var(--surface-subtle);
    transform: translateX(2px);
}

.section-nav__link.is-active {
    color: var(--text);
    background: var(--accent-soft);
}

.section-nav__icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    opacity: 1;
    filter: saturate(1.38) contrast(1.04);
    transition:
        opacity 160ms ease,
        filter 160ms ease,
        transform 160ms ease;
}

.section-nav__icon img {
    display: block;
    width: 28px;
    height: 24px;
    object-fit: contain;
}

.section-nav__link:hover .section-nav__icon {
    opacity: 1;
    filter: saturate(1.48) contrast(1.06);
}

.section-nav__link.is-active .section-nav__icon {
    opacity: 1;
    filter:
        saturate(1.48)
        contrast(1.06)
        drop-shadow(0 5px 8px color-mix(in srgb, var(--accent) 20%, transparent));
    transform: scale(1.06);
}

.section-nav__link[data-section-link="web-archive"] .section-nav__icon img {
    width: 28px;
    height: 24px;
    object-fit: contain;
    transform: scaleY(1.45);
    transform-origin: center;
}

.section-nav__ahrefs-mark {
    position: relative;
    display: inline-block;
    padding-right: 3px;
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 25px;
    font-weight: 900;
    letter-spacing: -0.08em;
    line-height: 1;
}

.section-nav__ahrefs-mark::after {
    position: absolute;
    top: 3px;
    right: 0;
    width: 3px;
    height: 19px;
    border-radius: 1px;
    background: #ff8800;
    content: "";
}

.section-nav__link i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--line-strong);
    transition: background-color 160ms ease, box-shadow 160ms ease;
}

.section-nav__link.is-active i {
    background: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.section-nav__search {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    padding: 0 9px 0 11px;
    border-top: 1px solid var(--line);
    color: var(--text-soft);
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
}

.section-nav__search:hover {
    color: var(--text);
}

.catalog-search {
    display: flex;
    align-items: center;
    width: min(100%, 340px);
    min-height: 46px;
    padding: 0 10px 0 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.catalog-search > span {
    color: var(--text-faint);
    font-size: 20px;
}

.catalog-search input {
    min-width: 0;
    flex: 1;
    padding: 0 12px;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font-size: 13px;
}

.catalog-search input::placeholder {
    color: var(--text-faint);
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 38px;
}

.category-filter button {
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text-soft);
    background: var(--surface);
    cursor: pointer;
    font-size: 12px;
    font-weight: 650;
    transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.category-filter button:hover,
.category-filter button.is-active {
    border-color: var(--text);
    color: var(--bg);
    background: var(--text);
}

.tool-groups {
    display: grid;
    gap: 45px;
}

.tool-group {
    scroll-margin-top: calc(var(--header-height) + 28px);
}

.tool-group__header {
    display: grid;
    grid-template-columns: minmax(220px, 0.75fr) minmax(280px, 1fr) auto;
    gap: 40px;
    align-items: end;
    padding-bottom: 17px;
    border-bottom: 1px solid var(--line-strong);
}

.tool-group__header h3 {
    margin: 0;
    font-size: 24px;
    letter-spacing: -0.035em;
}

.tool-group__header p {
    max-width: 480px;
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
}

.tool-group__header > strong {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 13px;
}

.tool-group__content {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: stretch;
    margin-top: 12px;
    isolation: isolate;
}

.tool-group__content--single {
    grid-template-columns: minmax(0, var(--tool-card-width)) 280px;
    justify-content: start;
}

.tool-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.tool-grid--single {
    width: min(100%, var(--tool-card-width));
    grid-template-columns: minmax(0, 1fr);
}

@container tools-page (max-width: 1119px) {
    .tool-grid:not(.tool-grid--single) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container tools-page (max-width: 779px) {
    .tool-grid:not(.tool-grid--single) {
        grid-template-columns: minmax(0, 1fr);
    }
}

.tool-card-reveal {
    position: relative;
    min-width: 0;
    min-height: 340px;
    isolation: isolate;
}

.tool-card-reveal > .tool-card {
    z-index: 2;
    height: 100%;
}

.tool-card {
    --tool-accent: var(--accent);
    position: relative;
    display: flex;
    min-height: 340px;
    flex-direction: column;
    padding: 24px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    transition: z-index 0s, transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.tool-tone--semrush {
    --tool-accent: #8f5cf6;
}

.tool-tone--ahrefs {
    --tool-accent: #f38b24;
}

.tool-tone--archive {
    --tool-accent: #4f6df5;
}

.tool-tone--domain-checks {
    --tool-accent: #159b73;
}

.tool-card::before {
    position: absolute;
    top: -1px;
    right: -1px;
    left: -1px;
    height: 2px;
    content: "";
    background: var(--tool-accent);
    opacity: 0;
    transform: scaleX(0.4);
    transition: opacity 180ms ease, transform 180ms ease;
}

.tool-card:hover {
    z-index: 2;
    background: var(--surface-raised);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.tool-card:hover::before {
    opacity: 1;
    transform: scaleX(1);
}

.tool-card--featured {
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--tool-accent) 8%, var(--surface)), var(--surface) 62%);
}

.tool-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tool-card__icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border: 1px solid color-mix(in srgb, var(--tool-accent) 28%, var(--line));
    border-radius: 14px;
    color: var(--tool-accent);
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--tool-accent) 15%, var(--surface)), var(--surface));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tool-accent) 6%, transparent);
}

.tool-card__icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tool-card__icon--compact {
    width: 38px;
    height: 38px;
    border-radius: 10px;
}

.tool-card__icon--compact svg {
    width: 20px;
    height: 20px;
}

.tool-card__status {
    --status-accent: var(--text-faint);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    min-height: 28px;
    padding: 4px 9px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--status-accent) 24%, var(--line));
    border-radius: 999px;
    color: var(--text-soft);
    background: color-mix(in srgb, var(--status-accent) 7%, var(--surface));
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-card__status::before {
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--status-accent) 13%, transparent);
    content: "";
}

.tool-card__status--progress {
    --status-accent: #d99322;
}

.tool-card__status--ready {
    --status-accent: #1ba97f;
}

.tool-card__body {
    margin-top: 28px;
}

.tool-card__body h4 {
    margin: 0;
    font-size: 17px;
    letter-spacing: -0.025em;
}

.tool-card__body p {
    margin: 12px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.65;
}

.tool-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 22px;
}

.tool-card__tags span {
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text-faint);
    background: var(--surface-subtle);
    font-family: var(--font-mono);
    font-size: 12px;
}

.tool-card__action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: auto;
    padding: 16px 0 0;
    border-top: 1px solid var(--line);
    color: var(--text);
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
}

.tool-card__action span {
    color: var(--accent);
    font-size: 17px;
    transition: transform 160ms ease;
}

.tool-card:hover .tool-card__action span {
    transform: translate(2px, -2px);
}

.tool-group__visual {
    --visual-accent: #3157f6;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 100%;
    z-index: 0;
    display: grid;
    width: 280px;
    place-items: center;
    margin: 0;
    pointer-events: none;
    opacity: 0.78;
    clip-path: inset(0 0 0 50%);
    transform: translateX(-50%);
    will-change: clip-path, transform;
    transition:
        transform 240ms cubic-bezier(0.23, 1, 0.32, 1),
        clip-path 240ms cubic-bezier(0.23, 1, 0.32, 1),
        opacity 180ms ease;
}

.tool-group__visual--orange {
    --visual-accent: #ff6b2c;
}

.tool-group__visual--purple {
    --visual-accent: #b786f8;
}

.tool-group__visual--blue {
    --visual-accent: #2568ff;
}

.tool-group__visual--green {
    --visual-accent: #159b73;
}

.tool-group__visual img {
    position: relative;
    z-index: 1;
    display: block;
    width: min(88%, 280px);
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 20px 24px color-mix(in srgb, var(--visual-accent) 20%, transparent));
}

.tool-group.is-active .tool-group__visual {
    opacity: 1;
    clip-path: inset(0);
    transform: translateX(0);
}

.tool-group__visual--brand img {
    width: min(74%, 280px);
    height: 180px;
    filter: none;
}

.tool-group__visual--web-archive img {
    transform: scaleY(1.28);
    transform-origin: center;
}

.empty-state {
    padding: 78px 24px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    text-align: center;
}

.empty-state > span {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
}

.empty-state h3 {
    margin: 11px 0 7px;
    font-size: 24px;
}

.empty-state p {
    margin: 0 0 20px;
    color: var(--text-soft);
}

.workspace-hero {
    position: relative;
    padding: 59px 0 84px;
}

.workspace-hero::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 0;
    border-top: 1px solid var(--line);
    content: "";
    background:
        radial-gradient(circle at 82% 8%, color-mix(in srgb, var(--text-faint) 7%, transparent), transparent 28rem),
        var(--bg);
}

.workspace-hero__layout {
    position: relative;
    z-index: 1;
}

.workspace-hero__nav-spacer {
    grid-column: 1;
}

.workspace-hero__card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
    min-height: 430px;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, var(--text-faint)), var(--surface-subtle));
    box-shadow: var(--shadow-md);
}

.workspace-hero__card::before {
    position: absolute;
    top: -190px;
    right: -140px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    content: "";
    pointer-events: none;
    background: radial-gradient(circle, color-mix(in srgb, var(--text-faint) 14%, transparent), transparent 66%);
}

.workspace-hero__content {
    position: relative;
    z-index: 1;
    align-self: center;
    padding: clamp(44px, 5vw, 74px);
}

.workspace-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.workspace-hero__eyebrow i {
    width: 28px;
    height: 2px;
    background: var(--line-strong);
}

.workspace-hero h2 {
    max-width: 660px;
    margin: 18px 0 0;
    font-size: clamp(34px, 4.5vw, 58px);
    letter-spacing: -0.055em;
    line-height: 1.02;
}

.workspace-hero__content > p {
    max-width: 620px;
    margin: 22px 0 0;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.7;
}

.workspace-hero__action {
    width: fit-content;
    margin-top: 30px;
}

.workspace-hero__action span {
    margin-left: 8px;
    transition: transform 160ms ease;
}

.workspace-hero__action:hover span {
    transform: translate(2px, -2px);
}

.workspace-hero__visual {
    position: relative;
    min-height: 430px;
    overflow: hidden;
    border-left: 1px solid var(--line);
    background:
        linear-gradient(color-mix(in srgb, var(--line) 34%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--line) 34%, transparent) 1px, transparent 1px);
    background-size: 42px 42px;
}

.workspace-hero__visual::after {
    position: absolute;
    inset: 0;
    content: "";
    background: radial-gradient(circle at center, transparent 14%, var(--surface-subtle) 74%);
}

.workspace-hero__orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    border: 1px solid color-mix(in srgb, var(--text-faint) 34%, transparent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.workspace-hero__orbit--outer {
    width: 330px;
    height: 330px;
    border-style: dashed;
    animation: workspace-orbit 24s linear infinite;
}

.workspace-hero__orbit--inner {
    width: 218px;
    height: 218px;
}

.workspace-hero__mascot {
    position: absolute;
    bottom: -8px;
    left: 50%;
    z-index: 2;
    display: block;
    width: min(88%, 380px);
    height: calc(100% - 8px);
    object-fit: contain;
    object-position: center bottom;
    filter: drop-shadow(0 26px 28px color-mix(in srgb, var(--text-faint) 18%, transparent));
    transform: translateX(-50%);
}

.workspace-hero__mascot--dark {
    display: none;
}

:root[data-theme="dark"] .workspace-hero__mascot--light {
    display: none;
}

:root[data-theme="dark"] .workspace-hero__mascot--dark {
    display: block;
    filter:
        drop-shadow(0 0 1px rgba(2, 5, 12, 0.98))
        drop-shadow(0 0 2px rgba(2, 5, 12, 0.9))
        drop-shadow(0 24px 28px rgba(0, 0, 0, 0.46));
}

@keyframes workspace-orbit {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.site-footer {
    padding: 48px 0 24px;
    border-top: 1px solid var(--line);
    color: var(--text-faint);
    background: var(--surface-subtle);
    font-size: 12px;
}

.site-footer__top,
.site-footer__bottom,
.site-footer__status,
.site-footer__meta {
    display: flex;
    align-items: center;
}

.site-footer__top {
    align-items: flex-start;
    justify-content: space-between;
    gap: 48px;
    padding-bottom: 38px;
}

.site-footer__intro {
    max-width: 480px;
}

.site-footer__intro strong {
    color: var(--text);
    font-size: 18px;
    letter-spacing: -0.025em;
}

.site-footer__intro p {
    margin: 12px 0 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.7;
}

.site-footer__links {
    display: flex;
    min-width: 230px;
    flex-direction: column;
    align-items: flex-start;
    gap: 11px;
}

.site-footer__links--sections {
    min-width: 150px;
}

.site-footer__links a {
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 650;
    transition: color 150ms ease;
}

.site-footer__links a:hover,
.site-footer__links a:focus-visible {
    color: var(--accent);
}

.site-footer__bottom {
    justify-content: space-between;
    gap: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.site-footer__status {
    gap: 10px;
}

.site-footer__meta {
    gap: 18px;
    padding-right: 86px;
}

.auth-page {
    min-height: calc(100vh - var(--header-height));
    padding: 70px 0 96px;
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(460px, 1.1fr);
    max-width: 1080px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow-md);
}

.auth-context {
    position: relative;
    display: flex;
    min-height: 620px;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    padding: 52px 48px;
    color: #ffffff;
    background:
        radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.12), transparent 22rem),
        linear-gradient(145deg, #171a22 0%, #252a36 52%, #323846 100%);
}

.auth-context::before,
.auth-context::after {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    content: "";
    pointer-events: none;
}

.auth-context::before {
    top: -95px;
    right: -105px;
    width: 380px;
    height: 380px;
}

.auth-context::after {
    top: -24px;
    right: -35px;
    width: 240px;
    height: 240px;
}

.auth-context__mark {
    position: absolute;
    top: 76px;
    left: 50%;
    width: 180px;
    height: 150px;
    background: rgba(255, 255, 255, 0.96);
    filter: drop-shadow(0 24px 36px rgba(5, 17, 71, 0.28));
    mask: url("../images/logo.svg") center / contain no-repeat;
    transform: translateX(-50%);
    -webkit-mask: url("../images/logo.svg") center / contain no-repeat;
}

.auth-context__eyebrow {
    position: relative;
    z-index: 1;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    opacity: 0.72;
    text-transform: uppercase;
}

.auth-context h1 {
    position: relative;
    z-index: 1;
    margin: 14px 0 0;
    color: #ffffff;
    font-size: clamp(42px, 5vw, 64px);
    letter-spacing: -0.06em;
    line-height: 0.98;
}

.auth-context > p {
    position: relative;
    z-index: 1;
    max-width: 500px;
    margin: 24px 0 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 14px;
    line-height: 1.7;
}

.auth-context__facts {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 28px;
}

.auth-context__facts span {
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.08);
    font-size: 12px;
    font-weight: 650;
    backdrop-filter: blur(12px);
}

.auth-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 54px 58px;
}

.auth-card__heading > span {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.auth-card__heading h2 {
    margin: 10px 0 0;
    font-size: clamp(34px, 4vw, 48px);
    letter-spacing: -0.055em;
    line-height: 1;
}

.auth-card__heading p {
    margin: 14px 0 0;
    color: var(--text-soft);
    font-size: 14px;
}

.auth-alert {
    margin-top: 24px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text-soft);
    background: var(--surface-subtle);
    font-size: 13px;
    line-height: 1.55;
}

.auth-alert--error {
    border-color: color-mix(in srgb, #d94b54 28%, var(--line));
    color: color-mix(in srgb, #d94b54 88%, var(--text));
    background: color-mix(in srgb, #d94b54 8%, var(--surface));
}

.auth-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.auth-form--register {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.auth-field {
    display: grid;
    min-width: 0;
    gap: 8px;
}

.auth-field--wide {
    grid-column: 1 / -1;
}

.auth-field > span {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.auth-field > span small {
    color: var(--text-faint);
    font-size: 12px;
    font-weight: 500;
}

.auth-field input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    color: var(--text);
    outline: 0;
    background: var(--surface-subtle);
    font: inherit;
    font-size: 14px;
    transition:
        border-color 150ms ease,
        background-color 150ms ease,
        box-shadow 150ms ease;
}

.auth-field input:hover {
    border-color: color-mix(in srgb, var(--accent) 34%, var(--line-strong));
}

.auth-field input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent);
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
    padding: 0 16px 0 18px;
    border-radius: 12px;
    color: #ffffff;
    background: var(--accent);
    box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 24%, transparent);
    cursor: pointer;
    font-size: 14px;
    font-weight: 750;
    transition:
        background-color 150ms ease,
        box-shadow 150ms ease,
        transform 150ms ease;
}

.auth-submit:hover {
    background: var(--accent-strong);
    box-shadow: 0 18px 36px color-mix(in srgb, var(--accent) 30%, transparent);
    transform: translateY(-1px);
}

.auth-consent {
    margin: 0;
    color: var(--text-faint);
    font-size: 12px;
    line-height: 1.6;
}

.auth-consent a,
.auth-card__foot a {
    color: var(--accent);
    font-weight: 700;
}

.auth-card__foot {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--text-faint);
    font-size: 13px;
}

.auth-recovery {
    margin: 16px 0 0;
    color: var(--text-faint);
    font-size: 13px;
    line-height: 1.5;
}

.auth-recovery a {
    color: var(--accent);
    font-weight: 700;
}

.legal-page {
    min-height: calc(100vh - var(--header-height));
    padding: 76px 0 110px;
}

.legal-layout {
    display: grid;
    grid-template-columns: minmax(190px, 220px) minmax(0, 820px);
    justify-content: center;
    gap: 64px;
}

.legal-nav {
    position: sticky;
    top: calc(var(--header-height) + 24px);
    align-self: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: var(--shadow-sm);
}

.legal-nav > span {
    display: block;
    padding: 8px 10px 12px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.legal-nav a {
    display: block;
    padding: 10px;
    border-radius: 9px;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 650;
}

.legal-nav a:hover,
.legal-nav a[aria-current="page"] {
    color: var(--text);
    background: var(--accent-soft);
}

.legal-document {
    min-width: 0;
}

.legal-document__eyebrow {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.legal-document h1 {
    max-width: 760px;
    margin: 14px 0 0;
    font-size: clamp(38px, 5vw, 64px);
    letter-spacing: -0.055em;
    line-height: 1;
}

.legal-document__lead {
    max-width: 720px;
    margin: 24px 0 0;
    color: var(--text-soft);
    font-size: 16px;
    line-height: 1.75;
}

.legal-document__updated {
    display: inline-flex;
    margin-top: 20px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text-faint);
    background: var(--surface);
    font-family: var(--font-mono);
    font-size: 12px;
}

.legal-sections {
    margin-top: 52px;
    border-top: 1px solid var(--line-strong);
}

.legal-section {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 24px;
    padding: 34px 0;
    border-bottom: 1px solid var(--line);
}

.legal-section > span {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
}

.legal-section h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -0.035em;
}

.legal-section p,
.legal-section li {
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.75;
}

.legal-section p {
    margin: 14px 0 0;
}

.legal-section ul {
    margin: 14px 0 0;
    padding-left: 20px;
}

.legal-section a {
    color: var(--accent);
    font-weight: 700;
}

.telegram-float {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: telegram-float 3.2s ease-in-out infinite;
}

.telegram-float:hover,
.telegram-float:focus-visible {
    animation-play-state: paused;
}

.telegram-float__label {
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text-soft);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(14px);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.telegram-float:hover .telegram-float__label,
.telegram-float:focus-visible .telegram-float__label {
    opacity: 1;
    transform: translateX(0);
}

.telegram-float__button {
    position: relative;
    display: grid;
    place-items: center;
    width: 78px;
    height: 78px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--accent) 58%, #ffffff);
    border-radius: 24px;
    background:
        radial-gradient(circle at 34% 25%, color-mix(in srgb, var(--accent) 65%, #ffffff), transparent 42%),
        var(--accent);
    box-shadow:
        0 18px 42px color-mix(in srgb, var(--accent) 30%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.26);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.telegram-float:hover .telegram-float__button {
    box-shadow:
        0 22px 48px color-mix(in srgb, var(--accent) 38%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px) scale(1.04);
}

.telegram-float__button img {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 74px;
    height: 74px;
    max-width: none;
    transform: translate(-50%, -50%);
}

.telegram-float.is-spinning {
    animation-play-state: paused;
}

.telegram-float.is-spinning .telegram-float__button {
    animation: telegram-spin 620ms cubic-bezier(0.42, 0, 0.2, 1);
}

@keyframes telegram-float {
    0%,
    100% {
        transform: translateY(0) rotate(-1deg);
    }

    50% {
        transform: translateY(-9px) rotate(1deg);
    }
}

@keyframes telegram-spin {
    from {
        transform: rotate(0);
    }

    to {
        transform: rotate(360deg);
    }
}

.telegram-redirect-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.telegram-redirect {
    display: grid;
    justify-items: center;
    max-width: 480px;
    text-align: center;
}

.telegram-redirect__logo {
    display: grid;
    width: 112px;
    height: 112px;
    place-items: center;
    border-radius: 28px;
    background: var(--accent);
    box-shadow:
        0 0 0 18px color-mix(in srgb, var(--accent) 10%, transparent),
        0 26px 48px color-mix(in srgb, var(--accent) 30%, transparent);
    animation: telegram-redirect-turn 680ms cubic-bezier(0.42, 0, 0.2, 1) both;
}

.telegram-redirect__logo img {
    display: block;
    width: 78px;
    height: 78px;
}

.telegram-redirect > div + div {
    margin-top: 34px;
}

.telegram-redirect span {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.telegram-redirect h1 {
    margin: 10px 0 0;
    font-size: clamp(30px, 8vw, 44px);
    letter-spacing: -0.045em;
}

.telegram-redirect p {
    margin: 10px 0 0;
    color: var(--text-soft);
    font-size: 14px;
}

.telegram-redirect > a {
    margin-top: 24px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.telegram-redirect > a:hover {
    color: var(--accent-strong);
}

@keyframes telegram-redirect-turn {
    from {
        transform: rotate(0) scale(0.9);
    }

    to {
        transform: rotate(360deg) scale(1);
    }
}

.command-dialog {
    width: min(calc(100% - 32px), 680px);
    max-height: min(720px, calc(100vh - 48px));
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 38px 100px rgba(0, 0, 0, 0.24);
}

.command-dialog::backdrop {
    background: rgba(8, 11, 16, 0.58);
    backdrop-filter: blur(8px);
}

.command-dialog__panel {
    display: flex;
    max-height: min(720px, calc(100vh - 48px));
    flex-direction: column;
}

.command-dialog__search {
    display: flex;
    align-items: center;
    min-height: 66px;
    padding: 0 16px 0 20px;
    border-bottom: 1px solid var(--line);
}

.command-dialog__search > span {
    color: var(--text-soft);
    font-size: 24px;
}

.command-dialog__search input {
    min-width: 0;
    flex: 1;
    padding: 0 15px;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font-size: 16px;
}

.command-dialog__search input::placeholder {
    color: var(--text-faint);
}

.command-dialog__meta,
.command-dialog__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.command-dialog__meta {
    border-bottom: 1px solid var(--line);
}

.command-list {
    min-height: 0;
    padding: 8px;
    overflow-y: auto;
}

.command-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 13px;
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    color: var(--text);
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.command-item:hover,
.command-item:focus-visible {
    background: var(--accent-soft);
    outline: 0;
}

.command-item > span:nth-child(2) {
    display: grid;
    gap: 2px;
}

.command-item strong {
    font-size: 13px;
}

.command-item small {
    color: var(--text-faint);
    font-size: 12px;
}

.command-dialog__footer {
    justify-content: flex-start;
    gap: 18px;
    border-top: 1px solid var(--line);
    background: var(--surface-subtle);
    text-transform: none;
}

.toast {
    position: fixed;
    right: 116px;
    bottom: 24px;
    z-index: 80;
    max-width: min(420px, calc(100% - 48px));
    padding: 13px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    color: var(--text);
    background: var(--surface-raised);
    box-shadow: var(--shadow-md);
    font-size: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 170ms ease, transform 170ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1080px) {
    .hero__grid {
        grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.75fr);
        gap: 48px;
    }

    .hero h1 {
        font-size: clamp(48px, 7vw, 68px);
    }

    .tool-group__content {
        grid-template-columns: minmax(0, 1fr) 220px;
    }

    .tool-group__visual {
        width: 220px;
    }
}

@media (max-width: 820px) {
    .shell {
        width: min(calc(100% - 32px), var(--shell));
    }

    .main-nav {
        display: none;
    }

    .command-trigger span {
        display: none;
    }

    .command-trigger {
        padding: 0 8px;
    }

    .hero {
        padding-top: 62px;
    }

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

    .workspace-card {
        min-height: 410px;
    }

    .workspace-card__visual {
        height: 280px;
    }

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

    .quick-item + .quick-item {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .section-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 20px;
    }

    .tools-layout {
        display: block;
        width: min(calc(100% - 32px), var(--shell));
        margin-inline: auto;
    }

    .section-nav {
        top: calc(var(--header-height) + 8px);
        width: auto;
        margin-left: 0;
        margin-bottom: 34px;
        padding: 7px;
        border-radius: 9px;
    }

    .section-nav__head,
    .section-nav__search {
        display: none;
    }

    .section-nav__links {
        display: flex;
        gap: 5px;
        padding: 0;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .section-nav__links::-webkit-scrollbar {
        display: none;
    }

    .section-nav__link {
        grid-template-columns: auto auto 6px;
        min-height: 40px;
        flex: 0 0 auto;
        padding: 7px 11px;
        border-radius: 6px;
        white-space: nowrap;
    }

    .section-nav__link:hover {
        transform: none;
    }

    .section-heading--compact {
        align-items: center;
        flex-direction: row;
    }

    .catalog-search {
        width: 100%;
    }

    .tool-group__header {
        grid-template-columns: 1fr auto;
        gap: 12px 24px;
    }

    .tool-group__header p {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .workspace-hero__card {
        grid-template-columns: 1fr;
    }

    .workspace-hero__nav-spacer {
        display: none;
    }

    .workspace-hero__visual {
        min-height: 330px;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .legal-page {
        padding-top: 56px;
    }

    .auth-page {
        padding: 40px 0 72px;
    }

    .auth-layout {
        grid-template-columns: 1fr;
    }

    .auth-context {
        min-height: 400px;
        padding: 44px 40px;
    }

    .auth-context__mark {
        top: 42px;
        left: auto;
        right: 38px;
        width: 150px;
        height: 124px;
        transform: none;
    }

    .auth-context h1 {
        max-width: 560px;
    }

    .legal-layout {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .legal-nav {
        position: static;
        display: flex;
        gap: 5px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .legal-nav::-webkit-scrollbar {
        display: none;
    }

    .legal-nav > span {
        display: none;
    }

    .legal-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .profile-dialog {
        max-height: calc(100vh - 24px);
    }

    .profile-dialog__panel {
        max-height: calc(100vh - 24px);
    }

    .settings-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto minmax(0, 1fr);
    }

    .settings-nav {
        flex-direction: row;
        gap: 5px;
        padding: 8px;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        scrollbar-width: none;
    }

    .settings-nav::-webkit-scrollbar {
        display: none;
    }

    .settings-nav__item {
        grid-template-columns: 30px auto;
        width: auto;
        min-width: max-content;
        min-height: 48px;
        flex: 1 0 auto;
        padding: 7px 10px;
    }

    .settings-nav__icon {
        width: 30px;
        height: 30px;
    }

    .settings-nav__item small {
        display: none;
    }

    .user-row {
        grid-template-columns: 38px minmax(130px, 1fr) auto;
    }

    .user-role {
        display: none;
    }

    .user-state {
        grid-column: 2;
    }

    .user-integrations {
        grid-column: 3;
        grid-row: 1 / span 2;
    }
}

@media (max-width: 580px) {
    :root {
        --header-height: 68px;
    }

    .brand__copy,
    .command-trigger {
        display: none;
    }

    .site-header__actions {
        gap: 6px;
    }

    .profile-menu__panel {
        right: -4px;
    }

    .profile-dialog__header,
    .profile-dialog__body,
    .profile-settings__account {
        padding-right: 18px;
        padding-left: 18px;
    }

    .profile-settings__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .profile-dialog__body {
        grid-template-columns: 1fr;
    }

    .profile-avatar-preview {
        width: 108px;
        border-radius: 20px;
    }

    .settings-panel__heading {
        padding-right: 18px;
        padding-left: 18px;
    }

    .integration-form {
        padding-right: 18px;
        padding-left: 18px;
    }

    .integration-card {
        padding: 15px;
    }

    .integration-card__header {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .integration-status {
        grid-column: 2;
        justify-self: start;
    }

    .integration-card__fields {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .integration-form__footer {
        align-items: stretch;
        flex-direction: column;
    }

    .integration-form__footer .button {
        width: 100%;
    }

    .invite-card {
        align-items: stretch;
        flex-direction: column;
        margin-right: 18px;
        margin-left: 18px;
    }

    .invite-card__actions .button {
        min-width: 0;
        flex: 1;
    }

    .users-heading,
    .users-list {
        margin-right: 18px;
        margin-left: 18px;
    }

    .user-row {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .user-integrations {
        grid-column: 2;
        grid-row: auto;
    }

    .user-state {
        grid-column: 2;
    }

    .hero {
        padding: 48px 0 58px;
    }

    .hero h1 {
        margin-top: 20px;
        font-size: clamp(42px, 13vw, 58px);
    }

    .hero__lead {
        font-size: 16px;
    }

    .hero__actions .button {
        width: 100%;
    }

    .hero__meta {
        justify-content: space-between;
        gap: 12px;
    }

    .hero__meta div + div {
        padding-left: 14px;
    }

    .workspace-card {
        min-height: 370px;
    }

    .workspace-card__visual {
        height: 240px;
    }

    .orbit--two {
        width: 270px;
        height: 270px;
    }

    .section-heading--compact {
        align-items: flex-start;
        flex-direction: column;
    }

    .quick-access {
        padding-bottom: 58px;
    }

    .tools-section {
        padding: 60px 0 0;
    }

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

    .tool-group__content,
    .tool-group__content--single {
        grid-template-columns: minmax(0, 1fr);
    }

    .tool-grid--single {
        width: 100%;
    }

    .tool-group__visual {
        display: none;
    }

    .tool-card {
        min-height: 290px;
    }

    .tool-card-reveal {
        min-height: 290px;
    }

    .tool-group__header {
        grid-template-columns: 1fr auto;
    }

    .auth-button {
        padding-inline: 11px;
    }

    .auth-page {
        padding: 22px 0 52px;
    }

    .auth-layout {
        border-radius: 20px;
    }

    .auth-context {
        min-height: 330px;
        padding: 34px 26px;
    }

    .auth-context__mark {
        top: 30px;
        right: 24px;
        width: 108px;
        height: 90px;
        opacity: 0.88;
    }

    .auth-context h1 {
        max-width: 320px;
        font-size: clamp(38px, 12vw, 50px);
    }

    .auth-context > p {
        max-width: 360px;
    }

    .auth-card {
        padding: 38px 24px;
    }

    .auth-form--register {
        grid-template-columns: 1fr;
    }

    .auth-field--wide {
        grid-column: auto;
    }

    .auth-card__foot {
        align-items: flex-start;
        flex-direction: column;
    }

    .workspace-hero {
        padding-top: 45px;
        padding-bottom: 68px;
    }

    .tools-catalog {
        padding-bottom: 45px;
    }

    .workspace-hero__card {
        min-height: 0;
        border-radius: 20px;
    }

    .workspace-hero__content {
        padding: 34px 26px 38px;
    }

    .workspace-hero h2 {
        font-size: clamp(34px, 10vw, 46px);
    }

    .workspace-hero__content > p {
        font-size: 14px;
    }

    .workspace-hero__action {
        width: 100%;
    }

    .workspace-hero__visual {
        min-height: 300px;
    }

    .workspace-hero__orbit--outer {
        width: 260px;
        height: 260px;
    }

    .workspace-hero__orbit--inner {
        width: 176px;
        height: 176px;
    }

    .workspace-hero__mascot {
        bottom: -6px;
        width: min(82%, 310px);
        height: calc(100% - 6px);
    }

    .site-footer__top,
    .site-footer__bottom,
    .site-footer__meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-footer__top {
        gap: 28px;
        padding-bottom: 28px;
    }

    .site-footer__links {
        min-width: 0;
        gap: 12px;
    }

    .site-footer__bottom {
        gap: 14px;
    }

    .site-footer__meta {
        gap: 8px;
        padding-right: 76px;
    }

    .legal-page {
        padding: 44px 0 76px;
    }

    .legal-layout {
        gap: 28px;
    }

    .legal-document h1 {
        font-size: clamp(36px, 12vw, 48px);
    }

    .legal-document__lead {
        margin-top: 20px;
        font-size: 15px;
    }

    .legal-sections {
        margin-top: 38px;
    }

    .legal-section {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 28px 0;
    }

    .telegram-float {
        right: 16px;
        bottom: 16px;
    }

    .auth-screen .telegram-float {
        display: none;
    }

    .telegram-float__label {
        display: none;
    }

    .telegram-float__button {
        width: 64px;
        height: 64px;
        border-radius: 20px;
    }

    .telegram-float__button img {
        width: 62px;
        height: 62px;
    }

    .toast {
        right: 16px;
        bottom: 92px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
