* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #f4f6fb; color: #12233f; -webkit-font-smoothing: antialiased; }
.top { background: #0a1f44; color: #fff; padding: 14px 16px 12px; }
.top h1 { margin: 0; font-size: 22px; }
.benefit { margin: 4px 0 10px; font-size: 14px; color: #d7e0f2; line-height: 1.35; }
main { max-width: 860px; margin: 0 auto; padding: 12px 12px 32px; }
.view-title { margin: 6px 0 10px; font-size: 20px; }
.card { background: #fff; border: 1px solid #dde3ef; border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(10,31,68,.06); }
.card h3 { margin: 2px 0 10px; font-size: 17px; }
.card label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
input, select, textarea { width: 100%; font-size: 16px; padding: 9px 10px; border: 1.5px solid #b9c4da; border-radius: 9px; margin-top: 4px; background: #fff; color: #12233f; }
textarea { resize: vertical; line-height: 1.5; }
.btn { padding: 10px 14px; font-size: 15px; font-weight: 600; border: 2px solid #0a1f44; border-radius: 10px; background: #fff; color: #0a1f44; cursor: pointer; min-height: 44px; }
.btn.primary { background: #9333ea; border-color: #9333ea; color: #fff; }
.btn.accent { border-color: #9333ea; color: #9333ea; }
.btn.danger { border-color: #a33; color: #a33; }
.btn.small { padding: 6px 10px; font-size: 13px; min-height: 40px; }
.btn.big { width: 100%; font-size: 16px; margin-top: 6px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row input { flex: 1; }
.fine { font-size: 13px; color: #68779a; line-height: 1.45; }
.honest { background: #fdf6e0; border: 1px solid #c9a227; border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.45; }
.version { font-size: 12px; color: #9aa7c2; }
.copied { color: #1a7a37; font-weight: 600; font-size: 14px; }
footer { margin-top: 18px; }
@media (max-width: 400px) { .doc-meta { font-size: 12px; } }

/* DocWorks — list */
.btn.big-ish { flex: 1 1 150px; font-size: 16px; }
#searchInput { flex: 2 1 170px; width: auto; margin-top: 0; }
#sortSel { flex: 1 1 140px; width: auto; margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.chip { padding: 8px 12px; font-size: 14px; font-weight: 600; border: 2px solid #9333ea; border-radius: 999px; background: #fff; color: #9333ea; cursor: pointer; min-height: 40px; }
.chip.active { background: #9333ea; color: #fff; }
.doc-card { width: 100%; text-align: left; background: #fff; border: 1px solid #dde3ef; border-radius: 12px; padding: 13px 14px; margin-bottom: 10px; cursor: pointer; font: inherit; color: inherit; box-shadow: 0 1px 3px rgba(10,31,68,.06); display: flex; flex-direction: column; gap: 2px; min-height: 44px; }
.doc-card strong { font-size: 17px; word-break: break-word; }
.doc-meta { font-size: 13px; color: #68779a; }
.doc-snip { font-size: 14px; color: #33456b; line-height: 1.4; word-break: break-word; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #f3e8fd; color: #9333ea; }
.tag.sample { background: #0a1f44; color: #ffd968; }
.frow { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #eef1f8; }
.frow:last-child { border-bottom: none; }

/* DocWorks — editor */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tool-btn { min-width: 48px; min-height: 40px; padding: 7px 12px; font-size: 14px; font-weight: 700; border: 1.5px solid #b9c4da; border-radius: 9px; background: #fff; color: #0a1f44; cursor: pointer; }
.tool-btn:active { background: #f3e8fd; border-color: #9333ea; }
#ed-body { min-height: 300px; font-size: 16px; }
#ed-title { font-size: 18px; font-weight: 700; }
.saved-line { font-size: 13px; color: #1a7a37; font-weight: 600; margin: 6px 0 0; }
#shareLinkOut { font-size: 13px; word-break: break-all; }
.share-view-body { white-space: pre-wrap; word-break: break-word; background: #f7f9fd; border: 1px solid #dde3ef; border-radius: 10px; padding: 12px; font-size: 15px; line-height: 1.55; max-height: 60vh; overflow: auto; }
