*,*::before,*::after{box-sizing:border-box}
body{margin:0;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:#1f2937;background:#fff;line-height:1.5}
img{max-width:100%;height:auto}
video,audio{max-width:100%}
a{color:#2563eb;text-decoration:none}
a:hover{text-decoration:underline}

.container{max-width:880px;margin:0 auto;padding:0 20px}

/* Header */
.site-header{border-bottom:1px solid #e5e7eb;padding:16px 0}
.site-header .container{display:flex;align-items:center;justify-content:space-between;gap:16px}
.brand{font-weight:700;font-size:18px;color:#111827}
.brand span{color:#2563eb}
.site-nav{display:flex;gap:16px;align-items:center}
.site-nav a{color:#4b5563;font-size:14px}
.site-nav a:hover{color:#2563eb}

/* Hero */
.hero{margin:32px 0 24px}
h1{font-size:30px;line-height:1.25;margin:0 0 8px;color:#111827}
.lede{font-size:16px;color:#4b5563;margin:0 0 20px}

/* Dropzone & Inputs */
.dropzone{border:2px dashed #e5e7eb;border-radius:12px;padding:36px 20px;text-align:center;cursor:pointer;background:#fafafa;transition:border-color .15s,background-color .15s}
.dropzone:hover,.dropzone.drag{border-color:#2563eb;background:#eff6ff}
.dropzone p{margin:8px 0;color:#4b5563;font-size:15px}
.dropzone input[type="file"]{display:block;margin:12px auto 0;font-size:13px;color:#6b7280;max-width:100%}
.url-row{display:flex;gap:8px;margin-top:16px}
.url-row input[type="url"],.url-row input[type="text"]{flex:1;min-width:0;padding:10px 14px;border:1px solid #e5e7eb;border-radius:8px;font-size:14px}
.url-row input:focus{outline:none;border-color:#2563eb}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;padding:10px 18px;background:#2563eb;color:#fff;border:none;border-radius:8px;font-size:14px;font-weight:500;cursor:pointer;text-decoration:none;transition:background-color .15s}
.btn:hover{background:#1d4ed8;text-decoration:none}
.btn-secondary{background:#f3f4f6;color:#374151;border:1px solid #e5e7eb}
.btn-secondary:hover{background:#e5e7eb;color:#111827}

/* Status */
.status{margin-top:16px;font-size:14px;color:#6b7280}
.status.error{color:#b91c1c;font-weight:500}

/* Viewer Output & PDF */
.viewer-output{margin-top:32px;border:1px solid #e5e7eb;border-radius:12px;padding:20px;background:#fff}
.viewer-output canvas{display:block;margin:0 auto 12px;max-width:100%;height:auto;box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);border-radius:4px}

/* Tables & Sheets */
.sheet-tabs{display:flex;gap:8px;margin-bottom:12px;overflow-x:auto;padding-bottom:4px}
.sheet-tabs button{padding:6px 12px;font-size:13px;border:1px solid #e5e7eb;border-radius:6px;background:#f9fafb;cursor:pointer;white-space:nowrap}
.sheet-tabs button.active{background:#2563eb;color:#fff;border-color:#2563eb}
.table-wrap{overflow-x:auto;margin:12px 0}
table{width:100%;border-collapse:collapse;font-size:14px}
th,td{border:1px solid #e5e7eb;padding:4px 8px;white-space:nowrap;text-align:left}
th{background:#f9fafb;font-weight:600}

/* JSON tree */
.json-tree{font-family:ui-monospace,monospace;font-size:13px;overflow-x:auto;background:#f9fafb;padding:14px;border-radius:8px;line-height:1.6}
.json-tree details{margin:2px 0 2px 14px}
.json-tree summary{cursor:pointer;color:#2563eb}
.json-tree summary:hover{color:#1d4ed8}

/* Plain text */
.text-view{white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,monospace;font-size:13px;background:#f9fafb;padding:12px;border-radius:8px;overflow-x:auto;line-height:1.5}

/* Rendered markdown */
.md-view{line-height:1.6;font-size:15px}
.md-view pre{background:#f9fafb;padding:12px;border-radius:8px;overflow-x:auto;border:1px solid #e5e7eb}
.md-view code{font-family:ui-monospace,monospace;font-size:13px}

/* Zip / file listing */
.file-list{list-style:none;padding:0;margin:0}
.file-list li{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border-bottom:1px solid #e5e7eb;font-family:ui-monospace,monospace;font-size:13px}
.file-list li:last-child{border-bottom:none}
.file-list li:hover{background:#f9fafb}

/* Funnel box */
.funnel{margin-top:16px;padding:12px 16px;background:#eff6ff;border-radius:8px;font-size:14px;color:#1e40af;border:1px solid #dbeafe}
.funnel a{font-weight:600;color:#2563eb}

/* Related formats grid */
.format-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;margin:24px 0}
.format-card{border:1px solid #e5e7eb;border-radius:8px;padding:12px;text-align:center;background:#fff;transition:border-color .15s}
.format-card:hover{border-color:#2563eb}
.format-card a{display:block;color:#111827;font-weight:500;font-size:14px}

/* Article & FAQ */
.article{margin-top:40px;line-height:1.65}
.article h2{margin-top:32px;color:#111827}
.faq details{margin:8px 0;padding:12px;border:1px solid #e5e7eb;border-radius:8px}
.faq summary{font-weight:600;cursor:pointer}

/* Embed page & mode */
textarea.code-box{width:100%;font-family:ui-monospace,monospace;font-size:13px;padding:10px;border:1px solid #e5e7eb;border-radius:8px;resize:vertical}
body.embed .site-header,body.embed .site-footer,body.embed .page-extra{display:none}
body.embed .container{max-width:100%;padding:10px}
body.embed .viewer-output{margin-top:0;border:none;padding:0}

/* Footer */
.site-footer{border-top:1px solid #e5e7eb;padding:24px 0;margin-top:56px;font-size:13px;color:#6b7280;text-align:center}
.site-footer a{color:#6b7280}
.site-footer a:hover{color:#2563eb}
.footer-links{display:flex;justify-content:center;gap:16px;margin-bottom:8px;flex-wrap:wrap}

/* Responsive */
@media (max-width:480px){
  .container{padding:0 12px}
  .hero{margin:20px 0 16px}
  h1{font-size:22px}
  .lede{font-size:14px}
  .dropzone{padding:24px 12px}
  .url-row{flex-direction:column}
  .viewer-output{padding:12px}
  .site-header{padding:12px 0}
  .site-footer{margin-top:36px;padding:16px 0}
}

/* assembly bridge: core.js sets class "ov-status" and looks for ".ov-url-row" */
.ov-status{color:#6b7280;font-size:14px;margin:10px 0;min-height:1.2em}
.ov-status.error{color:#b91c1c}
.ov-funnel-label{font-weight:600;margin-right:6px}
.funnel a{margin-right:14px}
.zip-preview{margin-top:12px}
.media-info{color:#6b7280;font-size:14px;margin-top:6px}

/* Muse visual-QA polish 2026-11-03: hide empty viewer output; style native file button */
.viewer-output:empty{display:none}
.dropzone input[type="file"]::file-selector-button{background:#2563eb;color:#fff;border:0;border-radius:8px;padding:8px 16px;font-size:14px;cursor:pointer;margin-right:10px}
.dropzone input[type="file"]::file-selector-button:hover{background:#1d4ed8}
