:root {
    --panel-soft: #f6f8fb;
    --text: #000000;
    --muted: #1a1f24;
    --accent-strong: #4e58b4;
    --sidebar-bg: #1d2c39;
    --sidebar-bg-deep: #16232f;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: #d9e6f1;
    --sidebar-muted: #98adbf;
    --sidebar-hover: #223748;
    --shadow: 0 14px 40px rgba(19, 37, 52, 0.16);
    --radius: 18px;
    --sidebar-width: 220px;
    --header-height: 78px;
    --transition: 180ms ease;
    --font: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    font-size: 14px;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: radial-gradient(circle at top right, rgba(107, 116, 199, 0.12), transparent 24rem), linear-gradient(180deg, #f6f8fb 0%, #eef3f7 100%);
    overflow: hidden;
}

button,
a {
    font: inherit;
}

button {
    cursor: pointer;
    border: 0;
    background: none;
    color: inherit;
}

a {
    color: #000030;
    font-weight: 600;
}

td {
    padding: 2px 6px 2px 2px
}

section.accordion__item a {
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    position: relative;
}

.sidebar {
    position: relative;
    z-index: 30;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 28%), linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-deep) 100%);
    color: var(--sidebar-text);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 10px 0 28px rgba(6, 15, 22, 0.2);
}

.sidebar__brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 22px 22px 18px;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar__brand-logo {
    display: block;
    width: 100%;
    max-width: 220px;
    height: auto;
    object-fit: contain;
}

.sidebar__nav {
    flex: 1 1 auto;
    overflow-y: auto;
}

    .sidebar__nav::-webkit-scrollbar,
    .workspace__body::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }

    .sidebar__nav::-webkit-scrollbar-thumb,
    .workspace__body::-webkit-scrollbar-thumb {
        background: rgba(112, 131, 150, 0.4);
        border-radius: 999px;
    }

.nav-link,
.accordion__trigger,
.nav-sublink {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    transition: background-color var(--transition), color var(--transition), transform var(--transition);
}

.nav-link,
.accordion__trigger {
    padding: 13px 20px;
    color: var(--sidebar-text);
    border-left: 3px solid transparent;
}

    .nav-link:hover,
    /*.accordion__trigger:hover*/ {
        background: var(--sidebar-hover);
    }

    .nav-link.is-active,
    .accordion__trigger {
        background: linear-gradient(90deg, rgba(107, 116, 199, 0.28), rgba(40, 68, 87, 0.12));
        border-left-color: #8aa9d9;
    }

.nav-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

    .nav-icon::before {
        content: "";
        position: absolute;
        inset: 5px;
        border-radius: 4px;
        border: 1px solid rgba(255, 255, 255, 0.45);
    }

.nav-label {
    min-width: 0;
    font-size: 0.95rem;
    line-height: 1.2;
}

.nav-chevron {
    margin-left: auto;
    color: var(--sidebar-muted);
    transition: transform var(--transition), color var(--transition);
}

.accordion__trigger[aria-expanded="true"] .nav-chevron {
    transform: rotate(90deg);
    color: var(--sidebar-text);
}

.accordion__panel {
    background: rgba(7, 15, 20, 0.12);
}

.nav-sublink {
    padding: 10px 20px 10px 54px;
    color: var(--sidebar-muted);
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    position: relative;
}

    .nav-sublink::before {
        content: "";
        position: absolute;
        left: 34px;
        top: 50%;
        width: 8px;
        height: 8px;
        transform: translateY(-50%);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.2);
    }

    .nav-sublink:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--sidebar-text);
    }

    .nav-sublink.is-active {
        color: #ffffff;
        border-left-color: #7ec1d0;
        background: rgba(255, 255, 255, 0.08);
    }

.sidebar__footer {
    padding: 16px 20px 22px;
    border-top: 1px solid var(--sidebar-border);
    color: var(--sidebar-muted);
    font-size: 0.82rem;
}

.workspace {
    min-width: 0;
    display: grid;
    grid-template-rows: var(--header-height) minmax(0, 1fr);
    min-height: 0;
    height: 100%;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(25, 50, 71, 0.08);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar__menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(25, 50, 71, 0.12);
    color: var(--text);
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 4px 14px rgba(25, 50, 71, 0.08);
}

    .topbar__menu-toggle span,
    .topbar__menu-toggle span::before,
    .topbar__menu-toggle span::after {
        display: block;
        width: 18px;
        height: 2px;
        background: currentColor;
        border-radius: 999px;
        position: relative;
        transition: transform var(--transition), opacity var(--transition);
    }

        .topbar__menu-toggle span::before,
        .topbar__menu-toggle span::after {
            content: "";
            position: absolute;
            left: 0;
        }

        .topbar__menu-toggle span::before {
            top: -6px;
        }

        .topbar__menu-toggle span::after {
            top: 6px;
        }

.breadcrumbs {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.breadcrumbs__title {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text);
}

.breadcrumbs__separator {
    color: #9aabba;
}

.breadcrumbs__current {
    font-size: 0.94rem;
    color: var(--muted);
}

.topbar__spacer {
    flex: 1 1 auto;
    min-width: 0;
}

.user-menu {
    position: relative;
    flex: 0 0 auto;
}

.user-menu__button {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 8px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(25, 50, 71, 0.1);
    box-shadow: 0 8px 24px rgba(25, 50, 71, 0.08);
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

    .user-menu__button:hover,
    .user-menu__button[aria-expanded="true"] {
        background: #ffffff;
        border-color: rgba(107, 116, 199, 0.45);
        box-shadow: 0 12px 30px rgba(25, 50, 71, 0.12);
    }

.user-menu__identity {
    text-align: right;
    line-height: 1.15;
}

.user-menu__name {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
}

.user-menu__meta {
    display: block;
    margin-top: 2px;
    font-size: 0.74rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.user-menu__avatar {
    width: 38px;
    height: 38px;
    border-radius: 13px;
    padding: 2px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
    object-fit: contain;
    display: block;
    flex: 0 0 auto;
}

.user-menu__chevron {
    color: var(--muted);
    transition: transform var(--transition);
}

.user-menu__button[aria-expanded="true"] .user-menu__chevron {
    transform: rotate(180deg);
}

.user-menu__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    padding: 8px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(25, 50, 71, 0.1);
    box-shadow: var(--shadow);
}

.user-menu__item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--text);
    text-align: left;
}

    .user-menu__item:hover,
    .user-menu__item:focus-visible {
        background: var(--panel-soft);
        outline: none;
    }

.workspace__body {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
}

.template-content {
    min-height: calc(100vh - var(--header-height) - 56px);
    display: grid;
    align-content: start;
    gap: 22px;
}

.content-placeholder {
    min-height: 100%;
    border-radius: calc(var(--radius) + 6px);
    border: 1px solid rgba(25, 50, 71, 0.08);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.content-placeholder__hero {
    padding: 28px 32px 22px;
    border-bottom: 1px solid rgba(25, 50, 71, 0.08);
    background: radial-gradient(circle at top left, rgba(107, 116, 199, 0.12), transparent 16rem), linear-gradient(180deg, rgba(107, 116, 199, 0.06), transparent);
}

.content-placeholder__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-strong);
    background: rgba(107, 116, 199, 0.12);
}

.content-placeholder__hero h1 {
    margin: 16px 0 10px;
    font-size: clamp(1.7rem, 2vw, 2.2rem);
    line-height: 1.15;
}

.content-placeholder__hero p {
    max-width: 54rem;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.content-placeholder__grid {
    display: grid;
    grid-template-columns: minmax(600px, 2fr) 280px;
    gap: 22px;
    /*padding: 22px 28px 30px;*/
}

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

.canvas,
.notes {
    border-radius: var(--radius);
    background: #ffffff;
    border: 1px solid rgba(25, 50, 71, 0.08);
    min-height: 340px;
    padding: 24px;
}

.canvas {
    display: grid;
    border-style: dashed;
    /* background:
    linear-gradient(180deg, rgba(246, 248, 251, 0.8), rgba(255, 255, 255, 0.96)),
    #ffffff; */
}

.canvas__badge {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(107, 116, 199, 0.18), rgba(94, 166, 193, 0.22)), #eef3f7;
    position: relative;
}

    .canvas__badge::before {
        content: "";
        position: absolute;
        inset: 16px;
        border: 2px dashed rgba(25, 50, 71, 0.32);
        border-radius: 16px;
    }

.canvas h1:first-of-type {
    padding-top: 0;
    margin-top: 0;
}

.canvas__inner h2,
.notes h2 {
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.canvas__inner p,
.notes p,
.notes li {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.notes ul {
    margin: 18px 0 0;
    padding-left: 0px;
    display: grid;
    gap: 10px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(9, 18, 27, 0.48);
    backdrop-filter: blur(4px);
}

    .sidebar-overlay.is-visible {
        display: block;
    }

.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;
}

@media (max-width: 1235px) {
    .content-placeholder__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(86vw, var(--sidebar-width));
        transform: translateX(-100%);
        transition: transform 220ms ease;
    }

        .sidebar.is-open {
            transform: translateX(0);
        }

    .topbar {
        padding-inline: 18px;
    }

    .topbar__menu-toggle {
        display: inline-flex;
    }

    .workspace__body {
        padding: 18px;
    }
}

@media (max-width: 640px) {
    .topbar {
        gap: 12px;
    }

    .breadcrumbs {
        gap: 6px;
    }

    .breadcrumbs__title {
        font-size: 0.95rem;
    }

    .user-menu__identity {
        display: none;
    }

    .content-placeholder__hero,
    .content-placeholder__grid,
    .canvas,
    .notes {
        padding-inline: 18px;
    }

    .content-placeholder__grid {
        padding-top: 18px;
    }
}

.is-hidden {
    display: none;
}

div.inline {
    display: inline;
}

#previewMessage {
    border: 1px solid darkgray;
    padding: 2px;
    color: black;
    background-color: #EEE;
}

[data-warn="true"] {
    color: red;
    font-weight: bolder;
    font-size: larger;
}

ul.linklist {
    list-style: none;
}

.default-table {
    border-collapse: collapse;
    border: none;
}

.default-table-wide {
    width: 100%;
}

.default-table th {
    font-weight: bold;
    color: white;
    background-color: #2f65a1;
    text-align: left;
    border: none;
}

.default-table tr:nth-child(odd) {
    background-color: white;
    border: none;
}

.default-table tr:nth-child(even) {
    background-color: #F7F6F3;
    border: none;
}

.default-table td {
    border: none;
}

.default-table-vertical td:first-child {
    font-weight: bold;
}

.default-table th,
.default-table td {
    padding-left: 12px;
    padding-right: 12px;
}

.default-table tr > th:first-child,
.default-table tr > td:first-child {
    padding-left: 2px;
}

.default-table tr > th:last-child,
.default-table tr > td:last-child {
    padding-right: 2px;
}