* { box-sizing: border-box; margin: 0; }
:root {
  --accent: #e0524d;
  --ink: #1f2937;
  --sub: #6b7280;
  --line: #e5e7eb;
  --bg: #fafaf7;
}
body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.site-header { background: #fff; border-bottom: 1px solid var(--line); padding: 18px 0 0; position: sticky; top: 0; z-index: 10; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 22px; letter-spacing: .04em; }
.tagline { color: var(--sub); font-size: 12.5px; margin-top: 2px; }
.search-row { display: flex; gap: 8px; margin-top: 12px; }
#search { flex: 1; font-size: 15px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 10px; outline: none; }
#search:focus { border-color: var(--accent); }
#category { font-size: 13px; padding: 8px; border: 2px solid var(--line); border-radius: 10px; background: #fff; max-width: 220px; }
.style-tabs { display: flex; gap: 4px; margin-top: 10px; padding-bottom: 10px; }
.style-tabs button { font-size: 13px; padding: 6px 14px; border: none; background: none; border-radius: 999px; cursor: pointer; color: var(--sub); }
.style-tabs button.active { background: var(--ink); color: #fff; }

.status { color: var(--sub); font-size: 13px; padding: 14px 2px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; padding-bottom: 24px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 6px 8px; text-align: center; cursor: pointer; transition: border-color .1s, transform .1s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card svg { width: 40px; height: 40px; color: var(--ink); }
.card .nm { display: block; font-size: 10.5px; color: var(--sub); margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .badge { display: inline-block; font-size: 9px; color: var(--accent); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-top: 4px; }
.more-row { text-align: center; padding-bottom: 40px; }
#more { font-size: 14px; padding: 10px 32px; border: 2px solid var(--ink); background: #fff; border-radius: 999px; cursor: pointer; }
#more:hover { background: var(--ink); color: #fff; }

dialog#modal { border: none; border-radius: 16px; padding: 0; max-width: 560px; width: calc(100vw - 32px); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.close { position: absolute; top: 8px; right: 12px; font-size: 22px; border: none; background: none; cursor: pointer; color: var(--sub); }
.modal-body { display: flex; gap: 20px; padding: 24px; flex-wrap: wrap; }
.preview-col { flex: 0 0 200px; }
.preview { width: 200px; height: 200px; background: repeating-conic-gradient(#f3f4f6 0 25%, #fff 0 50%) 0 0 / 20px 20px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.preview svg { width: 160px; height: 160px; }
.controls { display: flex; gap: 14px; margin-top: 10px; font-size: 12.5px; color: var(--sub); align-items: center; }
.controls select { padding: 3px; }
.info-col { flex: 1; min-width: 200px; }
.info-col h2 { font-size: 18px; }
.tags { font-size: 12px; color: var(--sub); margin: 8px 0 16px; line-height: 1.8; }
.dl-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.dl-buttons button { font-size: 14px; font-weight: 600; padding: 10px 20px; border: none; border-radius: 10px; background: var(--accent); color: #fff; cursor: pointer; }
.dl-buttons button:hover { opacity: .85; }
.dl-buttons button.ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); font-weight: 400; }
.license-note { font-size: 11.5px; color: var(--sub); margin-top: 14px; }

.site-footer { background: #fff; border-top: 1px solid var(--line); padding: 28px 0 48px; margin-top: 20px; }
.site-footer h3 { font-size: 15px; margin-bottom: 8px; }
.site-footer p { font-size: 12.5px; color: var(--sub); line-height: 1.9; margin-bottom: 8px; }
.site-footer a { color: var(--accent); }

@media (max-width: 560px) {
  .modal-body { justify-content: center; }
}
