* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Hiragino Sans", "Noto Sans JP", sans-serif; background: #f5f5f5; color: #333; }
header { background: #1a237e; color: #fff; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
header h1 { font-size: 1.3rem; }
nav { display: flex; flex-wrap: wrap; gap: 4px; }
nav button { background: rgba(255,255,255,0.15); border: none; color: #fff; padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 0.85rem; }
nav button:hover { background: rgba(255,255,255,0.3); }
nav button.active { background: #fff; color: #1a237e; font-weight: bold; }
#screen { max-width: 960px; margin: 24px auto; padding: 0 16px; }

.card { background: #fff; border-radius: 8px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.card h2 { font-size: 1.1rem; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid #1a237e; }

.btn { display: inline-block; padding: 8px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 0.9rem; }
.btn-primary { background: #1a237e; color: #fff; }
.btn-primary:hover { background: #12174f; }
.btn-secondary { background: #e0e0e0; color: #333; }
.btn-secondary:hover { background: #ccc; }
.btn-danger { background: #e53935; color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; }

.form-group { margin-bottom: 12px; }
.form-group label { display: block; font-weight: bold; font-size: 0.85rem; margin-bottom: 4px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.9rem; font-family: inherit; }
.form-group textarea { min-height: 60px; resize: vertical; }
.form-row { display: flex; gap: 8px; }
.form-row .form-group { flex: 1; }

table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #eee; font-size: 0.9rem; }
table th { background: #fafafa; font-weight: bold; }
table .actions { white-space: nowrap; text-align: right; }

.empty-state { text-align: center; padding: 40px 20px; color: #999; }
.empty-state p { margin-top: 8px; }

.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }

.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ""; position: absolute; left: 12px; top: 0; bottom: 0; width: 2px; background: #1a237e; }
.tl-item { position: relative; padding: 8px 0 8px 16px; margin-bottom: 4px; }
.tl-item::before { content: ""; position: absolute; left: -24px; top: 14px; width: 10px; height: 10px; border-radius: 50%; background: #1a237e; border: 2px solid #fff; }
.tl-item .tl-time { font-size: 0.8rem; color: #666; }
.tl-item .tl-cat { display: inline-block; font-size: 0.7rem; padding: 1px 6px; border-radius: 3px; color: #fff; margin-left: 4px; }
.tl-item .tl-content { margin-top: 2px; font-size: 0.9rem; }
.tl-item .tl-source { font-size: 0.75rem; color: #888; }

.cat-0 { background: #c62828; }
.cat-1 { background: #0277bd; }
.cat-2 { background: #e65100; }
.cat-3 { background: #424242; }
.cat-4 { background: #2e7d32; }
.cat-5 { background: #6a1b9a; }
.cat-6 { background: #00838f; }
.cat-7 { background: #ad1457; }
.cat-8 { background: #1565c0; }
.cat-9 { background: #78909c; }

.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar button { padding: 4px 10px; border: 1px solid #ccc; border-radius: 12px; background: #fff; cursor: pointer; font-size: 0.8rem; }
.filter-bar button.active { background: #1a237e; color: #fff; border-color: #1a237e; }
.filter-bar input { flex: 1; min-width: 200px; padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85rem; }

.tl-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.stat-chip { font-size: 0.75rem; padding: 2px 8px; border-radius: 10px; color: #fff; }
.tl-date-group { margin: 14px 0 2px; padding-bottom: 2px; font-weight: bold; font-size: 0.9rem; color: #1a237e; border-bottom: 1px solid #e3e8f1; }

@media print {
  header, nav, .no-print { display: none !important; }
  #screen { max-width: 100%; margin: 0; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}