/* ============================================================
   notion-ai-alternative · 1000HW · styles.css · v1
   Cache-bust: ?v=4
   ============================================================ */

/* --- Design tokens --- */
:root {
    --void: #050505;
    --void-2: #0a0a0a;
    --void-3: #0f0f0f;
    --concrete: #e0e0e0;
    --concrete-2: #b0b0b0;
    --concrete-3: #808080;
    --acid: #ccff00;
    --acid-dim: rgba(204, 255, 0, 0.18);
    --structure: #333333;
    --structure-2: #1a1a1a;
    --danger: #ff5577;
    --danger-dim: rgba(255, 85, 119, 0.18);
    --info: #4aa8ff;
    --info-dim: rgba(74, 168, 255, 0.18);
    --warn: #ffb84a;
    --warn-dim: rgba(255, 184, 74, 0.18);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    --radius: 6px;
    --radius-lg: 12px;
    --shadow-lg: 0 24px 64px -16px rgba(0, 0, 0, 0.6);
    --transition: 0.18s ease;

    --nav-height: 56px;
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background-color: var(--void);
    color: var(--concrete);
    line-height: 1.55;
    min-height: 100vh;
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--acid);
    color: var(--void);
}

a {
    color: var(--acid);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover,
a:focus-visible {
    color: var(--concrete);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--acid);
    outline-offset: 2px;
}

button {
    font-family: inherit;
    cursor: pointer;
}

code,
pre {
    font-family: var(--font-mono);
    font-size: 0.92em;
}

pre {
    background: var(--void-3);
    border: 1px solid var(--structure);
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    line-height: 1.45;
}

code:not(pre code) {
    background: var(--void-3);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    border: 1px solid var(--structure-2);
    color: var(--concrete);
}

input,
textarea {
    font-family: inherit;
    color: inherit;
}

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

.skip-link {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--acid);
    color: var(--void);
    padding: 0.6rem 1rem;
    font-weight: 700;
    z-index: 9999;
    border-radius: 0 0 var(--radius) 0;
    transition: top var(--transition);
}

.skip-link:focus {
    top: 0;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* --- Nav --- */
.nav {
    border-bottom: 1px solid var(--structure);
    background: rgba(5, 5, 5, 0.92);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 40;
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.nav-back {
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--concrete-3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: color var(--transition);
}

.nav-back:hover {
    color: var(--acid);
    text-decoration: none;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.04em;
}

.brand-acid {
    color: var(--acid);
}

.nav-toggles {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.lang-toggle {
    background: transparent;
    border: 1px solid var(--structure);
    color: var(--concrete-3);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all var(--transition);
}

.lang-toggle:hover {
    color: var(--concrete);
    border-color: var(--concrete-3);
}

.lang-toggle.active {
    background: var(--acid);
    color: var(--void);
    border-color: var(--acid);
    font-weight: 700;
}

/* --- Hero --- */
.hero {
    padding: 3rem 0 2rem;
    border-bottom: 1px solid var(--structure);
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    border: 1px solid transparent;
}

.tag-acid {
    color: var(--acid);
    border-color: var(--acid);
    background: var(--acid-dim);
}

.tag-priv {
    color: var(--concrete);
    border-color: var(--structure);
    background: var(--void-2);
}

.hero h1 {
    font-size: clamp(1.85rem, 4vw + 1rem, 3.4rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin: 0 0 1.25rem;
    font-weight: 800;
    color: var(--concrete);
}

.hero h1 .accent {
    color: var(--acid);
}

.hero-lede {
    font-size: clamp(1rem, 1.2vw + 0.7rem, 1.2rem);
    color: var(--concrete-2);
    max-width: 64ch;
    margin: 0 0 1.5rem;
}

.hero-disclaimer {
    font-size: 0.88rem;
    color: var(--concrete-3);
    border-left: 3px solid var(--warn);
    padding: 0.75rem 1rem;
    background: var(--warn-dim);
    border-radius: 0 var(--radius) var(--radius) 0;
    max-width: 64ch;
    margin: 0;
}

/* --- Tool section --- */
.tool-section {
    padding: 2rem 0;
}

.tool-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;
    min-height: 70vh;
    align-items: stretch;
}

/* --- Sidebar --- */
.sidebar {
    background: var(--void-2);
    border: 1px solid var(--structure);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 78vh;
    overflow-y: auto;
    position: sticky;
    top: 4.5rem;
}

.sidebar-header,
.sidebar-search,
.sidebar-actions {
    display: flex;
    gap: 0.5rem;
}

.sidebar-search {
    position: relative;
}

.search-input {
    width: 100%;
    background: var(--void-3);
    border: 1px solid var(--structure);
    border-radius: var(--radius);
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
    color: var(--concrete);
    transition: border-color var(--transition);
}

.search-input:focus {
    border-color: var(--acid);
    outline: none;
}

.sidebar-actions {
    flex-wrap: wrap;
}

.sidebar-tree {
    flex-grow: 1;
    overflow-y: auto;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}

.sidebar-empty {
    font-size: 0.82rem;
    color: var(--concrete-3);
    padding: 1rem 0.5rem;
    text-align: center;
    font-style: italic;
}

.sidebar-footer {
    border-top: 1px solid var(--structure);
    padding-top: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar-warn {
    margin: 0;
    font-size: 0.72rem;
    color: var(--warn);
    line-height: 1.4;
    font-family: var(--font-mono);
}

.sidebar-storage {
    margin: 0;
    font-size: 0.7rem;
    color: var(--concrete-3);
    font-family: var(--font-mono);
}

/* --- Tree node --- */
.tree-node {
    position: relative;
    margin: 0;
    padding: 0;
}

.tree-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius);
    transition: background var(--transition);
    cursor: pointer;
    user-select: none;
    font-size: 0.88rem;
}

.tree-row:hover {
    background: var(--void-3);
}

.tree-row.active {
    background: var(--acid-dim);
    color: var(--acid);
}

.tree-row.dragging {
    opacity: 0.5;
}

.tree-row.drag-over {
    outline: 2px dashed var(--acid);
    outline-offset: -2px;
}

.tree-caret {
    width: 14px;
    flex-shrink: 0;
    text-align: center;
    color: var(--concrete-3);
    font-size: 0.7rem;
    cursor: pointer;
    transition: transform var(--transition);
}

.tree-caret.empty {
    visibility: hidden;
}

.tree-caret.expanded {
    transform: rotate(90deg);
}

.tree-icon {
    flex-shrink: 0;
    color: var(--concrete-3);
    font-size: 0.85rem;
}

.tree-label {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tree-search-hit {
    background: rgba(255, 220, 0, 0.4);
    color: var(--void);
    padding: 0 2px;
    border-radius: 2px;
    font-weight: 700;
}

.tree-actions {
    display: none;
    gap: 0.2rem;
    flex-shrink: 0;
}

.tree-row:hover .tree-actions {
    display: flex;
}

.tree-action {
    background: transparent;
    border: none;
    color: var(--concrete-3);
    font-size: 0.85rem;
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    line-height: 1;
    transition: all var(--transition);
}

.tree-action:hover {
    color: var(--acid);
    background: var(--acid-dim);
}

.tree-action.danger:hover {
    color: var(--danger);
    background: var(--danger-dim);
}

.tree-children {
    margin: 0;
    padding: 0;
    list-style: none;
}

.tree-children.collapsed {
    display: none;
}

/* --- Main pane --- */
.main-pane {
    background: var(--void-2);
    border: 1px solid var(--structure);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 70vh;
}

.page-toolbar {
    border-bottom: 1px solid var(--structure);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    background: var(--void);
}

.page-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-grow: 1;
    min-width: 200px;
}

.page-title {
    background: transparent;
    border: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--concrete);
    padding: 0.25rem 0;
    width: 100%;
}

.page-title:focus {
    outline: none;
    border-bottom: 2px solid var(--acid);
}

.page-tags {
    background: var(--void-3);
    border: 1px solid var(--structure);
    border-radius: var(--radius);
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
    color: var(--concrete-2);
    font-family: var(--font-mono);
    width: 100%;
}

.page-tags:focus {
    border-color: var(--acid);
    outline: none;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.split-view {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    min-height: 500px;
}

.pane {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pane-editor {
    border-right: 1px solid var(--structure);
}

.pane-label {
    background: var(--void-3);
    padding: 0.4rem 0.85rem;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--concrete-3);
    border-bottom: 1px solid var(--structure);
}

.editor-textarea {
    flex-grow: 1;
    background: var(--void);
    border: none;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--concrete);
    resize: none;
    outline: none;
    width: 100%;
    tab-size: 2;
}

.editor-textarea:focus {
    background: var(--void-2);
}

.pane-preview {
    background: var(--void-2);
}

.preview-pane {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    line-height: 1.7;
    color: var(--concrete);
}

.main-empty {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--concrete-3);
    font-style: italic;
    text-align: center;
}

/* --- Markdown body styles (preview) --- */
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    margin-top: 1.6em;
    margin-bottom: 0.5em;
    line-height: 1.25;
    letter-spacing: -0.02em;
    font-weight: 700;
    color: var(--concrete);
}

.markdown-body h1 { font-size: 1.85rem; border-bottom: 1px solid var(--structure); padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.5rem; }
.markdown-body h3 { font-size: 1.2rem; color: var(--acid); }
.markdown-body h4 { font-size: 1.05rem; color: var(--concrete-2); }

.markdown-body h1:first-child,
.markdown-body h2:first-child,
.markdown-body h3:first-child {
    margin-top: 0;
}

.markdown-body p {
    margin: 0.85em 0;
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.6em;
    margin: 0.85em 0;
}

.markdown-body li {
    margin: 0.3em 0;
}

.markdown-body input[type="checkbox"] {
    margin-right: 0.5em;
    accent-color: var(--acid);
}

.markdown-body blockquote {
    border-left: 3px solid var(--acid);
    margin: 1em 0;
    padding: 0.5em 1em;
    color: var(--concrete-2);
    background: var(--void-3);
    border-radius: 0 var(--radius) var(--radius) 0;
}

.markdown-body table {
    border-collapse: collapse;
    margin: 1em 0;
    width: 100%;
    overflow-x: auto;
    display: block;
}

.markdown-body th,
.markdown-body td {
    border: 1px solid var(--structure);
    padding: 0.5em 0.85em;
    text-align: left;
}

.markdown-body th {
    background: var(--void-3);
    font-weight: 700;
}

.markdown-body tr:nth-child(even) td {
    background: var(--void-2);
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--structure);
    margin: 0.5em 0;
}

.markdown-body hr {
    border: none;
    border-top: 1px solid var(--structure);
    margin: 2em 0;
}

.markdown-body a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.markdown-body a:hover {
    color: var(--concrete);
}

.markdown-body .attachment-error {
    color: var(--danger);
    background: var(--danger-dim);
    padding: 0.5em 0.85em;
    border-radius: var(--radius);
    font-family: var(--font-mono);
    font-size: 0.85em;
    display: inline-block;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.95rem;
    background: var(--void-3);
    color: var(--concrete);
    border: 1px solid var(--structure);
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
}

.btn:hover {
    border-color: var(--acid);
    color: var(--acid);
}

.btn-primary {
    background: var(--acid);
    color: var(--void);
    border-color: var(--acid);
    font-weight: 700;
}

.btn-primary:hover {
    background: var(--concrete);
    border-color: var(--concrete);
    color: var(--void);
}

.btn-secondary {
    background: var(--void-2);
}

.btn-ghost {
    background: transparent;
    border-color: var(--structure-2);
    color: var(--concrete-2);
}

.btn-ghost:hover {
    color: var(--acid);
    border-color: var(--acid);
    background: var(--acid-dim);
}

.btn-danger {
    color: var(--danger);
    border-color: var(--danger-dim);
    background: var(--danger-dim);
}

.btn-danger:hover {
    color: var(--concrete);
    background: var(--danger);
    border-color: var(--danger);
}

.btn-sm {
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
}

.btn-block {
    width: 100%;
}

.btn[disabled],
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Modal --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal {
    background: var(--void-2);
    border: 1px solid var(--structure);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.modal h3 {
    margin: 0 0 0.85rem;
    color: var(--acid);
    font-size: 1.15rem;
}

.modal p {
    margin: 0 0 1rem;
    color: var(--concrete-2);
    font-size: 0.92rem;
}

.modal-input {
    width: 100%;
    background: var(--void-3);
    border: 1px solid var(--structure);
    border-radius: var(--radius);
    padding: 0.6rem 0.85rem;
    color: var(--concrete);
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

.modal-input:focus {
    border-color: var(--acid);
    outline: none;
}

.modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.toast-message {
    position: fixed;
    bottom: 6rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--void-2);
    border: 1px solid var(--acid);
    color: var(--acid);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    z-index: 200;
    box-shadow: var(--shadow-lg);
    animation: toast-fade 0.3s ease-out;
}

.toast-message.error {
    border-color: var(--danger);
    color: var(--danger);
}

@keyframes toast-fade {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* --- Ad section --- */
.ad-section {
    padding: 1.5rem 0;
    background: var(--void-2);
    border-top: 1px solid var(--structure);
    border-bottom: 1px solid var(--structure);
    margin: 1.5rem 0;
}

.ad-section .adsbygoogle {
    display: block;
    width: 100%;
    min-width: 250px;
    min-height: 100px;
}

/* --- Content section --- */
.content-section {
    padding: 2.5rem 0;
    border-top: 1px solid var(--structure);
}

.content-section h2 {
    font-size: 1.65rem;
    letter-spacing: -0.02em;
    color: var(--concrete);
    margin: 1.5em 0 0.65em;
    line-height: 1.2;
}

.content-section h2:first-child {
    margin-top: 0;
}

.content-section h3 {
    font-size: 1.2rem;
    color: var(--acid);
    margin: 1.25em 0 0.5em;
}

.content-section p {
    margin: 0 0 1rem;
    color: var(--concrete-2);
    max-width: 70ch;
}

.content-list {
    margin: 0 0 1rem;
    padding-left: 1.4em;
    color: var(--concrete-2);
    max-width: 70ch;
}

.content-list li {
    margin: 0.5em 0;
}

.callout {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--info);
    background: var(--void-2);
}

.callout h3 {
    margin-top: 0;
}

.callout-warn {
    border-left-color: var(--warn);
    background: rgba(255, 184, 74, 0.05);
}

.faq-list {
    margin: 1rem 0;
    max-width: 70ch;
}

.faq-item {
    border: 1px solid var(--structure);
    border-radius: var(--radius);
    margin-bottom: 0.6rem;
    background: var(--void-2);
    transition: border-color var(--transition);
}

.faq-item[open] {
    border-color: var(--acid);
}

.faq-item summary {
    padding: 0.85rem 1rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--concrete);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    color: var(--acid);
    font-size: 1.3rem;
    line-height: 1;
    font-weight: 400;
    transition: transform var(--transition);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item summary:hover {
    color: var(--acid);
}

.faq-item p {
    padding: 0 1rem 1rem;
    margin: 0;
    color: var(--concrete-2);
    border-top: 1px solid var(--structure-2);
    padding-top: 0.85rem;
}

.glossary {
    max-width: 70ch;
    margin: 1rem 0;
}

.glossary dt {
    margin-top: 1em;
    font-weight: 700;
    color: var(--acid);
    font-size: 1rem;
}

.glossary dt:first-child {
    margin-top: 0;
}

.glossary dd {
    margin: 0.3em 0 0 1.2em;
    color: var(--concrete-2);
}

.footer-disclaimer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--structure);
    text-align: center;
    font-size: 0.85rem;
    color: var(--concrete-3);
    font-family: var(--font-mono);
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid var(--structure);
    padding: 1.5rem 0;
    background: var(--void-2);
    text-align: center;
    font-size: 0.85rem;
    color: var(--concrete-3);
    margin-top: auto;
}

.site-footer p {
    margin: 0.3rem 0;
}

.site-footer a {
    color: var(--concrete-2);
}

.site-footer a:hover {
    color: var(--acid);
}

.footer-brand {
    color: var(--concrete);
    font-weight: 700;
}

.footer-meta {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--concrete-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* --- Offline banner --- */
.offline-banner {
    position: fixed;
    top: calc(var(--nav-height, 60px) + 8px);
    left: 0;
    right: 0;
    z-index: 30;
    background: linear-gradient(135deg, var(--acid-dim), rgba(74, 168, 255, 0.18));
    border-bottom: 1px solid var(--acid);
    color: var(--concrete);
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    font-size: 0.88rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    animation: slide-down 0.4s ease-out;
}

.offline-banner-icon {
    color: var(--acid);
    font-weight: 700;
    font-size: 1.1rem;
}

.offline-banner-text {
    flex-grow: 1;
    text-align: center;
}

.offline-banner-close {
    background: transparent;
    border: none;
    color: var(--concrete);
    font-size: 1.4rem;
    line-height: 1;
    padding: 0 0.4rem;
    cursor: pointer;
}

.offline-banner-close:hover {
    color: var(--acid);
}

@keyframes slide-down {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* --- Donation toast --- */
.donation-toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 50;
    background: var(--void-2);
    border: 1px solid var(--structure);
    padding: 0.85rem 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    max-width: calc(100vw - 2rem);
    width: 360px;
    animation: slide-up 0.5s ease-out 0.6s backwards;
}

.donation-toast-icon {
    color: var(--acid);
    font-size: 1.4rem;
    flex-shrink: 0;
}

.donation-toast-content {
    flex-grow: 1;
    min-width: 0;
}

.donation-toast-title {
    margin: 0 0 0.15rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--concrete);
}

.donation-toast-subtitle {
    margin: 0;
    font-size: 0.75rem;
    color: var(--concrete-3);
    line-height: 1.35;
}

.donation-toast-btn {
    background: var(--acid);
    color: var(--void);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.7rem;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-decoration: none;
    flex-shrink: 0;
    transition: background var(--transition);
}

.donation-toast-btn:hover {
    background: var(--concrete);
    color: var(--void);
    text-decoration: none;
}

.donation-toast-close {
    background: transparent;
    border: none;
    color: var(--concrete-3);
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 0.25rem;
    cursor: pointer;
    flex-shrink: 0;
}

.donation-toast-close:hover {
    color: var(--concrete);
}

@keyframes slide-up {
    from { transform: translateY(120%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Long content section (slightly different bg to break visual) --- */
.content-long {
    background: var(--void-2);
    border-top: 1px solid var(--structure);
    border-bottom: 1px solid var(--structure);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .tool-grid {
        grid-template-columns: 240px 1fr;
    }
}

@media (max-width: 900px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        top: 0;
        max-height: none;
    }

    .sidebar-tree {
        max-height: 300px;
    }

    .split-view {
        grid-template-columns: 1fr;
        min-height: 600px;
    }

    .pane-editor {
        border-right: none;
        border-bottom: 1px solid var(--structure);
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 2rem 0 1.25rem;
    }

    .nav-inner {
        flex-wrap: wrap;
    }

    .nav-toggles {
        order: 3;
        flex-basis: 100%;
        justify-content: flex-end;
    }

    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions {
        justify-content: flex-start;
    }

    .donation-toast {
        bottom: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
        width: auto;
        max-width: none;
    }

    .split-view {
        min-height: 500px;
    }

    .editor-textarea,
    .preview-pane {
        padding: 0.85rem 1rem;
        font-size: 0.88rem;
    }
}

@media (max-width: 380px) {
    .container {
        padding: 0 0.85rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .tag {
        font-size: 0.65rem;
    }
}

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