.home-heading .eyebrow {
    margin: 0 0 8px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
}

.home-heading h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 1.02;
}

.home-heading p:not(.eyebrow) {
    max-width: 680px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.7;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 24px 0 28px;
}

.home-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 34px;
}

.home-stats div {
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.home-stats strong {
    display: block;
    font-size: 32px;
    line-height: 1;
}

.home-stats span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.home-section {
    border-top: 1px solid var(--line);
    padding-top: 22px;
}

.home-section h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

.home-note-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.home-note-grid a {
    display: block;
    min-height: 112px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 14px;
}

.home-note-grid a:hover {
    border-color: var(--accent);
}

.home-note-grid strong,
.home-note-grid span {
    display: block;
}

.home-note-grid strong {
    margin-bottom: 8px;
}

.home-note-grid span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.tag-page {
    max-width: 1080px;
}

.tag-page-heading {
    margin-bottom: 24px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--accent) 14%, transparent),
            transparent 46%
        ),
        var(--panel);
    box-shadow: var(--shadow);
}

.tag-page-heading .eyebrow {
    margin: 0 0 8px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 800;
}

.tag-page-heading h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 60px);
    line-height: 1.05;
}

.tag-page-heading p {
    margin: 12px 0 0;
    color: var(--muted);
}

.tag-result-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.tag-result-grid a {
    display: grid;
    gap: 8px;
    min-height: 148px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    padding: 16px;
    color: var(--ink);
    box-shadow: 0 12px 26px rgba(54, 42, 29, 0.045);
}

.tag-result-grid a:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.tag-result-grid strong,
.tag-result-grid span,
.tag-result-grid em {
    display: block;
}

.tag-result-grid span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.tag-result-grid em {
    align-self: end;
    color: var(--accent-dark);
    font-size: 13px;
    font-style: normal;
    font-weight: 800;
}

.category-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-self: end;
}

.tag-result-grid .category-badges em {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 7%, var(--panel));
    color: var(--accent-dark);
    padding: 5px 8px;
    font-size: 12px;
    line-height: 1.2;
}

.tag-page-more {
    margin-top: 18px;
}

.editor {
    display: grid;
    gap: 16px;
    max-width: 980px;
}

.editor form:first-child {
    display: grid;
    gap: 16px;
}

.structured-editor label {
    display: grid;
    gap: 7px;
}

.structured-editor label span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.title-input,
.category-input,
.structured-editor input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink);
    padding: 12px 13px;
    outline: none;
}

.title-input:focus,
.category-input:focus,
.structured-editor input:focus,
.editor textarea:focus {
    border-color: var(--accent);
}

.title-input {
    font-size: 28px;
    font-weight: 800;
}

.editor textarea {
    width: 100%;
    min-height: 210px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--ink);
    padding: 16px;
    line-height: 1.6;
    outline: none;
}

.editor textarea.short {
    min-height: 120px;
}

.markdown-editor textarea.raw-markdown {
    min-height: 62vh;
    font-family:
        ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
}

.empty-state {
    max-width: 720px;
    margin: 80px auto;
    text-align: center;
}

.empty-state h1 {
    margin: 0 0 12px;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.08;
}

.empty-state p {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
}

/* =========================
   Home / Tag Page Centered v2
========================= */

.home,
.tag-page {
    width: min(1180px, 100%);
    max-width: none;
    margin: 0 auto;
}

/* Home Hero */

.home {
    display: grid;
    gap: 26px;
    padding: 22px 0 42px;
}

.home-heading {
    position: relative;
    overflow: hidden;
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 26px;
    background:
        radial-gradient(
            circle at 8% 8%,
            color-mix(in srgb, var(--accent) 14%, transparent),
            transparent 34%
        ),
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--panel) 96%, transparent),
            color-mix(in srgb, var(--bg) 92%, var(--panel) 8%)
        );
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.055);
    padding: clamp(26px, 5vw, 54px);
}

.home-heading .eyebrow {
    display: inline-flex;
    margin: 0 0 12px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 900;
}

.home-heading h1 {
    max-width: 860px;
    margin: 0;
    color: var(--ink);
    font-size: clamp(44px, 7vw, 84px);
    letter-spacing: -0.07em;
    line-height: 0.98;
}

.home-heading p:not(.eyebrow) {
    max-width: 720px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: clamp(16px, 2vw, 20px);
    line-height: 1.75;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 28px 0 0;
}

.home-actions a,
.home-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
    border-radius: 12px;
    background: var(--panel);
    color: var(--ink);
    padding: 0 14px;
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
}

.home-actions a:first-child,
.home-actions button:first-child {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 20%, transparent);
}

.home-actions a:hover,
.home-actions button:hover {
    border-color: var(--accent);
}

/* Home Stats */

.home-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}

.home-stats div {
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 20px;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--panel) 94%, transparent),
        color-mix(in srgb, var(--bg) 92%, var(--panel) 8%)
    );
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.04);
    padding: 22px;
}

.home-stats strong {
    display: block;
    color: var(--ink);
    font-size: 36px;
    letter-spacing: -0.055em;
    line-height: 1;
}

.home-stats span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

/* Recent Docs */

.home-section {
    border: 0;
    padding: 0;
}

.home-section h2 {
    margin: 0 0 14px;
    color: var(--ink);
    font-size: 22px;
    letter-spacing: -0.035em;
}

.home-note-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.home-note-grid a {
    display: grid;
    gap: 10px;
    min-height: 132px;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 18px;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--panel) 96%, transparent),
        color-mix(in srgb, var(--bg) 94%, var(--panel) 6%)
    );
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.035);
    padding: 18px;
    transition:
        border-color 0.16s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease;
}

.home-note-grid a:hover {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
    transform: translateY(-2px);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.07);
}

.home-note-grid strong {
    color: var(--ink);
    font-size: 16px;
    font-weight: 900;
}

.home-note-grid span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* Tag / Search / Category Hero */

.tag-page {
    display: grid;
    gap: 24px;
    padding: 22px 0 44px;
}

.tag-page-heading {
    position: relative;
    overflow: hidden;
    margin: 0;
    border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
    border-radius: 24px;
    background:
        radial-gradient(
            circle at 0% 0%,
            color-mix(in srgb, var(--accent) 13%, transparent),
            transparent 34%
        ),
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--panel) 96%, transparent),
            color-mix(in srgb, var(--bg) 92%, var(--panel) 8%)
        );
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.055);
    padding: clamp(24px, 4vw, 42px);
}

.tag-page-heading .eyebrow {
    display: inline-flex;
    margin: 0 0 12px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 900;
}

.tag-page-heading h1 {
    margin: 0;
    color: var(--ink);
    font-size: clamp(42px, 6vw, 76px);
    letter-spacing: -0.07em;
    line-height: 1;
}

.tag-page-heading p {
    max-width: 680px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.7;
}

/* Tag Result Cards */

.tag-result-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.tag-result-grid a {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 12px;
    min-height: 220px;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 18px;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--panel) 96%, transparent),
        color-mix(in srgb, var(--bg) 94%, var(--panel) 6%)
    );
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.035);
    padding: 18px;
    color: var(--ink);
    transition:
        border-color 0.16s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease;
}

.tag-result-grid a::after {
    content: '';
    position: absolute;
    right: -34px;
    bottom: -38px;
    width: 110px;
    height: 110px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 7%, transparent);
    pointer-events: none;
}

.tag-result-grid a:hover {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
    transform: translateY(-2px);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.075);
}

.tag-result-grid strong {
    position: relative;
    z-index: 1;
    color: var(--ink);
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.tag-result-grid span {
    position: relative;
    z-index: 1;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
}

.tag-result-grid em {
    position: relative;
    z-index: 1;
    align-self: end;
    color: var(--accent-dark);
    font-size: 13px;
    font-style: normal;
    font-weight: 900;
}

/* Category badges inside cards */

.category-badges {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-self: end;
}

.tag-result-grid .category-badges em {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 7%, var(--panel));
    color: var(--accent-dark);
    padding: 4px 8px;
    font-size: 12px;
    line-height: 1;
}

/* Responsive */

@media (max-width: 1180px) {
    .home,
    .tag-page {
        width: 100%;
    }

    .tag-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .home,
    .tag-page {
        padding-top: 0;
    }

    .home-heading,
    .tag-page-heading {
        border-radius: 18px;
    }

    .home-stats {
        grid-template-columns: 1fr;
    }

    .home-note-grid,
    .tag-result-grid {
        grid-template-columns: 1fr;
    }

    .tag-result-grid a {
        min-height: 180px;
    }
}

/* =========================
   TreeView Modern Home / List
========================= */

.tv-home-page,
.tv-list-page {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 22px 0 56px;
}

.tv-home-page {
    display: grid;
    gap: 34px;
}

.tv-list-page {
    display: grid;
    gap: 24px;
}

/* Hero */

.tv-home-hero,
.tv-list-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 30px;
    background:
        radial-gradient(
            circle at 0% 0%,
            color-mix(in srgb, var(--accent) 15%, transparent),
            transparent 34%
        ),
        radial-gradient(
            circle at 100% 0%,
            color-mix(in srgb, var(--green) 10%, transparent),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--panel) 96%, transparent),
            color-mix(in srgb, var(--bg) 92%, var(--panel) 8%)
        );
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.06);
}

.tv-home-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 28px;
    align-items: end;
    padding: clamp(28px, 5vw, 58px);
}

.tv-list-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: clamp(26px, 4vw, 46px);
}

.tv-hero-kicker {
    display: inline-flex;
    margin-bottom: 13px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 950;
}

.tv-hero-copy h1,
.tv-list-hero h1 {
    margin: 0;
    color: var(--ink);
    letter-spacing: -0.075em;
    line-height: 0.98;
}

.tv-hero-copy h1 {
    max-width: 780px;
    font-size: clamp(48px, 7vw, 86px);
}

.tv-list-hero h1 {
    font-size: clamp(44px, 6vw, 76px);
}

.tv-hero-copy p,
.tv-list-hero p {
    max-width: 720px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: clamp(16px, 1.8vw, 20px);
    line-height: 1.75;
}

/* Hero Buttons */

.tv-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.tv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
    border-radius: 13px;
    background: var(--panel);
    color: var(--ink);
    padding: 0 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.tv-btn:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 7%, var(--panel));
}

.tv-btn.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 22%, transparent);
}

.tv-btn.primary:hover {
    background: var(--accent-dark);
}

/* Hero Stats */

.tv-hero-panel {
    display: grid;
    gap: 10px;
}

.tv-hero-panel div {
    display: grid;
    gap: 5px;
    border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
    border-radius: 18px;
    background: color-mix(in srgb, var(--panel) 74%, transparent);
    backdrop-filter: blur(12px);
    padding: 18px;
}

.tv-hero-panel span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.tv-hero-panel strong {
    color: var(--ink);
    font-size: 30px;
    letter-spacing: -0.05em;
    line-height: 1;
}

/* Sections */

.tv-section {
    display: grid;
    gap: 16px;
}

.tv-section-head,
.tv-result-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.tv-section-head span,
.tv-result-toolbar span {
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 950;
}

.tv-section-head h2 {
    margin: 5px 0 0;
    color: var(--ink);
    font-size: 24px;
    letter-spacing: -0.045em;
}

.tv-section-head a,
.tv-result-toolbar strong {
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.tv-section-head a:hover {
    color: var(--accent-dark);
}

/* Cards */

.tv-card-grid,
.tv-result-grid {
    display: grid;
    gap: 16px;
}

.tv-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tv-result-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tv-doc-card,
.tv-result-card,
.tv-empty-card {
    position: relative;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 22px;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--panel) 96%, transparent),
        color-mix(in srgb, var(--bg) 94%, var(--panel) 6%)
    );
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.045);
}

.tv-doc-card,
.tv-result-card {
    display: grid;
    gap: 13px;
    min-height: 210px;
    color: var(--ink);
    padding: 20px;
    transition:
        border-color 0.16s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease;
}

.tv-doc-card::after,
.tv-result-card::after {
    content: '';
    position: absolute;
    right: -42px;
    bottom: -44px;
    width: 130px;
    height: 130px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 7%, transparent);
    pointer-events: none;
}

.tv-doc-card:hover,
.tv-result-card:hover {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
    transform: translateY(-3px);
    box-shadow: 0 24px 58px rgba(15, 23, 42, 0.08);
}

.tv-card-top,
.tv-card-foot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tv-card-top span {
    overflow: hidden;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tv-card-top em {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 10px;
    background: var(--panel);
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.tv-doc-card:hover .tv-card-top em,
.tv-result-card:hover .tv-card-top em {
    border-color: var(--accent);
    color: var(--accent-dark);
}

.tv-doc-card strong,
.tv-result-card strong {
    position: relative;
    z-index: 1;
    color: var(--ink);
    font-size: 18px;
    font-weight: 950;
    letter-spacing: -0.035em;
    line-height: 1.25;
}

.tv-doc-card p,
.tv-result-card p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.tv-doc-card p {
    -webkit-line-clamp: 3;
}

.tv-result-card p {
    -webkit-line-clamp: 6;
}

.tv-card-foot {
    align-self: end;
}

.tv-card-foot span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.tv-empty-card {
    grid-column: 1 / -1;
    padding: 28px;
}

.tv-empty-card strong {
    display: block;
    color: var(--ink);
    font-size: 18px;
    font-weight: 950;
}

.tv-empty-card p {
    margin: 8px 0 0;
    color: var(--muted);
}

/* Tag Cloud */

.tv-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
    border-radius: 22px;
    background: color-mix(in srgb, var(--panel) 72%, transparent);
    padding: 18px;
}

.tv-tag-cloud a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 999px;
    background: var(--panel);
    color: var(--accent-dark);
    padding: 0 12px;
    font-size: 13px;
    font-weight: 850;
}

.tv-tag-cloud a:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.tv-tag-cloud span {
    color: var(--muted);
    font-size: 12px;
}

/* Responsive */

@media (max-width: 1180px) {
    .tv-home-page,
    .tv-list-page {
        width: 100%;
    }

    .tv-home-hero {
        grid-template-columns: 1fr;
    }

    .tv-hero-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tv-card-grid,
    .tv-result-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .tv-home-page,
    .tv-list-page {
        padding-top: 0;
    }

    .tv-home-hero,
    .tv-list-hero {
        border-radius: 22px;
    }

    .tv-list-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .tv-hero-panel {
        grid-template-columns: 1fr;
    }

    .tv-card-grid,
    .tv-result-grid {
        grid-template-columns: 1fr;
    }

    .tv-doc-card,
    .tv-result-card {
        min-height: 180px;
    }
}

/* =========================
   TreeView Docs Layout Pages
========================= */

.tv-doc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 34px;
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 22px 0 56px;
}

.tv-doc-main {
    display: grid;
    gap: 34px;
    min-width: 0;
}

.tv-right-rail {
    position: sticky;
    top: 88px;
    display: grid;
    align-self: start;
    gap: 14px;
    min-width: 0;
}

/* Hero */

.tv-home-hero,
.tv-list-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 30px;
    background:
        radial-gradient(
            circle at 0% 0%,
            color-mix(in srgb, var(--accent) 14%, transparent),
            transparent 34%
        ),
        radial-gradient(
            circle at 100% 0%,
            color-mix(in srgb, var(--green) 9%, transparent),
            transparent 30%
        ),
        linear-gradient(
            135deg,
            color-mix(in srgb, var(--panel) 96%, transparent),
            color-mix(in srgb, var(--bg) 92%, var(--panel) 8%)
        );
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.06);
}

.tv-home-hero {
    padding: clamp(30px, 5vw, 60px);
}

.tv-list-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: clamp(26px, 4vw, 46px);
}

.tv-hero-kicker {
    display: inline-flex;
    margin-bottom: 13px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 950;
}

.tv-hero-copy h1,
.tv-list-hero h1 {
    margin: 0;
    color: var(--ink);
    letter-spacing: -0.075em;
    line-height: 0.98;
}

.tv-hero-copy h1 {
    max-width: 760px;
    font-size: clamp(48px, 7vw, 84px);
}

.tv-list-hero h1 {
    font-size: clamp(44px, 6vw, 76px);
}

.tv-hero-copy p,
.tv-list-hero p {
    max-width: 720px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: clamp(16px, 1.8vw, 20px);
    line-height: 1.75;
}

.tv-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.tv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
    border-radius: 13px;
    background: var(--panel);
    color: var(--ink);
    padding: 0 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
}

.tv-btn:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 7%, var(--panel));
}

.tv-btn.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 22%, transparent);
}

.tv-btn.primary:hover {
    background: var(--accent-dark);
}

/* Sections */

.tv-section {
    display: grid;
    gap: 16px;
}

.tv-section-head,
.tv-result-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
}

.tv-section-head span,
.tv-result-toolbar span {
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 950;
}

.tv-section-head h2 {
    margin: 5px 0 0;
    color: var(--ink);
    font-size: 24px;
    letter-spacing: -0.045em;
}

.tv-section-head a,
.tv-result-toolbar strong {
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

/* Cards */

.tv-card-grid,
.tv-result-grid {
    display: grid;
    gap: 16px;
}

.tv-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tv-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tv-doc-card,
.tv-result-card,
.tv-empty-card {
    position: relative;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 22px;
    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--panel) 96%, transparent),
        color-mix(in srgb, var(--bg) 94%, var(--panel) 6%)
    );
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.045);
}

.tv-doc-card,
.tv-result-card {
    display: grid;
    gap: 13px;
    min-height: 210px;
    color: var(--ink);
    padding: 20px;
    transition:
        border-color 0.16s ease,
        transform 0.16s ease,
        box-shadow 0.16s ease;
}

.tv-doc-card::after,
.tv-result-card::after {
    content: '';
    position: absolute;
    right: -42px;
    bottom: -44px;
    width: 130px;
    height: 130px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent) 7%, transparent);
    pointer-events: none;
}

.tv-doc-card:hover,
.tv-result-card:hover {
    border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
    transform: translateY(-3px);
    box-shadow: 0 24px 58px rgba(15, 23, 42, 0.08);
}

.tv-card-top,
.tv-card-foot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.tv-card-top span {
    overflow: hidden;
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tv-card-top em {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 10px;
    background: var(--panel);
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.tv-doc-card strong,
.tv-result-card strong {
    position: relative;
    z-index: 1;
    color: var(--ink);
    font-size: 18px;
    font-weight: 950;
    letter-spacing: -0.035em;
    line-height: 1.25;
}

.tv-doc-card p,
.tv-result-card p {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

.tv-doc-card p {
    -webkit-line-clamp: 3;
}

.tv-result-card p {
    -webkit-line-clamp: 6;
}

.tv-card-foot {
    align-self: end;
}

.tv-card-foot span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.tv-empty-card {
    grid-column: 1 / -1;
    padding: 28px;
}

.tv-empty-card strong {
    display: block;
    color: var(--ink);
    font-size: 18px;
    font-weight: 950;
}

.tv-empty-card p {
    margin: 8px 0 0;
    color: var(--muted);
}

/* Tag Cloud */

.tv-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
    border-radius: 22px;
    background: color-mix(in srgb, var(--panel) 72%, transparent);
    padding: 18px;
}

.tv-tag-cloud a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 999px;
    background: var(--panel);
    color: var(--accent-dark);
    padding: 0 12px;
    font-size: 13px;
    font-weight: 850;
}

.tv-tag-cloud a:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.tv-tag-cloud span {
    color: var(--muted);
    font-size: 12px;
}

/* Right Rail */

.tv-rail-card {
    border-left: 1px solid var(--line);
    padding-left: 16px;
}

.tv-rail-card + .tv-rail-card {
    margin-top: 2px;
}

.tv-rail-title {
    margin-bottom: 10px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 950;
}

.tv-rail-stats {
    display: grid;
    gap: 8px;
}

.tv-rail-stats div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--panel) 72%, transparent);
    padding: 9px 10px;
}

.tv-rail-stats span,
.tv-rail-links a,
.tv-rail-links button {
    color: var(--muted);
    font-size: 12px;
}

.tv-rail-stats strong {
    color: var(--accent-dark);
    font-size: 14px;
}

.tv-rail-links {
    display: grid;
    gap: 3px;
}

.tv-rail-links a,
.tv-rail-links button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    padding: 7px 8px;
    cursor: pointer;
    font-weight: 750;
    text-align: left;
}

.tv-rail-links a:hover,
.tv-rail-links button:hover {
    background: color-mix(in srgb, var(--accent) 8%, var(--panel));
    color: var(--accent-dark);
}

.tv-rail-links span {
    color: inherit;
    font-size: 12px;
}

.tv-tag-profile {
    display: grid;
    gap: 5px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 7%, var(--panel));
    padding: 12px;
}

.tv-tag-profile strong {
    color: var(--accent-dark);
    font-size: 18px;
}

.tv-tag-profile span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.tv-rail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tv-rail-tags a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    padding: 0 9px;
    font-size: 12px;
    font-weight: 800;
}

.tv-rail-tags a:hover {
    border-color: var(--accent);
    color: var(--accent-dark);
}

/* Responsive */

@media (max-width: 1080px) {
    .tv-doc-layout {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
    }

    .tv-right-rail {
        display: none;
    }
}

@media (max-width: 760px) {
    .tv-doc-layout {
        padding-top: 0;
    }

    .tv-home-hero,
    .tv-list-hero {
        border-radius: 22px;
    }

    .tv-list-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .tv-card-grid,
    .tv-result-grid {
        grid-template-columns: 1fr;
    }

    .tv-doc-card,
    .tv-result-card {
        min-height: 180px;
    }
}

.tv-page-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 0 0 -10px;
    color: var(--muted);
    font-size: 12px;
}

.tv-page-breadcrumb a {
    color: var(--muted);
    font-weight: 750;
}

.tv-page-breadcrumb a:hover {
    color: var(--accent-dark);
}

.tv-page-breadcrumb span {
    color: color-mix(in srgb, var(--muted) 62%, transparent);
}

.tv-category-path {
    display: inline-flex;
    margin-top: 6px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 850;
}

/* =========================
   Contact / Policy Page
   file: assets/css/contact.css
========================= */

.policy-layout {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(
            circle at top left,
            rgba(37, 99, 235, 0.12),
            transparent 34%
        ),
        radial-gradient(
            circle at top right,
            rgba(14, 165, 233, 0.1),
            transparent 30%
        ),
        #f6f8fc;
    color: #111827;
}

/* Main card */

.policy-page {
    width: min(760px, calc(100% - 32px));
    margin: 48px auto 40px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
    padding: 34px;
}

.policy-page > .button:first-child {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin-bottom: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    color: #374151;
    padding: 0 15px;
    font-size: 13px;
    font-weight: 850;
    text-decoration: none;
}

.policy-page > .button:first-child:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.policy-page h1 {
    margin: 0;
    color: #0f172a;
    font-size: clamp(34px, 5vw, 52px);
    font-weight: 950;
    letter-spacing: -0.06em;
    line-height: 1.08;
}

.policy-page > p {
    margin: 14px 0 0;
    color: #64748b;
    font-size: 15px;
    line-height: 1.75;
}

.policy-page > p a {
    color: #2563eb;
    font-weight: 850;
    text-decoration: none;
}

.policy-page > p a:hover {
    text-decoration: underline;
}

/* Notice */

.policy-page .notice {
    margin-top: 20px;
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.5;
}

.policy-page .notice.success {
    border: 1px solid rgba(34, 197, 94, 0.25);
    background: rgba(34, 197, 94, 0.09);
    color: #15803d;
}

.policy-page .notice.danger {
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.09);
    color: #b91c1c;
}

/* Form */

.contact-form {
    display: grid;
    gap: 16px;
    margin-top: 28px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    background: linear-gradient(
        180deg,
        rgba(248, 250, 252, 0.96),
        rgba(255, 255, 255, 0.96)
    );
    padding: 22px;
}

.contact-form label {
    display: grid;
    gap: 8px;
}

.contact-form label span {
    color: #475569;
    font-size: 13px;
    font-weight: 850;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    color: #0f172a;
    outline: none;
    padding: 13px 14px;
    font-size: 15px;
    line-height: 1.55;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease;
}

.contact-form input {
    min-height: 48px;
}

.contact-form textarea {
    min-height: 190px;
    resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #94a3b8;
}

.contact-form .button.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border: 0;
    border-radius: 15px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 950;
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.24);
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        background 0.16s ease;
}

.contact-form .button.primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 20px 42px rgba(37, 99, 235, 0.3);
}

/* Footer */

.policy-footer {
    width: min(960px, calc(100% - 32px));
    margin: 0 auto 36px;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.05);
    backdrop-filter: blur(12px);
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 22px;
}

.site-footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.site-footer-mark {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #2563eb;
    color: #fff;
    font-size: 17px;
    font-weight: 950;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.site-footer-brand strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    font-weight: 950;
}

.site-footer-brand p {
    overflow: hidden;
    max-width: 340px;
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.site-footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #64748b;
    padding: 0 11px;
    font-size: 12px;
    font-weight: 850;
    text-decoration: none;
}

.site-footer-links a:hover {
    border-color: #e2e8f0;
    background: #fff;
    color: #2563eb;
}

/* Responsive */

@media (max-width: 760px) {
    .policy-page {
        margin-top: 24px;
        padding: 24px;
    }

    .contact-form {
        padding: 18px;
    }

    .site-footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    .policy-page {
        width: calc(100% - 24px);
        border-radius: 22px;
        padding: 20px;
    }

    .policy-page h1 {
        font-size: 34px;
    }

    .contact-form .button.primary {
        width: 100%;
    }

    .policy-footer {
        width: calc(100% - 24px);
        border-radius: 20px;
    }

    .site-footer-brand {
        align-items: flex-start;
    }

    .site-footer-links {
        display: grid;
        width: 100%;
        grid-template-columns: 1fr;
    }

    .site-footer-links a {
        justify-content: center;
        border-color: #e2e8f0;
        background: #fff;
    }
}
