/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body,
button,
input {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button,
input {
    font: inherit;
}


/* =========================================================
   THEME
========================================================= */

:root {
    --bg-color: #fbfbfd;

    --left-s-color: #ffffff;
    --right-s-color: #fcfcfe;

    --background-color: #ffffff;
    --secondary-background-color: #f7f6fc;

    --text-color: #15182b;
    --secondary-text-color: #888da8;

    --accent-color: #7048ff;
    --accent-soft: color-mix(
        in srgb,
        var(--accent-color) 9%,
        white
    );

    --border-color: #e9e9f1;

    --sidebar-text: #34394f;

    --shadow-small:
        0 2px 8px rgba(20, 20, 50, 0.025);

    --shadow-button:
        0 5px 16px
        color-mix(
            in srgb,
            var(--accent-color) 20%,
            transparent
        );

    --sidebar-width: clamp(240px, 20vw, 310px);

    --radius-small: 10px;
    --radius-medium: 14px;
    --radius-large: 18px;
}


/* DARK THEME */

[data-theme="dark"] {
    --bg-color: #111218;

    --left-s-color: #15161d;
    --right-s-color: #111218;

    --background-color: #181920;
    --secondary-background-color: #202129;

    --text-color: #f4f4f7;
    --secondary-text-color: #9193a0;

    --accent-color: #7b5cff;

    --border-color: #292b34;

    --sidebar-text: #d9dae2;

    --accent-soft: color-mix(
        in srgb,
        var(--accent-color) 13%,
        transparent
    );
}


/* =========================================================
   BODY / MAIN LAYOUT
========================================================= */

body {
    width: 100%;
    min-width: 1000px;
    min-height: 100vh;

    display: flex;

    background: var(--bg-color);
    color: var(--text-color);

    overflow-x: auto;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}


/* =========================================================
   LEFT SIDEBAR
========================================================= */

.section__left {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: var(--sidebar-width);
    min-width: 240px;

    padding: 0 clamp(18px, 2vw, 28px);

    display: flex;
    flex-direction: column;

    background: var(--left-s-color);

    border-right: 1px solid var(--border-color);

    z-index: 10;
}


/* Общий блок sidebar */

.left__block {
    width: 100%;
}


/* =========================================================
   LOGO
========================================================= */

.left__block:nth-child(1) {
    height: 110px;

    display: flex;
    justify-content: flex-start;
    align-items: center;

    font-size: clamp(20px, 1.7vw, 27px);
    font-weight: 700;
    letter-spacing: -0.8px;

    color: var(--text-color);
}


/* фиолетовая имитация второй части логотипа */

.left__block:nth-child(1)::first-letter {
    color: var(--accent-color);
}


/* =========================================================
   MENU / BOARDS
========================================================= */

.left__block.menu {
    flex: 1;
    min-height: 0;

    display: flex;

    overflow: hidden;

    scrollbar-width: thin;
    scrollbar-color:
        var(--border-color)
        transparent;
}


/* =========================================================
   ADD BOARD
========================================================= */

#boards {
    width: 100%;

    min-height: 0;

    display: flex;
    flex-direction: column;
}


/*
   Текст "Добавить папаку:" в твоём HTML остаётся,
   но визуально делаем его маленьким заголовком.
*/

#boards label {
    width: 100%;

    display: grid;
    grid-template-columns: 1fr 42px;
    grid-template-rows: auto 42px;

    gap: 8px;

    margin-bottom: 22px;

    flex-shrink: 0;

    color: var(--secondary-text-color);

    font-size: 12px;
    font-weight: 600;

    letter-spacing: 0.04em;
}


/* INPUT */

#addBoard {
    grid-column: 1;
    grid-row: 2;

    width: 100%;
    min-width: 0;
    height: 42px;

    padding: 0 13px;

    background: var(--secondary-background-color);

    color: var(--text-color);

    border: 1px solid transparent;
    border-radius: var(--radius-small);

    outline: none;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}


#addBoard:focus {
    background: var(--background-color);

    border-color:
        color-mix(
            in srgb,
            var(--accent-color) 35%,
            var(--border-color)
        );

    box-shadow:
        0 0 0 3px
        color-mix(
            in srgb,
            var(--accent-color) 8%,
            transparent
        );
}


/* ADD BUTTON */

#boards label > button {
    grid-column: 2;
    grid-row: 2;

    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--accent-color);

    color: #ffffff;

    border: none;
    border-radius: var(--radius-small);

    font-size: 20px;
    font-weight: 400;

    cursor: pointer;

    box-shadow: var(--shadow-button);

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;
}


#boards label > button:hover {
    opacity: 0.9;
}


#boards label > button:active {
    transform: scale(0.95);
}


/* =========================================================
   BOARD LIST
========================================================= */

#selectBoards {
    width: 100%;
    min-height: 0;

    display: flex;
    flex-direction: column;

    gap: 6px;

    padding-right: 4px;

    overflow-y: auto;

    color: var(--secondary-text-color);

    font-size: 12px;
}


/* Кнопки создаются через JS */

#selectBoards button {
    position: relative;

    width: 100%;
    min-height: 52px;

    display: flex;
    align-items: center;

    padding: 0 16px;

    background: transparent;

    border: none;
    border-radius: 12px;

    color: var(--sidebar-text);

    font-size: 15px;
    font-weight: 500;

    text-align: left;

    cursor: pointer;

    transition:
        background 0.18s ease,
        color 0.18s ease,
        transform 0.18s ease;
}


/* маленькая иконка папки без изменения HTML */

#selectBoards button::before {
    content: "◇";

    width: 25px;

    margin-right: 9px;

    color: var(--secondary-text-color);

    font-size: 18px;

    transition: color 0.18s ease;
}


#selectBoards button:hover {
    background: var(--secondary-background-color);

    color: var(--text-color);
}


/* SELECTED BOARD */

#selectBoards button.active {
    background: var(--accent-soft);

    color: var(--accent-color);
}


#selectBoards button.active::before {
    color: var(--accent-color);
}


.board-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;

    border-radius: 12px;
}


.board-item.active {
    background: var(--accent-soft);
}


#selectBoards .board-item__select {
    min-width: 0;

    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}


#selectBoards .board-item__select::before {
    content: "◇";

    width: 25px;

    margin-right: 9px;

    color: var(--secondary-text-color);

    font-size: 18px;

    transition: color 0.18s ease;
}


.board-item.active .board-item__select {
    color: var(--accent-color);
}


.board-item.active .board-item__select::before {
    color: var(--accent-color);
}


.board-item__actions {
    display: flex;
    align-items: center;
    gap: 2px;

    padding-right: 6px;

    opacity: 0;

    transition: opacity 0.18s ease;
}


.board-item:hover .board-item__actions,
.board-item:focus-within .board-item__actions {
    opacity: 1;
}


#selectBoards .icon-action {
    width: 44px;
    min-height: 44px;
    height: 44px;

    padding: 0;

    justify-content: center;

    background: transparent;

    border-radius: 9px;
}


#selectBoards .icon-action::before {
    content: none;
}


/* EMPTY STATES */

.empty-state {
    width: 100%;

    display: flex;

    background:
        linear-gradient(
            135deg,
            var(--accent-soft),
            var(--background-color)
        );

    border: 1px solid
        color-mix(
            in srgb,
            var(--accent-color) 12%,
            var(--border-color)
        );

    border-radius: 15px;

    color: var(--secondary-text-color);
}


.links__container > .empty-state {
    grid-column: 1 / -1;
}


.empty-state__icon {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--accent-color);

    color: #ffffff;

    border-radius: 12px;

    box-shadow: var(--shadow-button);
}


.empty-state h4 {
    margin-bottom: 7px;

    color: var(--text-color);

    font-size: 15px;
    font-weight: 650;
}


.empty-state p {
    color: var(--secondary-text-color);

    font-size: 13px;
    line-height: 1.45;
}


.empty-state a {
    width: fit-content;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 36px;

    padding: 0 14px;

    background: var(--background-color);

    color: var(--accent-color);

    border: 1px solid
        color-mix(
            in srgb,
            var(--accent-color) 18%,
            var(--border-color)
        );
    border-radius: 10px;

    font-size: 13px;
    font-weight: 600;

    text-decoration: none;

    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        transform 0.18s ease;
}


.empty-state a:hover {
    background: var(--accent-soft);

    border-color:
        color-mix(
            in srgb,
            var(--accent-color) 34%,
            var(--border-color)
        );

    text-decoration: none;

    transform: translateY(-1px);
}


.empty-state--boards {
    flex-direction: column;
    gap: 12px;

    padding: 18px;
}


.empty-state--boards .empty-state__icon {
    width: 38px;
    height: 38px;

    font-size: 22px;
}


.empty-state--boards a {
    margin-top: 4px;
}


.empty-state--links {
    align-items: flex-start;
    gap: 18px;

    min-height: 150px;

    padding: 24px 28px;
}


.empty-state--links .empty-state__icon {
    width: 48px;
    height: 48px;

    font-size: 23px;
}


.empty-state--links h4 {
    font-size: 17px;
}


.empty-state__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;

    margin-top: 16px;
}


/* =========================================================
   INFO BLOCK
========================================================= */

.left__block.info {
    width: 100%;

    padding: 18px 0;
}


.info__block {
    width: 100%;

    min-height: 145px;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;

    padding: 22px;

    background:
        linear-gradient(
            135deg,
            var(--accent-soft),
            var(--background-color)
        );

    border: 1px solid
        color-mix(
            in srgb,
            var(--accent-color) 10%,
            var(--border-color)
        );

    border-radius: 16px;

    color: var(--secondary-text-color);

    font-size: 13px;
    line-height: 1.5;
}


.info__block span {
    color: var(--accent-color);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 0.08em;
}


.info__block p {
    color: var(--secondary-text-color);

    font-size: 13px;
    line-height: 1.55;
}


/* =========================================================
   THEME BUTTON
========================================================= */

.left__block.theme {
    min-height: 80px;

    display: flex;
    justify-content: flex-start;
    align-items: center;
}


.theme button {
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 12px;

    background: transparent;

    border: none;
    border-radius: 10px;

    color: var(--secondary-text-color);

    font-size: 14px;

    cursor: pointer;

    transition:
        color 0.2s ease,
        background 0.2s ease;
}


.theme button::before {
    content: "☼";

    font-size: 21px;
}


[data-theme="dark"] .theme button::before {
    content: "☾";
}


.theme button:hover {
    background: var(--secondary-background-color);

    color: var(--text-color);
}


/* =========================================================
   RIGHT SECTION
========================================================= */

.section__right {
    width: calc(100% - var(--sidebar-width));

    min-height: 100vh;

    margin-left: var(--sidebar-width);

    padding:
        0
        clamp(35px, 4vw, 70px)
        50px;

    background: var(--right-s-color);
}


/* Ограничение слишком сильного растягивания */

.right__block {
    width: 100%;
    max-width: 1450px;

    margin-left: auto;
    margin-right: auto;
}


/* =========================================================
   HEADER
========================================================= */

.right__block.head {
    min-height: 140px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    gap: 30px;
}


.head h1 {
    margin-bottom: 10px;

    color: var(--text-color);

    font-size: clamp(25px, 2vw, 32px);

    font-weight: 700;

    letter-spacing: -0.7px;
}


.head p {
    color: var(--secondary-text-color);

    font-size: clamp(14px, 1.1vw, 17px);
}


#usernameRender {
    color: var(--text-color);
}


/* USER TOP RIGHT */

#username {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 10px 14px;

    color: var(--text-color);
    background: transparent;
    border: none;

    font-size: 15px;
    font-weight: 500;

    border-radius: 12px;

    transition: background 0.2s ease;

    cursor: pointer;
}


#username:hover {
    background: var(--secondary-background-color);
}


#username::before {
    content: "";

    width: 38px;
    height: 38px;

    flex-shrink: 0;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            var(--accent-color),
            #d9d2ff
        );
}


#username::after {
    content: "▼";

    margin-left: 4px;

    color: var(--secondary-text-color);
}


/* =========================================================
   ADD LINK OUTER BLOCK
========================================================= */

.right__block.add__link {
    margin-bottom: 35px;
}


.add__link > div {
    width: 100%;
}


/* =========================================================
   ADD LINK FORM
========================================================= */

#addLink {
    width: 100%;

    padding: clamp(18px, 1.7vw, 25px);

    background: var(--background-color);

    border: 1px solid var(--border-color);
    border-radius: var(--radius-large);

    box-shadow: var(--shadow-small);
}


#addLink label {
    width: 100%;
    min-height: 72px;

    display: flex;
    align-items: center;

    gap: 12px;

    padding: 10px;

    background: var(--background-color);

    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
}


/* =========================================================
   ADD LINK INPUTS
========================================================= */

#addLink input {
    height: 50px;

    padding: 0 18px;

    background: transparent;

    color: var(--text-color);

    border: 1px solid transparent;
    border-radius: 10px;

    outline: none;

    font-size: 15px;

    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}


#addLink input::placeholder {
    color: var(--secondary-text-color);
}


#addLink input:focus {
    border-color:
        color-mix(
            in srgb,
            var(--accent-color) 25%,
            transparent
        );
}


/* URL */

#inpunL {
    flex: 1;

    min-width: 170px;
}


/* HEADER */

#inpunH {
    width: clamp(190px, 22vw, 300px);

    background: var(--secondary-background-color) !important;
}


/* =========================================================
   ADD LINK BUTTON
========================================================= */

#addLink button {
    height: 50px;

    flex-shrink: 0;

    padding: 0 28px;

    background: var(--accent-color);

    color: #ffffff;

    border: none;
    border-radius: 11px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    box-shadow: var(--shadow-button);

    transition:
        transform 0.15s ease,
        opacity 0.15s ease,
        box-shadow 0.15s ease;
}


#addLink button:hover {
    opacity: 0.9;

    box-shadow:
        0 7px 20px
        color-mix(
            in srgb,
            var(--accent-color) 25%,
            transparent
        );
}


#addLink button:active {
    transform: scale(0.97);
}


[data-auth="guest"] #boards label,
[data-auth="guest"] #addLink {
    opacity: 0.58;
}


[data-auth="guest"] #boards input,
[data-auth="guest"] #boards button,
[data-auth="guest"] #addLink input,
[data-auth="guest"] #addLink button {
    cursor: not-allowed;
}


/* =========================================================
   LINKS SECTION
========================================================= */

.right__block.links {
    padding-bottom: 50px;
}


/* HEADER ABOVE LINKS */

.head__links {
    min-height: 60px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 10px;

    padding: 0 8px;
}


.head__links h3 {
    color: var(--text-color);

    font-size: 18px;
    font-weight: 650;

    letter-spacing: -0.3px;
}


.head__links > div:last-child {
    display: flex;
    align-items: center;

    gap: 5px;
}

.ua {
    opacity: 0.3;
}

/* Три существующие кнопки */

.head__links button {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;

    color: var(--secondary-text-color);

    border: none;
    border-radius: 9px;

    cursor: pointer;

    font-size: 15px;

    transition:
        background 0.18s ease,
        color 0.18s ease;
}


.head__links button:hover {
    background: var(--secondary-background-color);

    color: var(--accent-color);
}


.links-view-controls {
    padding: 4px;

    background: var(--background-color);

    border: 1px solid var(--border-color);
    border-radius: 12px;
}


.links-view-btn img {
    width: 28px;
    height: 28px;

    object-fit: contain;

    opacity: 0.78;

    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}


.links-view-btn:hover img,
.links-view-btn.active img {
    opacity: 1;
}


.links-view-btn.active {
    background: var(--accent-soft);
}


.links-view-btn.active img {
    transform: scale(1.04);
}


/* =========================================================
   LINKS CONTAINER
========================================================= */

.links__container {
    width: 100%;

    display: grid;

    gap: 9px;
}


.links__container--list {
    grid-template-columns: 1fr;
}


.links__container--medium {
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 14px;
}


.links__container--small {
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 14px;
}


/*
   Пока я не вижу твою разметку одной ссылки,
   поэтому это универсальный стиль для элементов,
   которые JS добавит внутрь links__container.
*/

.links__container > * {
    width: 100%;

    min-height: 92px;

    padding: 18px 24px;

    display: flex;
    align-items: center;
    gap: 18px;

    background: var(--background-color);

    border: 1px solid var(--border-color);
    border-radius: 15px;

    box-shadow: var(--shadow-small);

    color: var(--text-color);

    transition:
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


.links__container > *:hover {
    border-color:
        color-mix(
            in srgb,
            var(--accent-color) 18%,
            var(--border-color)
        );

    transform: translateY(-1px);

    box-shadow:
        0 7px 25px rgba(20, 20, 50, 0.045);
}


/* Ссылки внутри карточки */

.links__container a {
    color: var(--accent-color);

    text-decoration: none;
}


.links__container a:hover {
    text-decoration: underline;
}


/* Заголовки внутри карточки */

.links__container h2,
.links__container h3,
.links__container h4 {
    color: var(--text-color);

    font-weight: 600;
}


/* Вторичный текст */

.links__container p,
.links__container span {
    color: var(--secondary-text-color);
}


/* Кнопки внутри карточек */

.links__container button {
    border: none;

    background: transparent;

    color: var(--secondary-text-color);

    cursor: pointer;

    border-radius: 8px;

    transition:
        background 0.18s ease,
        color 0.18s ease;
}


.links__container button:hover {
    background: var(--secondary-background-color);

    color: var(--accent-color);
}


/* =========================================================
   SCROLLBAR
========================================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}


::-webkit-scrollbar-track {
    background: transparent;
}


::-webkit-scrollbar-thumb {
    background: var(--border-color);

    border-radius: 20px;
}


::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-text-color);
}


/* =========================================================
   SELECTION
========================================================= */

::selection {
    background:
        color-mix(
            in srgb,
            var(--accent-color) 25%,
            transparent
        );

    color: var(--text-color);
}

.right__block.head {
    position: relative;
}


/* USERNAME */

#username {
    position: relative;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 14px;

    background: transparent;

    border: none;
    border-radius: 12px;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;

    user-select: none;
}

#username:hover {
    background: var(--secondary-background-color);
}


/* стрелка */

#username::after {
    content: "";

    width: 8px;
    height: 8px;

    margin-left: 4px;

    border-right: 2px solid var(--secondary-text-color);
    border-bottom: 2px solid var(--secondary-text-color);

    transform: rotate(45deg) translateY(-2px);

    transition: transform 0.2s ease;
}


/* при открытом меню */

#username.active::after {
    transform: rotate(225deg) translate(-2px, -2px);
}


/* DROP MENU */

.drop__menu {
    position: absolute;

    top: calc(50% + 35px);
    right: 0;

    width: 220px;

    padding: 8px;

    background: var(--background-color);

    border: 1px solid var(--border-color);
    border-radius: 14px;

    box-shadow:
        0 12px 35px rgba(20, 20, 40, 0.10);

    opacity: 0;
    visibility: hidden;

    transform: translateY(-8px);

    pointer-events: none;

    z-index: 100;

    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0.18s ease;
}


/* открыто */

.drop__menu.active {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);

    pointer-events: auto;
}


/* LIST */

.drop__menu ul {
    list-style: none;
}


/* ITEM */

.drop__menu li {
    width: 100%;
}


.link-card {
    justify-content: space-between;
}


.link-card__icon {
    width: 48px;
    height: 48px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    object-fit: cover;

    background: var(--secondary-background-color);

    border: 1px solid var(--border-color);
    border-radius: 12px;
}


.link-card__icon--fallback {
    background:
        linear-gradient(
            135deg,
            var(--accent-color),
            #d9d2ff
        );

    color: #ffffff;

    font-size: 20px;
    font-weight: 750;
}


.link-card__content {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 5px;
}


.link-card__content h4 {
    max-width: 100%;

    overflow: hidden;

    font-size: 16px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.link-card__content h4 a {
    color: var(--text-color);
}


.link-card__content > a {
    max-width: 100%;

    overflow: hidden;

    color: var(--accent-color);

    font-size: 14px;
    font-weight: 600;

    text-overflow: ellipsis;
    white-space: nowrap;
}


.link-card__settings {
    flex-shrink: 0;

    min-width: 78px;

    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}


.icon-action {
    width: 48px;
    height: 48px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    background: transparent;

    border: none;
    border-radius: 10px;

    cursor: pointer;

    transition:
        background 0.18s ease,
        transform 0.18s ease;
}


.icon-action img {
    width: 40px;
    height: 40px;

    object-fit: contain;

    opacity: 0.66;

    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}


.icon-action:hover {
    background: var(--secondary-background-color);
}


.icon-action:hover img {
    opacity: 1;

    transform: scale(1.05);
}


.icon-action:active {
    transform: scale(0.95);
}


.icon-action--danger:hover {
    background: rgba(224, 75, 75, 0.09);
}


/* ACTION MODAL */

.action-modal {
    position: fixed;
    inset: 0;

    display: grid;
    place-items: center;

    padding: 24px;

    background: rgba(10, 10, 18, 0.38);

    z-index: 1000;
}


.action-modal__panel {
    width: min(100%, 430px);

    background: var(--background-color);

    border: 1px solid var(--border-color);
    border-radius: var(--radius-large);

    box-shadow: 0 22px 70px rgba(10, 10, 24, 0.18);
}


.action-modal__form {
    padding: 22px;
}


.action-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 18px;
}


.action-modal__head h3 {
    color: var(--text-color);

    font-size: 19px;
    font-weight: 700;
}


.action-modal__close {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: transparent;

    color: var(--secondary-text-color);

    border: none;
    border-radius: 9px;

    font-size: 24px;
    line-height: 1;

    cursor: pointer;
}


.action-modal__close:hover {
    background: var(--secondary-background-color);

    color: var(--text-color);
}


.action-modal__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}


.action-modal__field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


.action-modal__field span {
    color: var(--sidebar-text);

    font-size: 13px;
    font-weight: 650;
}


.action-modal__field input {
    width: 100%;
    height: 48px;

    padding: 0 14px;

    background: var(--secondary-background-color);

    color: var(--text-color);

    border: 1px solid transparent;
    border-radius: 12px;

    outline: none;

    font-size: 15px;
}


.action-modal__field input:focus {
    background: var(--background-color);

    border-color:
        color-mix(
            in srgb,
            var(--accent-color) 35%,
            var(--border-color)
        );
}


.action-modal__text {
    color: var(--secondary-text-color);

    font-size: 14px;
    line-height: 1.5;
}


.action-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;

    margin-top: 22px;
}


.action-modal__cancel,
.action-modal__submit {
    min-height: 42px;

    padding: 0 16px;

    border: none;
    border-radius: 11px;

    font-size: 14px;
    font-weight: 650;

    cursor: pointer;

    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}


.action-modal__cancel {
    background: var(--secondary-background-color);

    color: var(--text-color);
}


.action-modal__submit {
    color: #ffffff;
}


.action-modal__submit--primary {
    background: var(--accent-color);
}


.action-modal__submit--danger {
    background: #e04b4b;
}


.action-modal__cancel:hover,
.action-modal__submit:hover {
    opacity: 0.9;
}


.action-modal__cancel:active,
.action-modal__submit:active {
    transform: scale(0.97);
}


.links__container--medium .link-card,
.links__container--small .link-card {
    min-height: 118px;

    align-items: flex-start;
}


.links__container--medium .link-card {
    padding: 20px;
}


.links__container--small .link-card {
    min-height: 132px;

    flex-direction: column;
    gap: 14px;

    padding: 18px;
}


.links__container--small .link-card__icon {
    width: 42px;
    height: 42px;

    border-radius: 11px;
}


.links__container--small .link-card__content {
    width: 100%;
}


.links__container--small .link-card__settings {
    width: 100%;
    min-width: 0;

    justify-content: flex-start;
}


@media (max-width: 760px) {
    .link-card .icon-action {
        width: 34px;
        height: 34px;
    }

    .link-card .icon-action img {
        width: 22px;
        height: 22px;
    }

    .action-modal {
        padding: 16px;
    }
}


/* POLISH */

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


#username {
    min-width: 0;

    color: var(--text-color);
    appearance: none;
}


#username::before {
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}


#username::after {
    flex-shrink: 0;
}


.drop__menu {
    top: calc(50% + 38px);

    border-radius: 12px;
}


#selectBoards .board-item__select:hover {
    background: transparent;
}


.board-item {
    min-height: 52px;

    transition:
        background 0.18s ease,
        box-shadow 0.18s ease;
}


.board-item:hover {
    background: var(--secondary-background-color);
}


.board-item.active:hover {
    background: var(--accent-soft);
}


.board-item__actions {
    padding-right: 8px;
}


#selectBoards .icon-action {
    width: 34px;
    min-height: 34px;
    height: 34px;
}


#selectBoards .icon-action img {
    width: 24px;
    height: 24px;
}


.link-card {
    border-radius: 14px;
}


.link-card__settings {
    opacity: 0;

    transition: opacity 0.18s ease;
}


.link-card:hover .link-card__settings,
.link-card:focus-within .link-card__settings {
    opacity: 1;
}


.link-card .icon-action {
    width: 38px;
    height: 38px;
}


.link-card .icon-action img {
    width: 26px;
    height: 26px;
}


.links__container--small .link-card__settings,
.links__container--medium .link-card__settings {
    opacity: 1;
}


.empty-state {
    box-shadow: var(--shadow-small);
}


.action-modal__panel {
    animation: modalIn 0.16s ease;
}


@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


@media (max-width: 1100px) {
    body {
        min-width: 0;
    }

    .section__left {
        width: 250px;
    }

    .section__right {
        width: calc(100% - 250px);
        margin-left: 250px;
        padding-left: 28px;
        padding-right: 28px;
    }

    #addLink label {
        align-items: stretch;
        flex-wrap: wrap;
    }

    #inpunL {
        flex-basis: 100%;
    }
}


.links__container--small .link-card__content h4 {
    font-size: 15px;
}


.links__container--small .link-card__content > a {
    font-size: 13px;
}


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


.drop__menu li[hidden] {
    display: none;
}


/* LINK */

.drop__menu a {
    width: 100%;
    min-height: 44px;

    display: flex;
    align-items: center;

    padding: 0 14px;

    color: var(--text-color);

    text-decoration: none;

    border-radius: 9px;

    font-size: 14px;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


.drop__menu a:hover {
    background: var(--secondary-background-color);

    color: var(--accent-color);
}


/* разделитель перед выходом */

.drop__menu li[data-auth="user"] {
    margin-top: 6px;
    padding-top: 6px;

    border-top: 1px solid var(--border-color);
}


/* выход */

.drop__menu li[data-auth="user"] a {
    color: #e04b4b;
}

.drop__menu li[data-auth="user"] a:hover {
    background: rgba(224, 75, 75, 0.08);
}


/* =========================================================
   RESPONSIVE APP LAYOUT
========================================================= */

@media (min-width: 901px) and (max-width: 1200px) {
    .section__right {
        padding-left: 32px;
        padding-right: 32px;
    }

    .links__container--medium,
    .links__container--small {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


@media (max-width: 900px) {
    :root {
        --mobile-gutter: clamp(18px, 5vw, 36px);
    }

    body {
        min-width: 0;
        min-height: 100vh;

        display: flex;
        flex-direction: column;

        overflow-x: hidden;
    }

    .section__left,
    .section__right {
        display: contents;
    }

    .left__block:nth-child(1),
    .right__block.head,
    .right__block.add__link,
    .left__block.menu,
    .right__block.links,
    .left__block.info,
    .left__block.theme {
        width: 100%;
        max-width: 760px;

        margin-left: auto;
        margin-right: auto;

        padding-left: var(--mobile-gutter);
        padding-right: var(--mobile-gutter);
    }

    .left__block:nth-child(1) {
        order: 1;

        height: 84px;

        font-size: 25px;
    }

    .right__block.head {
        order: 2;

        min-height: 0;

        display: block;

        padding-top: 18px;
        padding-bottom: 28px;
    }

    .head h1 {
        margin-bottom: 8px;

        font-size: clamp(25px, 5vw, 31px);
        line-height: 1.16;
        letter-spacing: 0;
    }

    .head p {
        font-size: 15px;
        line-height: 1.5;
    }

    #username {
        position: absolute;
        top: -67px;
        right: var(--mobile-gutter);

        width: 48px;
        height: 48px;

        justify-content: center;

        padding: 5px;

        font-size: 0;
    }

    #username::before {
        width: 38px;
        height: 38px;

        margin: 0;
    }

    #username::after {
        display: none;
    }

    .drop__menu {
        top: -14px;
        right: var(--mobile-gutter);

        width: min(250px, calc(100vw - (var(--mobile-gutter) * 2)));
    }

    .right__block.add__link {
        order: 3;

        margin-bottom: 30px;
    }

    #addLink {
        padding: 14px;

        border-radius: 16px;
    }

    #addLink label {
        min-height: 0;

        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;

        padding: 8px;
    }

    #addLink input {
        width: 100%;
        min-width: 0;
    }

    #inpunL {
        grid-column: 1 / -1;

        background: var(--secondary-background-color);
    }

    #inpunH {
        width: 100%;
    }

    #addLink button {
        min-width: 132px;
    }

    .left__block.menu {
        order: 4;

        flex: none;

        display: block;

        padding-bottom: 34px;

        overflow: visible;
    }

    #boards label {
        margin-bottom: 16px;
    }

    #selectBoards {
        max-height: min(46vh, 420px);

        gap: 8px;

        padding-right: 5px;

        overscroll-behavior: contain;
    }

    .board-item {
        min-height: 64px;

        background: var(--background-color);

        border: 1px solid var(--border-color);
        border-radius: 14px;

        box-shadow: var(--shadow-small);
    }

    #selectBoards .board-item__select {
        min-height: 62px;

        padding-left: 14px;
        padding-right: 8px;
    }

    .board-item__actions {
        padding-right: 9px;

        opacity: 1;
    }

    .right__block.links {
        order: 5;

        padding-bottom: 36px;
    }

    .head__links {
        min-height: 52px;

        margin-bottom: 12px;

        padding: 0;
    }

    .head__links h3 {
        font-size: 19px;
    }

    .links__container {
        gap: 10px;
    }

    .links__container--medium,
    .links__container--small {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 12px;
    }

    .links__container > * {
        min-width: 0;
    }

    .links__container--medium .link-card,
    .links__container--small .link-card {
        min-height: 154px;

        flex-direction: column;
        gap: 12px;

        padding: 16px;
    }

    .links__container--medium .link-card__content,
    .links__container--small .link-card__content {
        width: 100%;
    }

    .links__container--medium .link-card__settings,
    .links__container--small .link-card__settings {
        width: 100%;
        min-width: 0;

        justify-content: flex-start;
    }

    .link-card__settings {
        opacity: 1;
    }

    .empty-state--links {
        min-height: 138px;

        padding: 22px;
    }

    .left__block.info {
        order: 6;

        padding-top: 0;
        padding-bottom: 12px;
    }

    .info__block {
        min-height: 112px;

        padding: 20px;
    }

    .left__block.theme {
        order: 7;

        min-height: 76px;

        padding-bottom: 18px;
    }

    .theme button {
        width: 100%;
        min-height: 48px;

        justify-content: flex-start;

        background: var(--background-color);

        border: 1px solid var(--border-color);
    }
}


@media (max-width: 640px) {
    :root {
        --mobile-gutter: 18px;
    }

    .left__block:nth-child(1) {
        height: 76px;

        font-size: 23px;
    }

    .right__block.head {
        padding-top: 14px;
        padding-bottom: 24px;
    }

    #username {
        top: -61px;
    }

    .drop__menu {
        top: -8px;
    }

    .right__block.add__link {
        margin-bottom: 26px;
    }

    #addLink {
        padding: 0;

        background: transparent;

        border: none;
        box-shadow: none;
    }

    #addLink label {
        grid-template-columns: 1fr;

        gap: 9px;

        padding: 12px;

        box-shadow: var(--shadow-small);
    }

    #inpunL,
    #inpunH,
    #addLink button {
        grid-column: 1;

        width: 100%;
    }

    #addLink button {
        min-width: 0;
    }

    .links__container--medium {
        grid-template-columns: 1fr;
    }

    .links__container--medium .link-card {
        min-height: 92px;

        flex-direction: row;
        align-items: center;

        padding: 16px;
    }

    .links__container--medium .link-card__content {
        width: auto;
    }

    .links__container--medium .link-card__settings {
        width: auto;
        min-width: 72px;

        justify-content: flex-end;
    }

    .links__container--small {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 9px;
    }

    .links__container--small .link-card {
        min-height: 158px;

        padding: 14px;
    }

    .links__container--small .link-card__settings {
        margin-top: auto;
    }

    .links__container--list .link-card,
    .links__container--medium .link-card {
        gap: 12px;
    }

    .links__container--list .link-card {
        min-height: 88px;

        padding: 14px;
    }

    .link-card__icon {
        width: 44px;
        height: 44px;

        border-radius: 11px;
    }

    .link-card__content h4 {
        font-size: 15px;
    }

    .link-card__content > a {
        font-size: 13px;
    }

    .link-card__settings {
        min-width: 72px;

        gap: 2px;
    }

    .link-card .icon-action {
        width: 34px;
        height: 34px;
    }

    .link-card .icon-action img {
        width: 26px;
        height: 26px;
    }

    .empty-state--links {
        flex-direction: column;

        gap: 14px;

        padding: 20px;
    }

    .action-modal__panel {
        max-height: calc(100vh - 32px);

        overflow-y: auto;
    }
}


@media (max-width: 420px) {
    :root {
        --mobile-gutter: 14px;
    }

    .head h1 {
        font-size: 24px;
    }

    .head p {
        font-size: 14px;
    }

    .head__links {
        gap: 10px;
    }

    .head__links h3 {
        font-size: 17px;
    }

    .head__links button {
        width: 36px;
        height: 36px;
    }

    .links-view-btn img {
        width: 24px;
        height: 24px;
    }

    #selectBoards .icon-action {
        width: 36px;
        min-height: 36px;
        height: 36px;
    }

    #selectBoards .icon-action img {
        width: 26px;
        height: 26px;
    }

    .links__container--list .link-card,
    .links__container--medium .link-card {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);

        gap: 10px 12px;
    }

    .links__container--list .link-card__settings,
    .links__container--medium .link-card__settings {
        grid-column: 2;

        width: 100%;
        min-width: 0;

        justify-content: flex-start;
    }

    .links__container--small .link-card {
        min-height: 150px;

        gap: 10px;

        padding: 12px;
    }

    .links__container--small .link-card__icon {
        width: 40px;
        height: 40px;
    }

    .action-modal {
        padding: 12px;
    }

    .action-modal__form {
        padding: 18px;
    }

    .action-modal__actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}


@media (hover: none), (pointer: coarse) {
    .board-item__actions,
    .link-card__settings {
        opacity: 1;
    }
}


/* =========================================================
   MOBILE LINK GRID VARIANTS
========================================================= */

.link-card__more {
    display: none;
}


@media (max-width: 900px) {
    .links__container--medium {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 12px;
    }

    .links__container--medium .link-card {
        min-height: 166px;

        flex-direction: column;
        align-items: flex-start;
        gap: 12px;

        padding: 16px;
    }

    .links__container--medium .link-card__icon {
        width: 44px;
        height: 44px;
    }

    .links__container--medium .link-card__content {
        width: 100%;
    }

    .links__container--medium .link-card__settings {
        width: 100%;
        min-width: 0;

        justify-content: flex-start;

        margin-top: auto;
    }

    .links__container--small {
        grid-template-columns: repeat(3, minmax(0, 1fr));

        gap: 10px;
    }

    .links__container--small .link-card {
        position: relative;

        min-height: 0;
        aspect-ratio: 1;

        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-end;
        gap: 10px;

        padding: 14px;
    }

    .links__container--small .link-card__icon {
        width: 46px;
        height: 46px;

        border-radius: 12px;
    }

    .links__container--small .link-card__content {
        width: 100%;

        padding-right: 28px;
    }

    .links__container--small .link-card__content h4 {
        display: -webkit-box;

        overflow: hidden;

        line-height: 1.3;
        white-space: normal;

        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .links__container--small .link-card__content > a {
        display: none;
    }

    .links__container--small .link-card__more {
        position: absolute;
        top: 9px;
        right: 9px;

        width: 38px;
        height: 38px;

        display: inline-flex;
        align-items: center;
        justify-content: center;

        padding: 0 0 7px;

        background: var(--secondary-background-color);

        color: var(--secondary-text-color);

        border: 1px solid var(--border-color);
        border-radius: 10px;

        font-size: 25px;
        font-weight: 700;
        line-height: 1;
        letter-spacing: 0;

        z-index: 3;
    }

    .links__container--small .link-card__more:hover,
    .links__container--small .link-card.actions-open .link-card__more {
        background: var(--accent-soft);

        color: var(--accent-color);
    }

    .links__container--small .link-card__settings {
        position: absolute;
        top: 52px;
        right: 9px;

        width: auto;
        min-width: 0;

        display: none;
        align-items: center;
        justify-content: center;
        gap: 3px;

        padding: 5px;

        background: var(--background-color);

        border: 1px solid var(--border-color);
        border-radius: 11px;

        box-shadow: 0 12px 28px rgba(20, 20, 40, 0.14);

        opacity: 0;

        z-index: 4;
    }

    .links__container--small .link-card.actions-open {
        z-index: 5;
    }

    .links__container--small .link-card.actions-open .link-card__settings {
        display: flex;

        opacity: 1;
    }

    .links__container--small .link-card__settings .icon-action {
        width: 38px;
        height: 38px;
    }

    .links__container--small .link-card__settings .icon-action img {
        width: 28px;
        height: 28px;
    }
}


@media (max-width: 640px) {
    .links__container--medium,
    .links__container--small {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 9px;
    }

    .links__container--medium .link-card {
        min-height: 164px;

        padding: 14px;
    }

    .links__container--medium .link-card__settings {
        width: 100%;

        justify-content: flex-start;
    }

    .links__container--small .link-card {
        min-height: 0;

        padding: 12px;
    }

    .links__container--small .link-card__icon {
        width: 42px;
        height: 42px;
    }
}


@media (max-width: 360px) {
    .links__container--medium .link-card {
        min-height: 156px;

        padding: 12px;
    }

    .links__container--medium .link-card__icon {
        width: 40px;
        height: 40px;
    }

    .links__container--small .link-card__more {
        top: 7px;
        right: 7px;

        width: 36px;
        height: 36px;
    }

    .links__container--small .link-card__settings {
        top: 47px;
        right: 7px;
    }
}


/* COMPACT SMALL GRID */

@media (max-width: 900px) {
    .links__container--small {
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));

        gap: 7px;
    }

    .links__container--small .link-card {
        min-height: 0;
        aspect-ratio: 1;

        justify-content: flex-start;
        gap: 6px;

        padding: 8px;

        border-radius: 12px;
    }

    .links__container--small .link-card__icon {
        width: 34px;
        height: 34px;

        border-radius: 9px;
    }

    .links__container--small .link-card__content {
        width: 100%;

        margin-top: auto;
        padding-right: 0;
    }

    .links__container--small .link-card__content h4 {
        font-size: 12px;
        line-height: 1.25;
    }

    .links__container--small .link-card__more {
        top: 7px;
        right: 7px;

        width: 32px;
        height: 32px;

        padding-bottom: 6px;

        border-radius: 8px;

        font-size: 21px;
    }

    .links__container--small .link-card__settings {
        top: 43px;
        right: 7px;

        gap: 2px;

        padding: 4px;

        border-radius: 9px;
    }

    .links__container--small .link-card__settings .icon-action {
        width: 34px;
        height: 34px;
    }

    .links__container--small .link-card__settings .icon-action img {
        width: 25px;
        height: 25px;
    }
}
