* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: #f9f7f2;
}

.zen-view {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #222;
    min-height: 100vh;
}

.zen-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: #f9f7f2;
    border-bottom: 1px solid #e8e4da;
    z-index: 100;
    gap: 16px;
}

.zen-back {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.zen-back:hover {
    background: #eceadf;
    color: #555;
}

.zen-status {
    flex: 1;
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 12px;
    color: #888;
}

.zen-cycle-btn {
    font-family: 'Iosevka SS14 Web', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    background: transparent;
    color: #8b7355;
    border: 1px solid #d8d4c8;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.zen-cycle-btn:hover {
    background: #eceadf;
    border-color: #c8c4b8;
}

.zen-edit {
    font-family: 'Iosevka SS14 Web', sans-serif;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 20px;
    background: #8b7355;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.zen-edit:hover {
    background: #7a6248;
}

.zen-main {
    min-height: calc(100vh - 60px);
}

.zen-content {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 24px 100px;
}

.zen-view-title {
    font-family: 'Charter', Georgia, serif;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
    color: #2a2520;
}

.zen-view-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e6e6e0;
}

.zen-view-date {
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 12px;
    color: #888;
}

.zen-tag {
    display: inline-flex;
    align-items: center;
    font-family: 'Iosevka SS14 Web', monospace;
    font-size: 12px;
    padding: 3px 8px;
    background: #e8e4d8;
    border-radius: 3px;
    color: #6b5a42;
    text-decoration: none;
    transition: background 0.15s;
}

.zen-tag:hover {
    background: #ddd8c8;
}

.zen-view-body {
    font-family: 'Charter', 'Georgia', serif;
    font-size: 16px;
    line-height: 1.7;
    color: #3a3530;
}

.zen-view-body h1, .zen-view-body h2, .zen-view-body h3 {
    font-family: 'Iosevka SS14 Web', Georgia, serif;
    margin-top: 32px;
    margin-bottom: 16px;
    color: #222;
    font-weight: 500;
}

.zen-view-body h1 { font-size: 1.5em; font-weight: 700; margin: 1.5em 0 0.5em; }
.zen-view-body h2 { font-size: 1.25em; font-weight: 600; margin: 1.25em 0 0.5em; }
.zen-view-body h3 { font-size: 1.1em; font-weight: 600; margin: 1em 0 0.4em; text-decoration: underline; text-decoration-color: rgba(139, 115, 85, 0.15); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.zen-view-body h4 { font-size: 1em; font-weight: 600; margin: 1em 0 0.4em; }

.zen-view-body p { margin-bottom: 1em; line-height: 1.6; }
.zen-view-body ul, .zen-view-body ol,
.org-fold > ul, .org-fold > ol { margin: 0 0 1em; padding-left: 1.5em; list-style-position: outside; }
.zen-view-body li { margin-bottom: 0.4em; line-height: 1.5; }
.zen-view-body li::marker { color: #8b7355; }

.zen-view-body pre {
    background: #fffef8;
    border: 1px solid #e6e6e0;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Iosevka SS14 Web', 'JetBrains Mono', monospace;
    font-size: 13px;
    margin-bottom: 16px;
    color: #333;
}

.zen-view-body code {
    font-family: 'Iosevka SS14 Web', 'JetBrains Mono', monospace;
    background: #ebe8df;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.zen-view-body pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

.zen-view-body blockquote {
    border-left: 3px solid #8b7355;
    padding-left: 20px;
    color: #666;
    font-style: italic;
    margin: 16px 0;
}

.zen-view-body a {
    color: #486878;
    text-decoration: underline;
    text-decoration-color: rgba(72, 104, 120, 0.35);
    text-underline-offset: 2px;
    background: rgba(72, 104, 120, 0.06);
    padding: 0 2px;
    border-radius: 2px;
}

.zen-view-body a:hover {
    color: #385868;
    text-decoration-color: rgba(72, 104, 120, 0.7);
    background: rgba(72, 104, 120, 0.12);
}

/* Folding sections */
.org-fold {
    margin: 0;
    border: none;
}

.org-fold + .org-fold {
    margin-top: 0.5em;
}

.org-fold-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0.25em 0;
}

.org-fold-summary::-webkit-details-marker {
    display: none;
}

.org-fold-summary::after {
    content: '▾';
    font-size: 0.9em;
    color: #9a8a7a;
    flex-shrink: 0;
    transition: transform 0.15s ease;
    margin-left: 0.5em;
}

.org-fold:not([open]) > .org-fold-summary::after {
    transform: rotate(-90deg);
}

.org-fold-summary h1,
.org-fold-summary h2,
.org-fold-summary h3,
.org-fold-summary h4,
.org-fold-summary h5,
.org-fold-summary h6 {
    margin: 0;
    display: inline;
    letter-spacing: -0.01em;
}

/* Typography hierarchy - size, weight, and underlines distinguish levels */

/* Level 1: Major sections - big and bold with underline */
.org-fold-summary h1 {
    font-size: 1.75em;
    font-weight: 700;
    color: #1a1815;
    letter-spacing: -0.02em;
    text-decoration: underline;
    text-decoration-color: rgba(139, 115, 85, 0.4);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 4px;
}

.org-fold[data-level="1"] {
    margin-top: 2.5em;
}

.org-fold[data-level="1"]:first-child {
    margin-top: 0;
}

/* Level 2: Clear subsections with subtle underline */
.org-fold-summary h2 {
    font-size: 1.35em;
    font-weight: 600;
    color: #2a2520;
    text-decoration: underline;
    text-decoration-color: rgba(139, 115, 85, 0.25);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.org-fold[data-level="2"] {
    margin-top: 1.75em;
}

/* Level 3: Smaller with very subtle underline */
.org-fold-summary h3 {
    font-size: 1.15em;
    font-weight: 600;
    color: #3a3530;
    text-decoration: underline;
    text-decoration-color: rgba(139, 115, 85, 0.15);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.org-fold[data-level="3"] {
    margin-top: 1.25em;
}

/* Level 4: Body-sized, bold, no underline */
.org-fold-summary h4 {
    font-size: 1em;
    font-weight: 600;
    color: #4a4540;
}

.org-fold[data-level="4"] {
    margin-top: 1em;
}

/* Level 5-6: Subtle, collapsed by default, with background */
.org-fold-summary h5,
.org-fold-summary h6 {
    font-size: 0.95em;
    font-weight: 600;
    color: #5a5550;
}

.org-fold[data-level="5"],
.org-fold[data-level="6"] {
    margin-top: 0.75em;
    background: rgba(139, 115, 85, 0.06);
    border-radius: 6px;
    padding: 4px 10px 4px 10px !important;
}

/* Quote blocks */
.org-quote {
    margin: 1em 0;
    padding: 0.75em 1em;
    border-left: 4px solid #8b7355;
    background: rgba(139, 115, 85, 0.08);
    border-radius: 0 6px 6px 0;
    font-style: italic;
    color: #5a5550;
}

.org-quote p {
    margin: 0.5em 0;
}

.org-quote p:first-child {
    margin-top: 0;
}

.org-quote p:last-child {
    margin-bottom: 0;
}

/* Aside drawer - collapsible supplementary content */
.org-aside {
    margin: 0.75em 0;
    background: rgba(139, 115, 85, 0.06);
    border-radius: 6px;
    padding: 4px 10px 0 10px;
}

.org-aside-summary {
    cursor: pointer;
    list-style: none;
    font-family: 'Iosevka SS14 Web', sans-serif;
    font-size: 0.95em;
    font-weight: 600;
    color: #5a5550;
    padding: 0 0 4px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.org-aside-summary::-webkit-details-marker {
    display: none;
}

.org-aside-summary::after {
    content: '▸';
    font-size: 0.9em;
    color: #9a8a7a;
    transition: transform 0.15s ease;
}

.org-aside[open] > .org-aside-summary::after {
    transform: rotate(90deg);
}

.org-aside-content {
    padding: 0.5em 0;
}

.org-fold-summary:hover {
    color: #2a2520;
}

/* Flat structure - no indentation, typography conveys hierarchy */
.org-fold .org-fold {
    margin-left: 0;
    padding-left: 0;
}

/* Image grid for consecutive images */
.org-image-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px 0;
}

.zen-view-body .org-image-grid img.org-image {
    margin: 0;
    width: calc(50% - 4px);
    height: auto;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 0 1px rgba(0,0,0,0.35), 0 3px 10px rgba(0,0,0,0.12);
}

/* Single images (not in grid) */
.zen-view-body img.org-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 16px 0;
    display: block;
    box-shadow: 0 0 1px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.zen-view-body img.org-image:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Image modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    touch-action: pinch-zoom;
    -webkit-overflow-scrolling: none;
    overscroll-behavior: none;
}

.image-modal.open {
    display: flex;
}

html.modal-open,
html.modal-open body {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.image-modal-container {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-img {
    max-width: 100%;
    max-height: 100vh;
    object-fit: contain;
    border-radius: 4px;
    position: absolute;
    opacity: 0;
    transition: opacity 0.15s ease-out, transform 0.15s ease-out;
}

.image-modal-img.active {
    opacity: 1;
    position: relative;
    transform: translateX(0);
}

.image-modal-img.slide-left {
    transform: translateX(-30px);
}

.image-modal-img.slide-right {
    transform: translateX(30px);
}

.image-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.image-modal-nav:hover {
    background: rgba(255,255,255,0.4);
}

.image-modal-prev {
    left: 16px;
}

.image-modal-next {
    right: 16px;
}

.zen-view-body video.org-video {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 16px 0;
    display: block;
    background: #000;
}

.zen-view-body audio.org-audio {
    width: 100%;
    margin: 16px 0;
    display: block;
}

.zen-view-body .org-pdf-preview {
    margin: 16px 0;
}

/* Table styling */
.org-table-wrapper {
    overflow-x: auto;
    margin: 16px 0;
    border-radius: 6px;
    -webkit-overflow-scrolling: touch;
}

.org-table {
    min-width: max-content;
    border-collapse: collapse;
    font-family: 'Iosevka SS14 Web', 'SF Mono', monospace;
    font-size: 14px;
    border: 1px solid #e0dcd0;
    background: #fffef8;
}

.org-table th,
.org-table td {
    padding: 8px 12px;
    border: 1px solid #e0dcd0;
    text-align: left;
}

.org-table th {
    background: #f0ede5;
    font-weight: 600;
    color: #4a4035;
}

.org-table tr:nth-child(even) td {
    background: #faf9f4;
}

.org-table tr:hover td {
    background: #f5f3ea;
}

.zen-view-body .org-pdf-frame {
    width: 100%;
    height: 400px;
    border: 1px solid #e6e6e0;
    border-radius: 6px;
    display: block;
}

.zen-view-body .org-pdf-link {
    display: block;
    margin-top: 8px;
    font-size: 14px;
}

/* Property drawer display - compact vertical badges */
.org-properties-details {
    margin: 8px 0 16px 0;
}

.org-properties-summary {
    font-family: 'Iosevka SS14 Web', monospace;
    font-size: 11px;
    font-weight: 500;
    color: #8b7355;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.org-properties-summary::-webkit-details-marker {
    display: none;
}

.org-properties-summary::before {
    content: '▸ ';
    font-size: 10px;
}

.org-properties-details[open] .org-properties-summary::before {
    content: '▾ ';
}

.org-properties-summary:hover {
    color: #6b5a42;
}

.org-properties-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0 0 0;
    padding: 0;
    font-family: 'Iosevka SS14 Web', monospace;
    font-size: 12px;
    background: transparent;
    border: none;
}

.org-property-line {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.org-property-key {
    display: inline-block;
    padding: 2px 6px;
    background: #6b5a42;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 3px 0 0 3px;
    min-width: 60px;
    text-align: right;
}

.org-property-value {
    display: inline-block;
    padding: 2px 8px;
    background: #f0ede5;
    color: #4a4035;
    font-size: 12px;
    border-radius: 0 3px 3px 0;
    border: 1px solid #e0dcd0;
    border-left: none;
}

.zen-view-body .html-embed {
    max-width: 100%;
    overflow: hidden;
    margin: 16px 0;
}

.zen-view-body .html-embed iframe {
    max-width: 100%;
    height: auto;
    aspect-ratio: 4/3;
    border-radius: 6px;
}

/* Maps embed */
.zen-view-body .maps-embed {
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #d4d4c8;
    background: #f8f8f4;
}

.zen-view-body .maps-iframe-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #e8e8e0;
}

.zen-view-body .maps-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.zen-view-body .maps-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #888;
    font-size: 14px;
    font-family: 'Iosevka SS14 Web', sans-serif;
}

.zen-view-body .maps-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #3d5a3d;
    text-decoration: none;
    font-size: 14px;
    font-family: 'Iosevka SS14 Web', sans-serif;
    background: linear-gradient(135deg, #e8f5e8 0%, #dceadc 100%);
    border-top: 1px solid #c8d8c8;
    transition: background 0.2s;
}

.zen-view-body .maps-link:hover {
    background: linear-gradient(135deg, #dceadc 0%, #d0e0d0 100%);
}

.zen-view-body .maps-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #4a7c4a;
}

.zen-view-body .maps-text {
    flex: 1;
    font-weight: 500;
}

.zen-view-body .maps-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.6;
}

@media (max-width: 480px) {
    .zen-view-body .maps-iframe-container {
        padding-bottom: 75%; /* Taller on mobile */
    }
}

@media (max-width: 720px) {
    .zen-content {
        padding: 32px 20px 80px;
    }
    .zen-view-title { font-size: 24px; }
    .zen-view-body { font-size: 17px; }

    .zen-view-body .html-embed iframe {
        width: 100% !important;
        height: auto !important;
        min-height: 300px;
    }
    
    /* Single images smaller on mobile */
    .zen-view-body img.org-image {
        max-width: 60%;
    }
    

}

/* Backlinks */
.zen-backlinks {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px dashed #d0c8c0;
}

.zen-backlinks-title {
    font-family: 'Iosevka SS14', monospace;
    font-size: 12px;
    font-weight: 500;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 12px 0;
}

.zen-backlinks-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.zen-backlinks-list li {
    margin: 0;
    padding: 8px 0;
    border-bottom: 1px solid #eae5e0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.zen-backlinks-list li:last-child {
    border-bottom: none;
}

.zen-backlinks-list a {
    font-size: 15px;
    color: #6b5a4a;
    text-decoration: none;
}

.zen-backlinks-list a:hover {
    color: #4a3a2a;
    text-decoration: underline;
}

.backlink-date {
    font-family: 'Iosevka SS14', monospace;
    font-size: 12px;
    color: #999;
}

/* TODO states and priorities */
.org-todo, .org-doing, .org-done, .org-waiting, .org-next {
    display: inline-block;
    font-family: 'Iosevka SS14 Web', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
    margin-right: 4px;
    border: none;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.org-todo:hover, .org-doing:hover, .org-done:hover, .org-waiting:hover, .org-next:hover {
    opacity: 0.85;
}

.org-todo:active, .org-doing:active, .org-done:active, .org-waiting:active, .org-next:active {
    transform: scale(0.95);
}

.org-todo {
    background: #dc3545;
    color: #fff;
}

.org-done {
    background: #28a745;
    color: #fff;
}

.org-waiting {
    background: #ffc107;
    color: #333;
}

.org-next {
    background: #17a2b8;
    color: #fff;
}

.org-doing {
    background: #fd7e14;
    color: #fff;
}

.org-priority {
    display: inline-block;
    font-family: 'Iosevka SS14 Web', monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
}

.org-priority-a {
    background: #ff6b6b;
    color: #fff;
}

.org-priority-b {
    background: #ffd93d;
    color: #333;
}

.org-priority-c {
    background: #6bcb77;
    color: #fff;
}

/* Completed headings get muted styling */
.org-fold-done > .org-fold-summary h1,
.org-fold-done > .org-fold-summary h2,
.org-fold-done > .org-fold-summary h3,
.org-fold-done > .org-fold-summary h4,
.org-fold-done > .org-fold-summary h5,
.org-fold-done > .org-fold-summary h6 {
    text-decoration: line-through;
    color: #888;
}

/* Checkbox lists */
.org-checklist {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

.org-checklist .org-checklist {
    margin-left: 24px;
}

.org-checkbox {
    font-size: 18px;
    color: #8b7355;
    user-select: none;
    background: none;
    border: none;
    padding: 2px 6px;
    margin: -2px 2px -2px -6px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    vertical-align: middle;
}

.org-checkbox:hover {
    background: rgba(139, 115, 85, 0.1);
}

.org-checkbox:active {
    transform: scale(0.9);
}

.org-checkbox-checked {
    color: #28a745;
}

.org-checkbox-partial {
    color: #ffc107;
}

.org-checkbox-item {
    padding: 4px 0;
    line-height: 1.5;
}

.org-checkbox-item-done {
    color: #888;
    text-decoration: line-through;
}

.org-checkbox-item-done .org-checkbox {
    color: #28a745;
}

/* LLM Conversation blocks */
.llm-message {
    margin: 0 0 16px 0;
    padding: 12px 16px;
    border-left: 3px solid;
}

.llm-tool {
    margin-bottom: 16px;
}

/* Remove bottom margin when followed by another LLM block */
.llm-message + .llm-message,
.llm-message + .llm-tool,
.llm-tool + .llm-message,
.llm-tool + .llm-tool {
    margin-top: 0;
}

.llm-message:has(+ .llm-message),
.llm-message:has(+ .llm-tool),
.llm-tool:has(+ .llm-message),
.llm-tool:has(+ .llm-tool) {
    margin-bottom: 0;
}

.llm-message:first-child,
.llm-tool:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.llm-message:last-child,
.llm-tool:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* When user/assistant/tool blocks are adjacent, join them */
.llm-message + .llm-message,
.llm-message + .llm-tool,
.llm-tool + .llm-message,
.llm-tool + .llm-tool {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.llm-user {
    background: #fefefe;
    border-left-color: #9080c0;
}

.llm-assistant {
    background: #fefefe;
    border-left-color: #50a8b8;
}

.llm-role {
    font-family: 'Iosevka SS14 Web', monospace;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ececec;
    opacity: 0.7;
}

.llm-user .llm-role {
    color: #9080c0;
}

.llm-assistant .llm-role {
    color: #50a8b8;
}

.llm-content {
    font-family: 'Iosevka SS14 Web', monospace;
    font-size: 14px;
    line-height: 1.5;
}

/* Tool blocks - collapsible */
.llm-tool {
    margin: 0;
    border: none;
    border-left: 3px solid #a0a0a8;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: #fafafa;
}

.llm-tool-summary {
    padding: 12px 16px;
    cursor: pointer;
    font-family: 'Iosevka SS14 Web', monospace;
    font-size: 13px;
    display: block;
    user-select: none;
    list-style: none;
}

.llm-tool-summary::-webkit-details-marker {
    display: none;
}

.llm-tool-call-line {
    display: block;
    position: relative;
    padding-right: 24px;
}

.llm-tool-summary .llm-tool-name {
    font-weight: 600;
    color: #5a5068;
    display: block;
    margin-bottom: 4px;
}

.llm-tool-summary .llm-tool-arrow {
    position: absolute;
    top: 0;
    right: 0;
    color: #9a8a7a;
    font-size: 0.9em;
    transition: transform 0.15s ease;
}

.llm-tool[open] > .llm-tool-summary .llm-tool-arrow {
    transform: rotate(90deg);
}

.llm-tool-role {
    font-family: 'Iosevka SS14 Web', monospace;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #808088;
    display: block;
    margin-bottom: 4px;
    opacity: 0.7;
}

.llm-tool-args-table {
    border-collapse: collapse;
    font-size: 12px;
    margin-left: 16px;
}

.llm-tool-arg-key {
    color: #808088;
    padding-right: 12px;
    padding-top: 1px;
    padding-bottom: 1px;
    white-space: nowrap;
    vertical-align: top;
}

.llm-tool-arg-val {
    color: #555;
    padding-top: 1px;
    padding-bottom: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

@media (min-width: 600px) {
    .llm-tool-arg-val {
        max-width: 400px;
    }
}

.llm-tool-content {
    margin: 8px 16px 12px;
    padding: 10px 12px;
    background: #f5f5f3;
    border: 1px solid #e0ddd8;
    border-radius: 4px;
}

.llm-tool-content pre {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}


.llm-content code {
    background: #eff5fb;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.llm-content pre code {
    display: block;
    padding: 12px;
    overflow-x: auto;
}
