* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; background: #efe6d5; color: #1a1a1a; }
.site-header { background: #fff; padding: 16px 32px; border-bottom: 1px solid #e5dcc8; display: flex; align-items: center; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-icon { display: inline-block; width: 28px; height: 28px; background: #b8b4d6; border-radius: 6px; position: relative; flex-shrink: 0; }
.brand-icon::before, .brand-icon::after { content: "+"; position: absolute; color: #555; font-weight: bold; font-size: 11px; line-height: 1; }
.brand-icon::before { top: 5px; left: 6px; }
.brand-icon::after { bottom: 5px; right: 6px; }
.brand-icon-img { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; flex-shrink: 0; }
.brand-name { font-weight: 600; font-size: 16px; }
.brand-short { font-weight: 700; font-size: 15px; }
main { padding: 24px 32px; max-width: 1100px; }
h1 { margin: 0 0 4px; font-size: 30px; font-weight: 800; }
.subtitle { color: #666; margin: 0 0 24px; font-size: 14px; }
.breadcrumb { color: #888; font-size: 14px; margin-bottom: 16px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.breadcrumb a { color: #888; text-decoration: none; }
.breadcrumb a:hover { color: #1a1a1a; }
.breadcrumb .current { color: #1a1a1a; font-weight: 700; }
.section-label { text-transform: uppercase; letter-spacing: 0.08em; color: #888; font-size: 12px; margin: 12px 0; font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { background: #fff; border-radius: 8px; padding: 20px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 1px 2px rgba(0,0,0,0.04); transition: transform .1s, box-shadow .1s; }
.card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.card-icon { width: 34px; height: 26px; margin-bottom: 14px; display: flex; align-items: center; }
.card-icon.icon-category { background: #6c9b8a; border-radius: 4px; position: relative; }
.card-icon.icon-category::after { content:""; position: absolute; top: 7px; left: 6px; right: 6px; height: 2px; background: #fff; border-radius: 1px; box-shadow: 0 5px 0 #fff; }
.card-icon-img { width: 36px; height: 36px; object-fit: contain; margin-bottom: 14px; }
.card-title { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.card-path { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: #888; font-size: 13px; overflow-wrap: anywhere; }
.card-meta { color: #666; font-size: 13px; margin-top: 6px; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; margin-top: 10px; align-self: flex-start; }
.badge-latest { background: #d4ecc8; color: #2a5e1f; }
.badge-older { background: #f0e3c0; color: #6f5a1f; }
.badge-empty { background: #e0ddd6; color: #6b6557; }
.card-empty { cursor: default; opacity: 0.65; }
.card-empty:hover { transform: none; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.empty { color: #999; font-size: 14px; padding: 20px 0; }
body.viewer { background: #1a3a30; height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.viewer-header { background: #fff; padding: 10px 20px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid #e5dcc8; flex-wrap: wrap; position: relative; }
.viewer-menu { display: flex; align-items: center; gap: 20px; flex: 1; flex-wrap: wrap; }
.viewer-header .breadcrumb { margin: 0; font-size: 13px; }
.viewer-header .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.viewer-header select, .viewer-header button:not(.hamburger), .viewer-header a.raw-link { font: inherit; font-size: 13px; padding: 6px 12px; border: 1px solid #d4d0c4; border-radius: 6px; background: #fff; color: #1a1a1a; text-decoration: none; cursor: pointer; }
.viewer-header select { min-width: 0; max-width: 100%; }
.viewer-header button:not(.hamburger):hover, .viewer-header a.raw-link:hover { background: #f7f3e8; }
.hamburger { display: none; align-items: center; justify-content: center; padding: 8px 10px; border: 1px solid #d4d0c4; border-radius: 6px; background: #fff; cursor: pointer; }
@media (max-width: 640px) {
  .viewer-header { padding: 8px 12px; gap: 10px; flex-wrap: nowrap; }
  .hamburger { display: inline-flex; margin-left: auto; }
  .viewer-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 12px; gap: 12px; border-bottom: 1px solid #e5dcc8; box-shadow: 0 4px 8px rgba(0,0,0,0.08); z-index: 10; }
  .viewer-menu.open { display: flex; }
  .viewer-header .actions { margin-left: 0; flex-direction: column; align-items: stretch; }
  .viewer-header select, .viewer-header button:not(.hamburger), .viewer-header a.raw-link { width: 100%; max-width: none; text-align: center; }
}
.viewer-frame { flex: 1; width: 100%; border: 0; background: #1a3a30; display: block; }
