html,
body {
    background: var(--vellum-bg);
}

.vellum {
    padding-bottom: 0;
}

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

.dc-header {
    align-items: center;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.84);
    border-bottom: 1px solid var(--vellum-hairline);
    display: flex;
    height: 4rem;
    justify-content: space-between;
    left: 0;
    padding: 0 0.75rem;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 50;
}

.dc-mark {
    align-items: center;
    background: var(--vellum-accent);
    border: 1px solid rgba(74, 93, 76, 0.18);
    border-radius: 6px;
    color: var(--vellum-accent-text);
    display: inline-flex;
    height: 2.25rem;
    justify-content: center;
    width: 2.25rem;
}

.dc-brand-title {
    margin: 0;
}

.dc-view-toggle {
    border: 1px solid var(--vellum-hairline);
    border-radius: 8px;
    gap: 0.75rem;
    padding: 0.25rem 0.65rem;
}

.dc-view-toggle .vellum-view-toggle {
    align-items: center;
    display: inline-flex;
    gap: 0.35rem;
}

.dc-project-select {
    max-width: 9.5rem;
}

.dc-new-project {
    height: 2.25rem;
    justify-content: center;
    padding: 0;
    width: 2.25rem;
}

.dc-header .vellum-action-cluster {
    align-items: center;
}

.dc-sidebar {
    background: rgba(255, 255, 255, 0.78);
    border-right: 1px solid var(--vellum-hairline);
    padding: 1.5rem;
    transition: transform 0.3s ease-in-out;
}

.dc-project-name {
    color: var(--vellum-ink);
    font-family: var(--vellum-font-serif);
    font-size: 1.35rem;
    font-weight: 700;
    padding-left: 0;
}

.dc-sidebar-label {
    display: block;
    margin-bottom: 0.75rem;
}

.dc-sidebar-scroll {
    padding-right: 1rem;
    scrollbar-gutter: stable;
}

.dc-panel {
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid var(--vellum-hairline);
    border-radius: 8px;
    padding: 1rem;
}

.dc-panel-section {
    border-top: 1px solid var(--vellum-rule);
    padding-top: 0.9rem;
}

.dc-tile-action,
.dc-nav-link {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--vellum-hairline);
    border-radius: 8px;
    color: var(--vellum-muted);
    display: flex;
    flex-direction: column;
    font-family: var(--vellum-font-mono);
    font-size: 0.625rem;
    gap: 0.25rem;
    justify-content: center;
    letter-spacing: 0.08em;
    min-height: 4.5rem;
    padding: 0.75rem;
    text-align: center;
    text-transform: uppercase;
    transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.dc-nav-link {
    align-items: flex-start;
    min-height: 3.6rem;
    text-align: left;
}

.dc-tile-action-wide {
    flex-direction: row;
}

.dc-tile-action:hover,
.dc-nav-link:hover {
    border-color: var(--vellum-card-hover);
    color: var(--vellum-ink);
    transform: translateY(-1px);
}

.dc-nav-index {
    color: var(--vellum-accent-text);
    display: block;
    font-size: 0.5rem;
    line-height: 1;
}

.dc-sidebar-footer {
    border-top: 1px solid var(--vellum-rule);
    padding-top: 1rem;
}

.dc-note,
.dc-quote {
    background: var(--vellum-accent);
    border: 1px solid rgba(74, 93, 76, 0.14);
    border-radius: 8px;
    color: var(--vellum-accent-text);
    font-size: 0.75rem;
    line-height: 1.55;
    padding: 0.9rem;
}

.dc-quote {
    font-family: var(--vellum-font-serif);
    font-style: italic;
}

.dc-quote-large {
    margin-top: 1rem;
}

.dc-primary-wide,
.dc-danger-wide {
    justify-content: center;
    width: 100%;
}

.dc-danger-wide {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 0;
}

.dc-main {
    background:
        linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0)),
        var(--vellum-bg);
}

.dc-print-title {
    border-bottom: 2px solid var(--vellum-accent);
    padding-bottom: 0.5rem;
}

.dc-print-signoff {
    color: var(--vellum-accent-text);
    font-family: var(--vellum-font-serif);
    font-style: italic;
    font-weight: 700;
}

.dc-print-footer {
    border-top: 2px solid var(--vellum-rule);
}

.dc-editor-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--vellum-hairline);
    border-radius: 8px;
    box-shadow: var(--vellum-shadow-paper);
    margin: 0;
    overflow: hidden;
    padding: 0;
}

.dc-editor-card[open] {
    border-color: var(--vellum-active-line);
}

.dc-editor-summary {
    align-items: center;
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 1rem;
}

.dc-editor-summary::-webkit-details-marker {
    display: none;
}

.dc-node-heading {
    align-items: center;
    display: flex;
    gap: 1rem;
}

.dc-node-label {
    color: var(--vellum-accent-text);
    font-family: var(--vellum-font-mono);
    font-size: 0.75rem;
    font-weight: 500;
}

.dc-node-title {
    color: var(--vellum-ink);
    font-family: var(--vellum-font-serif);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.dc-chevron {
    color: var(--vellum-faint);
}

.dc-node-body {
    border-top: 1px solid var(--vellum-rule);
    padding: 0 1rem 1rem;
}

.dc-node-prompt {
    background: rgba(232, 240, 233, 0.58);
    border: 1px solid rgba(74, 93, 76, 0.12);
    border-radius: 8px;
    color: var(--vellum-accent-text);
    margin: 1rem 0;
    padding: 0.85rem;
}

.dc-node-prompt p {
    margin: 0;
}

.dc-node-question {
    font-size: 0.8125rem;
    font-weight: 600;
}

.dc-node-tip {
    color: var(--vellum-muted);
    font-family: var(--vellum-font-mono);
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    margin-top: 0.35rem;
    text-transform: uppercase;
}

.node-display {
    background: #ffffff;
    border: 1px solid var(--vellum-hairline);
    border-radius: 8px;
    color: var(--vellum-text);
    cursor: text;
    min-height: 120px;
    padding: 1rem;
}

.node-display:empty::before {
    color: var(--vellum-faint);
    content: 'Click to add content...';
}

.node-display p {
    line-height: 1.6;
    margin: 0.5rem 0;
}

.node-display ul,
.node-display ol {
    line-height: 1.8;
    margin: 0.75rem 0;
    padding-left: 2rem;
}

.node-display ul {
    list-style-position: outside;
    list-style-type: disc;
}

.node-display ol {
    list-style-position: outside;
    list-style-type: decimal;
}

.node-display ul ul {
    list-style-type: circle;
    margin: 0.25rem 0;
}

.node-display ul ul ul {
    list-style-type: square;
    margin: 0.25rem 0;
}

.node-display li {
    display: list-item;
    margin: 0.35rem 0;
}

.node-display code {
    background: rgba(232, 240, 233, 0.5);
    border: 1px solid var(--vellum-hairline);
    border-radius: 4px;
    font-family: var(--vellum-font-mono);
    font-size: 0.9em;
    padding: 0.2rem 0.4rem;
}

.node-display pre {
    background: #ffffff;
    border: 1px solid var(--vellum-hairline);
    border-radius: 8px;
    margin: 0.75rem 0;
    overflow-x: auto;
    padding: 1rem;
}

.node-display pre code {
    background: none;
    border: 0;
    padding: 0;
}

.node-display blockquote {
    border-left: 2px solid var(--vellum-accent);
    color: var(--vellum-muted);
    font-family: var(--vellum-font-serif);
    font-style: italic;
    margin: 0.75rem 0;
    padding-left: 1rem;
}

.node-display h1,
.node-display h2,
.node-display h3,
.node-display h4,
.node-display h5,
.node-display h6 {
    color: var(--vellum-ink);
    font-weight: 700;
    margin: 0.75rem 0 0.5rem;
}

.node-display h1 { font-size: 1.25rem; }
.node-display h2 { font-size: 1.1rem; }
.node-display h3 { font-size: 1rem; }

.dc-node-textarea {
    background: #ffffff !important;
    border: 1px solid var(--vellum-hairline) !important;
    border-radius: 8px !important;
    color: var(--vellum-text) !important;
    min-height: 120px;
    padding: 1rem !important;
}

.dc-handout-card {
    display: flex;
    flex-direction: column;
    max-width: 25rem;
    min-height: 42.5rem;
    padding: 2rem;
    width: 100%;
}

.dc-handout-header {
    border-bottom: 2px solid var(--vellum-accent);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}

.dc-handout-header .vellum-company-name {
    font-size: 1.55rem;
    margin-bottom: 0.35rem;
}

.dc-handout-rule {
    background: var(--vellum-ink);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.75rem;
    line-height: 1.55;
    margin-top: 1.5rem;
    padding: 1rem;
}

.dc-handout-rule .vellum-kicker {
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.62);
    margin-bottom: 0.65rem;
    padding-bottom: 0.35rem;
}

.dc-handout-node {
    align-items: center;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--vellum-hairline);
    border-left: 4px solid var(--vellum-accent);
    border-radius: 8px;
    display: flex;
    gap: 0.75rem;
    padding: 0.55rem;
}

.dc-handout-node-title {
    font-size: 0.82rem;
    line-height: 1.15;
    margin: 0;
}

.dc-handout-node-tip {
    font-family: var(--vellum-font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.06em;
    line-height: 1.35;
    margin-top: 0.25rem;
    text-transform: uppercase;
}

.dc-map-panel {
    background: rgba(255, 255, 255, 0.64);
    border: 1px solid var(--vellum-hairline);
    border-radius: 8px;
    height: 280px;
    padding: 1rem;
    position: relative;
}

.dc-section-kicker {
    display: block;
    margin-bottom: 0.75rem;
}

.dc-caption {
    color: var(--vellum-faint);
    font-family: var(--vellum-font-serif);
    font-size: 0.7rem;
    font-style: italic;
    line-height: 1.45;
    margin: 0.5rem 0 0;
    text-align: center;
}

.dc-mini-list {
    color: var(--vellum-muted);
    font-size: 0.72rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.dc-mini-list li {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
}

.dc-handout-footer {
    align-items: center;
    border-top: 1px solid var(--vellum-rule);
    color: var(--vellum-faint);
    display: flex;
    font-family: var(--vellum-font-mono);
    font-size: 0.55rem;
    justify-content: space-between;
    letter-spacing: 0.12em;
    margin-top: 1rem;
    padding-top: 1rem;
    text-transform: uppercase;
}

.dc-modal-backdrop {
    align-items: center;
    background: rgba(26, 26, 26, 0.42);
    backdrop-filter: blur(6px);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 100;
}

.dc-modal-backdrop.hidden {
    display: none;
}

.dc-modal {
    max-height: 90vh;
    max-width: 42rem;
    min-height: auto;
    overflow-y: auto;
    padding: 0;
    width: 100%;
}

.dc-modal-header {
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--vellum-rule);
    display: flex;
    justify-content: space-between;
    padding: 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1;
}

.dc-copy {
    color: var(--vellum-muted);
    line-height: 1.7;
}

.dc-help-list {
    color: var(--vellum-muted);
    display: grid;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.dc-help-list li {
    align-items: flex-start;
    display: flex;
    gap: 0.85rem;
    line-height: 1.55;
    margin: 0;
}

.dc-overlay {
    background: rgba(26, 26, 26, 0.36);
    backdrop-filter: blur(4px);
    inset: 0;
    position: fixed;
    z-index: 30;
}

#toast-container {
    bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
    position: fixed;
    right: 16px;
    z-index: 60;
}

.toast {
    background: var(--vellum-ink);
    border: 1px solid var(--vellum-hairline);
    border-radius: 8px;
    box-shadow: var(--vellum-shadow-paper);
    color: #ffffff;
    font-family: var(--vellum-font-mono);
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    opacity: 0;
    padding: 0.75rem 0.85rem;
    text-transform: uppercase;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: var(--vellum-success);
}

.toast-warn {
    background: var(--vellum-warning);
}

.toast-error {
    background: var(--vellum-danger);
}

.print-mirror {
    display: none;
}

@media (min-width: 640px) {
    .dc-header {
        padding: 0 1rem;
    }
}

@media (max-width: 1023px) {
    #sidebar.closed {
        transform: translateX(-100%);
    }
}

@media (max-width: 640px) {
    .dc-brand-title {
        display: none;
    }

    .dc-project-select {
        max-width: 4.5rem;
    }

    .dc-view-toggle {
        gap: 0.45rem;
        padding-inline: 0.5rem;
    }

    .dc-handout-card {
        padding: 1.5rem;
    }
}

@media print {
    html,
    body {
        background: white !important;
        height: auto !important;
        overflow: visible !important;
    }

    .vellum {
        width: auto;
    }

    .h-screen {
        height: auto !important;
        overflow: visible !important;
    }

    .flex {
        display: block !important;
    }

    .print-hidden,
    header,
    aside,
    #sidebar-overlay,
    #help-modal,
    nav,
    button,
    select,
    summary i {
        display: none !important;
    }

    main,
    #main-content {
        display: block !important;
        height: auto !important;
        margin-left: 0 !important;
        overflow: visible !important;
        padding: 0 !important;
    }

    #view-workspace {
        display: block !important;
        padding: 20px !important;
        width: 100% !important;
    }

    #view-workspace.hidden,
    #view-handout.hidden {
        display: none !important;
    }

    textarea {
        display: none !important;
    }

    .print-mirror {
        display: none !important;
    }

    .node-display {
        display: block !important;
    }

    details {
        border: 1px solid #e5e7eb !important;
        break-inside: avoid;
        display: block !important;
        margin-bottom: 1.5rem !important;
    }

    details[open] summary {
        background-color: #ffffff !important;
        border-bottom: 1px solid #e5e7eb !important;
    }

    .print-block {
        display: block !important;
    }

    #view-handout {
        align-items: center !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .card {
        border: 2px solid #e5e7eb !important;
        box-shadow: none !important;
        break-inside: avoid;
        margin: 0 auto 20px !important;
        min-height: 24cm !important;
        page-break-after: always;
        width: 17cm !important;
    }

    svg {
        overflow: visible !important;
    }
}
