:root {
  --bs-primary: #1e88e5;
  --bs-primary-rgb: 30, 136, 229;
  --app-light-blue: #e3f2fd;
  --app-sky-blue: #64b5f6;
}

body {
  background: var(--app-light-blue);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Hiragino Kaku Gothic ProN, Meiryo, sans-serif;
}

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.08);
  padding: 12px 14px 32px;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 14px;
  border-bottom: 2px solid var(--app-sky-blue);
  margin-bottom: 14px;
}

.app-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.app-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--bs-primary);
  margin: 0;
  flex: 1;
}

.reload-btn {
  border: none;
  background: none;
  color: var(--bs-primary);
  font-size: 1.4rem;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
}

.reload-btn:active {
  color: var(--app-sky-blue);
}

.health-dot {
  position: relative;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #bdbdbd;
  flex: 0 0 auto;
  cursor: pointer;
  outline: none;
}

.health-dot.ok { background: var(--bs-success); }
.health-dot.err { background: var(--bs-danger); }

.health-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: -6px;
  width: max-content;
  max-width: 220px;
  background: #fff;
  color: #333;
  border: 1px solid var(--app-sky-blue);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 400;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  z-index: 10;
}

.health-dot.ok:hover .health-tooltip,
.health-dot.ok.show .health-tooltip {
  display: block;
}

.health-error {
  color: var(--bs-danger);
  font-size: 0.8rem;
  font-weight: 500;
  margin: -10px 0 12px;
}

.view.d-none {
  display: none !important;
}

.menu-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.month-label {
  font-weight: 700;
  color: var(--bs-primary);
  margin: 4px 0 8px;
}

.calendar-accordion {
  margin-bottom: 10px;
}

.calendar-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid #dbe9f7;
  border-radius: 8px;
  background: var(--app-light-blue);
  color: var(--bs-primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
}

.accordion-icon {
  display: inline-block;
  transition: transform 0.15s ease;
}

.calendar-toggle[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
}

.calendar-panel {
  border: 1px solid #dbe9f7;
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 8px;
}

.mini-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.calendar-weekday {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--bs-primary);
  padding: 2px 0 4px;
}

.calendar-day {
  min-height: 40px;
  border-radius: 6px;
  padding: 2px 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.calendar-day:active {
  background: var(--app-light-blue);
}

.calendar-day.empty {
  cursor: default;
}

.calendar-day.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--bs-primary);
  border-radius: 6px;
}

.calendar-day-num {
  font-size: 0.75rem;
}

.calendar-day-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  min-height: 6px;
}

.calendar-day-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.tag-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  border: none;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

/* タグ固有色(JSでbackground/colorを設定)は保ったまま、選択中は白+青の二重リングで示す */
.tag-chip.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--bs-primary);
}

.task-list li {
  border: 1px solid #dbe9f7;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  background: #fff;
}

.task-list li:active {
  background: var(--app-light-blue);
}

.task-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.task-due-date {
  font-weight: 700;
  color: var(--bs-primary);
  font-size: 0.85rem;
}

.status-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
}

.status-badge.status-未完了 { background: var(--bs-primary); }
.status-badge.status-完了 { background: #bdbdbd; }
.status-badge.status-保留 { background: #9e9e9e; }
.status-badge.status-過日 { background: #dc3545; }

.task-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.task-tags .badge {
  font-weight: 500;
}

.task-content-preview {
  font-size: 0.85rem;
  color: #333;
}

.login-form {
  max-width: 320px;
  margin: 40px auto;
}

.tag-chip-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip-input .tag-chip {
  cursor: default;
}

.tag-chip-input .tag-chip .remove {
  cursor: pointer;
  font-weight: 700;
}
