* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --card: #eaecef;
  --accent: #2c6e8a;
  --accent2: #666;
  --text: #1a1a1a;
  --muted: #666;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 0 0 2rem;
}

header {
  background: var(--surface);
  padding: 1.2rem 1.5rem;
  text-align: center;
  border-bottom: 2px solid var(--accent);
}
header h1 { font-size: 1.3rem; font-weight: 600; }

.container { max-width: 600px; margin: 0 auto; padding: 1rem; }

/* ステータス（インライン） */
.status-inline {
  padding: 0.7rem 0.2rem;
  font-size: 0.9rem;
  font-weight: 600;
}
.status-ok { color: #2d6a2d; }
.status-warn { color: #7a5500; }
.status-err { color: #b94a48; }

/* ボタン */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
  color: #fff;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); }
.btn-danger { background: var(--accent2); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.4; cursor: default; }

.btn-row {
  display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap;
}

/* タブ */
.tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.tab {
  flex: 1;
  padding: 0.6rem;
  border: 2px solid #333;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.tab.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(108, 99, 255, 0.15);
}

/* フォーム */
.form-card {
  background: var(--surface);
  padding: 1.2rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}
.form-card h2 { font-size: 1rem; margin-bottom: 0.8rem; }

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
  line-height: 1.5;
}
.hint code {
  background: rgba(255,255,255,0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-family: monospace;
}
.hint.ex {
  background: rgba(255,255,255,0.04);
  border-left: 3px solid var(--accent);
  padding: 0.5rem 0.7rem;
  border-radius: 0 6px 6px 0;
  font-family: monospace;
  white-space: pre-wrap;
}

label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.3rem; }
input, textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}
textarea { resize: vertical; min-height: 60px; font-family: monospace; }

/* 通知リスト */
.notif-list { list-style: none; }
.notif-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 0.6rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}
.notif-info { flex: 1; min-width: 0; }
.notif-msg {
  font-size: 0.95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-time { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }
.notif-sent { opacity: 0.5; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  margin-right: 0.4rem;
}

.empty-msg {
  text-align: center; color: var(--muted); padding: 2rem 0; font-size: 0.9rem;
}

/* タイムライン */
.timeline-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  border: 1px solid #ccc;
}
.timeline-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--text);
}
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.timeline-item {
  display: grid;
  grid-template-columns: 3rem 1.2rem 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  position: relative;
}
.timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 3.55rem;
  top: 1.4rem;
  bottom: -0.4rem;
  width: 2px;
  background: #ddd;
}
.timeline-time {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--accent);
  justify-self: center;
}
.timeline-msg {
  font-size: 0.88rem;
  color: var(--text);
}
.timeline-past .timeline-time,
.timeline-past .timeline-msg { color: var(--muted); }
.timeline-past .timeline-dot { background: #ccc; box-shadow: 0 0 0 2px #ccc; }
.timeline-empty {
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  padding: 0.6rem 0;
}

/* カレンダー */
.cal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.6rem;
}
.cal-header span { font-weight: 700; font-size: 1rem; }
.cal-header button {
  background: none; border: none; font-size: 1.4rem; cursor: pointer;
  color: var(--accent); padding: 0 0.4rem; line-height: 1;
}
.cal-table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.cal-table th {
  text-align: center; padding: 0.3rem 0; font-weight: 600; font-size: 0.8rem;
}
.cal-table td {
  vertical-align: top; text-align: center;
  padding: 0.2rem; min-width: 0; width: 14.28%;
}
.cal-day {
  font-size: 0.85rem; margin: 0 auto;
  width: 1.8rem; height: 1.8rem; line-height: 1.8rem;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.cal-has-notif .cal-day {
  cursor: pointer; font-weight: 700;
  border: 2px solid var(--accent);
}
.cal-has-notif .cal-day:hover { background: rgba(44,110,138,0.15); }
.cal-today {
  background: rgba(100,200,120,0.18);
  border-radius: 6px;
}
.cal-today .cal-day {
  background: var(--accent); color: #fff;
}
