@layer views {
/* Documents: the doc page (text with its links beside it), the index of cards, and docs linked from tickets, epics and goals. */
.doc-page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
.doc-main { min-width: 0; max-width: 860px; }
.doc-title { font-family: var(--f-display); font-weight: 700; font-size: var(--fs-30); letter-spacing: -0.02em; line-height: 1.1; margin-bottom: 10px; }
.doc-title button { text-align: left; border-radius: var(--r-8); padding: 2px 6px; margin-left: -6px; }
.doc-title button:hover { background: var(--bg-3); }
.doc-title-input { font-family: var(--f-display); font-weight: 700; font-size: var(--fs-26); height: auto; padding: 6px 10px; margin-bottom: 10px; width: 100%; }
.doc-meta { display: flex; align-items: center; gap: 8px; color: var(--fg-3); font-size: var(--fs-12); padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.doc-body { font-size: var(--fs-14); line-height: 1.65; }
.doc-body img { cursor: default; max-height: 640px; }
.doc-empty { text-align: left; padding: 28px 0; }
.doc-side { position: sticky; top: 0; }
.doc-link { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-top: 1px solid var(--line); }
.doc-link:first-child { border-top: 0; }
.doc-link-go { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; color: inherit; text-align: left; }
.doc-link-go .tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-link-go .mono { font-size: var(--fs-11); color: var(--fg-3); }
.doc-link-go:hover .tt { text-decoration: underline; text-underline-offset: 3px; }
.editor-foot { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); font-size: var(--fs-12); }

.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.doc-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-12); background: var(--bg-2); color: inherit; }
.doc-card:hover { border-color: var(--line-2); background: var(--bg-3); }
.doc-card .i { color: var(--fg-3); }
.doc-card .muted { font-size: var(--fs-11-5); }

.rel .kind.doc { color: var(--accent); }

/* The sketch dialog keeps its pen widths compact (dialogs stretch segmented controls by default). */
.dialog .sketch-tools .seg { width: auto; }
.dialog .sketch-tools .seg button { flex: none; }
.rel a.tt { color: inherit; }

@media (max-width: 1100px) { .doc-page { grid-template-columns: minmax(0, 1fr); } .doc-side { position: static; } }
}
